import { DatabaseService } from "../interfaces/database";

declare module "@jlongster/sql.js" {
  interface SQL {
    Database: unknown;
    FS: unknown;
    register_for_idb: (fs: unknown) => void;
  }

  function initSqlJs(config: {
    locateFile: (file: string) => string;
  }): Promise<SQL>;
  export default initSqlJs;
}

declare module "absurd-sql" {
  export class SQLiteFS {
    constructor(fs: unknown, backend: unknown);
  }
}

declare module "absurd-sql/dist/indexeddb-backend" {
  export default class IndexedDBBackend {
    constructor();
  }
}

declare const databaseService: DatabaseService;
export default databaseService;
