/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectionToken } from "@ogre-tools/injectable"; import type { SetRequired } from "type-fest"; import type { RequestChannel } from "./request-channel-injection-token"; export type RequestFromChannel = < TChannel extends RequestChannel, >( channel: TChannel, ...request: TChannel["_requestSignature"] extends void ? [] : [TChannel["_requestSignature"]] ) => Promise["_responseSignature"]>; export const requestFromChannelInjectionToken = getInjectionToken({ id: "request-from-request-channel", });