import Database from 'better-sqlite3'; import type { DatabaseAdapter, QueueJobRecord } from '../interfaces/database.ts'; import type { JobMeta, JobStatus } from '../interfaces/job.ts'; import { DbQueue } from '../drivers/db.ts'; export interface SQLiteDatabase { exec(sql: string): void; prepare(sql: string): { run(...params: any[]): { lastInsertRowid: number | bigint; changes: number; }; get(...params: any[]): any; }; } export interface BetterSQLite3Config { filename: string; options?: Database.Options; } export declare class SQLiteDatabaseAdapter implements DatabaseAdapter { private db; constructor(db: SQLiteDatabase); private initializeSchema; 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; clear(): Promise; close(): void; } export declare class SQLiteQueue> extends DbQueue { constructor(config: { database: SQLiteDatabase; name: string; }); } export declare function createSQLiteQueue>(name: string, filename: string, options?: Database.Options): SQLiteQueue; export { DbQueue };