import { type AstDocument, type Range } from "@telorun/analyzer"; /** One `imports:` map entry, located in the source text. * * `source` is the *folded* form — an object-form `integrity:` sibling is * folded into the source string as a `#sha256-…` fragment, exactly as * `inlineImportManifests` does, so callers reason about a single * representation regardless of which shape the author wrote. */ export interface ImportEntry { alias: string; /** The source with any `integrity:` sibling folded in as a fragment. */ source: string; /** Span of the alias key — where a per-entry affordance anchors. */ keyRange: Range; /** Span of the source scalar's value: the entry value itself for the scalar * shorthand, the `source:` value for the object form. Replacing this span * re-points the import. */ sourceRange: Range; /** Where an object-form `integrity:` sibling sits, when the entry declares * one. Absent for the scalar shorthand — there the pin rides inside * `sourceRange` as a `#sha256-…` fragment — and for an unpinned entry. */ integrity?: ImportEntryIntegrity; } /** The two spans a caller needs to act on an object-form `integrity:`: one to * re-pin it, one to remove it. They are separate because a flow-style map * (`{source: …, integrity: …}`) supports the first and not the second. */ export interface ImportEntryIntegrity { /** Span of the hash value itself. Replacing it re-pins the entry in the shape * the author wrote, in any YAML style. */ valueRange: Range; /** Whole-line span of the `integrity:` entry including its trailing newline, * so a caller with no replacement hash can delete the line outright. Absent * when the pair shares a line with other content, where removing it would * need a structural rewrite rather than a line splice. */ lineRange?: Range; } /** Where the `imports:` map lives in a module document. */ export interface ImportsBlock { /** Span of the `imports:` key — where a summary affordance anchors. */ keyRange: Range; entries: ImportEntry[]; } /** Locate the `imports:` map of the file's module document (`Telo.Application` * / `Telo.Library`). Returns `undefined` when the file declares no module doc * or the doc has no `imports:` map — a partial file, or a module with no * dependencies. * * Reads the AST rather than the analyzer's flattened manifests because the * affordances built on top of this write back to the source: the exact span of * each source scalar is the deliverable, not the resolved value. */ export declare function findImportEntries(text: string, docs: AstDocument[], lineOffsets: number[]): ImportsBlock | undefined; //# sourceMappingURL=find-import-entries.d.ts.map