/** * selector-utils.ts — Utility for trying multiple comma-separated CSS selectors. * * When AI sends comma-separated selectors like * `button:has-text("OK"), a:has-text("OK"), [aria-label*="OK"]` * these helpers try each one sequentially and return the selector that matched. */ import type { Page } from 'playwright'; /** * Apply the optional post-navigation `waitForSelector` / `waitForTimeout` * params shared by the browser_navigate MCP tool and its local-server HTTP * counterpart: wait for a selector to appear, then wait for an additional * (clamped) delay. Both are no-ops when their param is falsy/undefined. */ export declare function applyPostNavigateWait(page: Page, waitForSelector: string | undefined, waitForTimeout: number | undefined): Promise; /** * Truncate a page-extracted text blob (e.g. innerText()) so it does not * overwhelm the LLM context. Shared by browser_get_text / browser_extract * across the in-process MCP tool and the local-server HTTP handler. */ export declare function truncateForContext(text: string, maxLength?: number): string; /** * Collapse whitespace and truncate to a single-line preview for display in * the browser action log (e.g. `get_text "selector" → "preview…"`). */ export declare function actionLogPreview(text: string, maxLength?: number): string; /** * Try multiple comma-separated CSS selectors for a click action. * Returns the selector that actually matched. * If the selector contains no commas, it is used as-is. */ export declare function tryClickSelectors(page: Page, selectors: string, options?: { waitForNavigation?: boolean; }): Promise; /** * Try multiple comma-separated CSS selectors for a fill action. * Returns the selector that actually matched. * If the selector contains no commas, it is used as-is. */ export declare function tryFillSelectors(page: Page, selectors: string, value: string): Promise; //# sourceMappingURL=selector-utils.d.ts.map