Skip to main content
Version: v1.2.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): void

Type parameters

NameType
Keyextends string | number | symbol

Parameters

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

Returns

void

off<Key>(event, callback): void

Type parameters

NameType
Keyextends string

Parameters

NameType
eventKey
callbackCallback

Returns

void


on

on<Key>(event, callback): void

Type parameters

NameType
Keyextends string | number | symbol

Parameters

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

Returns

void

on<Key>(event, callback): void

Type parameters

NameType
Keyextends string

Parameters

NameType
eventKey
callbackCallback

Returns

void