export interface Interfaces { type: 'request' | 'response' | 'notification' | 'initialization'; } export interface RequestMessage extends Interfaces { type: 'request'; requestId: number; payload: T; } export interface ResponseMessage extends Interfaces { type: 'response'; requestId: number; result: T; } export interface NotificationMessage extends Interfaces { type: 'notification'; payload: T; } export interface InitializationMessage extends Interfaces { type: 'initialization'; } type FunctionWithArgs = (...args: any[]) => any; type FunctionWithoutArgs = () => any; export type HandlerFunction = FunctionWithArgs | FunctionWithoutArgs | any; export interface Handlers { [methodName: string]: HandlerFunction; } export {};