export type EventKey = string | symbol; export type Listener = (...args: any[]) => unknown; type Listeners = Record; /** Emitted before an error is delivered to `error` listeners, and even when there are none. */ export declare const errorMonitor: unique symbol; /** Implemented by an emitter to handle promise rejections returned from its listeners. */ export declare const captureRejectionSymbol: unique symbol; declare const kCapture: unique symbol; export interface EventEmitterOptions { /** Route rejections from listeners returning promises to the emitter's `Symbol.for('nodejs.rejection')` handler. */ captureRejections?: boolean; } /** * The subset of `node:events` that streams are built on, with Node's semantics: * an unhandled `error` event throws, listeners fire in insertion order against a * snapshot of the list, and `once()` wrappers expose their original via `.listener`. * * `setMaxListeners` is honored as state but never produces Node's * `MaxListenersExceededWarning`. */ export declare class EventEmitter { #private; static defaultMaxListeners: number; /** The default for the `captureRejections` option of newly created emitters. */ static captureRejections: boolean; static readonly captureRejectionSymbol: typeof captureRejectionSymbol; static readonly errorMonitor: typeof errorMonitor; _events: Listeners; _eventsCount: number; _maxListeners?: number; protected [kCapture]: boolean; constructor(options?: EventEmitterOptions); setMaxListeners(n: number): this; getMaxListeners(): number; emit(type: EventKey, ...args: any[]): boolean; addListener(type: EventKey, listener: Listener): this; on(type: EventKey, listener: Listener): this; prependListener(type: EventKey, listener: Listener): this; once(type: EventKey, listener: Listener): this; prependOnceListener(type: EventKey, listener: Listener): this; removeListener(type: EventKey, listener: Listener): this; off(type: EventKey, listener: Listener): this; removeAllListeners(type?: EventKey): this; listeners(type: EventKey): Listener[]; rawListeners(type: EventKey): Listener[]; listenerCount(type: EventKey, listener?: Listener): number; eventNames(): EventKey[]; } export {};