/** * Storage Backend Interface * * Provides a unified interface for persisting vector index data across different platforms: * - Bun/Node.js: File system storage via BunStorageBackend * - Browser: OPFS (Origin Private File System) or IndexedDB * - Testing: In-memory storage * * All operations are async to support both sync and async underlying storage. */ export interface StorageBackend { /** * Read data from storage * @param key Unique key/path for the data * @returns ArrayBuffer of data or null if not found */ read(key: string): Promise; /** * Write data to storage (overwrites existing) * @param key Unique key/path for the data * @param data Data to write */ write(key: string, data: ArrayBuffer | Uint8Array): Promise; /** * Append data to existing file (for WAL) * @param key Unique key/path for the data * @param data Data to append */ append(key: string, data: ArrayBuffer | Uint8Array): Promise; /** * Delete data from storage * @param key Unique key/path to delete */ delete(key: string): Promise; /** * Check if key exists in storage * @param key Unique key/path to check */ exists(key: string): Promise; /** * List all keys with given prefix * @param prefix Optional prefix to filter keys */ list(prefix?: string): Promise; /** * Create a directory (for file-based backends) * @param path Directory path to create */ mkdir(path: string): Promise; /** * Get storage type identifier */ readonly type: string; } /** * Options for creating a storage backend */ export interface StorageOptions { /** Base path for file-based storage */ path?: string; /** Database name for IndexedDB */ dbName?: string; /** Store name for IndexedDB */ storeName?: string; } //# sourceMappingURL=StorageBackend.d.ts.map