Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DLocRoot

A class for objects that are used to mark DOM nodes as roots for the purpose of using DLoc objects.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

node

Methods

nodeToPath

  • nodeToPath(node: Node | Attr): string
  • Converts a node to a path. A path is a string representation of the location of a node relative to the root.

    Parameters

    • node: Node | Attr

      The node for which to construct a path.

    Returns string

    The path.

pathToNode

  • pathToNode(path: string): Node | Attr | null
  • This function recovers a DOM node on the basis of a path previously created by nodeToPath.

    throws

    {Error} If given a malformed path.

    Parameters

    • path: string

      The path to interpret.

    Returns Node | Attr | null

    The node corresponding to the path, or null if no such node exists.

Generated using TypeDoc