import type { Browser, Page } from 'playwright-core'; import type { PageState, RoleRefs } from './types.js'; /** Page extended with Playwright's private `_snapshotForAI` method. */ export type PageWithAI = Page & { _snapshotForAI?: (opts: { timeout: number; track: string; }) => Promise<{ full?: string; }>; }; export declare function ensurePageState(page: Page): PageState; export declare function setStealthEnabled(enabled: boolean): void; export declare function storeRoleRefsForTarget(opts: { page: Page; cdpUrl: string; targetId?: string; refs: RoleRefs; frameSelector?: string; mode?: 'role' | 'aria'; }): void; export declare function restoreRoleRefsForTarget(opts: { cdpUrl: string; targetId?: string; page: Page; }): void; export declare function connectBrowser(cdpUrl: string, authToken?: string): Promise<{ browser: Browser; cdpUrl: string; authToken?: string; }>; export declare function disconnectBrowser(): Promise; export declare function getAllPages(browser: Browser): Promise; export declare function pageTargetId(page: Page): Promise; export declare function findPageByTargetId(browser: Browser, targetId: string, cdpUrl?: string): Promise; export declare function getPageForTargetId(opts: { cdpUrl: string; targetId?: string; }): Promise; export declare function refLocator(page: Page, ref: string): import("playwright-core").Locator; export declare function toAIFriendlyError(error: unknown, selector: string): Error; export declare function normalizeTimeoutMs(timeoutMs: number | undefined, fallback: number, maxMs?: number): number;