/** * File system provider interface for abstracting file operations. * This allows the core package to run in different environments: * - Node.js (local filesystem) * - Cloudflare edge runtime (remote storage, KV, R2, etc.) */ export interface FileSystemProvider { /** * Check if a path exists */ exists(path: string): Promise | boolean; /** * Read a directory and return entries */ readdir(path: string): Promise; /** * Read file content as text */ readFile(path: string): Promise; /** * Read file content as a buffer */ readFileAsBuffer(path: string): Promise; /** * Get file statistics */ stat(path: string): Promise; /** * Join path segments */ join(...paths: string[]): string; /** * Normalize a path */ normalize(path: string): string; } /** * Represents a directory entry */ export interface DirectoryEntry { name: string; isDirectory: boolean; isFile: boolean; } /** * File statistics */ export interface FileStats { size: number; isDirectory: boolean; isFile: boolean; } /** * Options for configuring the file system provider */ export interface FileSystemProviderOptions { /** * Base directory for relative paths */ baseDir?: string; }