import type { WorkspaceEdit } from "../safety/transaction.js"; import type { LspTextEdit, LspWorkspaceEdit } from "./types.js"; /** * Rename preview & transactional refactoring support. * * `lsp_rename_preview` produces a structured proposed transaction with ZERO * physical mutations. Applying the rename uses Jensen 1.3.0 transactional * mutation (policy → lease → checkpoint → deterministic edit application → * validation → confirm/rollback). */ export interface RenameFileEdit { workspaceRelativePath: string; absolutePath: string; newContent: string; contentHashBefore: string; editCount: number; } export interface RenamePreview { symbol: string; oldName: string; newName: string; affectedFiles: RenameFileEdit[]; totalEditCount: number; conflicts: string[]; unsupportedResourceOperations: string[]; transactionId: string | null; zeroMutation: true; } export interface ApplyTextEditOptions { preserveBom?: boolean; } /** Apply LSP text edits to file content (later offsets first). UTF-16-aware. */ export declare function applyTextEdits(content: string, edits: LspTextEdit[], opts?: ApplyTextEditOptions): { newContent: string; conflicts: string[]; }; declare function sha256Content(content: string): string; /** * Read the current content of a file (workspace path, absolute), apply edits, * and return the new content plus hash preconditions. Edits outside the * workspace root are rejected. */ export declare function previewFileEdits(absPath: string, workspaceRoot: string, edits: LspTextEdit[]): Promise; /** * Normalize an LSP WorkspaceEdit into a preview. Resource operations * (create/rename/delete files) are reported as unsupported unless represented * safely; here they are surfaced but excluded from the transactional snapshot * so no physical change occurs. */ export declare function normalizeWorkspaceEditForPreview(edit: LspWorkspaceEdit, workspaceRoot: string, symbol: string, oldName: string, newName: string): { version: string; preview: RenamePreview; }; export { sha256Content }; /** Translate a normalized LSP edit set into Jensen transactional WorkspaceEdits. */ export declare function buildJensenWorkspaceEdits(byPath: Map, workspaceRoot: string): Promise<{ edits: WorkspaceEdit[]; contentHashes: Record; }>; /** Extract the per-absolute-path edit map from an LSP WorkspaceEdit. */ export declare function extractEditsByPath(edit: LspWorkspaceEdit, workspaceRoot: string): { byPath: Map; conflicts: string[]; unsupported: string[]; }; //# sourceMappingURL=rename.d.ts.map