@gta5urban/types-server 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +31 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1957,14 +1957,44 @@ declare namespace RpcMp {
1957
1957
  export function register(name: string, cb: ProcedureListener): () => void;
1958
1958
  export function unregister(name: string): void;
1959
1959
 
1960
+ export function call<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
1961
+ export function callServer<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
1962
+ export function callClient<T = any>(player: Player, name: string, args?: any, options?: CallOptions): Promise<T>;
1963
+ export function callClient<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
1964
+ export function callBrowsers<T = any>(player: Player, name: string, args?: any, options?: CallOptions): Promise<T>;
1965
+ export function callBrowsers<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
1966
+ export function callBrowser<T = any>(browser: Browser, name: string, args?: any, options?: CallOptions): Promise<T>;
1967
+
1960
1968
  export function on(name: string, cb: ProcedureListener): () => void;
1961
1969
  export function off(name: string, cb: ProcedureListener): void;
1962
1970
 
1971
+ export function trigger(name: string, args?: any): void;
1972
+ export function triggerServer(name: string, args?: any): void;
1973
+ export function triggerClient(player: Player, name: string, args?: any): void;
1974
+ export function triggerClient(name: string, args?: any): void;
1975
+ export function triggerBrowsers(player: Player, name: string, args?: any): void;
1976
+ export function triggerBrowsers(name: string, args?: any): void;
1977
+ export function triggerBrowser(browser: Browser, name: string, args?: any): void;
1978
+
1979
+ export interface Player {
1980
+ call: (eventName: string, args?: any[]) => void;
1981
+ [property: string]: any;
1982
+ }
1983
+
1984
+ export interface Browser {
1985
+ execute: (code: string) => void;
1986
+ [property: string]: any;
1987
+ }
1963
1988
 
1964
1989
  export interface ProcedureListenerInfo {
1965
1990
  environment: string;
1966
1991
  id?: string;
1967
- player?: PlayerMp;
1992
+ player?: Player;
1993
+ }
1994
+
1995
+ export interface CallOptions {
1996
+ timeout?: number;
1997
+ noRet?: boolean;
1968
1998
  }
1969
1999
 
1970
2000
  export type ProcedureListener = (args: any, info: ProcedureListenerInfo) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gta5urban/types-server",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "Types definitions for RAGE:MP server-side module",
5
5
  "main": "index.d.ts",
6
6
  "files": [