Class DirectionCaret<Value>

A builder of DirectionNode graphs.

  • connect/disconnect
  • spawn/erase
  • move
  • save/restore
  • push/pop

Type Parameters

  • Value

Hierarchy

  • DirectionCaret

Constructors

Properties

_nodeRoot: DirectionNode<Value>
_nodes: DirectionNode<Value>[]
_savedNodes: {
    [key: string]: DirectionNode<Value>;
}

Type declaration

Methods

  • Aligns the current node in the given direction.

    If only the alignment is given, the parent node is aligned in the current direction.

    Throws

    if the current node is root (alignment is done by the parent, not the child)

    Parameters

    Returns void

  • Moves the caret to the most recently pushed node and removes it from the caret's stack.

    See

    push

    Returns void

  • Saves the current node in the caret's stack of DirectionNodes.

    See

    pop to return to this node.

    Returns void

  • Replaces the current node's value with the given value.

    Returns

    the original value.

    Parameters

    • Optional value: Value

      the new value. If undefined, then the value is removed.

    Returns Value

  • Moves the caret to the saved node named by the given id.

    See

    save

    Parameters

    • id: string

      the name of the saved node.

    Returns void

  • Saves the current node in the caret's map of DirectionNodes using the given key.

    Returns

    the key used to save the current node

    See

    restore

    Parameters

    • Optional id: string

      the key for the current node. If undefined, a new key will be created.

    Returns string

Generated using TypeDoc