/**
 * @module Lock
 */
import { type IDeinitizable, type IInitizable, type IPrunable } from "../../../../utilities/_module-exports.js";
import type { IDatabaseLockAdapter, ILockData } from "../../../../lock/contracts/_module-exports.js";
import type { CollectionOptions, Db } from "mongodb";
/**
 *
 * IMPORT_PATH: `"@daiso-tech/core/lock/adapters"`
 * @group Adapters
 */
export type MongodbLockAdapterSettings = {
    database: Db;
    /**
     * @default {"lock"}
     */
    collectionName?: string;
    collectionSettings?: CollectionOptions;
};
/**
 * To utilize the `MongodbLockAdapter`, you must install the `"mongodb"` package.
 *
 * Note in order to use `MongodbLockAdapter` correctly, ensure you use a single, consistent database across all server instances.
 *
 * IMPORT_PATH: `"@daiso-tech/core/lock/adapters"`
 * @group Adapters
 */
export declare class MongodbLockAdapter implements IDatabaseLockAdapter, IDeinitizable, IInitizable, IPrunable {
    private readonly database;
    private readonly collection;
    private readonly collectionName;
    /**
     * @example
     * ```ts
     * import { MongodbLockAdapter } from "@daiso-tech/core/lock/adapters";
     * import { MongoClient } from "mongodb";
     *
     * const client = await MongoClient.connect("YOUR_MONGODB_CONNECTION_STRING");
     * const database = client.db("database");
     * const lockAdapter = new MongodbLockAdapter({
     *   database
     * });
     * // You need initialize the adapter once before using it.
     * await lockAdapter.init()
     * ```
     */
    constructor({ collectionName, collectionSettings, database, }: MongodbLockAdapterSettings);
    removeAllExpired(): Promise<void>;
    /**
     * Creates all related indexes.
     * Note the `init` method needs to be called before using the adapter.
     */
    init(): Promise<void>;
    /**
     * Removes the collection where the lock keys are stored and all it's related indexes.
     * Note all lock data will be removed.
     */
    deInit(): Promise<void>;
    insert(key: string, owner: string, expiration: Date | null): Promise<void>;
    update(key: string, owner: string, expiration: Date | null): Promise<number>;
    remove(key: string, owner: string | null): Promise<void>;
    refresh(key: string, owner: string, expiration: Date): Promise<number>;
    find(key: string): Promise<ILockData | null>;
}
