import type { Dialect } from "../dialect.js"; import { type TemplatedParseResult } from "./parse.js"; import { type TemplateRegion } from "./regions.js"; /** One enumerated branch alternative of a template — a coherent, lazily-parsed variant. */ export interface TemplateVariant { /** * The one non-default arm this variant activates; undefined for variant 0 (all * defaults). `syntheticEmpty`: the region's body is wholly absent in this * realization (the synthetic empty-else arm — see file header); `armIndex` is 0 as * a type-stable placeholder — the discriminator is `syntheticEmpty`, never the * index. (0 collides with nothing: real non-default arms start at 1, and keeping * `armIndex` REQUIRED keeps the anvil channel contract additive.) */ active?: { region: TemplateRegion; armIndex: number; syntheticEmpty?: true; }; /** * This variant's realized source: the ORIGINAL text with every inactive arm's body * whitespace-blanked (identical length, newlines at identical offsets). Lazy + memoized * separately from `parse()` — calling `text()` alone never forces a parse. */ text(): string; /** Parse this variant (lazy + memoized). Coordinates are ORIGINAL-document; inactive arm bodies are whitespace-blanked. */ parse(): TemplatedParseResult; } /** * Enumerate the arm-coverage branch variants of a dbt template (see file header). * Linear in total arm count; each variant is a coherent, lazily-parsed alternative. * Total — never throws on any input. */ export declare function templateVariants(text: string, dialect: Dialect): TemplateVariant[];