/**
 * Version History Service
 *
 * Tracks plugin version history for rollback support.
 * Records installed versions with metadata for restoration.
 *
 * @since v1.22.0
 */
import type { PluginSourceType } from '../types/index.js';
/**
 * A single version entry in the history
 */
export interface PluginVersionEntry {
    /** The version string */
    version: string;
    /** When this version was installed */
    installedAt: string;
    /** Original JAR filename */
    jarFilename: string;
    /** JAR file size in bytes */
    jarSize: number;
    /** SHA256 hash for verification */
    sha256: string;
    /** Source that provided this version */
    source: PluginSourceType;
    /** Path to backup file containing this version (if available) */
    backupPath?: string;
}
/**
 * History for a single plugin
 */
export interface PluginHistory {
    /** Plugin name (normalized) */
    pluginName: string;
    /** Version entries (newest first) */
    entries: PluginVersionEntry[];
}
/**
 * Full version history store
 */
export interface VersionHistoryStore {
    /** Schema version for migrations */
    version: string;
    /** Last modification timestamp */
    lastUpdated: string;
    /** Plugin histories by normalized name */
    plugins: Record<string, PluginHistory>;
}
/**
 * Rollback configuration
 */
export interface RollbackConfig {
    /** Maximum versions to keep per plugin */
    maxVersionsPerPlugin: number;
    /** Maximum days to keep backup files */
    maxBackupAgeDays: number;
    /** Maximum total backup storage in bytes */
    maxBackupSizeBytes: number;
}
/**
 * Default rollback configuration
 */
export declare const DEFAULT_ROLLBACK_CONFIG: RollbackConfig;
/**
 * Version History Service
 *
 * Manages plugin version history for rollback support.
 */
export declare class VersionHistoryService {
    private store;
    private storagePath;
    private loaded;
    private config;
    constructor(storagePath?: string, config?: Partial<RollbackConfig>);
    /**
     * Create an empty store
     */
    private createEmptyStore;
    /**
     * Load history from disk
     */
    load(): Promise<void>;
    /**
     * Save history to disk
     */
    save(): Promise<void>;
    /**
     * Record a new version installation
     */
    recordInstall(pluginName: string, entry: Omit<PluginVersionEntry, 'installedAt'>): Promise<void>;
    /**
     * Get history for a specific plugin
     */
    getHistory(pluginName: string): PluginVersionEntry[];
    /**
     * Get a specific version entry
     */
    getVersion(pluginName: string, version: string): PluginVersionEntry | null;
    /**
     * Get the previous version (one before current)
     */
    getPreviousVersion(pluginName: string, currentVersion: string): PluginVersionEntry | null;
    /**
     * Get all plugins with rollback history available
     */
    getPluginsWithHistory(): string[];
    /**
     * Get rollback options for a plugin (versions available for rollback)
     */
    getRollbackOptions(pluginName: string, currentVersion?: string): PluginVersionEntry[];
    /**
     * Check if rollback is available for a plugin
     */
    hasRollbackAvailable(pluginName: string, currentVersion?: string): boolean;
    /**
     * Remove a plugin's history
     */
    removePlugin(pluginName: string): Promise<void>;
    /**
     * Remove a specific version from history
     */
    removeVersion(pluginName: string, version: string): Promise<void>;
    /**
     * Update backup path for a version
     */
    updateBackupPath(pluginName: string, version: string, backupPath: string): Promise<void>;
    /**
     * Clear all history
     */
    clear(): Promise<void>;
    /**
     * Get total number of tracked plugins
     */
    getPluginCount(): number;
    /**
     * Get total number of version entries
     */
    getTotalVersionCount(): number;
    /**
     * Get the last updated timestamp
     */
    getLastUpdated(): Date | null;
}
/**
 * Get the singleton version history service instance
 */
export declare function getVersionHistoryService(): VersionHistoryService;
/**
 * Reset the singleton (for testing)
 */
export declare function resetVersionHistoryService(): void;
//# sourceMappingURL=version-history.d.ts.map