/** * CDP client — implements IPage by connecting directly to a Chrome/Electron CDP WebSocket. * * Fixes applied: * - send() now has a 30s timeout guard (P0 #4) * - goto() waits for Page.loadEventFired instead of hardcoded 1s sleep (P1 #3) * - Implemented scroll, autoScroll, screenshot, networkRequests (P1 #2) * - Shared DOM helper methods extracted to reduce duplication with Page (P1 #5) */ import type { IPage } from '../types.js'; import type { IBrowserFactory } from '../runtime.js'; export interface CDPTarget { type?: string; url?: string; title?: string; webSocketDebuggerUrl?: string; } export declare const CDP_RESPONSE_BODY_CAPTURE_LIMIT: number; export declare class CDPBridge implements IBrowserFactory { private _ws; private _idCounter; private _pending; private _eventListeners; connect(opts?: { timeout?: number; session?: string; cdpEndpoint?: string; contextId?: string; idleTimeout?: number; windowMode?: 'foreground' | 'background'; surface?: 'browser' | 'adapter'; siteSession?: 'ephemeral' | 'persistent'; }): Promise; close(): Promise; send(method: string, params?: Record, timeoutMs?: number): Promise; on(event: string, handler: (params: unknown) => void): void; off(event: string, handler: (params: unknown) => void): void; waitForEvent(event: string, timeoutMs?: number): Promise; } declare function selectCDPTarget(targets: CDPTarget[]): CDPTarget | undefined; declare function scoreCDPTarget(target: CDPTarget, preferredPattern?: RegExp): number; export declare const __test__: { selectCDPTarget: typeof selectCDPTarget; scoreCDPTarget: typeof scoreCDPTarget; }; export {};