import type { EventMap, Listener } from "../types"; /** * Emits events to a managed pool of listeners. Works conveniently with the `on` and `once` tools. */ export declare class EventEmitter { /** * Listeners by event type. */ listeners: { [K in keyof E]?: Listener[]; }; /** * Adds a listener for a particular event. * * @param type The event type to listen to. * @param listener The listener to call with the event. */ addEventListener(type: K, listener: Listener): void; /** * Removes a listener from a particular event. * * @param type The event type to stop listening. * @param listener The listener to remove. */ removeEventListener(type: K, listener: Listener): void; /** * Dispatches the provided event of a given `type` to the registered listeners, if any. * * @param type The event type to dispatch. * @param event The event to dispatch. */ dispatchEvent(type: K, event: E[K]): void; }