/** * Ref System * * Uses Playwright's ariaSnapshot API to assign sequential @e refs to interactive elements. * No DOM mutation — works through Shadow DOM and CSP-restricted pages. * * ariaSnapshot() returns YAML-like lines: * - heading "Hello" [level=1] * - button "Click me" * - textbox "Search" * - link "Home" */ type Page = import('playwright').Page; type Locator = import('playwright').Locator; export interface RefEntry { ref: string; role: string; name: string; attrs: Record; } export interface RefMap { entries: RefEntry[]; byRef: Map; rawSnapshot: string; timestamp: number; } /** * Parse ariaSnapshot YAML output into RefEntry objects. * * Format examples: * - heading "Dashboard" [level=1] * - button "Submit" * - textbox "Email" [disabled] * - link "Settings": * - /url: /settings */ export declare function parseAriaSnapshot(snapshot: string, options?: { interactive?: boolean; }): RefEntry[]; /** * Build a ref map from the page's accessibility tree. * Uses locator.ariaSnapshot() (Playwright 1.49+). */ export declare function buildRefMap(page: Page, options?: { interactive?: boolean; }): Promise; /** * Resolve a @ref to a Playwright Locator. * Uses getByRole with name matching for robustness. */ export declare function resolveRef(page: Page, ref: string): Locator; /** * Check if a ref is still valid (element exists in DOM). * ~5ms overhead vs 30s Playwright timeout on stale refs. */ export declare function checkRefStale(page: Page, ref: string): Promise; /** * Format a ref map as human-readable text. */ export declare function formatRefMap(refMap: RefMap): string; /** Store current snapshot as baseline for future diffs. */ export declare function setBaseline(): void; /** Get the current baseline ref map. */ export declare function getBaseline(): RefMap | null; /** Get the current ref map. */ export declare function getCurrentRefMap(): RefMap | null; /** Clear both current and baseline ref maps. */ export declare function clearRefMaps(): void; export {}; //# sourceMappingURL=refs.d.ts.map