Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Element(name: string, attribs: {}, children?: Node[]): Element
  • Parameters

    • name: string

      Name of the tag, eg. div, span.

    • attribs: {}

      Object mapping attribute names to attribute values.

      • [name: string]: string
    • Optional children: Node[]

      Children of the node.

    Returns Element

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

Optional x-attribsNamespace

x-attribsNamespace: Record<string, string>

Optional x-attribsPrefix

x-attribsPrefix: Record<string, string>

Accessors

attributes

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

tagName

  • get tagName(): string
  • set tagName(name: string): 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