declare type EventType = string | symbol; declare type Handler = (event: T) => void; declare type EventHandlerList = Array>; export declare type EventHandler = (event: Events[Key]) => void; export declare class Emitter> { /** * A Map of event names to registered handler functions. */ all: Map>; /** * Register an event handler for the given type. * @param {string|symbol} type Type of event to listen for, or `'*'` for all events * @param {Function} handler Function to call in response to given event */ on(type: Key, handler: EventHandler): void; /** * Register an event handler for given type, to run once * @param {string|symbol} type Type for the event to listen for * @param {Function} handler Function to call in response to given event */ once(type: Key, handler: EventHandler): void; /** * Remove an event handler for the given type. * If `handler` is omitted, all handlers of the given type are removed. * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler) * @param {Function} [handler] Handler function to remove */ off(type: Key, handler?: EventHandler): void; /** * Invoke all handlers for the given type. * * @param {string|symbol} type The event type to invoke * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler */ emit(type: Key, evt?: Events[Key]): void; } export {};