import { GetOddOrEvenSegments, EmptyObject } from './utils'; import { MetaType } from './metaTypeCreator'; import { Doc, Collection, DocCreator, CollectionCreator, CollectionGroupCreator, CollectionGroupFunction } from './refs'; import { And, Or, AndCreator, OrCreator } from './queryConstraints'; type Doc_ = { doc: Doc; }; type Collection_ = { collection: Collection; }; type CollectionGroup_ = { collectionGroup: CollectionGroupFunction; }; type Or_ = { /** * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of * the given filter constraints. A disjunction filter includes a document if it * satisfies any of the given filters. * * @param queryConstraints - Optional. The list of * {@link QueryFilterConstraint}s to perform a disjunction for. These must be * created with calls to {@link where}, {@link or}, or {@link and}. * @returns The newly created {@link QueryCompositeFilterConstraint}. */ or: Or; }; type And_ = { /** * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of * the given filter constraints. A conjunction filter includes a document if it * satisfies all of the given filters. * * @param queryConstraints - Optional. The list of * {@link QueryFilterConstraint}s to perform a conjunction for. These must be * created with calls to {@link where}, {@link or}, or {@link and}. * @returns The newly created {@link QueryCompositeFilterConstraint}. */ and: And; }; type Creators = { docCreator: DocCreator; collectionCreator: CollectionCreator; collectionGroupCreator: CollectionGroupCreator; andCreator: AndCreator; orCreator: OrCreator; }; export type FirelordRef = Creators> = (unknown extends H['docCreator'] ? EmptyObject : Doc_) & (unknown extends H['collectionCreator'] ? EmptyObject : Collection_) & (unknown extends H['collectionGroupCreator'] ? EmptyObject : CollectionGroup_) & (unknown extends H['andCreator'] ? EmptyObject : And_) & (unknown extends H['orCreator'] ? EmptyObject : Or_); export type GetFirelordShakable = >(creators: H) => GetFirelord; export type GetFirelord> = (firestore: void, ...collectionIDs: GetOddOrEvenSegments) => FirelordRef; export {};