/**
 * TypedEventEmitter - A type-safe event emitter with advanced features
 *
 * Provides type-safe event emission/listening, priority handling, wildcard listeners,
 * event history tracking, and an adapter for gradual migration from native EventEmitter.
 */
import { EventEmitter } from 'events';
import type { BaseEvent, EventListener, EventFilter, ListenerOptions, EventHistoryEntry, EventStats, AllEvents } from './types.js';
import { FilteredEventEmitter } from './filtered-emitter.js';
/**
 * TypedEventEmitter - A type-safe event emitter with advanced features
 */
export declare class TypedEventEmitter<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>> {
    private emitter;
    private listeners;
    private wildcardListeners;
    private eventHistory;
    private maxHistorySize;
    private stats;
    private listenerIdCounter;
    private enabled;
    constructor(options?: {
        maxHistorySize?: number;
    });
    /**
     * Generate a unique listener ID
     */
    private generateListenerId;
    /**
     * Enable or disable the event emitter
     */
    setEnabled(enabled: boolean): void;
    /**
     * Check if the emitter is enabled
     */
    isEnabled(): boolean;
    /**
     * Emit an event
     */
    emit<K extends keyof TEvents>(type: K, event: Omit<TEvents[K], 'type' | 'timestamp'>): boolean;
    /**
     * Add an event listener
     */
    on<K extends keyof TEvents>(type: K, listener: EventListener<TEvents[K]>, options?: ListenerOptions<TEvents[K]>): string;
    /**
     * Add a one-time event listener
     */
    once<K extends keyof TEvents>(type: K, listener: EventListener<TEvents[K]>, options?: Omit<ListenerOptions<TEvents[K]>, 'once'>): string;
    /**
     * Add a wildcard listener that receives all events
     */
    onAny(listener: EventListener<BaseEvent>, options?: ListenerOptions<BaseEvent>): string;
    /**
     * Remove an event listener by ID
     */
    off(listenerId: string): boolean;
    /**
     * Remove all listeners for a specific event type
     */
    offAll<K extends keyof TEvents>(type?: K): void;
    /**
     * Remove a listener by ID
     */
    private removeListenerById;
    /**
     * Add event to history
     */
    private addToHistory;
    /**
     * Get event history
     */
    getHistory(): EventHistoryEntry[];
    /**
     * Get filtered event history
     */
    getFilteredHistory<T extends BaseEvent>(filter: EventFilter<T>): EventHistoryEntry<T>[];
    /**
     * Clear event history
     */
    clearHistory(): void;
    /**
     * Get listener count for a specific event type
     */
    listenerCount<K extends keyof TEvents>(type?: K): number;
    /**
     * Get event names that have listeners
     */
    eventNames(): string[];
    /**
     * Get event statistics
     */
    getStats(): EventStats;
    /**
     * Reset statistics
     */
    resetStats(): void;
    /**
     * Wait for a specific event (returns a Promise)
     */
    waitFor<K extends keyof TEvents>(type: K, options?: {
        timeout?: number;
        filter?: EventFilter<TEvents[K]>;
    }): Promise<TEvents[K]>;
    /**
     * Pipe events to another emitter
     */
    pipe<K extends keyof TEvents>(type: K, target: TypedEventEmitter<TEvents>, options?: {
        transform?: (event: TEvents[K]) => TEvents[K];
    }): string;
    /**
     * Create a filtered view of this emitter
     */
    filter<K extends keyof TEvents>(type: K, predicate: EventFilter<TEvents[K]>): FilteredEventEmitter<TEvents, K>;
    /**
     * Dispose the emitter and clean up resources
     */
    dispose(): void;
}
/**
 * Adapter that wraps native EventEmitter to provide TypedEventEmitter interface.
 * This allows gradual migration from EventEmitter to TypedEventEmitter.
 *
 * Usage:
 * ```typescript
 * // Old code (EventEmitter)
 * class MyClass extends EventEmitter {
 *   doSomething() {
 *     this.emit('event', { data: 'value' });
 *   }
 * }
 *
 * // New code (TypedEventEmitterAdapter)
 * class MyClass extends TypedEventEmitterAdapter<MyEvents> {
 *   doSomething() {
 *     this.emitTyped('event', { data: 'value' });
 *   }
 * }
 * ```
 */
export declare class TypedEventEmitterAdapter<TEvents extends Record<string, BaseEvent> = AllEvents> extends EventEmitter {
    private typedEmitter;
    constructor(options?: {
        maxHistorySize?: number;
    });
    /**
     * Type-safe emit (new API)
     */
    emitTyped<K extends keyof TEvents>(type: K, event: Omit<TEvents[K], 'type' | 'timestamp'>): boolean;
    /**
     * Type-safe listener (new API)
     */
    onTyped<K extends keyof TEvents>(type: K, listener: EventListener<TEvents[K]>, options?: ListenerOptions<TEvents[K]>): string;
    /**
     * Type-safe once listener (new API)
     */
    onceTyped<K extends keyof TEvents>(type: K, listener: EventListener<TEvents[K]>, options?: Omit<ListenerOptions<TEvents[K]>, 'once'>): string;
    /**
     * Remove typed listener by ID
     */
    offTyped(listenerId: string): boolean;
    /**
     * Wait for a typed event
     */
    waitForTyped<K extends keyof TEvents>(type: K, options?: {
        timeout?: number;
        filter?: EventFilter<TEvents[K]>;
    }): Promise<TEvents[K]>;
    /**
     * Get the underlying TypedEventEmitter
     */
    getTypedEmitter(): TypedEventEmitter<TEvents>;
    /**
     * Get event statistics
     */
    getEventStats(): EventStats;
    /**
     * Get event history
     */
    getEventHistory(): EventHistoryEntry[];
    /**
     * Dispose both emitters
     */
    dispose(): void;
}
