/**
 * Template Applicator
 *
 * Applies templates to plugin configurations with variable input,
 * preview, backup, and rollback support.
 *
 * @since v1.69.2
 */
import type { ConfigTemplate, RenderedFile, TemplateApplyResult, TemplateVariableValues } from './template-types.js';
/**
 * Conflict resolution strategy
 */
export type ConflictStrategy = 'overwrite' | 'backup' | 'merge' | 'skip';
/**
 * File conflict information
 */
export interface FileConflict {
    path: string;
    existingContent: string;
    newContent: string;
    differences: FileDifference[];
}
/**
 * File difference
 */
export interface FileDifference {
    line: number;
    type: 'add' | 'remove' | 'change';
    oldValue?: string;
    newValue?: string;
}
/**
 * Application options
 */
export interface ApplicationOptions {
    conflictStrategy?: ConflictStrategy;
    createBackup?: boolean;
    backupSuffix?: string;
    dryRun?: boolean;
    selectedFiles?: string[];
}
/**
 * Application preview result
 */
export interface ApplicationPreview {
    files: PreviewFile[];
    conflicts: FileConflict[];
    newFiles: string[];
    modifiedFiles: string[];
    unchangedFiles: string[];
}
/**
 * Preview file information
 */
export interface PreviewFile {
    path: string;
    content: string;
    isNew: boolean;
    hasConflict: boolean;
    differences: FileDifference[];
}
/**
 * Rollback information
 */
export interface RollbackInfo {
    templateId: string;
    appliedAt: string;
    backupFiles: Array<{
        original: string;
        backup: string;
    }>;
    newFiles: string[];
}
/**
 * Template applicator service
 */
export declare class TemplateApplicator {
    private engine;
    private validator;
    private existingFiles;
    private rollbackHistory;
    constructor();
    /**
     * Set existing file contents for conflict detection
     */
    setExistingFiles(files: Map<string, string> | Record<string, string>): void;
    /**
     * Preview template application
     */
    preview(template: ConfigTemplate, variables: TemplateVariableValues, options?: ApplicationOptions): ApplicationPreview | null;
    /**
     * Apply template to create files
     * Note: Actual file writing should be done by caller
     */
    apply(template: ConfigTemplate, variables: TemplateVariableValues, options?: ApplicationOptions): TemplateApplyResult;
    /**
     * Get rendered files for writing
     */
    getRenderedFiles(template: ConfigTemplate, variables: TemplateVariableValues): RenderedFile[] | null;
    /**
     * Get files that need backup
     */
    getBackupFiles(template: ConfigTemplate, variables: TemplateVariableValues): string[];
    /**
     * Get rollback information
     */
    getRollbackInfo(): RollbackInfo[];
    /**
     * Get last rollback info
     */
    getLastRollback(): RollbackInfo | undefined;
    /**
     * Can rollback the last application
     */
    canRollback(): boolean;
    /**
     * Pop and return rollback info for actual rollback
     */
    popRollback(): RollbackInfo | undefined;
    /**
     * Clear rollback history
     */
    clearRollbackHistory(): void;
    /**
     * Generate diff-like output for preview
     */
    generateDiffOutput(conflict: FileConflict): string;
    private calculateDifferences;
}
/**
 * Create a new template applicator
 */
export declare function createTemplateApplicator(): TemplateApplicator;
//# sourceMappingURL=template-applicator.d.ts.map