import type { ExecutionContext } from './base-types';
export interface HookContext {
    commandName: string;
    element: Element | null;
    args: unknown[];
    modifiers: Record<string, unknown>;
    event?: Event;
    executionContext: ExecutionContext;
}
export type BeforeExecuteHook = (ctx: HookContext) => void | Promise<void>;
export type AfterExecuteHook = (ctx: HookContext, result: unknown) => void | Promise<void>;
export type OnErrorHook = (ctx: HookContext, error: Error) => void | Error | Promise<void | Error>;
export type InterceptCommandHook = (commandName: string, ctx: HookContext) => boolean;
export interface RuntimeHooks {
    beforeExecute?: BeforeExecuteHook;
    afterExecute?: AfterExecuteHook;
    onError?: OnErrorHook;
    interceptCommand?: InterceptCommandHook;
}
export declare class HookRegistry {
    private hooks;
    private beforeExecuteHooks;
    private afterExecuteHooks;
    private onErrorHooks;
    private interceptCommandHooks;
    register(name: string, hooks: RuntimeHooks): void;
    unregister(name: string): boolean;
    has(name: string): boolean;
    runBeforeExecute(ctx: HookContext): Promise<void>;
    runAfterExecute(ctx: HookContext, result: unknown): Promise<void>;
    runOnError(ctx: HookContext, error: Error): Promise<Error>;
    shouldIntercept(commandName: string, ctx: HookContext): boolean;
    getRegisteredNames(): string[];
    clear(): void;
}
export declare function createHooks(config: {
    name?: string;
    beforeExecute?: BeforeExecuteHook;
    afterExecute?: AfterExecuteHook;
    onError?: OnErrorHook;
    interceptCommand?: InterceptCommandHook;
}): RuntimeHooks;
export declare const loggingHooks: RuntimeHooks;
export declare function createTimingHooks(onTiming: (commandName: string, durationMs: number) => void): RuntimeHooks;
//# sourceMappingURL=hooks.d.ts.map