/** * Storage Backend Factory * * Auto-detects the best storage backend for the current environment: * - Bun/Node.js: BunStorageBackend (file system) * - Modern browsers: OPFSBackend (Origin Private File System) * - Fallback: MemoryBackend (in-memory) */ import type { StorageBackend, StorageOptions } from './StorageBackend.js'; export type StorageType = 'auto' | 'bun' | 'opfs' | 'memory'; export interface CreateStorageOptions extends StorageOptions { /** Force a specific storage type */ type?: StorageType; } /** * Detect the current runtime environment */ export declare function detectEnvironment(): 'bun' | 'browser' | 'node' | 'unknown'; /** * Create the optimal storage backend for the current environment * * @param options Configuration options * @returns Initialized storage backend * * @example * ```typescript * // Auto-detect best backend * const storage = await createStorageBackend(); * * // Force specific backend * const bunStorage = await createStorageBackend({ type: 'bun', path: './data' }); * const memStorage = await createStorageBackend({ type: 'memory' }); * ``` */ export declare function createStorageBackend(options?: CreateStorageOptions): Promise; /** * Get the recommended storage type for the current environment */ export declare function getRecommendedStorageType(): StorageType; /** * Check if a specific storage type is available */ export declare function isStorageTypeAvailable(type: StorageType): boolean; //# sourceMappingURL=createStorageBackend.d.ts.map