import { ObjectId, MongoClient } from 'mongodb'; import type { DatabaseAdapter, QueueJobRecord } from '../interfaces/database.ts'; import type { JobMeta, JobStatus } from '../interfaces/job.ts'; import { DbQueue } from '../drivers/db.ts'; export interface MongoCollection { insertOne(doc: any): Promise<{ insertedId: ObjectId; }>; findOneAndUpdate(filter: any, update: any, options?: any): Promise; updateOne(filter: any, update: any): Promise; updateMany(filter: any, update: any): Promise; findOne(filter: any, options?: any): Promise; deleteOne(filter: any): Promise; createIndex(keys: any, options?: any): Promise; } export interface MongoConfig { url?: string; database?: string; collection?: string; } export declare class MongoDatabaseAdapter implements DatabaseAdapter { private col; private indexesInitialized; constructor(col: MongoCollection); private initializeIndexes; ensureIndexes(): Promise; insertJob(payload: Buffer, meta: JobMeta): Promise; reserveJob(timeout: number): Promise; completeJob(id: string): Promise; releaseJob(id: string): Promise; failJob(id: string, error: string): Promise; getJobStatus(id: string): Promise; deleteJob(id: string): Promise; markJobDone(id: string): Promise; close(): Promise; } export declare class MongoQueue> extends DbQueue { mongoAdapter: MongoDatabaseAdapter; constructor(config: { collection: MongoCollection; name: string; }); } export declare function createMongoQueue>(name: string, client: MongoClient, database: string, collection?: string): MongoQueue; export declare function createMongoQueueFromUrl>(name: string, url: string, database: string, collection?: string): Promise>; export { DbQueue };