Skip to main content

onServer

Callable

  • onServer<K>(eventName: K, listener: (...args: Parameters<ICustomServerClientEvent[K]>) => void): void
  • onServer<K>(eventName: Exclude<K, never>, listener: (...args: any[]) => void): void
  • onServer(listener: (eventName: string, ...args: any[]) => void): void

  • Subscribes to a server event with the specified listener.


    Type parameters

    • K: never