/**
 * Unified Diff Editor - Aider-inspired code editing system
 *
 * Based on research from Aider's unified diff format:
 * - 3X better edit quality than search/replace
 * - NO line numbers (LLMs fail at them consistently)
 * - Treats each hunk as a search/replace operation
 * - Flexible matching with normalization
 *
 * Key insight from Aider: Line numbers are unreliable because:
 * 1. LLMs hallucinate line numbers
 * 2. Context shifts invalidate line numbers
 * 3. Users can't easily verify line numbers
 */
export interface DiffHunk {
    searchText: string;
    replaceText: string;
    contextBefore?: string;
    contextAfter?: string;
}
export interface DiffOperation {
    filePath: string;
    hunks: DiffHunk[];
    createIfMissing?: boolean;
}
export interface DiffResult {
    success: boolean;
    filePath: string;
    hunksApplied: number;
    hunksFailed: number;
    errors: string[];
    diff?: string;
    backup?: string;
}
export interface MatchResult {
    found: boolean;
    startIndex: number;
    endIndex: number;
    matchedText: string;
    confidence: number;
}
/**
 * Unified Diff Editor class
 * Applies edits using search/replace patterns without line numbers
 */
export declare class UnifiedDiffEditor {
    private backupDir;
    private enableBackups;
    private fuzzyMatchThreshold;
    private vfs;
    constructor(options?: {
        backupDir?: string;
        enableBackups?: boolean;
        fuzzyMatchThreshold?: number;
    });
    /**
     * Apply a diff operation to a file
     */
    applyDiff(operation: DiffOperation): Promise<DiffResult>;
    /**
     * Apply a single hunk to content
     */
    private applyHunk;
    /**
     * Find exact match for search text
     */
    private findExactMatch;
    /**
     * Find fuzzy match using line-by-line comparison
     */
    private findFuzzyMatch;
    /**
     * Find match with whitespace normalization
     */
    private findNormalizedMatch;
    /**
     * Normalize whitespace for matching
     */
    private normalizeWhitespace;
    /**
     * Map position from normalized text back to original
     */
    private mapNormalizedPosition;
    /**
     * Calculate similarity between two strings (0-1)
     */
    private calculateSimilarity;
    /**
     * Create a backup of the original file
     */
    private createBackup;
    /**
     * Generate unified diff for display
     */
    private generateDiff;
    /**
     * Truncate string for display
     */
    private truncate;
    /**
     * Parse a unified diff string into operations
     */
    static parseDiff(diffString: string): DiffOperation[];
    /**
     * Parse hunk content into search/replace texts
     */
    private static parseHunkContent;
    /**
     * Restore from backup
     */
    restoreBackup(backupPath: string, originalPath: string): Promise<boolean>;
    /**
     * List available backups for a file
     */
    listBackups(filePath: string): Promise<string[]>;
}
export declare function getUnifiedDiffEditor(options?: {
    backupDir?: string;
    enableBackups?: boolean;
    fuzzyMatchThreshold?: number;
}): UnifiedDiffEditor;
export declare function resetUnifiedDiffEditor(): void;
