import type { BrowserContext, Locator, Page } from 'playwright-core'; import type { EvaluateResult, RefInfo, ScrollPosition, TabState, WaitForPageReadyOptions } from '../types'; export declare const LONG_TEXT_THRESHOLD = 400; export declare const TYPE_TIMEOUT_BASE_MS = 10000; export declare const TYPE_TIMEOUT_PER_CHAR_MS = 80; export declare const TYPE_TIMEOUT_MAX_MS = 120000; export declare function withTimeout(promise: Promise, timeoutMs: number, label?: string): Promise; export declare function withTabLock(tabId: string, operation: () => Promise): Promise; export declare function clearTabLock(tabId: string): void; export declare function clearAllTabLocks(): void; export declare function calculateTypeTimeoutMs(text: string): number; export declare function safePageClose(page: (Pick & { isClosed?: () => boolean; }) | { close: (...args: any[]) => Promise; isClosed?: () => boolean; } | null | undefined): Promise; export interface ValidateUrlOptions { allowPrivateNetworkTargets?: boolean; } export declare function throwBlockedNavigationErrorIfPresent(page: Page): void; export declare function flushBlockedNavigationError(page: Page): Promise; export declare function withBlockedNavigationTracking(page: Page, action: () => Promise): Promise; export declare function validateUrl(url: string, options?: ValidateUrlOptions): string | null; export declare function validateNavigationUrl(url: string, options?: ValidateUrlOptions): Promise; export declare function navigateWithSafetyGuard(page: Pick, targetUrl: string, options?: ValidateUrlOptions & { waitUntil?: 'load' | 'domcontentloaded' | 'networkidle'; timeout?: number; }): Promise; export declare function annotateAriaYamlWithRefs(ariaYaml: string | null, refs: Map): string; export declare function waitForPageReady(page: Page, options?: WaitForPageReadyOptions): Promise; export declare function dismissConsentDialogs(page: Page): Promise; export declare function buildRefs(page: Page): Promise>; export declare function buildRefsFromAriaSnapshot(ariaYaml: string | null): Map; export declare function getAriaSnapshot(page: Page): Promise; export declare function isElementRef(target: string): boolean; export declare function refToLocator(page: Page, ref: string, refs: Map): Promise; export declare function acquirePageForNewTab(context: BrowserContext): Promise; export declare function createTabState(page: Page): Promise; export declare function navigateTab(tabId: string, tabState: TabState, params: { url?: string; macro?: string; query?: string; allowPrivateNetworkTargets?: boolean; }): Promise<{ ok: true; url: string; }>; export declare function snapshotTab(tabState: TabState): Promise<{ url: string; snapshot: string; refsCount: number; }>; export interface SnapshotPayload { url: string; snapshot: string; refsCount: number; offset: number; truncated: boolean; totalChars: number; hasMore: boolean; nextOffset: number | null; } export declare function buildSnapshotPayload(raw: { url: string; snapshot: string; refsCount: number; }, offset?: number): SnapshotPayload; export declare function clickTab(tabId: string, tabState: TabState, params: { ref?: string; selector?: string; }): Promise<{ ok: true; url: string; }>; /** * Smart fill that handles contenteditable elements differently from standard inputs. * Prevents text doubling on rich-text editors (Lexical, ProseMirror, Slate, etc.) */ export declare function smartFill(locator: Locator, page: Page, text: string): Promise; export declare function typeTab(tabId: string, tabState: TabState, params: { ref?: string; selector?: string; text: string; }): Promise<{ ok: true; }>; export declare function pressTab(tabId: string, tabState: TabState, key: string): Promise<{ ok: true; }>; export declare function scrollTab(tabState: TabState, params: { direction?: 'up' | 'down' | 'left' | 'right'; amount?: number; }): Promise<{ ok: true; }>; export declare function scrollElementTab(tabId: string, tabState: TabState, params: { selector?: string; ref?: string; deltaX?: number; deltaY?: number; scrollTo?: { top?: number; left?: number; }; }): Promise<{ ok: true; scrollPosition: ScrollPosition; }>; export declare function evaluateTab(tabId: string, tabState: TabState, params: { expression: string; timeout?: number; }): Promise; export declare function evaluateTabExtended(tabId: string, tabState: TabState, params: { expression: string; timeout?: number; }): Promise; export declare function backTab(tabId: string, tabState: TabState): Promise<{ ok: true; url: string; }>; export declare function forwardTab(tabId: string, tabState: TabState): Promise<{ ok: true; url: string; }>; export declare function refreshTab(tabId: string, tabState: TabState): Promise<{ ok: true; url: string; }>; export declare function getLinks(tabState: TabState, params: { limit: number; offset: number; scope?: string; extension?: string; downloadOnly?: boolean; }): Promise<{ links: Array<{ url: string; text: string; }>; pagination: { total: number; offset: number; limit: number; hasMore: boolean; }; }>; export declare function screenshotTab(tabState: TabState, fullPage: boolean): Promise; export declare function waitTab(tabState: TabState, params: { timeout: number; waitForNetwork: boolean; }): Promise<{ ok: true; ready: boolean; }>; //# sourceMappingURL=tab.d.ts.map