export type ClientEventEmitter<E> = EventEmitter && {
on(event: E, listener: ClientEventHandler<E>): this;
on(event: string, listener: Function): this;
};
such that you can
export type PingEventEmitter = ClientEventEmitter<'ping'>;
and perhaps also extend the definition to also support arrays such that the following are equivalent:
type X = ClientEventEmitter<'ping'> | ClientEventEmitter<'pong'> | ClientEventEmitter<'stream'>;
type Y = ClientEventEmitter<['ping', 'pong', 'stream']>;
Feature description
I quote:
As well as this example.