import EventTarget from '../../event/EventTarget.cjs'; import * as PropertySymbol from '../../PropertySymbol.cjs'; import MutationListener from '../../mutation-observer/MutationListener.cjs'; import INode from './INode.cjs'; import IDocument from '../document/IDocument.cjs'; import IElement from '../element/IElement.cjs'; import NodeTypeEnum from './NodeTypeEnum.cjs'; import NodeDocumentPositionEnum from './NodeDocumentPositionEnum.cjs'; import INodeList from './INodeList.cjs'; /** * Node. */ export default class Node extends EventTarget implements INode { static [PropertySymbol.ownerDocument]: IDocument | null; static readonly ELEMENT_NODE = NodeTypeEnum.elementNode; static readonly ATTRIBUTE_NODE = NodeTypeEnum.attributeNode; static readonly TEXT_NODE = NodeTypeEnum.textNode; static readonly CDATA_SECTION_NODE = NodeTypeEnum.cdataSectionNode; static readonly COMMENT_NODE = NodeTypeEnum.commentNode; static readonly DOCUMENT_NODE = NodeTypeEnum.documentNode; static readonly DOCUMENT_TYPE_NODE = NodeTypeEnum.documentTypeNode; static readonly DOCUMENT_FRAGMENT_NODE = NodeTypeEnum.documentFragmentNode; static readonly PROCESSING_INSTRUCTION_NODE = NodeTypeEnum.processingInstructionNode; static readonly DOCUMENT_POSITION_CONTAINED_BY = NodeDocumentPositionEnum.containedBy; static readonly DOCUMENT_POSITION_CONTAINS = NodeDocumentPositionEnum.contains; static readonly DOCUMENT_POSITION_DISCONNECTED = NodeDocumentPositionEnum.disconnect; static readonly DOCUMENT_POSITION_FOLLOWING = NodeDocumentPositionEnum.following; static readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = NodeDocumentPositionEnum.implementationSpecific; static readonly DOCUMENT_POSITION_PRECEDING = NodeDocumentPositionEnum.preceding; readonly ELEMENT_NODE: any; readonly ATTRIBUTE_NODE: any; readonly TEXT_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_TYPE_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; [PropertySymbol.isConnected]: boolean; [PropertySymbol.ownerDocument]: IDocument; [PropertySymbol.parentNode]: INode | null; [PropertySymbol.nodeType]: NodeTypeEnum; [PropertySymbol.rootNode]: INode; [PropertySymbol.formNode]: INode; [PropertySymbol.selectNode]: INode; [PropertySymbol.textAreaNode]: INode; [PropertySymbol.observers]: MutationListener[]; [PropertySymbol.childNodes]: INodeList; /** * Constructor. */ constructor(); /** * Returns `Symbol.toStringTag`. * * @returns `Symbol.toStringTag`. */ get [Symbol.toStringTag](): string; /** * Returns connected state. * * @returns Connected state. */ get isConnected(): boolean; /** * Returns owner document. * * @returns Owner document. */ get ownerDocument(): IDocument; /** * Returns parent node. * * @returns Parent node. */ get parentNode(): INode | null; /** * Returns node type. * * @returns Node type. */ get nodeType(): number; /** * Get child nodes. * * @returns Child nodes list. */ get childNodes(): INodeList; /** * Get text value of children. * * @returns Text content. */ get textContent(): string; /** * Sets text content. * * @param _textContent Text content. */ set textContent(_textContent: string); /** * Node value. * * @returns Node value. */ get nodeValue(): string; /** * Sets node value. */ set nodeValue(_nodeValue: string); /** * Node name. * * @returns Node name. */ get nodeName(): string; /** * Previous sibling. * * @returns Node. */ get previousSibling(): INode; /** * Next sibling. * * @returns Node. */ get nextSibling(): INode; /** * First child. * * @returns Node. */ get firstChild(): INode; /** * Last child. * * @returns Node. */ get lastChild(): INode; /** * Returns parent element. * * @returns Element. */ get parentElement(): IElement | null; /** * Returns base URI. * * @returns Base URI. */ get baseURI(): string; /** * Connected callback. */ connectedCallback?(): void; /** * Disconnected callback. */ disconnectedCallback?(): void; /** * Returns "true" if the node has child nodes. * * @returns "true" if the node has child nodes. */ hasChildNodes(): boolean; /** * Returns "true" if this node contains the other node. * * @param otherNode Node to test with. * @returns "true" if this node contains the other node. */ contains(otherNode: INode): boolean; /** * Returns closest root node (Document or ShadowRoot). * * @param options Options. * @param options.composed A Boolean that indicates whether the shadow root should be returned (false, the default), or a root node beyond shadow root (true). * @returns Node. */ getRootNode(options?: { composed: boolean; }): INode; /** * Clones a node. * * @param [deep=false] "true" to clone deep. * @returns Cloned node. */ cloneNode(deep?: boolean): INode; /** * Append a child node to childNodes. * * @param node Node to append. * @returns Appended node. */ appendChild(node: INode): INode; /** * Remove Child element from childNodes array. * * @param node Node to remove. * @returns Removed node. */ removeChild(node: INode): INode; /** * Inserts a node before another. * * @param newNode Node to insert. * @param referenceNode Node to insert before. * @returns Inserted node. */ insertBefore(newNode: INode, referenceNode: INode | null): INode; /** * Replaces a node with another. * * @param newChild New child. * @param oldChild Old child. * @returns Replaced node. */ replaceChild(newChild: INode, oldChild: INode): INode; /** * Compares two nodes. * Two nodes are equal if they have the same type, defining the same attributes, and so on. * * @param node Node to compare. * @returns boolean - `true` if two nodes are equal. */ isEqualNode(node: INode): boolean; /** * Converts the node to a string. * * @param listener Listener. */ toString(): string; /** * Observeres the node. * Used by MutationObserver, but it is not part of the HTML standard. * * @param listener Listener. */ [PropertySymbol.observe](listener: MutationListener): void; /** * Stops observing the node. * Used by MutationObserver, but it is not part of the HTML standard. * * @param listener Listener. */ [PropertySymbol.unobserve](listener: MutationListener): void; /** * Connects this element to another element. * * @param parentNode Parent node. */ [PropertySymbol.connectToNode](parentNode?: INode): void; /** * Reports the position of its argument node relative to the node on which it is called. * * @see https://dom.spec.whatwg.org/#dom-node-comparedocumentposition * @param otherNode Other node. */ compareDocumentPosition(otherNode: INode): number; /** * Normalizes the sub-tree of the node, i.e. joins adjacent text nodes, and * removes all empty text nodes. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize */ normalize(): void; /** * Determines whether the given node is equal to the current node. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/isSameNode * @param node Node to check. * @returns True if the given node is equal to the current node, otherwise false. */ isSameNode(node: INode): boolean; } //# sourceMappingURL=Node.d.ts.map