import type { BulkWriteOptions, Collection, DeleteResult, Document, Filter, FindCursor, InsertOneOptions, MongoClient, OptionalUnlessRequiredId, ReplaceOptions, UpdateFilter, WithId } from 'mongodb'; import type { BaseMongoSdkConfig } from './Config.js'; /** Provides a typed wrapper around common MongoDB collection operations. */ export declare class BaseMongoSdk { /** The MongoDB SDK configuration for this instance. */ config: BaseMongoSdkConfig; constructor(config: BaseMongoSdkConfig); /** Returns the MongoDB connection URI, either from the config or constructed from URL-encoded credential fields. */ get uri(): string; /** * Deletes all documents matching the filter. * @param filter - The query filter to match documents for deletion */ deleteMany(filter: Filter): Promise; /** * Deletes the first document matching the filter. * @param filter - The query filter to match a document for deletion */ deleteOne(filter: Filter): Promise; /** * Finds all documents matching the filter and returns a cursor. * @param filter - The query filter */ find(filter: Filter): Promise>>; /** * Finds a single document matching the filter. * @param filter - The query filter * @returns The matched document, or `null` if not found */ findOne(filter: Filter): Promise | null>; /** * Inserts multiple documents into the collection. * @param items - The documents to insert * @param options - Optional bulk write options */ insertMany(items: OptionalUnlessRequiredId[], options?: BulkWriteOptions): Promise>; /** * Inserts a single document into the collection. * @param item - The document to insert * @param options - Optional insert options */ insertOne(item: OptionalUnlessRequiredId, options?: InsertOneOptions): Promise>; /** * Replaces a single document matching the filter. * @param filter - The query filter to match the document * @param item - The replacement document * @param options - Optional replace options */ replaceOne(filter: Filter, item: OptionalUnlessRequiredId, options?: ReplaceOptions): Promise>; /** * Updates a single document matching the filter without upserting. * @param filter - The query filter to match the document * @param fields - The update operations to apply */ updateOne(filter: Filter, fields: UpdateFilter): Promise>; /** * Updates a single document matching the filter, inserting it if it does not exist. * @param filter - The query filter to match the document * @param fields - The update operations to apply */ upsertOne(filter: Filter, fields: UpdateFilter): Promise>; /** * Executes a callback with access to the configured MongoDB collection. * @param func - A callback receiving the typed collection * @returns The result of the callback */ useCollection(func: (collection: Collection) => Promise | R): Promise; /** * Executes a callback with a connected MongoClient, handling connection and disconnection. * @param func - A callback receiving the connected MongoClient * @returns The result of the callback */ useMongo(func: (client: MongoClient) => Promise | R): Promise; } //# sourceMappingURL=Base.d.ts.map