Skip to main content

Text

reexport
class Text {
  data: string;
  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;
}

Text within the document.

Fields#

data#

required
data: string;

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.