@sedeh/extensible-json-transformations
Version:
Have you ever wanted to perform query on a JSON? Have you ever wanted to consume it in a program but the JSON was in a form not suitable for your program? Have you wanted to use the JSON without writing any code to do it? Have you wondered what it takes
60 lines (59 loc) • 1.65 kB
TypeScript
export interface Template {
name: string;
match?: string;
value?: string;
context: string;
inPool?: string;
style: any;
}
export interface QueryOperation {
name: string;
args?: QueryOperation[];
}
export declare class JXPath {
private path;
constructor(jpath: string);
fromLast(): JXPath;
nodeOf(node: any): any;
private _nodeOf;
valueOf(node: any): any;
private _valueOf;
}
export declare class Inquirer {
private supportedMethods;
private templates;
private rootNode;
private contextNode;
private globalPool;
private pathPool;
constructor();
private jXPathFor;
setRootNode(node: any): void;
setContextNode(node: any): void;
templateForName(name: string): any;
nodeList(node: any): any;
query(command: string, node: any): any;
invoke(operation: QueryOperation, node: any): any;
concatenate(...args: any): any;
split(...args: any): any[];
valueOf(...args: any): any;
each(...args: any): any[];
enlist(...args: any): any[];
join(...args: any): string | never[];
private joinItems;
apply(...args: any): any[];
match(...args: any): any[];
private evaluateIntoList;
filter(...args: any): any[];
select(...args: any): any[];
style(...args: any): any[];
addSupportingMethod(name: string, method: any): void;
private removeQuotes;
toQueryOperation(methods: any): any;
private toFunctions;
templateNodes(template: Template, nodes: any): any;
private evaluateOperation;
private offPool;
initTemplates(list: any): void;
initPools(templates: any): void;
}