@mathjax/src
    Preparing search index...

    Interface Visitor<N>

    The Visitor interface

    interface Visitor<N extends VisitorNode<N>> {
        removeNodeHandler(kind: string): void;
        setNodeHandler(kind: string, handler: VisitorFunction<N>): void;
        visitDefault(node: N, ...args: any[]): any;
        visitNode(node: N, ...args: any[]): any;
        visitTree(tree: N, ...args: any[]): any;
        [property: string]: any;
    }

    Type Parameters

    Implemented by

    Indexable

    • [property: string]: any

      The various visitor functions implemented by the subclasses, and any data they need

    Index

    Methods

    • Remove the visitor function for a given node kind

      Parameters

      • kind: string

        The node kind whose visitor function is to be removed

      Returns void

    • Define a visitor function for a given node kind

      Parameters

      • kind: string

        The node kind for which the handler is being defined

      • handler: VisitorFunction<N>

        The function to call to handle nodes of this kind

      Returns void

    • The default visitor function for when no node-specific function is defined

      Parameters

      • node: N

        The node to visit

      • ...args: any[]

        The arguments to pass to the visitor function for this node

      Returns any

      Whatever the visitor function returns for this node

    • Visit a node by calling the visitor function for the given type of node (passing along any needed parameters)

      Parameters

      • node: N

        The node to visit

      • ...args: any[]

        The arguments to pass to the visitor function for this node

      Returns any

      Whatever the visitor function returns for this node

    • Visit the tree rooted at the given node (passing along any needed parameters)

      Parameters

      • tree: N

        The node that is the root of the tree

      • ...args: any[]

        The arguments to pass to the visitNode functions

      Returns any

      Whatever the visitNode function returns for the root tree node