Class Client

Hierarchy

  • EventEmitter
    • Client

Constructors

Properties

host: Host
prefixed: string | boolean

Methods

  • Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any

    Returns this

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • Rest...args: any[]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

  • Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • Optionalfn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • Add a listener for a given event.

    Parameters

    • event: "connect"
    • listener: ((netID: number) => void)
        • (netID): void
        • Parameters

          • netID: number

          Returns void

    Returns this

  • Parameters

    • event: "raw"
    • listener: ((netID: number, channelID: number, data: Buffer) => void)
        • (netID, channelID, data): void
        • Parameters

          • netID: number
          • channelID: number
          • data: Buffer

          Returns void

    Returns this

  • Parameters

    • event: "ready"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: ((error: Error, data?: Buffer) => void)
        • (error, data?): void
        • Parameters

          • error: Error
          • Optionaldata: Buffer

          Returns void

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: ((netID: number) => void)
        • (netID): void
        • Parameters

          • netID: number

          Returns void

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any

    Returns this

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optionalevent: string | symbol

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • Optionalfn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this