UNPKG

sdg-rpc

Version:

pomelo ts rpc

27 lines (26 loc) 786 B
export interface IRpcMsg { namespace: string; service: string; serverType: string; method: string; args: any[]; } export declare type IFunctionProxy = Function; export interface IProxy { (routeParam: any, ...args: any[]): Promise<any>; toServer(serverId: string, ...args: any[]): Promise<any>; route(routeParam: any, notify?: boolean): (...args: any[]) => Promise<any>; defaultRoute(...args: any[]): Promise<any>; to(serverId: string, notify?: boolean): (...args: any[]) => Promise<any>; broadcast(...args: any[]): Promise<any>; } export interface IProxyModule { [module: string]: { [methodName: string]: IProxy; }; } export interface IProxies { [namespace: string]: { [serverType: string]: IProxyModule; }; }