The type of data passed to event listeners. Defaults to void for events without data.
PrivateenabledPrivatelistenersPrivate StaticlogPrivateoncePrivate ReadonlyonPrivatesafeAdds a listener function to the list of listeners for this event.
The listener function that processes the event.
A function that removes the listener when called.
Adds a listener function that will be removed after its first invocation.
The listener function to invoke only once.
A function that removes the listener when called (useful for canceling before first trigger).
Removes all listeners and once listeners for this event.
Disables triggering of the event.
Enables triggering of the event.
Returns true if there are any listeners attached.
true if at least one listener is attached, false otherwise.
Returns true if the event is enabled.
true if the event can be triggered, false if disabled.
Returns the number of attached listeners.
The total count of regular and one-time listeners.
Removes a specific listener from the list of listeners for this event.
The listener function to remove.
Triggers the event, calling all registered listeners in the order they were added. Errors in listeners do not prevent subsequent listeners from being called.
A type-safe event emitter that supports adding, removing, and triggering listeners. Provides functionality for one-time listeners, error handling, and event enabling/disabling.
Example
Example
Example