/** * DOM Service for getting the DOM tree and other DOM-related information. * * This service provides comprehensive DOM tree extraction and serialization capabilities * for browser automation, including accessibility information and visual layout data. */ import { BrowserSession } from '../browser/session'; import { DOMRect, EnhancedDOMTreeNode, SerializedDOMState } from './views'; /** * Service for getting the DOM tree and other DOM-related information. * * Either browser or page must be provided. * * TODO: currently we start a new websocket connection PER STEP, we should definitely keep this persistent */ export declare class DomService { private browserSession; private logger; private crossOriginIframes; constructor(browserSession: BrowserSession, logger?: any, crossOriginIframes?: boolean); /** * Get the target info for a specific page. */ private getTargetsForPage; /** * Build enhanced accessibility node from CDP AX node data */ private buildEnhancedAXNode; /** * Get viewport dimensions, device pixel ratio, and scroll position using CDP. */ private getViewportRatio; /** * Check if the element is visible according to all its parent HTML frames. */ static isElementVisibleAccordingToAllParents(node: EnhancedDOMTreeNode, htmlFrames: EnhancedDOMTreeNode[]): boolean; /** * Recursively collect all frames and merge their accessibility trees into a single array. */ private getAXTreeForAllFrames; /** * Get DOM tree, accessibility tree, and snapshot data for a target. */ private getAllTrees; /** * Recursively construct enhanced DOM tree nodes. */ private constructEnhancedNode; /** * Get the DOM tree for a specific target. */ getDOMTree(targetId: string, initialHtmlFrames?: EnhancedDOMTreeNode[], initialTotalFrameOffset?: DOMRect): Promise; /** * Get the serialized DOM tree representation for LLM consumption. * * Returns tuple of (serialized_dom_state, enhanced_dom_tree_root, timing_info) */ getSerializedDOMTree(previousCachedState?: SerializedDOMState): Promise<[SerializedDOMState, EnhancedDOMTreeNode, Record]>; } //# sourceMappingURL=service.d.ts.map