Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeNode<P, C>

Interface implemented by all nodes that make up the parsed tree.

Type parameters

  • P: Block

    type of the parent of this node

  • C: Block

    type of the children of this node

Hierarchy

Index

Methods

children

  • children(): C[]
  • Gets the children of this node

    Returns C[]

    an array of children or an empty array if this is a leaf node

hasChild

  • hasChild(item: C): boolean
  • Determines whether or not the specified node is a child of this node.

    Parameters

    • item: C

      the item to look for

    Returns boolean

    true if the item is a child of this node, false otherwise

parent

  • parent(): P | undefined
  • Get the parent node of this node

    Returns P | undefined

    the parent of this node or undefined if this is the root node

Generated using TypeDoc