extracted declarations from @citizenfx packages

This commit is contained in:
Danya H 2025-07-08 22:48:39 +01:00
parent 821cd589d9
commit 43b7d16f9a
2 changed files with 23 additions and 4 deletions

View File

@ -1,5 +1,3 @@
/// <reference types="@citizenfx/client" />
import type * as s from '@entityseven/fivem-rpc-shared-types' import type * as s from '@entityseven/fivem-rpc-shared-types'
import { Emitter } from '../utils/emitter' import { Emitter } from '../utils/emitter'
import { generateUUID, parse, stringify, stringifyWeb } from '../utils/funcs' import { generateUUID, parse, stringify, stringifyWeb } from '../utils/funcs'
@ -19,6 +17,20 @@ import {
} from '../utils/types' } from '../utils/types'
import { Wrapper } from './wrapper' 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 { export class RPCInstanceClient extends Wrapper {
private readonly _emitterServer: Emitter private readonly _emitterServer: Emitter
private readonly _pendingServer: Emitter private readonly _pendingServer: Emitter

View File

@ -1,5 +1,3 @@
/// <reference types="@citizenfx/server" />
import type * as s from '@entityseven/fivem-rpc-shared-types' import type * as s from '@entityseven/fivem-rpc-shared-types'
import { Emitter } from '../utils/emitter' import { Emitter } from '../utils/emitter'
import { generateUUID, parse, stringify } from '../utils/funcs' import { generateUUID, parse, stringify } from '../utils/funcs'
@ -14,6 +12,15 @@ import {
} from '../utils/types' } from '../utils/types'
import { Wrapper } from './wrapper' 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 { export class RPCInstanceServer extends Wrapper {
private readonly _emitterClient: Emitter private readonly _emitterClient: Emitter
private readonly _pendingClient: Emitter private readonly _pendingClient: Emitter