import { ArrayPrimitive, InferredType, KeysOf, KeysOfNonPrimitives, NonArrayPrimitive, Primitive, TypeOf } from 'tsds-tools'; import { ObjectLiteral } from 'typeorm'; import { FirestoreRepository } from '../firestore-repository'; export type FilterFunction = (item: Entity | null) => boolean; export type OrderBy = Map; type QueryBuilder = (q: FirestoreQueryWithWhere) => FirestoreQueryWithWhere; type FirebaseQuery = { queryRef: FirebaseFirestore.Query | FirebaseFirestore.CollectionReference; cache?: number | boolean; next?: string | null; limit?: number | null; filterFunction?: FilterFunction; orderByMap?: OrderBy; filteredProps: Set; }; export declare class FirestoreQueryWithWhere { readonly repository: FirestoreRepository; protected query: FirebaseQuery; constructor(repository: FirestoreRepository); static from | FirestoreQuery | FirestorePaginatedQuery>(query: QueryType): FirestoreQueryWithWhere; whereEqualTo>(key: Key, value: TypeOf | undefined): this; whereNotEqualTo>(key: Key, value: TypeOf | undefined): this; whereMoreThan>(key: Key, value: TypeOf | undefined): this; whereNotMoreThan>(key: Key, value: TypeOf | undefined): this; whereMoreThanOrEqual>(key: Key, value: TypeOf | undefined): this; whereNotMoreThanOrEqual>(key: Key, value: TypeOf | undefined): this; whereLessThan>(key: Key, value: TypeOf | undefined): this; whereNotLessThan>(key: Key, value: TypeOf | undefined): this; whereLessThanOrEqual>(key: Key, value: TypeOf | undefined): this; whereNotLessThanOrEqual>(key: Key, value: TypeOf | undefined): this; whereBetween>(key: Key, from: TypeOf | undefined, to: TypeOf | undefined): this; whereTextContains>(key: Key, value: TypeOf | undefined): void; whereTextStartsWith>(key: Key, value: TypeOf | undefined): this; whereTextEndsWith>(key: Key, value: TypeOf | undefined): void; whereTextInAnyCaseContains>(key: Key, value: TypeOf | undefined): void; whereTextInAnyCaseStartsWith>(key: Key, value: TypeOf | undefined): void; whereTextInAnyCaseEndsWith>(key: Key, value: TypeOf | undefined): void; whereIn>(key: Key, value: TypeOf[] | undefined): this; whereIsNull>(key: Key): this; whereIsNotNull>(key: Key): this; whereArrayContains>(key: Key, value: InferredType | undefined): this; whereArrayContainsAny>(key: Key, value: InferredType[] | undefined): this; whereJoin, Type extends InferredType & ObjectLiteral>(key: Key, queryBuilder: QueryBuilder): void; whereOr(queryBuilder1: QueryBuilder, queryBuilder2: QueryBuilder, ...otherQueryBuilder: QueryBuilder[]): any; toQuery(): FirebaseQuery; } export declare class FirestoreQuery extends FirestoreQueryWithWhere { static from | FirestoreQuery | FirestorePaginatedQuery>(query: QueryType): FirestoreQuery; orderByAscending>(key: Key): this; orderByDescending>(key: Key): this; toOrderByMap(): OrderBy; select>(key: Key): this; fetchRelation, Key2 extends KeysOfNonPrimitives>, Key3 extends KeysOfNonPrimitives, Key2>>, Key4 extends KeysOfNonPrimitives, Key2>, Key3>>>(key1: Key1, key2?: Key2, key3?: Key3, key4?: Key4): void; cache(cache?: boolean | number): this; } export declare class FirestorePaginatedQuery extends FirestoreQuery { static from | FirestoreQuery | FirestorePaginatedQuery>(query: QueryType): FirestorePaginatedQuery; pagination(pagination: { next?: string | null; limit?: number | null; } | null | undefined): this; next(next: string | null | undefined): this; limit(limit: number | null | undefined): this; filter(predicate: FilterFunction): this; } export {};