Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Node(type: Root | CDATA | Script | Style | Tag, children: Node[]): Node
  • Parameters

    • type: Root | CDATA | Script | Style | Tag

      Type of the node.

    • children: Node[]

      Children of the node. Only certain node types can have children.

    Returns Node

Properties

attribs

attribs: {}

Type declaration

  • [name: string]: string

children

children: Node[]

data

data: string

Optional endIndex

endIndex: number

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

name

name: string

Optional next

next: Node

Next sibling

Optional parent

parent: Node

Parent of the node

Optional prev

prev: Node

Previous sibling

Optional startIndex

startIndex: number

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

type

type: ElementType

Accessors

childNodes

  • get childNodes(): Node[]
  • set childNodes(children: Node[]): any

firstChild

  • get firstChild(): Node | null

lastChild

  • get lastChild(): Node | null

nextSibling

  • get nextSibling(): Node | null
  • set nextSibling(next: Node | null): any

nodeType

  • get nodeType(): number

parentNode

  • get parentNode(): Node | null
  • set parentNode(parent: Node | null): any

previousSibling

  • get previousSibling(): Node | null
  • set previousSibling(prev: Node | null): any

Methods

cloneNode

  • cloneNode(recursive?: boolean): Node
  • Clone this node, and optionally its children.

    Parameters

    • Optional recursive: boolean

      Clone child nodes as well.

    Returns Node

    A clone of the node.

Generated using TypeDoc