import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js'; import * as Protocol from '../../generated/protocol.js'; import * as Common from '../common/common.js'; import * as Platform from '../platform/platform.js'; import { CSSModel } from './CSSModel.js'; import { OverlayModel } from './OverlayModel.js'; import { RemoteObject } from './RemoteObject.js'; import { RuntimeModel } from './RuntimeModel.js'; import { SDKModel } from './SDKModel.js'; import { type Target } from './Target.js'; import { TargetManager } from './TargetManager.js'; /** Keep this list in sync with https://w3c.github.io/aria/#state_prop_def **/ export declare const ARIA_ATTRIBUTES: Set; export declare enum DOMNodeEvents { TOP_LAYER_INDEX_CHANGED = "TopLayerIndexChanged", SCROLLABLE_FLAG_UPDATED = "ScrollableFlagUpdated", AD_RELATED_STATE_UPDATED = "AdRelatedStateUpdated", GRID_OVERLAY_STATE_CHANGED = "GridOverlayStateChanged", FLEX_CONTAINER_OVERLAY_STATE_CHANGED = "FlexContainerOverlayStateChanged", SCROLL_SNAP_OVERLAY_STATE_CHANGED = "ScrollSnapOverlayStateChanged", CONTAINER_QUERY_OVERLAY_STATE_CHANGED = "ContainerQueryOverlayStateChanged" } export interface DOMNodeEventTypes { [DOMNodeEvents.TOP_LAYER_INDEX_CHANGED]: void; [DOMNodeEvents.SCROLLABLE_FLAG_UPDATED]: void; [DOMNodeEvents.AD_RELATED_STATE_UPDATED]: void; [DOMNodeEvents.GRID_OVERLAY_STATE_CHANGED]: { enabled: boolean; }; [DOMNodeEvents.FLEX_CONTAINER_OVERLAY_STATE_CHANGED]: { enabled: boolean; }; [DOMNodeEvents.SCROLL_SNAP_OVERLAY_STATE_CHANGED]: { enabled: boolean; }; [DOMNodeEvents.CONTAINER_QUERY_OVERLAY_STATE_CHANGED]: { enabled: boolean; }; } export declare class DOMNode extends Common.ObjectWrapper.ObjectWrapper { #private; ownerDocument: DOMDocument | null; id: Protocol.DOM.NodeId; index: number | undefined; nodeValueInternal: string; assignedSlot: DOMNodeShortcut | null; readonly shadowRootsInternal: DOMNode[]; childNodeCountInternal: number; childrenInternal: DOMNode[] | null; nextSibling: DOMNode | null; previousSibling: DOMNode | null; firstChild: DOMNode | null; lastChild: DOMNode | null; parentNode: DOMNode | null; templateContentInternal?: DOMNode; contentDocumentInternal?: DOMDocument; childDocumentPromiseForTesting?: Promise; publicId?: string; systemId?: string; internalSubset?: string; name?: string; value?: string; /** * Set when a DOMNode is retained in a detached sub-tree. */ retained: boolean; /** * Set if a DOMNode is a root of a detached sub-tree. */ detached: boolean; constructor(domModel: DOMModel); static create(domModel: DOMModel, doc: DOMDocument | null, isInShadowTree: boolean, payload: Protocol.DOM.Node, retainedNodes?: Set): DOMNode; init(doc: DOMDocument | null, isInShadowTree: boolean, payload: Protocol.DOM.Node, retainedNodes?: Set): void; private requestChildDocument; setTopLayerIndex(idx: number): void; topLayerIndex(): number; adProvenance(): Protocol.Network.AdProvenance | undefined; isRootNode(): boolean; isSVGNode(): boolean; isScrollable(): boolean; affectedByStartingStyles(): boolean; isMediaNode(): boolean; isViewTransitionPseudoNode(): boolean; creationStackTrace(): Promise; get subtreeMarkerCount(): number; domModel(): DOMModel; backendNodeId(): Protocol.DOM.BackendNodeId; children(): DOMNode[] | null; setChildren(children: DOMNode[]): void; setIsScrollable(isScrollable: boolean): void; setIsAdRelated(adProvenance?: Protocol.Network.AdProvenance): void; setAffectedByStartingStyles(affectedByStartingStyles: boolean): void; hasAttributes(): boolean; childNodeCount(): number; setChildNodeCount(childNodeCount: number): void; shadowRoots(): DOMNode[]; templateContent(): DOMNode | null; contentDocument(): DOMDocument | null; setContentDocument(node: DOMDocument): void; isIframe(): boolean; importedDocument(): DOMNode | null; nodeType(): number; nodeName(): string; pseudoType(): string | undefined; pseudoIdentifier(): string | undefined; hasPseudoElements(): boolean; pseudoElements(): Map; checkmarkPseudoElement(): DOMNode | undefined; beforePseudoElement(): DOMNode | undefined; afterPseudoElement(): DOMNode | undefined; pickerIconPseudoElement(): DOMNode | undefined; markerPseudoElement(): DOMNode | undefined; backdropPseudoElement(): DOMNode | undefined; viewTransitionPseudoElements(): DOMNode[]; carouselPseudoElements(): DOMNode[]; hasAssignedSlot(): boolean; isInsertionPoint(): boolean; distributedNodes(): DOMNodeShortcut[]; isInShadowTree(): boolean; getTreeRoot(): DOMNode; ancestorShadowHost(): DOMNode | null; ancestorShadowRoot(): DOMNode | null; ancestorUserAgentShadowRoot(): DOMNode | null; isShadowRoot(): boolean; shadowRootType(): string | null; nodeNameInCorrectCase(): string; setNodeName(name: string, callback?: ((arg0: string | null, arg1: DOMNode | null) => void)): void; localName(): string; nodeValue(): string; setNodeValueInternal(nodeValue: string): void; setNodeValue(value: string, callback?: ((arg0: string | null) => void)): void; getAttribute(name: string): string | undefined; setAttribute(name: string, text: string, callback?: ((arg0: string | null) => void)): void; setAttributeValue(name: string, value: string, callback?: ((arg0: string | null) => void)): void; setAttributeValuePromise(name: string, value: string): Promise; attributes(): Attribute[]; removeAttribute(name: string): Promise; getChildNodesPromise(): Promise; getChildNodes(callback: (arg0: DOMNode[] | null) => void): void; getSubtree(depth: number, pierce: boolean): Promise; getOuterHTML(includeShadowDOM?: boolean): Promise; setOuterHTML(html: string, callback?: ((arg0: string | null) => void)): void; removeNode(callback?: ((arg0: string | null, arg1?: Protocol.DOM.NodeId | undefined) => void)): Promise; path(): string; isAncestor(node: DOMNode): boolean; isDescendant(descendant: DOMNode): boolean; frameOwnerFrameId(): Protocol.Page.FrameId | null; frameId(): Protocol.Page.FrameId | null; setAttributesPayload(attrs: string[]): boolean; insertChild(prev: DOMNode | undefined, payload: Protocol.DOM.Node): DOMNode; removeChild(node: DOMNode): void; setChildrenPayload(payloads: Protocol.DOM.Node[]): void; private setPseudoElements; private toAdoptedStyleSheets; setAdoptedStyleSheets(ids: Protocol.DOM.StyleSheetId[]): void; get adoptedStyleSheetsForNode(): AdoptedStyleSheet[]; setDistributedNodePayloads(payloads: Protocol.DOM.BackendNode[]): void; setAssignedSlot(payload: Protocol.DOM.BackendNode): void; private renumber; private addAttribute; setAttributeInternal(name: string, value: string): void; removeAttributeInternal(name: string): void; copyTo(targetNode: DOMNode, anchorNode: DOMNode | null, callback?: ((arg0: string | null, arg1: DOMNode | null) => void)): void; moveTo(targetNode: DOMNode, anchorNode: DOMNode | null, callback?: ((arg0: string | null, arg1: DOMNode | null) => void)): void; isXMLNode(): boolean; setMarker(name: string, value: unknown): void; marker(name: string): T | null; getMarkerKeysForTest(): string[]; traverseMarkers(visitor: (arg0: DOMNode, arg1: string) => void): void; resolveURL(url: string): Platform.DevToolsPath.UrlString | null; highlight(mode?: string): void; highlightForTwoSeconds(): void; resolveToObject(objectGroup?: string, executionContextId?: Protocol.Runtime.ExecutionContextId): Promise; boxModel(): Promise; setAsInspectedNode(): Promise; enclosingElementOrSelf(): DOMNode | null; callFunction(fn: (this: HTMLElement, ...args: U[]) => T, args?: U[]): Promise<{ value: T; } | null>; scrollIntoView(): Promise; focus(): Promise; simpleSelector(): string; getAnchorBySpecifier(specifier?: string): Promise; takeSnapshot(ownerDocumentSnapshot?: DOMDocument): Promise; classNames(): string[]; } export declare namespace DOMNode { enum ShadowRootTypes { UserAgent = "user-agent", Open = "open", Closed = "closed" } } export declare class DeferredDOMNode { #private; constructor(target: Target, backendNodeId: Protocol.DOM.BackendNodeId); resolve(callback: (arg0: DOMNode | null) => void): void; resolvePromise(): Promise; backendNodeId(): Protocol.DOM.BackendNodeId; domModel(): DOMModel; highlight(): void; } export declare class DOMNodeShortcut { nodeType: number; nodeName: string; deferredNode: DeferredDOMNode; childShortcuts: DOMNodeShortcut[]; constructor(target: Target, backendNodeId: Protocol.DOM.BackendNodeId, nodeType: number, nodeName: string, childShortcuts?: DOMNodeShortcut[]); } export declare class DOMDocument extends DOMNode { body: DOMNode | null; documentElement: DOMNode | null; documentURL: Platform.DevToolsPath.UrlString; baseURL: Platform.DevToolsPath.UrlString; constructor(domModel: DOMModel, payload: Protocol.DOM.Node); } export declare class AdoptedStyleSheet { readonly id: Protocol.DOM.StyleSheetId; readonly parent: DOMNode; constructor(id: Protocol.DOM.StyleSheetId, parent: DOMNode); get cssModel(): CSSModel; } export declare class DOMModel extends SDKModel { #private; agent: ProtocolProxyApi.DOMApi; idToDOMNode: Map; frameIdToOwnerNode: Map; readonly runtimeModelInternal: RuntimeModel; constructor(target: Target); runtimeModel(): RuntimeModel; cssModel(): CSSModel; overlayModel(): OverlayModel; static cancelSearch(targetManager?: TargetManager): void; private scheduleMutationEvent; private onDocumentOpened; requestDocument(): Promise; getOwnerNodeForFrame(frameId: Protocol.Page.FrameId): Promise; private requestDocumentInternal; existingDocument(): DOMDocument | null; pushNodeToFrontend(objectId: Protocol.Runtime.RemoteObjectId): Promise; pushNodeByPathToFrontend(path: string): Promise; pushNodesByBackendIdsToFrontend(backendNodeIds: Set): Promise | null>; attributeModified(nodeId: Protocol.DOM.NodeId, name: string, value: string): void; attributeRemoved(nodeId: Protocol.DOM.NodeId, name: string): void; inlineStyleInvalidated(nodeIds: Protocol.DOM.NodeId[]): void; private loadNodeAttributes; characterDataModified(nodeId: Protocol.DOM.NodeId, newValue: string): void; nodeForId(nodeId: Protocol.DOM.NodeId | null): DOMNode | null; documentUpdated(): void; private setDocument; setDocumentForTest(document: Protocol.DOM.Node | null): void; private setDetachedRoot; setChildNodes(parentId: Protocol.DOM.NodeId, payloads: Protocol.DOM.Node[]): void; childNodeCountUpdated(nodeId: Protocol.DOM.NodeId, newValue: number): void; childNodeInserted(parentId: Protocol.DOM.NodeId, prevId: Protocol.DOM.NodeId, payload: Protocol.DOM.Node): void; childNodeRemoved(parentId: Protocol.DOM.NodeId, nodeId: Protocol.DOM.NodeId): void; shadowRootPushed(hostId: Protocol.DOM.NodeId, root: Protocol.DOM.Node): void; shadowRootPopped(hostId: Protocol.DOM.NodeId, rootId: Protocol.DOM.NodeId): void; pseudoElementAdded(parentId: Protocol.DOM.NodeId, pseudoElement: Protocol.DOM.Node): void; adoptedStyleSheetsModified(parentId: Protocol.DOM.NodeId, styleSheets: Protocol.DOM.StyleSheetId[]): void; scrollableFlagUpdated(nodeId: Protocol.DOM.NodeId, isScrollable: boolean): void; adRelatedStateUpdated(nodeId: Protocol.DOM.NodeId, adProvenance?: Protocol.Network.AdProvenance): void; affectedByStartingStylesFlagUpdated(nodeId: Protocol.DOM.NodeId, affectedByStartingStyles: boolean): void; pseudoElementRemoved(parentId: Protocol.DOM.NodeId, pseudoElementId: Protocol.DOM.NodeId): void; distributedNodesUpdated(insertionPointId: Protocol.DOM.NodeId, distributedNodes: Protocol.DOM.BackendNode[]): void; private unbind; getNodesByStyle(computedStyles: Array<{ name: string; value: string; }>, pierce?: boolean): Promise; performSearch(query: string, includeUserAgentShadowDOM: boolean): Promise; searchResult(index: number): Promise; private cancelSearch; classNamesPromise(nodeId: Protocol.DOM.NodeId): Promise; querySelector(nodeId: Protocol.DOM.NodeId, selector: string): Promise; querySelectorAll(nodeId: Protocol.DOM.NodeId, selector: string): Promise; getTopLayerElements(): Promise; topLayerElementsUpdated(): void; getDetachedDOMNodes(): Promise; getElementByRelation(nodeId: Protocol.DOM.NodeId, relation: Protocol.DOM.GetElementByRelationRequestRelation): Promise; markUndoableState(minorChange?: boolean): void; nodeForLocation(x: number, y: number, includeUserAgentShadowDOM: boolean): Promise; getContainerForNode(nodeId: Protocol.DOM.NodeId, containerName?: string, physicalAxes?: Protocol.DOM.PhysicalAxes, logicalAxes?: Protocol.DOM.LogicalAxes, queriesScrollState?: boolean, queriesAnchored?: boolean): Promise; pushObjectAsNodeToFrontend(object: RemoteObject): Promise; suspendModel(): Promise; resumeModel(): Promise; dispose(): void; parentModel(): DOMModel | null; getAgent(): ProtocolProxyApi.DOMApi; registerNode(node: DOMNode): void; } export declare enum Events { AttrModified = "AttrModified", AttrRemoved = "AttrRemoved", CharacterDataModified = "CharacterDataModified", DOMMutated = "DOMMutated", DocumentURLChanged = "DocumentURLChanged", NodeInserted = "NodeInserted", NodeRemoved = "NodeRemoved", DocumentUpdated = "DocumentUpdated", ChildNodeCountUpdated = "ChildNodeCountUpdated", DistributedNodesChanged = "DistributedNodesChanged", MarkersChanged = "MarkersChanged", TopLayerElementsChanged = "TopLayerElementsChanged", AffectedByStartingStylesFlagUpdated = "AffectedByStartingStylesFlagUpdated", AdoptedStyleSheetsModified = "AdoptedStyleSheetsModified" } export interface EventTypes { [Events.AttrModified]: { node: DOMNode; name: string; }; [Events.AttrRemoved]: { node: DOMNode; name: string; }; [Events.CharacterDataModified]: DOMNode; [Events.DOMMutated]: DOMNode; [Events.DocumentURLChanged]: DOMDocument; [Events.NodeInserted]: DOMNode; [Events.NodeRemoved]: { node: DOMNode; parent: DOMNode; }; [Events.DocumentUpdated]: DOMModel; [Events.ChildNodeCountUpdated]: DOMNode; [Events.DistributedNodesChanged]: DOMNode; [Events.MarkersChanged]: DOMNode; [Events.TopLayerElementsChanged]: { document: DOMDocument; documentShortcuts: DOMNodeShortcut[]; }; [Events.AffectedByStartingStylesFlagUpdated]: { node: DOMNode; }; [Events.AdoptedStyleSheetsModified]: DOMNode; } export declare class DOMModelUndoStack { #private; constructor(); static instance(opts?: { forceNew: boolean | null; }): DOMModelUndoStack; markUndoableState(model: DOMModel, minorChange: boolean): Promise; undo(): Promise; redo(): Promise; dispose(model: DOMModel): void; } export declare class DOMNodeSnapshot extends DOMNode { init(_doc: DOMDocument | null, _isInShadowTree: boolean, _payload: Protocol.DOM.Node, _retainedNodes?: Set | undefined): void; setNodeName(_name: string, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; setNodeValue(_value: string, _callback?: ((arg0: string | null) => void) | undefined): void; setAttribute(_name: string, _text: string, _callback?: ((arg0: string | null) => void) | undefined): void; setAttributeValue(_name: string, _value: string, _callback?: ((arg0: string | null) => void) | undefined): void; removeAttribute(_name: string): Promise; setOuterHTML(_html: string, _callback?: ((arg0: string | null) => void) | undefined): void; removeNode(_callback?: ((arg0: string | null, arg1?: Protocol.DOM.NodeId | undefined) => void) | undefined): Promise; copyTo(_targetNode: DOMNode, _anchorNode: DOMNode | null, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; moveTo(_targetNode: DOMNode, _anchorNode: DOMNode | null, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; setAsInspectedNode(): Promise; } export declare class DOMDocumentSnapshot extends DOMDocument { init(_doc: DOMDocument | null, _isInShadowTree: boolean, _payload: Protocol.DOM.Node, _retainedNodes?: Set | undefined): void; setNodeName(_name: string, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; setNodeValue(_value: string, _callback?: ((arg0: string | null) => void) | undefined): void; setAttribute(_name: string, _text: string, _callback?: ((arg0: string | null) => void) | undefined): void; setAttributeValue(_name: string, _value: string, _callback?: ((arg0: string | null) => void) | undefined): void; removeAttribute(_name: string): Promise; setOuterHTML(_html: string, _callback?: ((arg0: string | null) => void) | undefined): void; removeNode(_callback?: ((arg0: string | null, arg1?: Protocol.DOM.NodeId | undefined) => void) | undefined): Promise; copyTo(_targetNode: DOMNode, _anchorNode: DOMNode | null, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; moveTo(_targetNode: DOMNode, _anchorNode: DOMNode | null, _callback?: ((arg0: string | null, arg1: DOMNode | null) => void) | undefined): void; setAsInspectedNode(): Promise; } export interface Attribute { name: string; value: string; _node: DOMNode; }