Skip to main content

Document

reexport
class Document {
  children: Array<Node>;
  endIndex: null | number;
  next: null | Node;
  parent: null | NodeWithChildren;
  prev: null | Node;
  startIndex: null | number;
  type: ElementType;
  x-mode?: "no-quirks"
    | "quirks"
    | "limited-quirks";
  cloneNode: <
    T extends Node<T>
  >(recursive?: boolean) => T;
}

The root node of the document.

Fields#

children#

required
children: Array<Node>;

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;

x-mode#

optional
x-mode?: "no-quirks"
  | "quirks"
  | "limited-quirks";

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.