Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ClientUtils

Index

Constructors

constructor

  • new ClientUtils(settings?: ClientUtilsParams): ClientUtils

Properties

Private _settings

_settings: ClientUtilSettings = ...

Methods

Private debugLog

  • debugLog(...args: any[]): void

emitNetPromise

  • emitNetPromise<T>(eventName: string, data: unknown): Promise<T>
  • Emit a promisified event towards the server which will resolve once the server responds.

    Type parameters

    • T = any

    Parameters

    • eventName: string

      The event name

    • data: unknown

      The data you wish to send with the request

    Returns Promise<T>

registerNuiProxy

  • registerNuiProxy(event: string): void
  • Will Register an NUI event callback that will immediately proxy to a server side promisified event of the same name. Once the server responds and resolves the promise on the client, this function will callback to the NUI and resolve the original HTTP request.

    Parameters

    • event: string

      The event name to listen for

    Returns void

registerRPCListener

  • registerRPCListener<T, R>(eventName: string, cb: RPCListenerCb<T, R>): void
  • Register a listener for the RPC system which can then be triggered by the server side RPC call.

    Type parameters

    • T = any

    • R = any

    Parameters

    • eventName: string

      The event name to listen for

    • cb: RPCListenerCb<T, R>

      The callback function that returns the desired value back to the server

    Returns void

setSettings

  • setSettings(settings?: ClientUtilsParams): void
  • Change the settings for this instance by passing a new config

    Parameters

    • Optional settings: ClientUtilsParams

      Settings you wish to overwrite

    Returns void

Generated using TypeDoc