1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/utils/channel/request-channel.ts
Sebastian Malton dba4f59644 Add enough code to get first couple terminal tests to pass
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-01-10 15:17:50 -05:00

19 lines
593 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export interface RequestChannel<Request, Response> {
id: string;
_requestSignature?: Request; // used only to mark `Request` as "used"
_responseSignature?: Response; // used only to mark `Response` as "used"
}
export type ChannelRequest<Channel> = Channel extends RequestChannel<infer Request, any>
? Request
: never;
export type ChannelResponse<Channel> = Channel extends RequestChannel<any, infer Response>
? Response
: never;