import type { DeterministicSortComparator, FilledMangoQuery, MangoQuery, PreparedQuery, QueryMatcher, RxDocument, RxDocumentData, RxJsonSchema, RxQuery } from './types/index.d.ts'; /** * Normalize the query to ensure we have all fields set * and queries that represent the same query logic are detected as equal by the caching. */ export declare function normalizeMangoQuery(schema: RxJsonSchema>, mangoQuery: MangoQuery, /** * @performance * Count queries do not need sort order. * Skipping the sort computation avoids iterating over schema indexes * and comparing fields, which improves count query performance. */ skipSort?: boolean): FilledMangoQuery; /** * Returns the sort-comparator, * which is able to sort documents in the same way * a query over the db would do. */ export declare function getSortComparator(schema: RxJsonSchema>, query: FilledMangoQuery): DeterministicSortComparator; /** * Returns a function * that can be used to check if a document * matches the query. */ export declare function getQueryMatcher(_schema: RxJsonSchema | RxJsonSchema>, query: FilledMangoQuery): QueryMatcher>; export declare function runQueryUpdateFunction(rxQuery: RxQuery, fn: (doc: RxDocument) => Promise>): Promise; /** * @returns a format of the query that can be used with the storage * when calling RxStorageInstance().query() */ export declare function prepareQuery(schema: RxJsonSchema>, mutateableQuery: FilledMangoQuery): PreparedQuery;