import * as jsonata from "jsonata"; import { ExprNode } from "jsonata"; interface GeneratedExprNode extends jsonata.ExprNode { pseudoType?: string; expr?: { value: any; type: string; position: number; }; usesReturnedValueFromFunction?: boolean; consarray?: boolean; } interface StepRecord { type: string; value: string; emit: boolean; } export default class DependencyFinder { compiledExpression: jsonata.Expression; private ast; private readonly currentSteps; private nodeStack; private readonly dependencies; readonly variables: Set; /** * program can be either a string to be compiled, or an already-compiled AST * @param program */ constructor(program: string | ExprNode); /** * If we are looking to analyze only a portion of the jsonata program we can provide another jsonata expression * such as '**[procedure.value='serial']' which will filter the AST down to what is defined. In the case of * '**[procedure.value='serial']' the expression will extract the AST for $serial(...) as it may exist in the * original program. * @param jsonatExpr */ withAstFilterExpression(jsonatExpr: string): Promise; findDependencies(node?: GeneratedExprNode): string[][]; /** * Function calls like $count(...) are recorded in this.variables so that the MetaInf can have a record * of what context variables (in this case functions) were accessed by the expression. * @param node * @private */ private captureBuiltInFunctionNames; private markScopeWhenFunctionReturnsValue; static peek(array: any[]): any; collectChildren(node: GeneratedExprNode): GeneratedExprNode[]; captureArrayIndexes(node: GeneratedExprNode): void; capturePathExpressions(node: GeneratedExprNode): void; hasParent(parentType: string): boolean; hasAncestor(matcher: any): boolean; ancestors(matcher: any): GeneratedExprNode[]; isSingle$Var(type: string, value: any): boolean; isRootedIn$$(value: any): boolean | undefined; isInsideAScopeWhere$IsLocal(node: GeneratedExprNode): boolean; emitPaths(): void; static isNoOpSteps(stepArray: StepRecord[]): boolean; static stepsRootedIn$(stepArray: StepRecord[]): boolean; static emit(stepArray: StepRecord[]): string[]; } export {}; //# sourceMappingURL=DependencyFinder.d.ts.map