@gta5urban/types-server 2.2.2 → 2.2.3

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 +50 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1342,7 +1342,6 @@ declare interface IServerEvents {
1342
1342
  vehicleHornToggle: (vehicle: VehicleMp, toggle: boolean) => void;
1343
1343
  vehicleSirenToggle: (vehicle: VehicleMp, toggle: boolean) => void;
1344
1344
  }
1345
-
1346
1345
  declare class EventMp {
1347
1346
  // @ts-ignore
1348
1347
  constructor<K extends keyof IServerEvents>(eventName: K, callback: IServerEvents[K]);
@@ -1954,6 +1953,54 @@ declare interface CommandsMp {
1954
1953
  getCommands: (player: PlayerMp) => CommandsMpInterface[];
1955
1954
  }
1956
1955
 
1956
+ declare namespace rpc {
1957
+ export function register(name: string, cb: ProcedureListener): () => void;
1958
+ export function unregister(name: string): void;
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
+
1968
+ export function on(name: string, cb: ProcedureListener): () => void;
1969
+ export function off(name: string, cb: ProcedureListener): void;
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
+ }
1988
+
1989
+ export interface ProcedureListenerInfo {
1990
+ environment: string;
1991
+ id?: string;
1992
+ player?: Player;
1993
+ }
1994
+
1995
+ export interface CallOptions {
1996
+ timeout?: number;
1997
+ noRet?: boolean;
1998
+ }
1999
+
2000
+ export type ProcedureListener = (args: any, info: ProcedureListenerInfo) => any;
2001
+ }
2002
+
2003
+
1957
2004
  declare interface Mp {
1958
2005
  Player: typeof PlayerMp;
1959
2006
  players: PlayerMpPool;
@@ -2002,6 +2049,8 @@ declare interface Mp {
2002
2049
 
2003
2050
  commands: CommandsMp;
2004
2051
 
2052
+ rpc: typeof rpc;
2053
+
2005
2054
  }
2006
2055
 
2007
2056
  declare const mp: Mp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gta5urban/types-server",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Types definitions for RAGE:MP server-side module",
5
5
  "main": "index.d.ts",
6
6
  "files": [