declare module 'absurd-sql/dist/indexeddb-backend' {
  export default class IndexedDBBackend {
    constructor(options?: {
      dbName?: string;
      storeName?: string;
      onReady?: () => void;
      onError?: (error: Error) => void;
    });
    init(): Promise<void>;
    exec(sql: string, params?: any[]): Promise<any>;
    close(): Promise<void>;
  }
}

declare module 'absurd-sql/dist/indexeddb-main-thread' {
  export function initBackend(worker: Worker): Promise<void>;

  export default class IndexedDBMainThread {
    constructor(options?: {
      dbName?: string;
      storeName?: string;
      onReady?: () => void;
      onError?: (error: Error) => void;
    });
    init(): Promise<void>;
    exec(sql: string, params?: any[]): Promise<any>;
    close(): Promise<void>;
  }
}

declare module 'absurd-sql' {
  export class SQLiteFS {
    constructor(fs: unknown, backend: IndexedDBBackend);
    init(): Promise<void>;
    close(): Promise<void>;
    exec(sql: string, params?: any[]): Promise<any>;
    prepare(sql: string): Promise<any>;
    run(sql: string, params?: any[]): Promise<any>;
    get(sql: string, params?: any[]): Promise<any>;
    all(sql: string, params?: any[]): Promise<any[]>;
  }

  export * from 'absurd-sql/dist/indexeddb-backend';
  export * from 'absurd-sql/dist/indexeddb-main-thread';
} 