import { WebSocket } from "ws";
export declare const PERMITTED_CDP_METHODS: ReadonlySet<string>;
export interface CdpClientOptions {
    readonly timeoutMs?: number;
    readonly socketFactory?: (url: string) => WebSocket;
}
export type CdpEventListener = (event: {
    readonly method: string;
    readonly params: unknown;
    readonly sessionId?: string;
}) => void;
export type CdpCloseListener = (reason: string) => void;
export declare class CdpClient {
    private readonly socket;
    private readonly timeoutMs;
    private readonly pending;
    private readonly listeners;
    private readonly closeListeners;
    private nextId;
    private connectPromise;
    private closed;
    private closeReason;
    constructor(url: string, options?: CdpClientOptions);
    connect(): Promise<void>;
    onEvent(listener: CdpEventListener): () => void;
    onClose(listener: CdpCloseListener): () => void;
    send<T = unknown>(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<T>;
    close(): void;
    isClosed(): boolean;
    closeCause(): string | undefined;
    private handleMessage;
    private dispatchEvent;
    private resolvePending;
    private handleSocketClosed;
}
//# sourceMappingURL=cdp-client.d.ts.map