@servicenow/sdk - v4.7.0
    Preparing search index...
    • Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.

      Type Parameters

      Parameters

      • node: T

        The Node whose children will be visited.

      • visitor: Visitor

        The callback used to visit each child.

      • context: TransformationContext | undefined

        A lexical environment context for the visitor.

      Returns T

    • Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.

      Type Parameters

      Parameters

      • node: T | undefined

        The Node whose children will be visited.

      • visitor: Visitor

        The callback used to visit each child.

      • context: TransformationContext | undefined

        A lexical environment context for the visitor.

      • OptionalnodesVisitor: {
            <
                TIn extends tsc.Node,
                TInArray extends NodeArray<TIn> | undefined,
                TOut extends tsc.Node,
            >(
                nodes: TInArray,
                visitor: Visitor<TIn, tsc.Node | undefined>,
                test: (node: tsc.Node) => node is TOut,
                start?: number,
                count?: number,
            ): NodeArray<TOut> | TInArray & undefined;
            <TIn extends tsc.Node, TInArray extends NodeArray<TIn> | undefined>(
                nodes: TInArray,
                visitor: Visitor<TIn, tsc.Node | undefined>,
                test?: (node: tsc.Node) => boolean,
                start?: number,
                count?: number,
            ): NodeArray<tsc.Node> | TInArray & undefined;
        }
          • <
                TIn extends tsc.Node,
                TInArray extends NodeArray<TIn> | undefined,
                TOut extends tsc.Node,
            >(
                nodes: TInArray,
                visitor: Visitor<TIn, tsc.Node | undefined>,
                test: (node: tsc.Node) => node is TOut,
                start?: number,
                count?: number,
            ): NodeArray<TOut> | TInArray & undefined
          • Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.

            • If the input node array is undefined, the output is undefined.
            • If the visitor can return undefined, the node it visits in the array will be reused.
            • If the output node array is not undefined, then its contents will satisfy the test.
            • In order to obtain a return type that is more specific than NodeArray<Node>, a test function must be provided, and that function must be a type predicate.

            Type Parameters

            Parameters

            • nodes: TInArray

              The NodeArray to visit.

            • visitor: Visitor<TIn, tsc.Node | undefined>

              The callback used to visit a Node.

            • test: (node: tsc.Node) => node is TOut

              A node test to execute for each node.

            • Optionalstart: number

              An optional value indicating the starting offset at which to start visiting.

            • Optionalcount: number

              An optional value indicating the maximum number of nodes to visit.

            Returns NodeArray<TOut> | TInArray & undefined

          • <TIn extends tsc.Node, TInArray extends NodeArray<TIn> | undefined>(
                nodes: TInArray,
                visitor: Visitor<TIn, tsc.Node | undefined>,
                test?: (node: tsc.Node) => boolean,
                start?: number,
                count?: number,
            ): NodeArray<tsc.Node> | TInArray & undefined
          • Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.

            • If the input node array is undefined, the output is undefined.
            • If the visitor can return undefined, the node it visits in the array will be reused.
            • If the output node array is not undefined, then its contents will satisfy the test.
            • In order to obtain a return type that is more specific than NodeArray<Node>, a test function must be provided, and that function must be a type predicate.

            Type Parameters

            Parameters

            • nodes: TInArray

              The NodeArray to visit.

            • visitor: Visitor<TIn, tsc.Node | undefined>

              The callback used to visit a Node.

            • Optionaltest: (node: tsc.Node) => boolean

              A node test to execute for each node.

            • Optionalstart: number

              An optional value indicating the starting offset at which to start visiting.

            • Optionalcount: number

              An optional value indicating the maximum number of nodes to visit.

            Returns NodeArray<tsc.Node> | TInArray & undefined

      • OptionaltokenVisitor: Visitor<tsc.Node, tsc.Node | undefined>

      Returns T | undefined