export type AttachmentData = ArrayBuffer | string; export declare enum EncodingType { UTF8 = "utf8", Base64 = "base64" } /** * LocalStorageAdapter defines the interface for local file storage operations. * Implementations handle file I/O, directory management, and storage initialization. * * @experimental * @alpha This is currently experimental and may change without a major version bump. */ export interface LocalStorageAdapter { /** * Saves data to a local file. * @param filePath Path where the file will be stored * @param data Data to store (ArrayBuffer, Blob, or string) * @returns Number of bytes written */ saveFile(filePath: string, data: AttachmentData): Promise; /** * Retrieves file data as an ArrayBuffer. * @param filePath Path where the file is stored * @returns ArrayBuffer containing the file data */ readFile(filePath: string): Promise; /** * Deletes the file at the given path. * @param filePath Path where the file is stored */ deleteFile(filePath: string): Promise; /** * Checks if a file exists at the given path. * @param filePath Path where the file is stored * @returns True if the file exists, false otherwise */ fileExists(filePath: string): Promise; /** * Creates a directory at the specified path. * @param path The full path to the directory */ makeDir(path: string): Promise; /** * Removes a directory at the specified path. * @param path The full path to the directory */ rmDir(path: string): Promise; /** * Initializes the storage adapter (e.g., creating necessary directories). */ initialize(): Promise; /** * Clears all files in the storage. */ clear(): Promise; /** * Returns the file path for the provided filename in the storage directory. * @param filename The filename to get the path for * @returns The full file path */ getLocalUri(filename: string): string; }