import type { BaseDocument, DocumentModelInstance, GenericObject, ICollectionRepository, IGetDocumentsOptions } from "../web/database/firestore/types"; import type { ICollectionRepositoryConstructor } from "./types"; declare class CollectionRepository implements ICollectionRepository { [key: string]: any; private name; private originalName; private schema; private defaults; private constraints?; private documents; private count; private hasBeenCounted?; private hasBeenFetched?; private getDocumentsImpl; private getDocumentsCountImpl; private getDocument?; private setDocument?; private deleteDocument?; constructor({ name, schema, defaults, getDocuments, getDocumentsCount, getDocument, setDocument, deleteDocument, }: ICollectionRepositoryConstructor); private obtainCount; private obtainDocuments; getName(): string; setSubcollectionName(name: string): void; appendSubcollectionName(name: string): void; getSchema(): Partial; getConstraints(): IGetDocumentsOptions; withConstraints(constraints: IGetDocumentsOptions): this; whereBy(constraint: IGetDocumentsOptions['whereBy']): this; whereOr(constraint: IGetDocumentsOptions['whereOr']): this; orderBy(constraint: IGetDocumentsOptions['orderBy']): this; limit(constraint: IGetDocumentsOptions['limit']): this; getCount(): Promise; private setCount; getDocuments(): Promise; Manager(): DocumentModelInstance>; private setDocuments; } /** * @example * const Users = createRepository({ * name: 'users', * schema: { * age: 25, * name: "John Doe", * isActive: true, * address: { * city: "New York", * zip: 10001, * }, * }, * }); * @param settings - Settings for the repository * @param settings.name - The name of the collection eg. 'users' or 'posts/postId/comments' * @param settings.schema - A javascript object that represents the schema of the collection * @param settings.defaults - A javascript object that represents the default values of the schema * @param settings.getDocuments - A function that returns the documents in the collection * @param settings.getDocumentsCount - A function that returns the count of documents in the collection * @param settings.getDocument - A function that returns a document in the collection * @param settings.setDocument - A function that sets a document in the collection * @param settings.deleteDocument - A function that deletes a document in the collection * @returns A new class that extends CollectionModel */ declare function createRepository({ name, schema, defaults, getDocuments, getDocumentsCount, getDocument, setDocument, deleteDocument }: ICollectionRepositoryConstructor): new () => ICollectionRepository; export { CollectionRepository, type ICollectionRepository, createRepository, }; //# sourceMappingURL=Repository.d.ts.map