object
should be in either of the following forms:
interface EventTypes {
'event-with-parameters': any[]
'event-with-example-handler': (...args: any[]) => void
}
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Add a one-time listener for a given event.
Wait when event with type
will be emitted for timeout
ms.
emitter.onceWithTimeout('d6910a9d-ea24-5fc6-a654-28781ef21f8f', 20000)
// => Promise
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
Generated using TypeDoc
Extended Event Emitted class
const emitter = new EmitterEventPayload(); // promise will be rejected in 20 secs // if no one event has been received with type 'ref-uuid-value' // otherwise promise will be fulfilled with payload object const promise = emitter.onceWithTimeout('ref-uuid-value', 20000)