import { ICodeEditor, IRange, ITextModel } from '@opensumi/ide-monaco'; /** * @internal */ export interface IMultiLineDiffChangeResult { added?: boolean; removed?: boolean; value: string; } interface IResultWithCount extends IMultiLineDiffChangeResult { count: number; } declare class MultiLineDiffComputer { private extractCommon; protected equals(a: string, b: string | undefined): boolean; protected tokenize(content: string): string[]; diff(originalContent: string, modifiedContent: string): IResultWithCount[] | undefined; } declare class RewriteDiffComputer extends MultiLineDiffComputer { equals(a: string, b: string): boolean; tokenize(content: string): string[]; } export declare const multiLineDiffComputer: MultiLineDiffComputer; export declare const rewriteDiffComputer: RewriteDiffComputer; export declare const mergeMultiLineDiffChanges: (lines: IMultiLineDiffChangeResult[], eol: string) => IMultiLineDiffChangeResult[]; /** * 根据原始内容和要修改的内容,返回字符级或单词级的差异 */ export declare const computeMultiLineDiffChanges: (originalContent: string, modifiedContent: string, monacoEditor: ICodeEditor, lineNumber: number, eol: string) => { singleLineCharChanges: IMultiLineDiffChangeResult[]; charChanges: IMultiLineDiffChangeResult[]; wordChanges: IMultiLineDiffChangeResult[]; isOnlyAddingToEachWord: boolean; }; /** * 将单词级别的 change 转换为行级别的 change 映射 */ export declare const wordChangesToLineChangesMap: (wordChanges: IMultiLineDiffChangeResult[], range: IRange, model: ITextModel | null) => { [lineNumber: number]: IMultiLineDiffChangeResult[][]; }; export {}; //# sourceMappingURL=diff-computer.d.ts.map