Class: HierarchicalEventEmitter<TPath, TEventMap>
utilities/events.HierarchicalEventEmitter
Type parameters
Name | Type |
---|---|
TPath | extends string = "" |
TEventMap | extends EventMap = {} |
Hierarchy
EventEmitter
<TEventMap
>↳
HierarchicalEventEmitter
↳↳
Module
Constructors
constructor
• new HierarchicalEventEmitter<TPath
, TEventMap
>(name?
, parent?
): HierarchicalEventEmitter
<TPath
, TEventMap
>
Type parameters
Name | Type |
---|---|
TPath | extends string = "" |
TEventMap | extends EventMap = {} |
Parameters
Name | Type |
---|---|
name? | string |
parent? | HierarchicalEventEmitter <"" , {}> |
Returns
HierarchicalEventEmitter
<TPath
, TEventMap
>
Overrides
Defined in
Accessors
path
• get
path(): TPath
Returns
TPath
Defined in
Methods
abs_path
▸ abs_path(path
): string
Parameters
Name | Type |
---|---|
path | string |
Returns
string
Defined in
emit
▸ emit<K
>(event
, ...args
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type |
---|---|
event | K |
...args | TEventMap [K ] |
Returns
void
Overrides
Defined in
events
▸ events(): string
[]
Returns
string
[]
Overrides
Defined in
eventsWithChildren
▸ eventsWithChildren(): string
[]
Returns
string
[]
Defined in
hasListeners
▸ hasListeners<K
>(event
): boolean
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type |
---|---|
event | K |
Returns
boolean
Overrides
Defined in
listeners
▸ listeners<K
>(event
): ListenerInfo
<any
[]>[]
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type |
---|---|
event | K |
Returns
ListenerInfo
<any
[]>[]
Overrides
Defined in
makeEvent
▸ makeEvent<TData
>(data
): TypedFFZEvent
<TData
>
Create a new FFZEvent instance. This is a convenience method that wraps ()
Type parameters
Name | Type |
---|---|
TData | extends Record <string , any > = {} |
Parameters
Name | Type |
---|---|
data | TData |
Returns
TypedFFZEvent
<TData
>
Inherited from
Defined in
makeWaitableEvent
▸ makeWaitableEvent<TData
, TReturn
>(data
): TypedFFZWaitableEvent
<TData
, TReturn
>
Create a new FFZWaitableEvent instance. This is a convenience method that wraps ()
Type parameters
Name | Type |
---|---|
TData | extends Record <string , any > = {} |
TReturn | void |
Parameters
Name | Type |
---|---|
data | TData |
Returns
TypedFFZWaitableEvent
<TData
, TReturn
>
Inherited from
EventEmitter.makeWaitableEvent
Defined in
many
▸ many<K
>(event
, ttl
, fn
, ctx?
, priority?
, prepend?
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type | Default value |
---|---|---|
event | K | undefined |
ttl | number | undefined |
fn | EventListener <TEventMap [K ]> | undefined |
ctx? | any | undefined |
priority? | number | undefined |
prepend | boolean | false |
Returns
void
Overrides
Defined in
off
▸ off<K
>(event?
, fn?
, ctx?
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type |
---|---|
event? | K |
fn? | EventListener <any []> |
ctx? | any |
Returns
void
Overrides
Defined in
offContext
▸ offContext<K
>(event
, ctx?
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type |
---|---|
event | K |
ctx? | any |
Returns
void
Inherited from
Defined in
on
▸ on<K
>(event
, fn
, ctx?
, priority?
, prepend?
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type | Default value |
---|---|---|
event | K | undefined |
fn | EventListener <TEventMap [K ]> | undefined |
ctx? | any | undefined |
priority? | number | undefined |
prepend | boolean | false |
Returns
void
Overrides
Defined in
once
▸ once<K
>(event
, fn
, ctx?
, priority?
, prepend?
): void
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type | Default value |
---|---|---|
event | K | undefined |
fn | EventListener <TEventMap [K ]> | undefined |
ctx? | any | undefined |
priority? | number | undefined |
prepend | boolean | false |
Returns
void
Overrides
Defined in
waitFor
▸ waitFor<K
>(event
, ctx?
, priority?
, prepend?
): Promise
<TEventMap
[K
]>
Type parameters
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type | Default value |
---|---|---|
event | K | undefined |
ctx? | any | undefined |
priority? | number | undefined |
prepend | boolean | false |
Returns
Promise
<TEventMap
[K
]>