/** * Shared DOM operation JS generators. * * Used by both Page (daemon mode) and CDPPage (direct CDP mode) * to eliminate code duplication for click, type, press, wait, scroll, etc. */ /** Generate JS to click an element by ref. * Returns { status, x, y, w, h } for CDP fallback when JS click fails. */ export declare function clickJs(ref: string): string; /** Generate JS to type text into an element by ref. * Uses native setter for React compat + execCommand for contenteditable. */ export declare function typeTextJs(ref: string, text: string): string; /** Generate JS to press a keyboard key */ export declare function pressKeyJs(key: string, modifiers?: string[]): string; /** Generate JS to wait for text to appear in the page */ export declare function waitForTextJs(text: string, timeoutMs: number): string; /** Generate JS for scroll */ export declare function scrollJs(direction: string, amount: number): string; /** Generate JS for auto-scroll with lazy-load detection */ export declare function autoScrollJs(times: number, delayMs: number): string; /** Generate JS to read performance resource entries as network requests */ export declare function networkRequestsJs(includeStatic: boolean): string; /** * Generate JS to wait until the DOM stabilizes (no mutations for `quietMs`), * with a hard cap at `maxMs`. Uses MutationObserver in the browser. * * Returns as soon as the page stops changing, avoiding unnecessary fixed waits. * If document.body is not available, falls back to a fixed sleep of maxMs. */ export declare function waitForDomStableJs(maxMs: number, quietMs: number): string; /** * Generate JS to wait until window.__opencli_xhr has ≥1 captured response. * Polls every 100ms. Resolves 'captured' on success; rejects after maxMs. * Used after installInterceptor() + goto() instead of a fixed sleep. */ export declare function waitForCaptureJs(maxMs: number): string; /** * Generate JS to wait until document.querySelector(selector) returns a match. * Uses MutationObserver for near-instant resolution; falls back to reject after timeoutMs. */ export declare function waitForSelectorJs(selector: string, timeoutMs: number): string;