From 43b7d16f9a13a2104647fff0dc4d42df90fc5ccd Mon Sep 17 00:00:00 2001 From: Danya H Date: Tue, 8 Jul 2025 22:48:39 +0100 Subject: [PATCH] extracted declarations from @citizenfx packages --- rpc/src/core/client.ts | 16 ++++++++++++++-- rpc/src/core/server.ts | 11 +++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/rpc/src/core/client.ts b/rpc/src/core/client.ts index bc97ee7..1bc064d 100644 --- a/rpc/src/core/client.ts +++ b/rpc/src/core/client.ts @@ -1,5 +1,3 @@ -/// - import type * as s from '@entityseven/fivem-rpc-shared-types' import { Emitter } from '../utils/emitter' import { generateUUID, parse, stringify, stringifyWeb } from '../utils/funcs' @@ -19,6 +17,20 @@ import { } from '../utils/types' import { Wrapper } from './wrapper' +declare function onNet(eventName: string, callback: Function): void +declare function emitNet(eventName: string, ...args: unknown[]): void +declare function on(eventName: string, callback: Function): void +declare function RegisterNuiCallbackType(callbackType: string): void +declare function GetPlayerServerId(player: number): number +declare function PlayerId(): number +declare function SetNuiFocus(hasFocus: boolean, hasCursor: boolean): void +declare function RegisterCommand( + commandName: string, + handler: Function, + restricted: boolean, +): void +declare function SendNuiMessage(jsonString: string): boolean + export class RPCInstanceClient extends Wrapper { private readonly _emitterServer: Emitter private readonly _pendingServer: Emitter diff --git a/rpc/src/core/server.ts b/rpc/src/core/server.ts index 868b898..3807217 100644 --- a/rpc/src/core/server.ts +++ b/rpc/src/core/server.ts @@ -1,5 +1,3 @@ -/// - import type * as s from '@entityseven/fivem-rpc-shared-types' import { Emitter } from '../utils/emitter' import { generateUUID, parse, stringify } from '../utils/funcs' @@ -14,6 +12,15 @@ import { } from '../utils/types' import { Wrapper } from './wrapper' +declare function onNet(eventName: string, callback: Function): void +declare function emitNet(eventName: string, ...args: unknown[]): void +declare function on(eventName: string, callback: Function): void +declare function RegisterCommand( + commandName: string, + handler: Function, + restricted: boolean, +): void + export class RPCInstanceServer extends Wrapper { private readonly _emitterClient: Emitter private readonly _pendingClient: Emitter