import type { NqlAst, NqlAstType, NqlPlaceholder } from "./Ast"; /** * Traverses an AST (Abstract Syntax Tree) or an array of AST nodes, and replaces all placeholder nodes * found within the tree with the result of a provided callback function. This function operates recursively, * handling various types of nodes including those with `args`, `left`, `right`, `condition`, `value`, `columns`, * `from`, `where`, `having`, `group_by`, `order_by`, `windows`, and `with` properties. The callback is invoked * with each placeholder node encountered, and the return value of the callback replaces the placeholder in the AST. * * @template T A union type of `NqlAstType` or an array of `NqlAstType`, indicating the expected type(s) of the placeholder's content. * @param {NqlAst|NqlAst[]} node The root AST node or an array of AST nodes to traverse. * @param {function(NqlPlaceholder): NqlAst} callback A function that takes a placeholder node and returns an AST node to replace it. * This function is called for every placeholder node found in the AST. * @returns {void} This function does not return a value; it modifies the AST nodes in place. * * @todo Validate that the replaced nodes adhere to the constraints of the placholder node (if any). * * @example * // Given an AST node or array of nodes `ast` and a function `replacePlaceholder`: * visitAndReplacePlaceholders(ast, replacePlaceholder); * // This will traverse `ast`, calling `replacePlaceholder` for each placeholder node, * // replacing them in place with the returned node from `replacePlaceholder`. */ export declare function visitAndReplacePlaceholders(node: NqlAst | NqlAst[], callback: (placeholderNode: NqlPlaceholder) => NqlAst): void;