import type { BaseDocument, DocumentModelInstance, GenericObject, IDocumentModelClass } from './types'; declare class DocumentModel implements IDocumentModelClass { [key: string]: any; private collection; private id?; private _data; private defaults?; private schema; private changedFields; constructor(collection: string, structure: GenericObject, defaults?: GenericObject, data?: GenericObject); private isExistentField; private generateAccessors; private getValue; private setValue; getCollection(): string; getId(): string; setId(value: string): void; set(data: GenericObject): void; getChanges(): GenericObject; resetChanges(): void; hasChanged(): boolean; hasFieldsChanged(...fields: string[]): boolean; commit(): Promise; get(): Promise; delete(): Promise; toJSON(): GenericObject; toString(): string; } /** * @example * // Declare the JavaScript object to be used as the schema * const config = { * age: 25, * name: "John Doe", * isActive: true, * address: { * city: "New York", * zip: 10001, * }, * }; * * // Usage with type suggestions * const User = createModel('users', config); * * // All these will have proper type suggestions * User.name = 'Jane Doe'; // string * User.age = 31; // number * console.log(User.address); // object * console.log(User.isActive); // true * console.log(User.address?.city); // 'New York' * @param collection - Firestore collection name eg. 'users' or 'posts/postId/comments' * @param schema - JS object to be used to create the model schema * @param defaults - Optional default values to be used to populate the model * @param data - Optional data to be used to populate the model * @returns - A new instance of the DocumentModel class */ declare function createModel(collection: string, schema: Partial, defaults?: GenericObject, data?: GenericObject): DocumentModelInstance; export { DocumentModel, createModel, }; //# sourceMappingURL=Model.d.ts.map