import type { Range, TextEdit, WorkspaceEdit } from "./types";
/**
 * Apply text edits to a string in-memory.
 * Edits are applied in reverse order (bottom-to-top) to preserve line/character indices.
 */
export declare function applyTextEditsToString(content: string, edits: TextEdit[]): string;
/** True when two ranges overlap (share any position other than a touching boundary). */
export declare function rangesOverlap(a: Range, b: Range): boolean;
/**
 * Sort edits bottom-to-top for in-place application and reject overlaps.
 * Equal start positions tiebreak by original array index descending so that,
 * applied bottom-up, inserts at the same position land in array order
 * (LSP spec: the order of edits in the array defines the order in the result).
 */
export declare function sortAndValidateTextEdits(edits: TextEdit[]): TextEdit[];
/**
 * Flatten a WorkspaceEdit's text edits into a Map<uri, TextEdit[]>.
 * Resource operations (create/rename/delete) are ignored — callers handle them separately.
 */
export declare function flattenWorkspaceTextEdits(edit: WorkspaceEdit): Map<string, TextEdit[]>;
/**
 * Apply text edits to a file.
 * Edits are applied in reverse order (bottom-to-top) to preserve line/character indices.
 */
export declare function applyTextEdits(filePath: string, edits: TextEdit[]): Promise<void>;
/**
 * Apply a workspace edit (collection of file changes).
 * All text-edit batches are overlap-validated before anything is written so a
 * conflict throws without leaving the workspace half-applied.
 * Returns array of applied change descriptions.
 */
export declare function applyWorkspaceEdit(edit: WorkspaceEdit, cwd: string): Promise<string[]>;
