import type { SourceRange } from '../seam/types'; /** Why a candidate could not be node-aligned (the five §4 Gate 4 drop reasons). */ export type AlignDropReason = 'not-found' | 'ambiguous' | 'non-node-aligned' | 'not-an-expression' | 'not-expression-placeable'; /** A successful alignment: the node's Stryker range + the verbatim sub-expression. */ interface AlignSuccess { /** The exactly-aligned EXPRESSION node's 0-based Stryker range. */ range: SourceRange; /** * The sub-expression's CURRENT source text (flows onto `Replacement.original`): * the candidate's own spelling on a verbatim match, the node's source on a * structural one. */ original: string; /** * True when the node was re-found by AST SHAPE rather than verbatim (the * STRUCTURAL FALLBACK in the module header) — a purchased candidate replayed * against respelled source. Counted per call next to the drop reasons. */ recovered: boolean; } /** A dropped candidate: the reason it could not be node-aligned. */ interface AlignDrop { /** Discriminant so callers branch on success vs. drop without a null check. */ dropped: true; /** Which of the five §4 Gate 4 conditions failed. */ reason: AlignDropReason; } /** The result of {@link alignCandidateRange}: a success or a typed drop. */ export type AlignResult = AlignSuccess | AlignDrop; /** * Derive a candidate's true {@link SourceRange} + `original` by locating its * sub-expression inside the enclosing function (verbatim, else structurally) and * node-aligning it. NEVER trusts LLM coordinates — the range comes from OUR OWN * parse. * * @param fileContent The FULL file source text. * @param fnStartOffset The enclosing function's absolute char START offset. * @param fnEndOffset The enclosing function's absolute char END offset (exclusive). * @param original The candidate's sub-expression as the model spelled it. * @returns {@link AlignSuccess} with the EXPRESSION node's range and its CURRENT * source text, or an {@link AlignDrop} carrying one of the five drop reasons. */ export declare function alignCandidateRange(fileContent: string, fnStartOffset: number, fnEndOffset: number, original: string): AlignResult; export {};