/** * Default event map with string keys and any arguments. * Using `any[]` is necessary here to allow flexible event argument types * while maintaining type safety through generic constraints in EventEmitter. */ export type DefaultEventMap = Record; /** * Event callback function type. * Using `any[]` default is necessary for variance and compatibility with event handlers. */ export type EventCallback = (...args: Args) => void; /** * EventEmitter class is used to emit and subscribe to events. * @template EventMap - Map of event names to their argument types */ export declare class EventEmitter { #private; /** * Subscribe to the event. * @param name Event name. * @param fn Callback. * @returns {void} */ on(name: K, fn: EventCallback): void; /** * Emit event. * @param name Event name. * @param args Arguments to pass to each listener. * @returns {void} */ emit(name: K, ...args: EventMap[K]): void; /** * Remove a specific callback from event * or all event subscriptions. * @param name Event name. * @param fn Callback. * @returns {void} */ off(name: K, fn?: EventCallback): void; /** * Subscribe to an event that will be called only once. * @param name Event name. * @param fn Callback. * @returns {void} */ once(name: K, fn: EventCallback): void; /** * Remove all registered events and subscriptions. */ removeAllListeners(): void; } //# sourceMappingURL=EventEmitter.d.ts.map