acebase/dist/types/query.d.ts
2022-10-31 11:17:53 +01:00

28 lines
No EOL
845 B
TypeScript

import { AceBaseBase } from 'acebase-core';
import type { Api, Query, QueryOptions } from 'acebase-core';
import { Storage } from './storage';
/**
* TODO: import once LocalApi has been ported to TypeScript
*/
declare type LocalApi = Api & {
db: AceBaseBase;
storage: Storage;
};
/**
*
* @param storage Target storage instance
* @param path Path of the object collection to perform query on
* @param query Query to execute
* @param options Additional options
* @returns Returns a promise that resolves with matching data or paths in `results`
*/
export declare function query(api: LocalApi, path: string, query: Query, options?: QueryOptions): Promise<{
results: Array<{
path: string;
val: any;
}> | string[];
context: any;
stop(): Promise<void>;
}>;
export {};
//# sourceMappingURL=query.d.ts.map