map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface Visitor<NodeType>

    A visitor which handles a node visited by a TreeWalker.

    interface Visitor<NodeType extends Node> {
        getChildren(
            node: NodeType,
            context: Context<NodeType>,
        ): undefined | void | NodeType[] | Iterable<NodeType, any, any>;
        postVisit(node: NodeType, context: Context<NodeType>): void | VisitCodes;
        preVisit(node: NodeType, context: Context<NodeType>): void | VisitCodes;
    }

    Type Parameters

    • NodeType extends Node
    Index

    Methods

    • Retrieves all children at a given node. HINT: This not necessarily have to be the children of the current node. An implementation may give the visitor a chance to return an arbitrary list of child nodes. By default, the node's children are considered to walk deeper the tree.

      Parameters

      Returns undefined | void | NodeType[] | Iterable<NodeType, any, any>

      Indicates how the walker shall proceed, the default is VisitCodes.CONTINUE.

    • Node handle to do something after visiting the node's children.

      Parameters

      Returns void | VisitCodes

      Indicates how the walker shall proceed, the default is VisitCodes.CONTINUE.

    • Node handle to do something before visiting the node's children.

      Parameters

      Returns void | VisitCodes

      Indicates how the walker shall proceed, the default is VisitCodes.CONTINUE.