/** * Bun/Node file-system storage backend * * High-performance file system storage using Bun native APIs when available, * with a Node.js filesystem fallback for runtime compatibility. * Features: * - Auto-initializing (no manual init() required) * - Automatic memory mapping for large files * - Efficient async I/O with O(1) append * - Native TypedArray support */ import type { StorageBackend } from './StorageBackend.js'; export declare class BunStorageBackend implements StorageBackend { readonly type = "bun"; private basePath; private nodeRuntimePromise; private dirCache; /** * Create a new Bun storage backend * @param basePath Base directory for all storage operations */ constructor(basePath?: string); private isBrowserRuntime; private getNodeRuntime; private wrapStorageError; private withStorageError; /** * Ensure directory exists, using cache to avoid redundant mkdir calls */ private ensureDir; /** * Get the full path for a key. * Validates that the resolved path stays within basePath to prevent path traversal. */ private getFullPath; /** * Ensure base directory exists (optional - operations auto-initialize) * @deprecated No longer required - write/append create directories automatically */ init(): Promise; read(key: string): Promise; write(key: string, data: ArrayBuffer | Uint8Array): Promise; append(key: string, data: ArrayBuffer | Uint8Array): Promise; delete(key: string): Promise; exists(key: string): Promise; list(prefix?: string): Promise; mkdir(dirPath: string): Promise; /** * Delete all data in the storage directory */ clear(): Promise; /** * Get file size without reading the entire file */ size(key: string): Promise; /** * Read a file as a stream (for large files). */ stream(key: string): Promise | null>; /** * Get the base path */ getBasePath(): string; } //# sourceMappingURL=BunStorageBackend.d.ts.map