import { StringEdit } from '../../../util/vs/editor/common/core/edits/stringEdit'; import { PositionOffsetTransformer } from '../../../util/vs/editor/common/core/text/positionToOffset'; /** * Resolves the current content of a line after applying an intermediate * user edit to the original document. * * The line's 0-based index in the original document may no longer be * valid after the user inserts or deletes lines above it. This function * maps the line's character offset through the edit to find the correct * line in the resulting document. * * @param originalDoc A transformer for the original document text (reused to * avoid recomputing line offsets). * @param docLineIdx 0-based line index in the original document. * @returns The line content, or `undefined` if the line index is out of * bounds or the original position falls inside a replacement range * (making the mapping ambiguous). */ export declare function getCurrentLine(originalDoc: PositionOffsetTransformer, docLineIdx: number, intermediateEdit: StringEdit, precomputed?: { currentDoc: string; currentTransformer: PositionOffsetTransformer; }): string | undefined; /** * Checks whether the model's line output is compatible with what the user * has typed since the request started. * * Algorithm: * 1. Diff original → current to find what the user typed. * 2. Diff original → model to find what the model changed. * 3. If the user's edit range falls within the model's edit range, check whether * the model's new text is a continuation of the user's typing. * * @example * original: `function fi`, current: `function fib`, model: `function fibonacci(n): number` * → user typed "b", model inserted "bonacci(n): number" * → model text starts with "b" → compatible ✓ * * @example * original: `function fi`, current: `function fix`, model: `function fibonacci(n): number` * → user typed "x", model inserted "bonacci(n): number" * → model text does not start with "x" → incompatible ✗ */ export declare function isModelLineCompatible(originalLine: string, currentLine: string, modelLine: string): boolean; //# sourceMappingURL=cursorLineDivergence.d.ts.map