/*! * Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT */ import type jsonata from 'jsonata'; import type { FunctionParam, JsonataFunctionsMap } from './functions'; export interface ExprNode extends jsonata.ExprNode { body?: jsonata.ExprNode; then?: jsonata.ExprNode; else?: jsonata.ExprNode; condition?: jsonata.ExprNode; error?: jsonata.JsonataError; } export interface JSONataASTResult { node: ExprNode; parent: ExprNode | null; } export declare const exprPropertiesToRecurse: ("then" | "condition" | "body" | "else" | "arguments" | "procedure" | "steps" | "expressions" | "stages" | "lhs" | "rhs")[]; export declare const JSONATA_TEMPLATE_WRAPPER: { readonly start: "{%"; readonly end: "%}"; }; export declare const MAX_AST_DEPTH = 100; /** * Dynamically imports jsonata and gets the AST of the string * @param input JSONata string to parse * @returns The root node of the JSONata AST */ export declare function getJSONataAST(input: string): Promise; export declare function getJSONataFunctionList(): Promise; /** * Searches the JSONata AST to find the node at a specified position. If the AST has nodes * that have a position past the position parameter, this function will return null. * @param ast The JSONata AST provided by the JSONata library * @param position The position to search the JSONata AST * @returns The node at the position */ export declare function findNodeInJSONataAST(ast: ExprNode, position: number): JSONataASTResult | null; /** * Generates the function argument string from a given list of JSONata function parameters. * Recursively surrounds optional arguments with [] and separates arguments with commas. * @param functionParams Function parameters properties used for generating the argument string * @param index The index of the parameter to start traversal at * @returns The function argument string */ export declare function getFunctionArguments(functionParams: ReadonlyArray, index?: number): string;