import type { Readable, Writable } from 'stream';
export interface CDPPipeTransport {
    read: Readable;
    write: Writable;
}
type EventHandler = (params: Record<string, unknown>, sessionId?: string) => void;
export declare function registerPipeTransport(transport: CDPPipeTransport): string;
export declare class CDPClient {
    private ws;
    private pipe;
    private pipeBuffer;
    private transport;
    private messageId;
    private pending;
    private eventHandlers;
    private pipeDataHandler;
    private pipeErrorHandler;
    private pipeCloseHandler;
    connect(endpoint: string): Promise<void>;
    connectPipe(transport: CDPPipeTransport): void;
    send<T = unknown>(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<T>;
    on(event: string, handler: EventHandler): void;
    off(event: string, handler: EventHandler): void;
    close(): void;
    get connected(): boolean;
    get isOpen(): boolean;
    private handlePipeData;
    private handleMessage;
    private handleClose;
}
export interface BrowserDiscovery {
    wsUrl: string;
    browser: string;
}
export declare class BrowserCdpConnectionError extends Error {
    readonly port: number;
    readonly profileName: string;
    readonly host: string;
    constructor(port: number, profileName?: string, host?: string);
}
export declare function formatBrowserCdpConnectionError(port: number, profileName?: string, host?: string): string;
export declare function discoverBrowserWsUrl(port: number, host?: string, profileName?: string): Promise<BrowserDiscovery>;
export declare function normalizeBrowserName(s: string): string;
export declare function verifyBrowserIdentity(reported: string, expected: string, port: number, host?: string): void;
export declare function listTargets(port: number, host?: string): Promise<Array<{
    id: string;
    type: string;
    title: string;
    url: string;
}>>;
export {};
