Skip to main content

on

Callable

  • on<K>(eventName: K, listener: (...args: Parameters<K extends keyof IServerEvent ? IServerEvent[K] : K extends never ? ICustomEmitEvent[K] : never>) => void): void
  • on<K>(eventName: Exclude<K, keyof IServerEvent>, listener: (...args: any[]) => void): void

  • Subscribes to a server event with the specified listener.


    Type parameters

    • K: keyof IServerEvent