export type EventHandler<T = unknown> = (data: T) => void;
export declare class EventBus {
    private handlers;
    /** Subscribe to an event. Returns unsubscribe function. */
    on<T = unknown>(event: string, handler: EventHandler<T>): () => void;
    /** Subscribe once — auto-removes after first call. */
    once<T = unknown>(event: string, handler: EventHandler<T>): () => void;
    /** Unsubscribe from an event. */
    off<T = unknown>(event: string, handler: EventHandler<T>): void;
    /** Emit an event to all subscribers. */
    emit<T = unknown>(event: string, data: T): void;
    /** Remove all handlers for an event, or all events if no arg. */
    clear(event?: string): void;
    /** Check if an event has any listeners. */
    has(event: string): boolean;
}
