Skip to main content

Node

reexport
class Node {
  endIndex: null | number;
  next: null | Node;
  parent: null | NodeWithChildren;
  prev: null | Node;
  startIndex: null | number;
  type: ElementType;
  cloneNode: <
    T extends Node<T>
  >(recursive?: boolean) => T;
}

This object will be used as the prototype for Nodes when creating a DOM-Level-1-compliant structure.

Fields#

endIndex#

required
endIndex: null | number;

The end index of the node. Requires withEndIndices on the handler to be `true.

next#

required
next: null | Node;

Next sibling

parent#

required
parent: null | NodeWithChildren;

Parent of the node

prev#

required
prev: null | Node;

Previous sibling

startIndex#

required
startIndex: null | number;

The start index of the node. Requires withStartIndices on the handler to be `true.

type#

required
type: ElementType;

Methods#

cloneNode#

required
cloneNode: <
  T extends Node<T>
>(recursive?: boolean) => T;

Clone this node, and optionally its children.

Parameters#

recursive

Clone child nodes as well.