UNPKG

@metrichor/jmespath

Version:

Typescript implementation of the JMESPath spec (100% compliant)

44 lines (43 loc) 2.3 kB
import { ExpressionNodeTree, LexerToken } from './Lexer'; import { InputArgument, RuntimeFunction, InputSignature } from './Runtime'; export type { FunctionSignature, RuntimeFunction, InputSignature } from './Runtime'; export declare type ObjectDict<T = unknown> = Record<string, T | undefined>; export declare type JSONPrimitive = string | number | boolean | null; export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray; export declare type JSONObject = { [member: string]: JSONValue; }; export declare type JSONArray = JSONValue[]; export declare const TYPE_ANY = InputArgument.TYPE_ANY; export declare const TYPE_ARRAY = InputArgument.TYPE_ARRAY; export declare const TYPE_ARRAY_NUMBER = InputArgument.TYPE_ARRAY_NUMBER; export declare const TYPE_ARRAY_STRING = InputArgument.TYPE_ARRAY_STRING; export declare const TYPE_BOOLEAN = InputArgument.TYPE_BOOLEAN; export declare const TYPE_EXPREF = InputArgument.TYPE_EXPREF; export declare const TYPE_NULL = InputArgument.TYPE_NULL; export declare const TYPE_NUMBER = InputArgument.TYPE_NUMBER; export declare const TYPE_OBJECT = InputArgument.TYPE_OBJECT; export declare const TYPE_STRING = InputArgument.TYPE_STRING; export declare function compile(expression: string): ExpressionNodeTree; export declare function tokenize(expression: string): LexerToken[]; export declare const registerFunction: (functionName: string, customFunction: RuntimeFunction<any, any>, signature: InputSignature[]) => void; export declare function search(data: JSONValue, expression: string): JSONValue; export declare const TreeInterpreter: import("./TreeInterpreter").TreeInterpreter; export declare const jmespath: { compile: typeof compile; registerFunction: (functionName: string, customFunction: RuntimeFunction<any, any>, signature: InputSignature[]) => void; search: typeof search; tokenize: typeof tokenize; TreeInterpreter: import("./TreeInterpreter").TreeInterpreter; TYPE_ANY: InputArgument; TYPE_ARRAY_NUMBER: InputArgument; TYPE_ARRAY_STRING: InputArgument; TYPE_ARRAY: InputArgument; TYPE_BOOLEAN: InputArgument; TYPE_EXPREF: InputArgument; TYPE_NULL: InputArgument; TYPE_NUMBER: InputArgument; TYPE_OBJECT: InputArgument; TYPE_STRING: InputArgument; }; export default jmespath;