/** * Browser-compatible file system utilities * * Provides file system functions that work in browser environments * while maintaining compatibility with Node.js fs/promises API. */ export interface FileSystemUtils { readFile(path: string, encoding?: string): Promise; writeFile(path: string, data: string, encoding?: string): Promise; access(path: string): Promise; stat(path: string): Promise; readdir(path: string): Promise; mkdir(path: string, options?: { recursive?: boolean; }): Promise; exists(path: string): Promise; } export interface FileStats { isFile(): boolean; isDirectory(): boolean; size: number; mtime: Date; ctime: Date; } declare class BrowserFileSystem implements FileSystemUtils { private cache; private mockFiles; /** * Read file content * In browser environment, this will work with pre-loaded or cached content */ readFile(path: string, _encoding?: string): Promise; /** * Write file content * In browser environment, this stores in memory cache */ writeFile(path: string, data: string, _encoding?: string): Promise; /** * Check file access */ access(path: string): Promise; /** * Get file stats */ stat(path: string): Promise; /** * Read directory contents */ readdir(path: string): Promise; /** * Create directory */ mkdir(path: string, _options?: { recursive?: boolean; }): Promise; /** * Check if file exists */ exists(path: string): Promise; /** * Pre-load file content (for browser usage) */ preloadFile(path: string, content: string): void; /** * Pre-load directory listing (for browser usage) */ preloadDirectory(path: string, files: string[]): void; /** * Set mock file content (for testing) */ setMockFile(path: string, content: string): void; /** * Clear all cached content */ clearCache(): void; /** * Check if path is a URL */ private isUrl; /** * Check if URL exists */ private checkUrlExists; } declare const browserFs: BrowserFileSystem; export declare const readFile: (path: string, _encoding?: string) => Promise; export declare const writeFile: (path: string, data: string, _encoding?: string) => Promise; export declare const access: (path: string) => Promise; export declare const stat: (path: string) => Promise; export declare const readdir: (path: string) => Promise; export declare const mkdir: (path: string, _options?: { recursive?: boolean; }) => Promise; export declare const exists: (path: string) => Promise; export declare const preloadFile: (path: string, content: string) => void; export declare const preloadDirectory: (path: string, files: string[]) => void; export declare const setMockFile: (path: string, content: string) => void; export declare const clearCache: () => void; export default browserFs; export { BrowserFileSystem }; //# sourceMappingURL=browser-fs.d.ts.map