import { Extension, StateField } from '@codemirror/state';
import { diffWords, diffChars } from 'diff';
import { LineMapping } from '../types';
/** Word diff data for a line */
export interface WordDiffData {
    lineNumber: number;
    ranges: WordDiffRange[];
}
/** A range within a line that was changed */
export interface WordDiffRange {
    from: number;
    to: number;
    type: 'added' | 'removed';
}
/** Effect to set word diff data */
export declare const setWordDiffDataEffect: import('@codemirror/state').StateEffectType<WordDiffData[]>;
/** State field for word diff data */
export declare const wordDiffDataField: StateField<WordDiffData[]>;
/**
 * Compute word-level diff between two strings.
 * Returns ranges of changes within each string.
 *
 * Strips common leading whitespace before diffing so that
 * `diffWords` doesn't treat the indent as part of a changed token
 * when only a single word follows (e.g. "    photoUrl:" vs "    imageUrl:").
 */
export declare function computeWordDiff(before: string, after: string, mode?: 'word' | 'char'): {
    beforeRanges: WordDiffRange[];
    afterRanges: WordDiffRange[];
};
/**
 * Build word diff data for modified lines.
 *
 * Handles two cases:
 * 1. Lines with type 'modified' (both sides on the same row)
 * 2. Paired remove+add lines linked by pairId (split rows for height alignment)
 *
 * @param lineMap - Line mappings with before/after correspondence
 * @param beforeLines - Content of before lines
 * @param afterLines - Content of after lines
 * @param side - Which side to generate data for
 * @param mode - Diff mode ('word' or 'char')
 */
export declare function buildWordDiffData(lineMap: LineMapping[], beforeLines: string[], afterLines: string[], side: 'before' | 'after', mode?: 'word' | 'char'): WordDiffData[];
/**
 * Build word diff data from before/after content strings for modified lines.
 * Uses a simpler approach when we have line-by-line content.
 */
export declare function buildWordDiffDataFromContent(lineMap: LineMapping[], beforeContent: string, afterContent: string, side: 'before' | 'after', mode?: 'word' | 'char'): WordDiffData[];
/**
 * Build word diff data for inline/unified view where modified lines
 * show inline changes. Uses beforeContentMap from generateUnifiedContentFromDiff.
 *
 * @param lines - The unified content lines
 * @param lineMap - Line mappings
 * @param beforeContentMap - Map of line index to before content for modified lines
 * @param mode - Diff mode ('word' or 'char')
 */
export declare function buildInlineWordDiffData(lines: string[], lineMap: LineMapping[], beforeContentMap: Map<number, string>, mode?: 'word' | 'char'): WordDiffData[];
/** Theme for word-level diff highlighting */
export declare const wordDiffTheme: Extension;
/** Create the word diff extension */
export declare function wordDiff(): Extension;
export { diffWords, diffChars };
