Merge pull request #6 from Yiin/patch-2
Allow user to specify type of returned values
This commit is contained in:
commit
465c6cc732
16
dist/rage-rpc.d.ts
vendored
16
dist/rage-rpc.d.ts
vendored
@ -2,13 +2,13 @@ export as namespace rpc;
|
||||
|
||||
export function register(name: string, cb: ProcedureListener): void;
|
||||
export function unregister(name: string): void;
|
||||
export function call(name: string, args?: any): Promise<any>;
|
||||
export function callServer(name: string, args?: any): Promise<any>;
|
||||
export function callClient(player: Player, name: string, args?: any): Promise<any>;
|
||||
export function callClient(name: string, args?: any): Promise<any>;
|
||||
export function callBrowsers(player: Player, name: string, args?: any): Promise<any>;
|
||||
export function callBrowsers(name: string, args?: any): Promise<any>;
|
||||
export function callBrowser(browser: Browser, name: string, args?: any): Promise<any>;
|
||||
export function call<T = any>(name: string, args?: any): Promise<T>;
|
||||
export function callServer<T = any>(name: string, args?: any): Promise<T>;
|
||||
export function callClient<T = any>(player: Player, name: string, args?: any): Promise<T>;
|
||||
export function callClient<T = any>(name: string, args?: any): Promise<T>;
|
||||
export function callBrowsers<T = any>(player: Player, name: string, args?: any): Promise<T>;
|
||||
export function callBrowsers<T = any>(name: string, args?: any): Promise<T>;
|
||||
export function callBrowser<T = any>(browser: Browser, name: string, args?: any): Promise<T>;
|
||||
|
||||
export interface Player {
|
||||
call: (eventName: string, args?: any[]) => void;
|
||||
@ -26,4 +26,4 @@ export interface ProcedureListenerInfo {
|
||||
player?: Player;
|
||||
}
|
||||
|
||||
export type ProcedureListener = (args: any, info: ProcedureListenerInfo) => any;
|
||||
export type ProcedureListener = (args: any, info: ProcedureListenerInfo) => any;
|
||||
|
Reference in New Issue
Block a user