This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
rage-framework-rpc/dist/rage-rpc.d.ts

29 lines
1.0 KiB
TypeScript
Raw Normal View History

2019-01-10 23:57:44 +00:00
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 interface Player {
call: (eventName: string, args?: any[]) => void;
[property: string]: any;
}
export interface Browser {
execute: (code: string) => void;
[property: string]: any;
}
export interface ProcedureListenerInfo {
environment: string;
id?: string;
player?: Player;
}
export type ProcedureListener = (args: any, info: ProcedureListenerInfo) => any;