import type { Document } from 'mongodb'; import { EventEmitter } from 'node:events'; import type { MongoConnectionContract } from '../types/database.js'; /** * Schema builder for MongoDB collections */ export declare class MongoSchemaBuilder { private collectionName; private connection; private emitter; /** * The collection to build the schema for */ private collection; /** * The indexes to create */ private indexes; constructor(collectionName: string, connection: MongoConnectionContract, emitter: EventEmitter); /** * Create a new index */ createIndex(keys: Document, options?: { name?: string; unique?: boolean; sparse?: boolean; expireAfterSeconds?: number; background?: boolean; }): this; /** * Create a unique index */ unique(keys: Document, options?: { name?: string; sparse?: boolean; }): this; /** * Create a text index */ text(keys: string | string[], options?: { name?: string; weights?: Record; }): this; /** * Create a TTL index */ ttl(key: string, seconds: number, options?: { name?: string; }): this; /** * Create a geospatial index */ geo(key: string, options?: { name?: string; sparse?: boolean; }): this; /** * Drop the collection */ drop(): Promise; /** * Create the collection with indexes */ create(): Promise; }