Class

TypedEventEmitter

A general, generic type-safe event emitter class. Extended by components needing typed event publishing and subscription contracts.

Signature

Type Definition
Class TypedEventEmitter

Type parameters

NameConstraintDefaultDescription
MobjectNoneNo type parameter summary yet.

Constructors

NameSignatureDescription
constructorconstructor(): TypedEventEmitter<M>No constructor summary yet.

Methods

NameSignatureDescription
emitemit(event: K, args: undefined): voidEmits a typed event to all active subscribers. Supports type-safety by enforcing key-value mapping and allows omitting the payload argument entirely if the map type is void.
onon(event: K, callback: (payload: indexedAccess) => void): () => voidSubscribes to a typed event.