browser-use-typescript
Version:
A TypeScript-based browser automation framework
46 lines (45 loc) • 1.71 kB
TypeScript
import { CoordinateSet, HashedDomElement, ViewportInfo } from "../domHIstory/historyTypes";
export interface DOMBaseNode {
isVisible: boolean;
parent: DOMElementNode | null;
}
export declare class DOMTextNode implements DOMBaseNode {
text: string;
type: string;
isVisible: boolean;
parent: DOMElementNode | null;
constructor(text: string, isVisible: boolean, parent: DOMElementNode | null);
hasParentWithHighlightIndex(): boolean;
isParentInViewport(): boolean;
isParentTopElement(): boolean;
}
export declare class DOMElementNode implements DOMBaseNode {
tagName: string;
xpath: string;
attributes: Record<string, string>;
children: DOMBaseNode[];
isVisible: boolean;
parent: DOMElementNode | null;
isInteractive: boolean;
isTopElement: boolean;
isInViewport: boolean;
shadowRoot: boolean;
highlightIndex: number | null;
viewportCoordinates: CoordinateSet | null;
pageCoordinates: CoordinateSet | null;
viewportInfo: ViewportInfo | null;
constructor(tagName: string, xpath: string, attributes: Record<string, string>, children: DOMBaseNode[], isVisible: boolean, parent: DOMElementNode | null);
toString(): string;
get hash(): HashedDomElement;
getAllTextTillNextClickableElement(maxDepth?: number): string;
clickableElementsToString(includeAttributes?: string[] | null): string;
getFileUploadElement(checkSiblings?: boolean): DOMElementNode | null;
}
export interface SelectorMap {
[key: number]: DOMElementNode;
}
export declare class DOMState {
elementTree: DOMElementNode;
selectorMap: SelectorMap;
constructor(elementTree: DOMElementNode, selectorMap: SelectorMap);
}