/** * Building a `` column in RAM (Engine 1). * * Split out of build.ts, which had grown past the file-size limit, and this is * the piece that earned its own file: a switch is the only construct whose * branches each own a DIFFERENT SUBSET of the rows, so it carries rules nothing * else needs — which rows a branch draws over, in what order, and when it must * fall back to the whole run to keep the streaming engine's answer. */ import type { SequenceBuildContext } from './context.js'; import type { CaseSpec, Sequence, SequenceRegistry, SequenceSpec, SwitchSpec } from './types.js'; /** * Switch sequence (in-memory / Engine 1): build each entry's value-producer * over all rows, then per row look the subject sequence's value up in the * entries' keys — the FIRST entry whose keys contain it wins. No match → the * `` value (if any), else empty. Like the conditional sequence, each * entry is built over the full row count; the subject just selects which * entry's value is used for the row. */ export declare function materializeSwitch(spec: SequenceSpec, switchSpec: SwitchSpec, registry: SequenceRegistry, count: number, prng: () => number, locale: string, now: number, ctx: SequenceBuildContext): Sequence; /** Does this `` body declare a share that the denominator has to be right for? */ export declare function caseCarriesPercent(body: CaseSpec | undefined): boolean; /** * A `` written inside a `` — the nested form, which contributes a * value rather than a column. * * It looks its subject up over THE ROWS OF THE BRANCH IT SITS IN. `ctx` already * carries those rows and this part's stream name, so position `i` here is the * same cell the streaming engine resolves at `absoluteRow(ctx, i)`. * * A branch of a nested switch is never RANKED. Its rows are an intersection of * two partitions — the enclosing branch's, and the inner subject's — and the * streaming engines cannot number an intersection one row at a time. So the same * rule the top level already uses applies here: * * - **The branch declares a share.** The streaming engines refuse it, the router * sends the config to this engine, and the quota goes over the branch's own * rows, where it is exact. * - **It declares no share.** Built over the enclosing branch's rows, which is * what the streaming engines do, so the two agree row for row. */ export declare function buildNestedSwitchValues(switchSpec: SwitchSpec, count: number, prng: () => number, locale: string, now: number, ctx: SequenceBuildContext): string[]; //# sourceMappingURL=switch-build.d.ts.map