Skip to main content
Version: v1.13.0

Interface: Emitter<EventMap>

A typed EventEmitter with events defined by BroadcastClientEventPayloads.

Type parameters

Name
EventMap

Properties

_events

Optional _events: Object

Index signature

▪ [Key: string]: Callback | Callback[]

Methods

emit

emit<Key>(event, params): void

Type parameters

NameType
Keyextends string | number | symbol

Parameters

NameType
eventKey
paramsEventMap[Key]

Returns

void

emit<Key, Params>(event, params?): void

Type parameters

NameType
Keyextends string
ParamsParams

Parameters

NameType
eventKey
params?Params

Returns

void


off

off<Key>(event, callback, context?): void

Type parameters

NameType
Keyextends string | number | symbol

Parameters

NameType
eventKey
callback(value: EventMap[Key]) => void
context?object

Returns

void

off<Key>(event, callback, context?): void

Type parameters

NameType
Keyextends string

Parameters

NameType
eventKey
callbackCallback
context?object

Returns

void


on

on<Key>(event, callback, context?): void

Type parameters

NameType
Keyextends string | number | symbol

Parameters

NameType
eventKey
callback(value: EventMap[Key]) => void
context?object

Returns

void

on<Key>(event, callback, context?): void

Type parameters

NameType
Keyextends string

Parameters

NameType
eventKey
callbackCallback
context?object

Returns

void


removeAllListeners

removeAllListeners(): void

Returns

void