import { PathInfo } from '../types.js'; import 'fs'; interface CopyOptions { source: string; app?: string; pattern?: string; recursive?: boolean; overwrite?: boolean; dryRun?: boolean; detailed?: boolean; table?: boolean; force?: boolean; interactive?: boolean; } interface CopyResult { success: boolean; targetPath: string; copiedFiles: string[]; failedFiles: string[]; errors: Error[]; } interface FileAnalysis { source: string; targetPaths: PathInfo[]; filesToCopy: string[]; totalFiles: number; totalSize: number; } declare class FileCopier { /** * Copy files to iCloud Drive * * @param source Source file or directory path * @param options Copy options * @returns Copy result * * @example * ```typescript * // Simple copy to iCloud Drive root * const result = await FileCopier.copy('./localfile.txt'); * * // Copy to specific app with options * const result = await FileCopier.copy('./documents', 'Notes', { * pattern: '*.md', * recursive: true, * overwrite: true * }); * ``` */ static copy(source: string, options?: Omit): Promise; static copy(source: string, target: string, options?: Omit): Promise; /** * Analyze source path and determine files to copy * * @param options Copy options excluding dryRun and overwrite * @returns Analysis result with files to copy and target paths */ analyze(options: Omit): Promise; /** * Copy files to iCloud Drive * * @param options Copy options * @returns Copy result */ copy(options: CopyOptions): Promise; /** * Copy files to iCloud Drive * * @param source Source file or directory path * @param target Target app name (optional, if not provided files will be copied to iCloud Drive root) * @param options Copy options * @returns Copy result */ copy(source: string, target?: string, options?: Omit): Promise; /** * Find target paths based on app name * * @param options Copy options * @returns Array of path info objects */ private findTargetPaths; /** * Find files to copy based on source path and options * * @param sourcePath Source path * @param options Copy options * @returns Array of file paths to copy */ private findFilesToCopy; /** * Recursively walk directory and collect files matching pattern * * @param dir Directory to walk * @param pattern File pattern to match * @param files Array to collect matching files */ private walkDirectory; /** * Copy a single file from source to target * * @param source Source file path * @param target Target file path * @param options Copy options */ private copyFile; /** * Calculate total size of files to copy * * @param files Array of file paths * @returns Total size in bytes */ private calculateTotalSize; } export { type CopyOptions, type CopyResult, type FileAnalysis, FileCopier };