/**
 * Config Migrator
 *
 * Migrates configuration files between versions:
 * - Schema transformations
 * - Default value updates
 * - Deprecated field removal
 * - New field additions
 */
import { EventEmitter } from 'events';
export interface ConfigTransform {
    version: string;
    name: string;
    description?: string;
    transform: (config: Record<string, unknown>) => Record<string, unknown>;
    validate?: (config: Record<string, unknown>) => boolean;
}
export interface ConfigMigrationResult {
    success: boolean;
    fromVersion: string;
    toVersion: string;
    transformsApplied: number;
    changes: ConfigChange[];
    errors: string[];
    backup?: string;
}
export interface ConfigChange {
    type: 'add' | 'remove' | 'modify' | 'rename';
    path: string;
    oldValue?: unknown;
    newValue?: unknown;
    description?: string;
}
export interface ConfigMigratorConfig {
    configDir?: string;
    configFile?: string;
    backupDir?: string;
    createBackup?: boolean;
    dryRun?: boolean;
}
/**
 * Config Migrator class
 */
export declare class ConfigMigrator extends EventEmitter {
    private config;
    private transforms;
    private initialized;
    constructor(config?: ConfigMigratorConfig);
    /**
     * Initialize config migrator
     */
    initialize(): Promise<void>;
    /**
     * Register a configuration transform
     */
    registerTransform(transform: ConfigTransform): void;
    /**
     * Register multiple transforms
     */
    registerTransforms(transforms: ConfigTransform[]): void;
    /**
     * Get all registered transforms sorted by version
     */
    getTransforms(): ConfigTransform[];
    /**
     * Get transforms between two versions
     */
    getTransformsBetween(fromVersion: string, toVersion: string): ConfigTransform[];
    /**
     * Load configuration from file
     */
    loadConfig(): Promise<Record<string, unknown> | null>;
    /**
     * Save configuration to file
     */
    saveConfig(config: Record<string, unknown>): Promise<void>;
    /**
     * Create a backup of the current configuration
     */
    createBackup(): Promise<string | null>;
    /**
     * Restore configuration from backup
     */
    restoreFromBackup(backupPath: string): Promise<boolean>;
    /**
     * List available backups
     */
    listBackups(): Promise<string[]>;
    /**
     * Get configuration version
     */
    getConfigVersion(config: Record<string, unknown>): string;
    /**
     * Set configuration version
     */
    setConfigVersion(config: Record<string, unknown>, version: string): Record<string, unknown>;
    /**
     * Migrate configuration to target version
     */
    migrate(targetVersion: string): Promise<ConfigMigrationResult>;
    /**
     * Detect changes between two config objects
     */
    private detectChanges;
    /**
     * Validate configuration against schema
     */
    validateConfig(config: Record<string, unknown>, requiredFields?: string[]): {
        valid: boolean;
        errors: string[];
    };
    /**
     * Apply default values to configuration
     */
    applyDefaults(config: Record<string, unknown>, defaults: Record<string, unknown>): Record<string, unknown>;
    /**
     * Remove deprecated fields from configuration
     */
    removeDeprecatedFields(config: Record<string, unknown>, deprecated: string[]): Record<string, unknown>;
    /**
     * Rename field in configuration
     */
    renameField(config: Record<string, unknown>, oldName: string, newName: string): Record<string, unknown>;
    /**
     * Check if initialized
     */
    isInitialized(): boolean;
    /**
     * Dispose resources
     */
    dispose(): void;
}
/**
 * Get or create config migrator
 */
export declare function getConfigMigrator(config?: ConfigMigratorConfig): ConfigMigrator;
/**
 * Reset config migrator singleton
 */
export declare function resetConfigMigrator(): void;
export default ConfigMigrator;
