import type { ElementHandle, Page } from "puppeteer-core";
export interface AriaSnapshotOptions {
    /** Maximum tree depth to render. */
    depth?: number;
    /** Append `[box=x,y,w,h]` bounding boxes to each node. */
    boxes?: boolean;
}
/**
 * Capture a Playwright-format ARIA snapshot of `root` (or the whole document when
 * null). Always runs in `ai` mode so every node carries a `[ref=eN]` id; resolve
 * those to elements with {@link resolveAriaRefHandle}. Ids are renumbered from e1
 * on each call and remain valid until the next snapshot.
 */
export declare function captureAriaSnapshot(page: Page, root: ElementHandle | null, options?: AriaSnapshotOptions): Promise<string>;
/**
 * Resolve a `[ref=eN]` id from the latest snapshot to a live `ElementHandle`, or
 * null when the ref no longer matches any element. Runs in the main world so it
 * sees the `_ariaRef` expandos the snapshot wrote.
 */
export declare function resolveAriaRefHandle(page: Page, ref: string): Promise<ElementHandle | null>;
/**
 * Recognize the explicit `[ref=eN]` selector forms and return the bare ref id,
 * else null. Accepts `aria-ref=e5` (Playwright-MCP style), `aria-ref/e5`, and
 * `ariaref/e5` — lets `tab.click("aria-ref=e5")` etc. act on snapshot refs. A
 * bare `e5` is intentionally NOT a ref selector: the cmux backend already uses
 * bare `eN`/`@eN` for its own observe ids, so requiring the prefix keeps action
 * selectors meaning the same thing on both backends. (`tab.ref("e5")` still
 * accepts a bare id directly.)
 */
export declare function parseAriaRefSelector(selector: string): string | null;
/**
 * Build a self-contained expression script that runs the vendored bundle in the
 * page and returns the ARIA snapshot YAML. Used by the cmux backend, whose
 * `browser.eval` RPC takes a script string and returns the completion value (it
 * has no ElementHandle to pass in). The script resolves `selector` via
 * `document.querySelector` in-page (CSS selectors only) or falls back to the
 * whole document. Like the puppeteer path it installs nothing on `window`.
 */
export declare function buildAriaSnapshotScript(selector: string | undefined, options?: AriaSnapshotOptions): string;
