/** * File System Service - Centralized file system operations * * Provides abstraction layer for file system operations with: * - Automatic directory creation * - Retry logic for transient errors * - Standardized error handling * - Consistent API across codebase * * @requirement TASK-2.1 - File System Abstraction */ /** * File system operation options */ export interface FileSystemOptions { /** * Retry attempts for transient errors (default: 3) */ retries?: number; /** * Retry delay in milliseconds (default: 100) */ retryDelay?: number; /** * Ensure directory exists before operation (default: true) */ ensureDir?: boolean; } /** * File System Service * * Centralizes file system operations with automatic directory creation, * retry logic, and standardized error handling. */ export declare class FileSystemService { private defaultRetries; private defaultRetryDelay; constructor(options?: { retries?: number; retryDelay?: number; }); /** * Ensure directory exists * * @param dirPath - Directory path * @throws Error if directory cannot be created */ ensureDir(dirPath: string): Promise; /** * Write file with automatic directory creation * * @param filePath - File path * @param content - File content * @param encoding - File encoding (default: 'utf-8') * @param options - Operation options */ writeFile(filePath: string, content: string, encoding?: BufferEncoding, options?: FileSystemOptions): Promise; /** * Write JSON file with automatic directory creation * * @param filePath - File path * @param data - JSON data * @param options - Operation options */ writeJson(filePath: string, data: any, options?: FileSystemOptions & { spaces?: number; }): Promise; /** * Read JSON file * * @param filePath - File path * @returns Parsed JSON data */ readJson(filePath: string): Promise; /** * Read file * * @param filePath - File path * @param encoding - File encoding (default: 'utf-8') * @returns File content */ readFile(filePath: string, encoding?: BufferEncoding): Promise; /** * Check if path exists * * @param filePath - File or directory path * @returns True if path exists */ pathExists(filePath: string): Promise; /** * Remove file or directory * * @param filePath - File or directory path */ remove(filePath: string): Promise; /** * Copy file or directory * * @param src - Source path * @param dest - Destination path * @param options - Operation options */ copy(src: string, dest: string, options?: FileSystemOptions): Promise; /** * Move file or directory * * @param src - Source path * @param dest - Destination path * @param options - Operation options */ move(src: string, dest: string, options?: FileSystemOptions): Promise; } /** * Default FileSystemService instance * * Use this for most operations. Create custom instances only if you need * different retry settings. */ export declare const fileSystemService: FileSystemService;