import type { HyperscriptEvent, ExecutionContext } from '../types/core';
interface ListenerInfo {
    element: HTMLElement;
    eventType: string;
    handler: EventListener;
    options?: AddEventListenerOptions & {
        delegated?: boolean;
    };
    wrappedHandler: EventListener;
}
export interface HyperscriptEventManager {
    listeners: Map<string, ListenerInfo>;
    delegatedListeners: Map<string, Set<string>>;
}
export type DelegationCleanupRegistrar = (cleanup: () => void, description: string) => void;
export declare function setDelegationCleanupRegistrar(registrar: DelegationCleanupRegistrar): void;
export declare function createEventManager(): HyperscriptEventManager;
export declare function registerEventListener(manager: HyperscriptEventManager, element: HTMLElement, eventType: string, handler: EventListener, options?: AddEventListenerOptions & {
    delegated?: boolean;
}): string;
export declare function unregisterEventListener(manager: HyperscriptEventManager, listenerId: string): boolean;
export declare function dispatchCustomEvent(element: HTMLElement, eventType: string, detail?: any, options?: CustomEventInit): boolean;
export declare function createHyperscriptEvent(eventName: string, data: {
    element: HTMLElement;
    context: ExecutionContext;
    command?: string;
    result?: any;
    error?: Error;
    originalEvent?: Event;
}): HyperscriptEvent;
export declare function setupEventDelegation(): void;
export declare function cleanupEventDelegation(): void;
export declare function registerManagerForDelegation(manager: HyperscriptEventManager): void;
export declare function unregisterManagerFromDelegation(manager: HyperscriptEventManager): void;
export declare function getActiveListeners(manager: HyperscriptEventManager): ListenerInfo[];
export declare function getListenerCount(manager: HyperscriptEventManager): number;
export declare function createDebouncedHandler(handler: EventListener, delay: number): EventListener;
export declare function createThrottledHandler(handler: EventListener, limit: number): EventListener;
export declare function createOnceHandler(handler: EventListener): EventListener;
export declare function waitForEvent(element: EventTarget, eventType: string, timeout?: number): Promise<Event>;
export declare function emitConfigEvent(element: HTMLElement, cfg: any): boolean;
export declare function emitBeforeEvent(element: HTMLElement, cfg: any): boolean;
export declare function emitAfterEvent(element: HTMLElement, cfg: any): boolean;
export declare function emitErrorEvent(element: HTMLElement, error: Error, cfg: any, command: any): void;
export declare function emitFinallyEvent(element: HTMLElement, cfg: any): void;
export declare function emitSwappedEvent(element: HTMLElement, cfg: any): void;
export {};
//# sourceMappingURL=events.d.ts.map