Class Node

Represents a Node in the Treegen structure.

Hierarchy

  • Node

Constructors

Properties

Accessors

Methods

Constructors

  • Constructor for the Node class.

    Parameters

    • name: string

      The name of the Node.

    • nodeType: NodeType = 'any'

      The type of the Node.

    Returns Node

Properties

children: Node[] = []
name: string

The name of the Node.

nodeType: NodeType = 'any'

The type of the Node.

tree: string = ''

Accessors

  • get getTree(): string
  • Get the generated tree.

    Must be called after Node.buildTree

    Returns string

Methods

  • Add a child Node to the current Node.

    Parameters

    • child: Node

      The child Node to add.

    Returns void

  • Build the tree structure starting from the current Node.

    Parameters

    • options: IBuildTreeOptions = {}

      Options for building the tree.

    Returns void

  • Generate the indentation for the tree structure.

    Parameters

    • level: number

      The level of indentation.

    • treeIndent: string

      The tree indent characters.

    Returns string

    The generated indentation.

  • Print the generated tree structure to the console or a file.

    Parameters

    • options: IPrintTreeOptions = {}

      Options for printing the tree.

    Returns void

Generated using TypeDoc