/** * BackupManager provides safety and rollback capabilities for file modifications. * Creates .bak files before modifications and supports restoration. */ export declare class BackupManager { /** * Creates a backup of the specified file with .bak extension. * Preserves file permissions from the original file. * @param filePath - Path to the file to backup * @returns Promise resolving to the backup file path */ createBackup(filePath: string): Promise; /** * Restores a file from its backup. * @param filePath - Path to the file to restore (backup must exist at filePath.bak) */ restoreFromBackup(filePath: string): Promise; /** * Lists all backup files for a given file path. * @param filePath - Base file path to search for backups * @returns Array of backup file names (not full paths) */ listBackups(filePath: string): Promise; /** * Cleans up old backups, keeping only the most recent N. * @param filePath - Base file path * @param keepCount - Number of recent backups to keep (default: 3) */ cleanupOldBackups(filePath: string, keepCount?: number): Promise; /** * Restores a file from a specific backup file. * Validates and sanitizes backupName to prevent path traversal attacks. * @param filePath - Path to the file to restore * @param backupName - Name of the backup file (not full path) * @throws Error if backupName contains path traversal attempts */ restoreFromSpecificBackup(filePath: string, backupName: string): Promise; } //# sourceMappingURL=backup.d.ts.map