/** * Interface for file system operations * * This interface abstracts file operations to support both local and remote file systems. */ export interface FileSystemInterface { /** * Checks if a file or directory exists * * @param path - Path to check * @returns True if the path exists, false otherwise */ fileExists(path: string): Promise; /** * Checks if a path is a directory * * @param path - Path to check * @returns True if the path is a directory, false otherwise */ isDirectory(path: string): Promise; /** * Ensures a directory exists, creating it if necessary * * @param path - Path to the directory */ ensureDirectory(path: string): Promise; /** * Reads a file's contents * * @param path - Path to the file * @returns The file contents as a string */ readFile(path: string): Promise; /** * Writes content to a file * * @param path - Path to the file * @param content - Content to write */ writeFile(path: string, content: string): Promise; /** * Appends content to a file without reading the existing data. * * Uses the OS append semantic (O_APPEND / >> ) so the operation is * safe even if the file is concurrently read by another process. * The file **must** already exist; behaviour for a missing file is * implementation-defined (may create the file or throw). * * @param path - Path to the file * @param content - Content to append */ appendFile(path: string, content: string): Promise; /** * Lists files in a directory * * @param path - Path to the directory * @returns Array of file names */ listFiles(path: string): Promise; /** * Deletes a file or directory * * @param path - Path to delete */ delete(path: string): Promise; /** * Copies a file or directory * * @param sourcePath - Source path * @param destPath - Destination path */ copy(sourcePath: string, destPath: string): Promise; /** * Gets the base directory for file operations * * @returns The base directory path */ getBaseDir(): string; } //# sourceMappingURL=FileSystemInterface.d.ts.map