Skip to main content
Construct is the base class for all elements in the tfts construct tree.

Constructor

Properties

node

readonly node: Node The tree node for this construct.

Node Class Methods

The node property provides access to the following methods:

setContext()

Sets a context value for this node and its children.

getContext()

Gets a context value from this node or its parents.

tryGetContext()

Tries to get a context value, returning undefined if not found.

findAll()

Returns all children of this node.

findChild()

Finds a child by its ID. Throws if not found.

tryFindChild()

Tries to find a child by its ID.

addMetadata()

Adds metadata to the construct.

addValidation()

Adds a validation to the construct.

validate()

Runs all validations on the construct and returns a list of errors.