import type { Page } from "playwright"; import type { CaptchaAction } from "../llm-connectors/llm-connector.js"; import type { CoordinateSet } from "./history-tree-processor/view.js"; export type Args = { doHighlightElements: boolean; focusHighlightIndex: number; viewportExpansion: number; debugMode: boolean; pendingActions: CaptchaAction[]; pastActions: CaptchaAction[]; }; interface PerfMetrics { buildDomTreeCalls: number; timings: { buildDomTree: number; highlightElement: number; isInteractiveElement: number; isElementVisible: number; isTopElement: number; isInExpandedViewport: number; isTextNodeVisible: number; getEffectiveScroll: number; }; cacheMetrics: { boundingRectCacheHits: number; boundingRectCacheMisses: number; computedStyleCacheHits: number; computedStyleCacheMisses: number; getBoundingClientRectTime: number; getComputedStyleTime: number; boundingRectHitRate: number; computedStyleHitRate: number; overallHitRate: number; }; nodeMetrics: { totalNodes: number; processedNodes: number; skippedNodes: number; }; buildDomTreeBreakdown: { totalTime: number; totalSelfTime: number; buildDomTreeCalls: number; domOperations: { [key: string]: number; getBoundingClientRect: number; getComputedStyle: number; }; domOperationCounts: { [key: string]: number; getBoundingClientRect: number; getComputedStyle: number; }; averageTimePerNode?: number; timeInChildCalls?: number; }; } export interface DOMNodeData { tagName?: string; attributes?: Record; xpath?: string; children?: string[]; isVisible?: boolean; isTopElement?: boolean; isInteractive?: boolean; isInViewport?: boolean; pageCoordinates?: CoordinateSet; highlightIndex?: number; shadowRoot?: boolean; type?: "TEXT_NODE"; text?: string; } type DomHashMap = Record; export interface DOMTreeMap { rootId: string | null; map: DomHashMap; perfMetrics?: PerfMetrics; } declare function buildDomTree(page: Page, args?: Args): Promise; export default buildDomTree; //# sourceMappingURL=extract-dom-tree.d.ts.map