import type * as SQLite from '@journeyapps/wa-sqlite'; import { RawWaSqliteDatabaseOptions } from './RawSqliteConnection.js'; /** * List of currently tested virtual filesystems */ export declare enum WASQLiteVFS { IDBBatchAtomicVFS = "IDBBatchAtomicVFS", OPFSCoopSyncVFS = "OPFSCoopSyncVFS", AccessHandlePoolVFS = "AccessHandlePoolVFS", OPFSWriteAheadVFS = "OPFSWriteAheadVFS", /** * A virtual file system storing data in-memory only, without persistence. * * This file system can be used in three configurations: * * 1. In shared workers (the default when available): All tabs share the same in-memory database, which is cleared * once the last tab is closed. * 2. In dedicated workers (used when `enableMultiTabs` is disabled). Each tab has its own in-memory database cleared * when the tab is closed. Queries are offloaded to a dedicated worker. * 3. In the context of the tab itself (used when both `enableMultiTabs` and `useWebWorker` are disabled). The per-tab * database is hosted in the tab itself, and queries run synchronously. This is _a lot_ faster than any other * single-threadedVFS, but can block JavaScript for computationally-intensive queries. * * This VFS primarily intended for development, but it also useful for online-first deployments not syncing large * amounts of data, as it is quicker to start up. */ InMemoryVfs = "InMemoryVFS" } export declare function vfsRequiresDedicatedWorkers(vfs: WASQLiteVFS): vfs is WASQLiteVFS.OPFSCoopSyncVFS | WASQLiteVFS.AccessHandlePoolVFS | WASQLiteVFS.OPFSWriteAheadVFS; /** * @internal */ export type WASQLiteModuleFactoryOptions = { dbFileName: string; encryptionKey?: string; }; /** * @internal */ export type SQLiteModule = Parameters[0]; /** * @internal */ export declare function loadModuleAndVfs({ vfs, filename, encryptionKey }: RawWaSqliteDatabaseOptions): Promise<{ module: SQLiteModule; vfs: SQLiteVFS; }>;