/**
 * Type-safe Event System
 *
 * Provides strongly-typed event emission and subscription with autocomplete support.
 */
export type EventHandler<T = unknown> = (payload: T) => void;
/**
 * Type-safe event emitter with generics
 */
export declare class TypedEventEmitter<TEvents extends Record<string, unknown> = Record<string, unknown>> {
    private eventBus;
    /**
     * Emit an event with type-safe payload
     */
    emit<K extends keyof TEvents>(event: K, payload: TEvents[K]): void;
    /**
     * Subscribe to an event with type-safe payload
     * Returns an unsubscribe function
     */
    on<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): () => void;
    /**
     * Subscribe to an event once (auto-unsubscribe after first emit)
     */
    once<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): () => void;
    /**
     * Unsubscribe a specific handler from an event
     */
    off<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): void;
    /**
     * Remove all listeners for a specific event
     */
    removeAllListeners<K extends keyof TEvents>(event: K): void;
    /**
     * Remove all listeners for all events
     */
    clearAll(): void;
    /**
     * Get the number of listeners for an event
     */
    listenerCount<K extends keyof TEvents>(event: K): number;
    /**
     * Get all registered event names
     */
    eventNames(): Array<keyof TEvents>;
}
/**
 * Default events for Hypen framework (can be extended by users)
 */
export type HypenFrameworkEvents = {
    'module:created': {
        moduleId: string;
    };
    'module:destroyed': {
        moduleId: string;
    };
    'route:changed': {
        from: string | null;
        to: string;
    };
    'state:updated': {
        moduleId: string;
        paths: string[];
    };
    'action:dispatched': {
        moduleId: string;
        actionName: string;
        payload?: unknown;
    };
    'error': {
        message: string;
        error?: Error;
        context?: string;
    };
};
/**
 * Create a typed event emitter with custom event map
 */
export declare function createEventEmitter<TEvents extends Record<string, unknown> = HypenFrameworkEvents>(): TypedEventEmitter<TEvents>;
