Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProcessingInstructionNode

A Processing instruction node

Hierarchy

  • Node
    • ProcessingInstructionNode

Index

Constructors

constructor

Properties

data

data: string

Data contained by this node

name

name: string

Name of this processing instruction

nextSibling

nextSibling: null | Node = null

Next sibling node, or null if none exists. Do not modify this directly, use NodeLogic or instance methods.

Readonly nodeData

nodeData: Record<PropertyKey, unknown> = {}

Extra DOM data associated with this node. This object prototypically inherits from the parent node's nodeData.

Readonly nodeTags

nodeTags: Set<string> = ...

Set of unique string tags applied to this node. These tags do not inherit and are unique to each instance. Meaning is tag-specific.

Readonly nodeType

nodeType: NodeType

Type of this node

parentNode

parentNode: null | NodeWithChildren = null

Parent of this node, or null if there is none. Do not modify this directly, use NodeLogic or instance methods.

prevSibling

prevSibling: null | Node = null

Previous sibling node, or null if none exists. Do not modify this directly, use NodeLogic or instance methods.

Accessors

nextSiblingTag

  • get nextSiblingTag(): null | TagNode
  • The closest following sibling that is a TagNode, or null if none exists.

    Returns null | TagNode

nextSiblingText

  • get nextSiblingText(): null | TextNode

prevSiblingTag

  • get prevSiblingTag(): null | TagNode
  • The closest previous sibling that is a TagNode, or null if none exists.

    Returns null | TagNode

prevSiblingText

  • get prevSiblingText(): null | TextNode

Methods

appendSibling

  • appendSibling(node: Node): void

clone

findNext

  • findNext(matcher: (node: Node) => boolean, deep?: boolean): null | Node
  • Finds the next node that matches a callback. The next node is defined as the first matching child, sibling, or sibling's child node starting from this node. This only checks child and sibling nodes, it will not move further up the DOM tree. To check only sibling nodes, set node to false.

    Parameters

    • matcher: (node: Node) => boolean

      Callback to test nodes

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • deep: boolean = true

      If true or not specified, then child nodes will be checked

    Returns null | Node

    The first matching node, or null if none found.

prependSibling

  • prependSibling(node: Node): void

removeSelf

  • removeSelf(): void

replaceSelf

  • replaceSelf(nodes: Node[]): void
  • Remove this node and all children from the DOM, and insert one or more nodes in its place

    Parameters

    • nodes: Node[]

      Nodes to insert in replacement. Can be empty.

    Returns void

toHtml

  • toHtml(): string
  • Serializes this node into HTML. Child nodes will be automatically serialize.

    Returns string

    HTML text representation of this node

Static isProcessingInstructionNode

Generated using TypeDoc