Skip to main content
Module

x/evt/lib/types/index.ts>dom.Node

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.Node
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.3.1/lib/types/index.ts";
const { Node } = dom;

Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way.

Properties

readonly
baseURI: string

Returns node's node document's document base URL.

readonly
childNodes: NodeListOf<ChildNode>

Returns the children.

readonly
firstChild: ChildNode | null

Returns the first child.

readonly
isConnected: boolean

Returns true if node is connected and false otherwise.

readonly
lastChild: ChildNode | null

Returns the last child.

readonly
deprecated
namespaceURI: string | null
readonly
nextSibling: ChildNode | null

Returns the next sibling.

readonly
nodeName: string

Returns a string appropriate for the type of node.

readonly
nodeType: number

Returns the type of node.

nodeValue: string | null
readonly
ownerDocument: Document | null

Returns the node document. Returns null for documents.

readonly
parentElement: HTMLElement | null

Returns the parent element.

readonly
parentNode: Node & ParentNode | null

Returns the parent.

readonly
previousSibling: ChildNode | null

Returns the previous sibling.

textContent: string | null
readonly
ATTRIBUTE_NODE: number
readonly
CDATA_SECTION_NODE: number

node is a CDATASection node.

readonly
COMMENT_NODE: number

node is a Comment node.

readonly
DOCUMENT_FRAGMENT_NODE: number

node is a DocumentFragment node.

readonly
DOCUMENT_NODE: number

node is a document.

readonly
DOCUMENT_POSITION_CONTAINED_BY: number

Set when other is a descendant of node.

readonly
DOCUMENT_POSITION_CONTAINS: number

Set when other is an ancestor of node.

readonly
DOCUMENT_POSITION_DISCONNECTED: number

Set when node and other are not in the same tree.

readonly
DOCUMENT_POSITION_FOLLOWING: number

Set when other is following node.

readonly
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number
readonly
DOCUMENT_POSITION_PRECEDING: number

Set when other is preceding node.

readonly
DOCUMENT_TYPE_NODE: number

node is a doctype.

readonly
ELEMENT_NODE: number

node is an element.

readonly
ENTITY_NODE: number
readonly
ENTITY_REFERENCE_NODE: number
readonly
NOTATION_NODE: number
readonly
PROCESSING_INSTRUCTION_NODE: number

node is a ProcessingInstruction node.

readonly
TEXT_NODE: number

node is a Text node.

Methods

appendChild<T extends Node>(newChild: T): T
cloneNode(deep?: boolean): Node

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

compareDocumentPosition(other: Node): number

Returns a bitmask indicating the position of other relative to node.

contains(other: Node | null): boolean

Returns true if other is an inclusive descendant of node, and false otherwise.

getRootNode(options?: GetRootNodeOptions): Node

Returns node's root.

hasChildNodes(): boolean

Returns whether node has children.

insertBefore<T extends Node>(newChild: T, refChild: Node | null): T
isDefaultNamespace(namespace: string | null): boolean
isEqualNode(otherNode: Node | null): boolean

Returns whether node and otherNode have the same properties.

isSameNode(otherNode: Node | null): boolean
lookupNamespaceURI(prefix: string | null): string | null
lookupPrefix(namespace: string | null): string | null
normalize(): void

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

removeChild<T extends Node>(oldChild: T): T
replaceChild<T extends Node>(newChild: Node, oldChild: T): T