import { MarkdownTextChange } from './types'; /** Sorted by position; drops no-ops. Overlapping changes are a caller bug and are clipped. */ export declare function normalizeChanges(changes: readonly MarkdownTextChange[]): MarkdownTextChange[]; export declare function changeLengthDelta(changes: readonly MarkdownTextChange[]): number; export declare function applyMarkdownChanges(doc: string, changes: readonly MarkdownTextChange[]): string; /** The change set that undoes `changes`, relative to the document after them. */ export declare function invertMarkdownChanges(doc: string, changes: readonly MarkdownTextChange[]): MarkdownTextChange[]; /** * Where `pos` lands after `changes`. A position inside a replaced span goes to * its start (`assoc` -1) or past the inserted text (`assoc` 1); a pure insert * at `pos` only pushes it along when `assoc` is 1. */ export declare function mapMarkdownPosition(pos: number, changes: readonly MarkdownTextChange[], assoc?: -1 | 1): number; /** * Rebase two change sets made concurrently against one document of * `docLength`. Returns `[a', b']`: applying `a` then `b'` and `b` then `a'` * give the same text. On an insert tie, `a`'s text comes first. */ export declare function transformMarkdownChanges(a: readonly MarkdownTextChange[], b: readonly MarkdownTextChange[], docLength: number): [MarkdownTextChange[], MarkdownTextChange[]]; /** One change set equivalent to `a` followed by `b` (`b` relative to the document after `a`). */ export declare function composeMarkdownChanges(a: readonly MarkdownTextChange[], b: readonly MarkdownTextChange[], docLength: number): MarkdownTextChange[]; /** The smallest single replacement turning `before` into `after`, or null when equal. */ export declare function diffMarkdown(before: string, after: string): MarkdownTextChange | null;