Class TypedEventEmitter<Events, Arguments, SuperclassArguments>

Typed Event Emitter class which can act as a Base Model for all our model and communication events. This makes it much easier for us to distinguish between events, as we now need to properly type this, so that our events are not stringly-based and prone to silly typos.

Type Parameters

  • Events extends string

  • Arguments extends ListenerMap<Events>

  • SuperclassArguments extends ListenerMap<any> = Arguments

Hierarchy

Constructors

  • Type Parameters

    • Events extends string

    • Arguments extends ListenerMap<Events>

    • SuperclassArguments extends ListenerMap<any> = Arguments

    Parameters

    • Optional options: EventEmitterOptions

    Returns TypedEventEmitter<Events, Arguments, SuperclassArguments>

Methods

  • Type Parameters

    • T extends string

    Parameters

    • event: T
    • Rest ...args: Parameters<SuperclassArguments[T]>

    Returns boolean

  • Type Parameters

    • T extends string

    Parameters

    • event: T
    • Rest ...args: Parameters<Arguments[T]>

    Returns boolean

Generated using TypeDoc