/** * File System Management Utilities using fs-extra * Enhanced with fs-extra for better maintainability and industry-standard implementation */ import fs from 'fs-extra'; /** * Safely deletes a file or directory using fs-extra * @param targetPath - Path to delete * @param recursive - Whether to delete directories recursively (default: false) * @returns true if successful, false otherwise */ export declare function safeDelete(targetPath: string, recursive?: boolean): Promise; /** * Safely deletes a file or directory (sync version - DEPRECATED: use async version) * @param targetPath - Path to delete * @param recursive - Whether to delete directories recursively (default: false) * @returns true if successful, false otherwise * @deprecated Use safeDelete instead for better scalability */ export declare function safeDeleteSync(targetPath: string, recursive?: boolean): boolean; /** * Ensures a directory exists using fs-extra * @param dirPath - Directory path to ensure * @returns true if successful, false otherwise */ export declare function ensureDir(dirPath: string): Promise; /** * Ensures a directory exists (sync version) * @param dirPath - Directory path to ensure * @returns true if successful, false otherwise */ export declare function ensureDirSync(dirPath: string): boolean; /** * Moves a file or directory using fs-extra * @param src - Source path * @param dest - Destination path * @param options - Move options * @returns true if successful, false otherwise */ export declare function safeMove(src: string, dest: string, options?: { overwrite?: boolean; }): Promise; /** * Copies a file or directory using fs-extra * @param src - Source path * @param dest - Destination path * @param options - Copy options * @returns true if successful, false otherwise */ export declare function safeCopy(src: string, dest: string, options?: { overwrite?: boolean; preserveTimestamps?: boolean; }): Promise; /** * Executes a file operation with error handling * @param operation - File operation function * @param context - Context description for error logging * @returns operation result or null if failed */ export declare function withFileErrorHandling(operation: () => Promise, context: string): Promise; /** * Executes a file operation with error handling (sync version) * @param operation - File operation function * @param context - Context description for error logging * @returns operation result or null if failed */ export declare function withFileErrorHandlingSync(operation: () => T, context: string): T | null; /** * Gets file statistics with error handling * @param filePath - Path to file * @returns File stats or null if failed */ export declare function safeStats(filePath: string): Promise<{ isFile: boolean; isDirectory: boolean; size: number; modified: Date; created?: Date; } | null>; /** * Checks if a path exists using fs-extra * @param path - Path to check * @returns true if path exists, false otherwise */ export declare function safePathExists(path: string): Promise; /** * Reads directory contents with error handling * @param dirPath - Directory path to read * @param options - Read options * @returns Array of file names or null if failed */ export declare function safeReadDir(dirPath: string, options?: { withFileTypes?: boolean; }): Promise | null>; /** * Creates a temporary directory with error handling * @param prefix - Directory name prefix (optional) * @returns Temporary directory path or null if failed */ export declare function createTempDir(prefix?: string): Promise; /** * Cleans up a directory safely (removes all contents but keeps directory) * @param dirPath - Directory path to clean * @returns true if successful, false otherwise */ export declare function cleanDirectory(dirPath: string): Promise; export { fs }; export { safeDeleteSync as safeDeleteLegacy, ensureDirSync as ensureDirSyncLegacy }; declare const _default: { safeDelete: typeof safeDelete; safeDeleteSync: typeof safeDeleteSync; ensureDir: typeof ensureDir; ensureDirSync: typeof ensureDirSync; safeMove: typeof safeMove; safeCopy: typeof safeCopy; withFileErrorHandling: typeof withFileErrorHandling; withFileErrorHandlingSync: typeof withFileErrorHandlingSync; safeStats: typeof safeStats; safePathExists: typeof safePathExists; safeReadDir: typeof safeReadDir; createTempDir: typeof createTempDir; cleanDirectory: typeof cleanDirectory; fs: typeof fs; }; export default _default; //# sourceMappingURL=managementUtils.d.ts.map