-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
First, thanks for this helpful package @binier ! I used to manually declare onX(…)
events to enforce typed events until I found it.
One thing I miss is a plain interface definition which I can inherit.
export interface ITypedEmitter<L extends ListenerSignature<L> = DefaultListener> {
addListener<U extends keyof L>( event: U, listener: L[U] ): this;
prependListener<U extends keyof L>( event: U, listener: L[U] ): this;
// etc.
}
export interface MyInterfaceWithEvents extends ITypedEmitter<MyEvents> {
// …
}
so users of the interface can also rely on typed events, not only users of the instance.
Metadata
Metadata
Assignees
Labels
No labels