/** * Common utilities * Helper functions used across the codebase */ /** * Ensure a directory exists * @param dirPath Directory path to ensure exists * @returns Promise that resolves when the directory exists */ declare function ensureDirectoryExists(dirPath: string): Promise; /** * Normalize a path to use forward slashes * @param filePath Path to normalize * @returns Normalized path */ declare function normalizePath(filePath: string): string; /** * Format a file size in a human-readable format * @param bytes Size in bytes * @param decimals Number of decimal places * @returns Formatted size string */ declare function formatFileSize(bytes: number, decimals?: number): string; /** * Check if a path is a subdirectory of another path * @param parent Parent directory path * @param child Child path to check * @returns True if child is a subdirectory of parent */ declare function isSubdirectory(parent: string, child: string): boolean; /** * Safely copy a file from source to destination using streams * @param source Source file path * @param destination Destination file path * @param overwrite Whether to overwrite if destination exists * @returns Promise that resolves when the copy is complete */ declare function copyFileWithStreams(source: string, destination: string, overwrite?: boolean): Promise; /** * Calculate total size of files * @param filePaths Array of file paths * @returns Promise resolving to total size in bytes */ declare function calculateTotalSize(filePaths: string[]): Promise; /** * Check if a file exists and is accessible * @param filePath Path to check * @returns Promise resolving to boolean indicating if file exists and is accessible */ declare function fileExists(filePath: string): Promise; /** * Get file extension from path * @param filePath File path * @returns File extension (without the dot) or empty string if no extension */ declare function getFileExtension(filePath: string): string; export { calculateTotalSize, copyFileWithStreams, ensureDirectoryExists, fileExists, formatFileSize, getFileExtension, isSubdirectory, normalizePath };