type MethodHandler = (params: Params, ctx: RequestContext, peer: ISocketClient, next: () => Promise) => Promise; type NonEmptyArray = [...T[], T]; export type MethodHandlers = { [Key in keyof Methods]: Methods[Key] extends (params: infer Params) => Promise ? NonEmptyArray> : Methods[Key] extends Record ? MethodHandlers : never; }; type ISocketClientMethodCall = { [Key in keyof Methods]: Methods[Key] extends (params: infer P) => Promise ? (params: P) => Promise : Methods[Key] extends Record ? ISocketClientMethodCall : never; }; export type ISocketClient = { close: () => void; call: ISocketClientMethodCall; }; export {}; //# sourceMappingURL=socket.d.ts.map