/**
 * Node.js EventEmitter shim
 * Basic event emitter implementation for browser environment
 */
export type EventListener = (...args: any[]) => void;
declare const kEvents: unique symbol;
declare const kMaxListeners: unique symbol;
interface EventStorage {
    [kEvents]?: Map<string, EventListener[]>;
    [kMaxListeners]?: number;
}
type EventTargetLike = EventStorage & {
    addEventListener?: (...args: unknown[]) => void;
    removeEventListener?: (...args: unknown[]) => void;
};
export declare class EventEmitter {
    [kEvents]?: Map<string, EventListener[]>;
    [kMaxListeners]?: number;
    private _getEvents;
    on(event: string, listener: EventListener): this;
    addListener(event: string, listener: EventListener): this;
    once(event: string, listener: EventListener): this;
    off(event: string, listener: EventListener): this;
    removeListener(event: string, listener: EventListener): this;
    removeAllListeners(event?: string): this;
    emit(event: string, ...args: unknown[]): boolean;
    listeners(event: string): EventListener[];
    rawListeners(event: string): EventListener[];
    listenerCount(event: string): number;
    eventNames(): string[];
    setMaxListeners(n: number): this;
    getMaxListeners(): number;
    prependListener(event: string, listener: EventListener): this;
    prependOnceListener(event: string, listener: EventListener): this;
    static listenerCount(emitter: EventEmitter, event: string): number;
}
export declare function setMaxListeners(n: number, ...targets: EventTargetLike[]): void;
export declare function getMaxListeners(target: EventTargetLike): number;
declare const events: typeof EventEmitter & {
    EventEmitter: typeof EventEmitter;
    once: (emitter: EventEmitter, event: string) => Promise<unknown[]>;
    on: (emitter: EventEmitter, event: string) => AsyncIterable<unknown[]>;
    getEventListeners: (emitter: EventEmitter, event: string) => EventListener[];
    listenerCount: (emitter: EventEmitter, event: string) => number;
    setMaxListeners: typeof setMaxListeners;
    getMaxListeners: typeof getMaxListeners;
    defaultMaxListeners: number;
};
export default events;
//# sourceMappingURL=events.d.ts.map