export = WOQLResult; /** * @typedef {import('../query/woqlCore')} WOQLQuery */ /** * @module WOQLResult * @license Apache Version 2 * Object representing the result of a WOQL Query * @param {object} results result JSON object as returned by WOQL query * @param {WOQLQuery} query the query object that generated the result * @param {object} [config] optional result configuration options object * [config.no_compress] by default all URLs are compressed where possible (v:X rather than http://.../variable/x) set to true to return non-compressed values * [config.context] specify the JSON-LD context to use for compressing results - by default * the query context will be used */ declare function WOQLResult(results: object, query: WOQLQuery, config?: object): void; declare class WOQLResult { /** * @typedef {import('../query/woqlCore')} WOQLQuery */ /** * @module WOQLResult * @license Apache Version 2 * Object representing the result of a WOQL Query * @param {object} results result JSON object as returned by WOQL query * @param {WOQLQuery} query the query object that generated the result * @param {object} [config] optional result configuration options object * [config.no_compress] by default all URLs are compressed where possible (v:X rather than http://.../variable/x) set to true to return non-compressed values * [config.context] specify the JSON-LD context to use for compressing results - by default * the query context will be used */ constructor(results: object, query: WOQLQuery, config?: object); bindings: any; insert_count: any; delete_count: any; transaction_retry_count: any; /** * @type {array | boolean} */ variable_names: any[] | boolean; query: import("../query/woqlCore"); cursor: number; formatter(context: any): any[]; /** * @param {object} [context] optional context to use for compression - * if ommitted query context is used * @returns {WOQLResult} */ compress(context?: object): WOQLResult; /** * Returns true if there are any results * @returns {boolean} */ hasBindings(): boolean; /** * Returns true if there are any results * @returns {boolean} */ hasUpdates(): boolean; /** * Returns original array of bindings returned by API * @returns {array} the data result */ getBindings(): any[]; /** * Returns original array of bindings returned by API * @returns {array} the data result */ rows(): any[]; /** * Returns list of variables returned in bindings from API * @returns {array|boolean} */ getVariableList(): any[] | boolean; /** * Number of rows in bound results * @returns {number} */ count(): number; /** * Number of reported inserts * @returns {number} */ inserts(): number; /** * Number of reported inserts * @returns {number} */ deletes(): number; /** * Get the first object record from the result set * @returns {object} */ first(): object; /** * Get the last object record from the result set * @returns {object} */ last(): object; /** * @returns {object} */ next(): object; /** * @returns {object} */ prev(): object; /** * Normally sorting of results is the job of the query - this is just in case you * want to resort results according to some key (variable) * @param {string} key * @param {string} asc_or_desc * @returns {WOQLResult} */ sort(key: string, asc_or_desc: string): WOQLResult; /** * Compares results a, b according to "asc" or "desc" order * @param {object} a * @param {object} b * @param {string} [asc_or_desc] * @returns {number} */ compareValues(a: object, b: object, asc_or_desc?: string): number; } declare namespace WOQLResult { export { WOQLQuery }; } type WOQLQuery = import('../query/woqlCore');