import { type AstDocument, type LoadedGraph } from "@telorun/analyzer"; import type { RenamePreparation, RenameResult } from "./types.js"; /** * Rename a name and every reference to it. * * **This is a refactor, not a fix**, and the distinction is the reason it lives * here rather than behind a `DiagnosticFix`. A fix is a whole-value replacement * for ONE node, verified by the diagnostic that produced it; a rename is only * correct when every reference moves with it, which means the operation's unit * is the reference graph, not the node. Renaming `metadata.name` alone leaves * every `!ref`, `resources.` and `steps..result` pointing at a name * that no longer exists — so a rename offered as a quick fix would break the * file it claimed to repair. * * **Three renameable surfaces, and every other one is an explicit refusal.** * What they have in common is that their reference set is *enumerable from this * workspace*: a resource instance, a step, and a `variables:` / `secrets:` / * `ports:` key are all module-local. A kind name, a module name and an import * alias are not supported yet — their references reach schema annotations * (`x-telo-ref`, `extends`, `exports.kinds`) as alias-qualified halves of a * larger value, which is a materially bigger surface than a bare identifier and * wants its own pass. * * **A name in `exports.resources` is refused outright**, and that is the load- * bearing refusal. Such a name is the library's public ABI: a consumer writes * `!ref Alias.name` and reads `resources.Alias.name`, in files this workspace * may not contain and, for a published consumer, cannot. Renaming it is a * breaking change to be *versioned*, not an edit to be applied — and a rename * box that silently ships one would be the worst available framing. * * **Ambiguity is refused rather than guessed.** A name declared twice in reach * (a `with:`-scoped resource shadowing a module-level one, two steps in one * resource sharing a spelling) has references that resolve to different * declarations, and no edit set is right for both. */ export declare function prepareRename(text: string, line: number, character: number, graph: LoadedGraph, currentFilePath: string, docs?: AstDocument[]): RenamePreparation; /** Prepare, validate the new name, then collect every edit. */ export declare function buildRename(text: string, line: number, character: number, newName: string, graph: LoadedGraph, currentFilePath: string, docs?: AstDocument[]): RenameResult; //# sourceMappingURL=build-rename.d.ts.map