/** * @file * * The minimal line diff Obsidian's Markdown edit view dispatches when it is handed new text for the file it is * already showing. It backs `MarkdownEditView.set`, which is what `MarkdownView.setViewData` delegates to. */ import type { Editor } from '../../obsidian/Editor.cjs'; /** * Replaces an editor's text the way Obsidian's Markdown edit view does when the file it is showing has changed * underneath it, rather than by replacing the whole document. * * The old and new texts are compared line by line: the common leading lines are trimmed, then the common trailing * ones, and when exactly one line differs the change is narrowed further to the characters that differ within it. * The one resulting change is dispatched through {@link Editor.transaction}, so the selection is mapped through it * and a cursor outside the changed range does not move. Identical text dispatches nothing at all, and so records no * undo step. * * @param editor - The editor to change. * @param data - The new text. `\r\n` breaks are normalized to `\n`, as they are on the way into CodeMirror. */ export declare function setMarkdownEditorText(editor: Editor, data: string): void;