@jmespath-community/jmespath
Version:
Typescript implementation of the JMESPath Community specification
23 lines (22 loc) • 1.02 kB
TypeScript
import { Runtime } from './Runtime';
import type { ExpressionNode, ExpressionReference, SliceNode } from './AST.type';
import type { JSONArray, JSONValue } from './JSON.type';
import { ScopeEntry } from './Parser.type';
export declare class TreeInterpreter {
runtime: Runtime;
private _rootValue;
private _scope;
constructor();
withScope(scope: ScopeEntry): TreeInterpreter;
search(node: ExpressionNode, value: JSONValue): JSONValue;
visit(node: ExpressionNode, value: JSONValue | ExpressionNode): JSONValue | ExpressionNode | ExpressionReference;
computeSliceParams(arrayLength: number, sliceNode: SliceNode): {
start: number;
stop: number;
step: number;
};
capSliceRange(arrayLength: number, actualValue: number, step: number): number;
slice(collection: JSONArray, start: number, end: number, step: number): JSONArray;
}
export declare const TreeInterpreterInstance: TreeInterpreter;
export default TreeInterpreterInstance;