import { Schema } from './schema'; import { type SearchIndexRegistry } from './search-index-registry'; import { ObjectId } from './objectid'; import { QueryBuilder } from './query-builder'; import { DocumentQueryBuilder } from './document-query-builder'; import { FindQueryBuilder } from './find-query-builder'; import { QueryableKeys } from './type-utils'; import { StorageStrategy } from './storage'; import { Document, type IDocument } from './document'; import type { Database } from './database'; export { Document }; export type { IDocument }; export type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; export type QueryOperator = { $eq?: T; $ne?: T; $in?: T[]; $nin?: T[]; $gt?: T; $gte?: T; $lt?: T; $lte?: T; $regex?: string | RegExp; $exists?: boolean; $size?: number; $elemMatch?: Record; $all?: T extends unknown[] ? T : never; $not?: QueryOperator; }; export type QueryValue = T | QueryOperator; type LogicalQueryOperators = { $or?: Query[]; $and?: Query[]; $nor?: Query[]; }; export type Query> = { [K in QueryableKeys]?: QueryValue; } & LogicalQueryOperators; export type UpdateOperator> = { $set?: Partial; $unset?: Partial>; $inc?: Partial>; $dec?: Partial>; $push?: Partial>; $pull?: Partial>; $addToSet?: Partial>; $pop?: Partial>; $rename?: Partial>; }; export type Update> = Partial | UpdateOperator; export type QueryOptions> = { sort?: Partial>; limit?: number; skip?: number; select?: Partial>; lean?: boolean; }; export type PopulateOptions = { path: string; select?: string | string[] | Record; match?: Query; populate?: PopulateOptions | PopulateOptions[]; model?: string; }; export declare class Model> { private _storage; private _schema?; private _discriminatorKey?; private _discriminatorValue?; private _database?; private _storageInitPromise; private _searchIndexRegistry; constructor(schema?: Schema, discriminatorValue?: string, storage?: StorageStrategy, database?: Database); _setStorageInitPromise(promise: Promise): void; private _ensureStorageReady; private _applyVirtuals; private _serializeDocument; private _applyFieldSelection; private _executePreHooks; private _executePostHooks; private _validateDocument; private _applyDefaults; private _ensureId; private _applyTimestamps; private _checkUniqueConstraints; _applyPopulate(docs: T[], options: string[] | PopulateOptions | PopulateOptions[]): Promise; private _normalizePopulateOptions; private _populatePath; private _applyPopulateSelect; createIndex(fields: keyof T | Array, options?: { unique?: boolean; }): Promise; private _hasNativeQuery; private _findDocumentsUsingIndexes; private _compareValues; private _matches; findOne(query: Query, options?: QueryOptions): DocumentQueryBuilder; find(query?: Query, options?: QueryOptions): FindQueryBuilder; _executeFindWithOptions(query: Query, options?: QueryOptions): Promise>; create(doc: DeepPartial): Promise; insertMany(docs: DeepPartial[]): Promise>; deleteOne(query: Query): QueryBuilder<{ deletedCount: number; }>; private _executeDeleteOne; deleteMany(query: Query): QueryBuilder<{ deletedCount: number; }>; private _executeDeleteMany; private _rebuildIndexes; private _updateIndexForDocument; private _applyUpdate; updateOne(query: Query, update: Update, options?: { upsert?: boolean; }): QueryBuilder<{ modifiedCount: number; upsertedCount?: number; }>; private _executeUpdateOne; updateMany(query: Query, update: Update): QueryBuilder<{ modifiedCount: number; }>; private _buildUpsertDocument; private _executeUpdateMany; countDocuments(query?: Query): Promise; findOneAndUpdate(query: Query, update: Update, options?: { returnDocument?: 'before' | 'after'; new?: boolean; upsert?: boolean; }): DocumentQueryBuilder; private _executeFindOneAndUpdate; findOneAndDelete(query: Query): DocumentQueryBuilder; private _executeFindOneAndDelete; distinct(field: K, query?: Query): Promise>; findById(id: string | ObjectId): DocumentQueryBuilder; findByIdAndUpdate(id: string | ObjectId, update: Update, options?: { returnDocument?: 'before' | 'after'; new?: boolean; upsert?: boolean; }): DocumentQueryBuilder; findByIdAndDelete(id: string | ObjectId): DocumentQueryBuilder; _getSearchIndexRegistry(): SearchIndexRegistry | null; aggregate>(pipeline: unknown[]): Promise; discriminator(name: string, schema: Schema): Model; } //# sourceMappingURL=model.d.ts.map