Pluggable
Base class for objects that can have plugins attached
Provides plugin attachment capabilities and lifecycle management. Plugins are attached during configuration and initialized during startup.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PluggablePluggable class.
class Pluggable<
TPluggableEvents extends SEEventMapLike<TPluggableEvents> =
SENoEvents
> extends StrictEventEmitter<TPluggableEvents>class Pluggable<
TPluggableEvents extends SEEventMapLike<TPluggableEvents> =
SENoEvents
> extends StrictEventEmitter<TPluggableEvents>Member visibility
Filter class members by access level.
Pluggable(shutdown: CoordinatedShutdown, startup: CoordinatedStartup)Pluggable(shutdown: CoordinatedShutdown, startup: CoordinatedStartup)Showing members with Protected visibility and higher.
TPluggableEvents
TPluggableEvents extends SEEventMapLike<TPluggableEvents> = SENoEventsTPluggableEvents extends SEEventMapLike<TPluggableEvents> = SENoEventsprotected readonly shutdown: CoordinatedShutdownprotected readonly shutdown: CoordinatedShutdownprotected readonly startup: CoordinatedStartupprotected readonly startup: CoordinatedStartupaddListener()
Alias of onon for compatibility with Node.js EventEmitter APIs.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
emit()
Emits an event with the strictly typed argument tuple for the event name.
eventThe event name to emit
argsTuple payload for the event
Inherited from:StrictEventEmitter
eventNamesTyped()
Returns the list of event names known to the emitter with the mapped key type.
eventNamesTyped(): SEEventKey<TEvents>[]eventNamesTyped(): SEEventKey<TEvents>[]Inherited from:StrictEventEmitter
listenerCountTyped()
Counts listeners for an event without widening the return type of listenerCountlistenerCount.
eventThe event name to inspect
Inherited from:StrictEventEmitter
listeners()
Retrieves the listener list for a given event with the correct tuple signature.
eventThe event name to inspect
Inherited from:StrictEventEmitter
off()
Removes a previously registered listener for the given event.
eventThe event name whose listener should be removed
listenerCallback originally registered for the event
Inherited from:StrictEventEmitter
on()
Registers a persistent listener with tuple-safe arguments for the given event.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
once()
Registers a one time listener that is removed after the first invocation.
eventThe event name to attach to
listenerCallback operating on the typed argument tuple for the event
Inherited from:StrictEventEmitter
Alias of offoff for compatibility with Node.js EventEmitter APIs.
eventThe event name whose listener should be removed
listenerCallback originally registered for the event
Inherited from:StrictEventEmitter
waitFor()
Waits for an event to be emitted, resolving with the listener arguments tuple once triggered. Supports optional abort signals and timeouts for cancellation semantics.
async waitFor<TEventKey>(
event: TEventKey,
opts?: { signal?: AbortSignal; timeoutMs?: number }
): Promise<TEvents[TEventKey]>async waitFor<TEventKey>(
event: TEventKey,
opts?: { signal?: AbortSignal; timeoutMs?: number }
): Promise<TEvents[TEventKey]>eventThe event name to wait for
optsOptional abort signal or timeout in milliseconds
Inherited from:StrictEventEmitter