import type { WebSecureStorageBackend } from "./web-storage-backend"; export type IndexedDBBackendOptions = { channelName?: string; onError?: (error: Error) => void; }; /** * Creates a `WebSecureStorageBackend` backed by IndexedDB. * * IndexedDB is async, but `WebSecureStorageBackend` requires a synchronous * interface. This implementation bridges the gap with a write-through in-memory * cache: * * - **Reads** are always served from the in-memory cache (synchronous, O(1)). * - **Writes** update the cache synchronously, then persist to IndexedDB * asynchronously in the background. * - **Initialisation**: the returned backend pre-loads all persisted entries * from IndexedDB into memory before resolving, so the first synchronous read * after `await createIndexedDBBackend()` already returns the correct value. * * @param dbName Name of the IndexedDB database. Defaults to `"nitro-storage-secure"`. * @param storeName Name of the object store inside the database. Defaults to `"keyvalue"`. * * @example * ```ts * import { setWebSecureStorageBackend } from "react-native-nitro-storage"; * import { createIndexedDBBackend } from "react-native-nitro-storage/indexeddb-backend"; * * const backend = await createIndexedDBBackend(); * setWebSecureStorageBackend(backend); * ``` */ export declare function createIndexedDBBackend(dbName?: string, storeName?: string, options?: IndexedDBBackendOptions): Promise; //# sourceMappingURL=indexeddb-backend.d.ts.map