Skip to content

Class: HierarchicalEventEmitter<TPath, TEventMap>

utilities/events.HierarchicalEventEmitter

Type parameters

NameType
TPathextends string = ""
TEventMapextends EventMap = {}

Hierarchy

Constructors

constructor

new HierarchicalEventEmitter<TPath, TEventMap>(name?, parent?): HierarchicalEventEmitter<TPath, TEventMap>

Type parameters

NameType
TPathextends string = ""
TEventMapextends EventMap = {}

Parameters

NameType
name?string
parent?HierarchicalEventEmitter<"", {}>

Returns

HierarchicalEventEmitter<TPath, TEventMap>

Overrides

EventEmitter.constructor

Defined in

src/utilities/events.ts:483

Accessors

path

get path(): TPath

Returns

TPath

Defined in

src/utilities/events.ts:507

Methods

abs_path

abs_path(path): string

Parameters

NameType
pathstring

Returns

string

Defined in

src/utilities/events.ts:516


emit

emit<K>(event, ...args): void

Type parameters

NameType
Kextends string

Parameters

NameType
eventK
...argsTEventMap[K]

Returns

void

Overrides

EventEmitter.emit

Defined in

src/utilities/events.ts:609


events

events(): string[]

Returns

string[]

Overrides

EventEmitter.events

Defined in

src/utilities/events.ts:627


eventsWithChildren

eventsWithChildren(): string[]

Returns

string[]

Defined in

src/utilities/events.ts:616


hasListeners

hasListeners<K>(event): boolean

Type parameters

NameType
Kextends string

Parameters

NameType
eventK

Returns

boolean

Overrides

EventEmitter.hasListeners

Defined in

src/utilities/events.ts:605


listeners

listeners<K>(event): ListenerInfo<any[]>[]

Type parameters

NameType
Kextends string

Parameters

NameType
eventK

Returns

ListenerInfo<any[]>[]

Overrides

EventEmitter.listeners

Defined in

src/utilities/events.ts:601


makeEvent

makeEvent<TData>(data): TypedFFZEvent<TData>

Create a new FFZEvent instance. This is a convenience method that wraps ()

Type parameters

NameType
TDataextends Record<string, any> = {}

Parameters

NameType
dataTData

Returns

TypedFFZEvent<TData>

Inherited from

EventEmitter.makeEvent

Defined in

src/utilities/events.ts:118


makeWaitableEvent

makeWaitableEvent<TData, TReturn>(data): TypedFFZWaitableEvent<TData, TReturn>

Create a new FFZWaitableEvent instance. This is a convenience method that wraps ()

Type parameters

NameType
TDataextends Record<string, any> = {}
TReturnvoid

Parameters

NameType
dataTData

Returns

TypedFFZWaitableEvent<TData, TReturn>

Inherited from

EventEmitter.makeWaitableEvent

Defined in

src/utilities/events.ts:128


many

many<K>(event, ttl, fn, ctx?, priority?, prepend?): void

Type parameters

NameType
Kextends string

Parameters

NameTypeDefault value
eventKundefined
ttlnumberundefined
fnEventListener<TEventMap[K]>undefined
ctx?anyundefined
priority?numberundefined
prependbooleanfalse

Returns

void

Overrides

EventEmitter.many

Defined in

src/utilities/events.ts:575


off

off<K>(event?, fn?, ctx?): void

Type parameters

NameType
Kextends string

Parameters

NameType
event?K
fn?EventListener<any[]>
ctx?any

Returns

void

Overrides

EventEmitter.off

Defined in

src/utilities/events.ts:595


offContext

offContext<K>(event, ctx?): void

Type parameters

NameType
Kextends string

Parameters

NameType
eventK
ctx?any

Returns

void

Inherited from

EventEmitter.offContext

Defined in

src/utilities/events.ts:274


on

on<K>(event, fn, ctx?, priority?, prepend?): void

Type parameters

NameType
Kextends string

Parameters

NameTypeDefault value
eventKundefined
fnEventListener<TEventMap[K]>undefined
ctx?anyundefined
priority?numberundefined
prependbooleanfalse

Returns

void

Overrides

EventEmitter.on

Defined in

src/utilities/events.ts:555


once

once<K>(event, fn, ctx?, priority?, prepend?): void

Type parameters

NameType
Kextends string

Parameters

NameTypeDefault value
eventKundefined
fnEventListener<TEventMap[K]>undefined
ctx?anyundefined
priority?numberundefined
prependbooleanfalse

Returns

void

Overrides

EventEmitter.once

Defined in

src/utilities/events.ts:565


waitFor

waitFor<K>(event, ctx?, priority?, prepend?): Promise<TEventMap[K]>

Type parameters

NameType
Kextends string

Parameters

NameTypeDefault value
eventKundefined
ctx?anyundefined
priority?numberundefined
prependbooleanfalse

Returns

Promise<TEventMap[K]>

Overrides

EventEmitter.waitFor

Defined in

src/utilities/events.ts:586