import type { Connector } from "../index.js"; /** A bounding box in CDP logical coordinates. */ export interface Box { x: number; y: number; width: number; height: number; } export interface Point { x: number; y: number; } export interface RefFlags { interactive: boolean; visible: boolean; offscreen: boolean; scrollable: boolean; disabled: boolean; editable: boolean; } /** Internal hit-test identities. Symbol keys are deliberately omitted from JSON output. */ export declare const SNAPSHOT_REF_HIT_NODE_IDS: unique symbol; declare const SNAPSHOT_REF_VISIBLE_BOX: unique symbol; declare const SNAPSHOT_REF_NEEDS_HIT_TEST: unique symbol; export declare const SNAPSHOT_REF_ANNOTATION_ROLE: unique symbol; export type SnapshotRefAnnotationRole = "action" | "editable" | "scrollable" | "target" | "generic"; /** Refs are stable only within the snapshot that produced them. */ export interface SnapshotRef { ref: string; /** Nearest surfaced ancestor in the compact snapshot; omitted for roots. */ parentRef?: string; tag: string; text: string; nodeId: number; backendNodeId?: number; center: Point; box: Box; flags: RefFlags; attributes: Record; [SNAPSHOT_REF_HIT_NODE_IDS]?: ReadonlySet; [SNAPSHOT_REF_VISIBLE_BOX]?: Box; [SNAPSHOT_REF_NEEDS_HIT_TEST]?: boolean; [SNAPSHOT_REF_ANNOTATION_ROLE]?: SnapshotRefAnnotationRole; } export interface SnapshotResult { viewport: Box | undefined; refs: SnapshotRef[]; } interface DomBoxModel { content?: number[]; border?: number[]; } /** Lynx DOM node returned by `DOM.getDocumentWithBoxModel`. */ export interface DomNode { nodeId: number; backendNodeId?: number; nodeName?: string; localName?: string; nodeValue?: string; nodeType?: number; attributes?: string[]; children?: DomNode[]; /** Field name used by the Lynx CDP protocol. */ box_model?: DomBoxModel; /** Compatibility with callers that already normalized CDP fields to camelCase. */ boxModel?: DomBoxModel; } export declare function centerOfQuad(quad: number[]): Point; /** Build compact refs from a DOM tree without requiring a live device. */ export declare function buildRefs(root: DomNode, viewport?: Box): SnapshotRef[]; /** Filter refs while preserving a valid compact tree among the retained nodes. */ export declare function filterSnapshotRefs(refs: readonly SnapshotRef[], predicate: (ref: SnapshotRef) => boolean): SnapshotRef[]; /** Fetch the DOM-derived structure for one Lynx session without live-node enrichment. */ export declare function buildSnapshotStructure(connector: Connector, clientId: string, sessionId: number, signal?: AbortSignal): Promise; /** Enrich a captured snapshot in place so its structure and live metadata stay from one DOM read. */ export declare function enrichSnapshot(connector: Connector, clientId: string, sessionId: number, snapshot: SnapshotResult, signal?: AbortSignal): Promise; /** Fetch a structured snapshot of interactive elements for one Lynx session. */ export declare function buildSnapshot(connector: Connector, clientId: string, sessionId: number, signal?: AbortSignal): Promise; export {};