export function TreeController(): void; export class TreeController { /** * extract node(s) from object * @param tree {object} - try to append a node * @param data {object} - data target to extract nodes * @param nodeKey {string} - node key from main data * @param nodePath {string | null} - full path of that node * @param opts - options { * nodeHandler: ({name, path, node})=>{}, // called each time node found; nodeIdHandler: ()=>{return null;} // called when want to process secondary data id; * } * @returns {Promise} - tree after append a node */ node(tree: object, data: object, nodeKey: string, nodePath?: string | null, opts?: { nodeHandler: ({ name, path, node }: { name: any; path: any; node: any; }) => Promise; nodeIdHandler: () => Promise; }): Promise; /** * * @param data {object | Array} - data to covert to tree * @param domain {string} - data namespace to use * @param opts - options { * nodeHandler: ({name, path, node})=>{}, // called each time node found; nodeIdHandler: ()=>{return null;} // called when want to process secondary data id; * } * @returns {Promise} - resolve to tree of nodes for that data */ objectToTree(data: object | Array, domain: string, opts?: { nodeHandler: ({ name, path, node }: { name: any; path: any; node: any; }) => Promise; nodeIdHandler: () => Promise; }): Promise; /** * * @param domain {string} table/collection/domain where we want to execute query * @param query {object | Array} query that we want to execute * @returns {Promise<{[key: string]:string} | Array<{[key: string]:string}>>} */ query(domain: string, query: object | Array): Promise<{ [key: string]: string; } | { [key: string]: string; }[]>; }