import type { HashedDomElement, CoordinateSet, ViewportInfo } from "./history-tree-processor/view.js"; /** * Base class for DOM nodes. */ export declare class DOMBaseNode { is_visible: boolean; parent: DOMElementNode | null; constructor(is_visible: boolean, parent?: DOMElementNode | null); } /** * Represents a text node in the DOM. */ export declare class DOMTextNode extends DOMBaseNode { text: string; type: string; constructor(text: string, is_visible: boolean, parent?: DOMElementNode | null); hasParentWithHighlightIndex(): boolean; isParentInViewport(): boolean; isParentTopElement(): boolean; } /** * Represents an element node in the DOM. * * The xpath here is relative to the last root (shadow root, iframe, or document) * so that you can traverse up the tree via the `parent` property to resolve the full path. */ export declare class DOMElementNode extends DOMBaseNode { tagName: string; xpath: string; attributes: { [key: string]: string; }; children: DOMBaseNode[]; is_interactive: boolean; is_top_element: boolean; is_in_viewport: boolean; shadow_root: boolean; highlightIndex: number | undefined; viewport_coordinates: CoordinateSet | undefined; page_coordinates: CoordinateSet | undefined; viewport_info: ViewportInfo | undefined; private _hash?; cssSelector: string; constructor(options: { tagName: string; xpath: string; attributes: { [key: string]: string; }; children?: DOMBaseNode[]; is_visible: boolean; is_interactive?: boolean; is_top_element?: boolean; is_in_viewport?: boolean; shadow_root?: boolean; highlightIndex?: number | undefined; viewport_coordinates?: CoordinateSet | undefined; page_coordinates?: CoordinateSet | undefined; viewport_info?: ViewportInfo | undefined; parent?: DOMElementNode | undefined; }); /** * Returns a string representation of the element, including its attributes * and extra info such as interactivity and viewport status. */ toString(): string; /** * A cached hash of this DOM element. */ get hash(): HashedDomElement; /** * Recursively collects all text from this node until a clickable element is encountered. * @param maxDepth Maximum recursion depth (-1 for unlimited) */ getAllTextTillNextClickableElement(maxDepth?: number): string; /** * Converts the processed DOM content to a string representation of clickable elements. * Optionally includes a list of attributes for each clickable element. */ clickableElementsToString(includeAttributes?: string[] | null): string; /** * Searches for and returns a file upload element within this node’s subtree or among its siblings. * @param checkSiblings If true, also checks siblings (only on the initial call) */ getFileUploadElement(checkSiblings?: boolean): DOMElementNode | null; } /** * A map from highlight index to clickable element. */ export type SelectorMap = Record; /** * A structure that holds the DOM tree and a selector map. */ export declare class DOMState { elementTree: DOMElementNode; selectorMap: SelectorMap; constructor(elementTree: DOMElementNode, selectorMap: SelectorMap); } //# sourceMappingURL=views.d.ts.map