import { type AstDocument } from "@telorun/analyzer"; /** * Every place a name is written, found over the read-only YAML AST plus the CEL * AST inside each scalar. Document offsets in, document offsets out — the * caller maps them to `Range`s once, with the line table it already built. * * **Offsets rather than ranges, and a flat list rather than a tree**, because * the two things a rename must guarantee are that no site is missed and that no * two edits overlap. Both are properties of a flat, sorted offset list, and * neither is checkable once the sites have been shaped per-feature. * * A `!ref` scalar's own range is its VALUE, excluding the tag (`!ref other` → * the span of `other`), so a local reference is a whole-node replacement. A CEL * identifier is a sub-span of its scalar, taken from `propertyRange` — which the * analyzer's `CelNode` has carried since it was written, for exactly this. */ export interface NameSite { /** `[start, end]` in document offsets — the identifier alone, never the * enclosing scalar or the `!ref`/`!cel` tag. */ range: [number, number]; } /** A resource's references within one document: `!ref ` (and its `Self.` * form) plus `resources.` in CEL. */ export declare function resourceSites(doc: AstDocument, name: string): NameSite[]; /** A step's references within its declaring document: `steps.` in CEL. * Deliberately document-scoped — `steps..result` is readable only inside * the resource whose body declares the step, and a resource is one document. */ export declare function stepSites(doc: AstDocument, name: string): NameSite[]; /** A `variables:` / `secrets:` / `ports:` entry's reads: `.`. */ export declare function declarationSites(doc: AstDocument, block: string, name: string): NameSite[]; /** * Every map in a document that declares a resource named `name` — a `kind:` * beside a `metadata.name`. * * Used to detect a **shadowing scope declaration**: a resource declared inside * another's `x-telo-scope` array shadows a module-level name of the same * spelling within that scope's regions, so renaming the module-level one must * not rewrite references that resolve to the scoped one. Detected structurally * rather than by reading `x-telo-scope` off the kind's schema, because the * question a rename needs answered is "is this spelling declared more than once * in reach", which is true of any nested declaration whether or not the slot * carrying it is annotated. */ export declare function resourceDeclarations(doc: AstDocument, name: string): Array<[number, number]>; /** Every step in a document declaring `name:` — the span of the name scalar. * More than one means the spelling is ambiguous within the resource, which is * a refusal rather than a guess. */ export declare function stepDeclarations(doc: AstDocument, name: string): Array<[number, number]>; //# sourceMappingURL=find-sites.d.ts.map