/**
 * Plugin Rollback Workflow
 *
 * Provides functionality to roll back plugins to previous versions
 * using version history and backup files.
 *
 * @since v1.22.0
 */
import { EventEmitter } from 'node:events';
import { type PluginVersionEntry, type VersionHistoryService } from '../core/history/index.js';
/**
 * Options for rollback operation
 */
export interface RollbackOptions {
    /** Target plugin name */
    pluginName: string;
    /** Version to rollback to */
    targetVersion: string;
    /** Directory containing plugin JARs */
    pluginsDir: string;
    /** Whether to backup current version before rollback */
    backupCurrent?: boolean;
    /** Version history service instance */
    versionHistory?: VersionHistoryService;
}
/**
 * Result of a rollback operation
 */
export interface RollbackResult {
    /** Whether rollback succeeded */
    success: boolean;
    /** Plugin name */
    pluginName: string;
    /** Version before rollback */
    fromVersion: string;
    /** Version after rollback */
    toVersion: string;
    /** Path to restored JAR */
    restoredJarPath?: string;
    /** Path to backup of previous version */
    previousVersionBackup?: string;
    /** Error message if failed */
    error?: string;
}
/**
 * Progress event during rollback
 */
export interface RollbackProgress {
    /** Current step */
    step: 'validating' | 'backing-up' | 'restoring' | 'verifying' | 'complete';
    /** Description of current action */
    message: string;
    /** Plugin being rolled back */
    pluginName: string;
}
/**
 * Create a single-file backup for rollback
 */
export declare function backupPluginForRollback(jarPath: string): Promise<string>;
/**
 * Rollback Workflow
 *
 * Handles plugin version rollbacks with backup and verification.
 */
export declare class RollbackWorkflow extends EventEmitter {
    private versionHistory;
    constructor(versionHistory?: VersionHistoryService);
    /**
     * Emit progress event
     */
    private emitProgress;
    /**
     * Rollback a plugin to a specific version
     */
    rollback(options: RollbackOptions): Promise<RollbackResult>;
    /**
     * Rollback to the previous version
     */
    rollbackToPrevious(pluginName: string, pluginsDir: string, currentVersion?: string): Promise<RollbackResult>;
    /**
     * Get available rollback options for a plugin
     */
    getRollbackOptions(pluginName: string, currentVersion?: string): Promise<PluginVersionEntry[]>;
    /**
     * Check if rollback is available
     */
    hasRollbackAvailable(pluginName: string, currentVersion?: string): Promise<boolean>;
    /**
     * Clean up old rollback backups
     */
    cleanupOldBackups(maxAgeDays?: number): Promise<number>;
}
/**
 * Get the singleton rollback workflow instance
 */
export declare function getRollbackWorkflow(): RollbackWorkflow;
/**
 * Reset the singleton (for testing)
 */
export declare function resetRollbackWorkflow(): void;
/**
 * Create a new rollback workflow with custom dependencies
 */
export declare function createRollbackWorkflow(versionHistory?: VersionHistoryService): RollbackWorkflow;
//# sourceMappingURL=rollback.d.ts.map