import { EventEmitter } from 'events';
/** `fn.toString()` for CDP — strip ESM `export` so the body is valid inside an IIFE. */
export declare function serializeFunctionForCdp(fn: (...args: unknown[]) => unknown): string;
/**
 * Single CDP WebSocket — all `send`/`evaluate` calls are serialized.
 * `runExclusive` pauses DOM poll (see DOMExtractor) while user commands run.
 */
export declare class CdpClient extends EventEmitter {
    private ws;
    private nextId;
    private pending;
    private _connected;
    private opChain;
    private commandExclusiveDepth;
    private withLock;
    connect(wsUrl: string): Promise<void>;
    disconnect(): void;
    isConnected(): boolean;
    /** True while a user command holds the CDP lane (DOM poll should skip). */
    isCommandExclusive(): boolean;
    /** Run fn as one atomic CDP session — inner `send` calls bypass the queue. */
    runExclusive<T>(fn: () => Promise<T>): Promise<T>;
    private enqueue;
    send(method: string, params?: Record<string, unknown>, timeoutMs?: number): Promise<Record<string, unknown>>;
    private sendOnce;
    /**
     * Evaluate a self-contained function in the page.
     * Injects __name shim — regex strip of __name() breaks nested helpers (see TROUBLESHOOTING).
     */
    callFunction(fn: (...args: unknown[]) => unknown, ...args: unknown[]): Promise<unknown>;
    /**
     * Like `callFunction`, but injects dependency function sources into the same scope
     * (e.g. `readActiveChatDom` for `focusSidebarAgentDom`).
     */
    callFunctionWithDeps(fn: (...args: unknown[]) => unknown, deps: Array<(...args: unknown[]) => unknown>, ...args: unknown[]): Promise<unknown>;
    evaluate(expression: string, timeoutMs?: number): Promise<unknown>;
    typeText(text: string): Promise<void>;
    pressKey(key: string, code: string, keyCode: number, modifiers?: number): Promise<void>;
    /** Attach local image files to Cursor composer via hidden file input. */
    attachComposerImages(filePaths: string[]): Promise<void>;
    click(selectorPath: string): Promise<void>;
    private handleMessage;
    private rejectAll;
}
