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

30 lines
1.1 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<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>;
2019-01-10 23:57:44 +00:00
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;