Skip to main content

NodeWithChildren

reexport
class NodeWithChildren {
  children: Array<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;
}
Defined in domhandler

A Node that can have children.

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;

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.