import { Extension } from '@codemirror/state'; import { EditorView } from '@codemirror/view'; import { CoordinatorOptions, DiffConfig, DiffData, DiffPairResult } from './types'; /** * Creates a combined diff extension for a single CodeMirror editor. * This is the main entry point for adding diff visualization to an existing editor. * * @param data - The diff data containing blocks, line mappings, and block mappings * @param config - Optional configuration overrides * @returns An Extension array to add to a CodeMirror editor * * @example * ```typescript * import { EditorView } from '@codemirror/view' * import { diff } from './codemirror' * * const view = new EditorView({ * doc: content, * extensions: [ * basicSetup, * diff(diffData, { side: 'after', showGutter: true }), * ], * parent: container, * }) * ``` */ export declare function diff(data: DiffData, config?: Partial): Extension; /** * Creates a paired side-by-side diff view with two synchronized editors. * * @param beforeParent - DOM element to mount the "before" editor * @param afterParent - DOM element to mount the "after" editor * @param beforeContent - Content for the "before" editor * @param afterContent - Content for the "after" editor * @param diffData - The diff data * @param config - Optional configuration * @returns DiffPairResult containing both editors and a coordinator * * @example * ```typescript * const { before, after, coordinator, destroy } = createDiffPair( * document.getElementById('before'), * document.getElementById('after'), * beforeYaml, * afterYaml, * diffData, * { showGutter: true, syncScroll: true } * ) * * // Navigate * coordinator.goToNextChange() * * // Cleanup * destroy() * ``` */ export declare function createDiffPair(beforeParent: HTMLElement, afterParent: HTMLElement, beforeContent: string, afterContent: string, diffData: DiffData, config?: Partial, coordinatorOptions?: CoordinatorOptions): DiffPairResult; /** * Creates a unified inline diff view with a single editor. * * @param parent - DOM element to mount the editor * @param unifiedContent - The unified content (typically the "after" content with annotations) * @param diffData - The diff data * @param config - Optional configuration * @returns The EditorView instance * * @example * ```typescript * const view = createUnifiedDiff( * document.getElementById('diff'), * unifiedContent, * diffData, * { showGutter: true } * ) * ``` */ export declare function createUnifiedDiff(parent: HTMLElement, unifiedContent: string, diffData: DiffData, config?: Partial): EditorView;