/** * Weighted-quota helpers for the streaming builder. * * These share one shape: a value's share is an exact quota over the WHOLE * column, so the streaming engine — which resolves one row at a time — must * plan it up front and map each row into it by index, never decide it from a * single-cell draw. Kept out of stream-build.ts to hold that file under its * line ceiling; all pure, no engine state. */ import { type NumberLengthChoice } from '../generators/number.js'; import type { PackEntry } from '../data-pack/load.js'; import type { GenSpec, SequenceSpec } from './types.js'; import type { DataSourceOptions } from '../data-source/resolve.js'; /** * The length groups of a weighted ``, or undefined when this gen is not one. Anything malformed is * left to the validator and the generator itself — this only decides whether * the quota path applies. */ export declare function numberLengthChoicesOf(gen: GenSpec): readonly NumberLengthChoice[] | undefined; /** * The same gen pinned to ONE length group, with `percent` dropped so the * per-row builder cannot re-run the split it has already lost the context for. */ export declare function pinLength(gen: GenSpec, group: NumberLengthChoice): GenSpec; /** * A `` pointing at a WEIGHTED pack, as {values, percents}, * or undefined for a plain template / non-template gen. Resolves the pack * address the same way the in-memory builder does, so both engines draw the * same pack by the same quota. */ /** * A pack whose BODY apportions a share over the whole column, as the parts the * lazy builder needs to run it: the body's own sequences and the text they are * assembled into. * * A single `` body comes back as a one-sequence body under a * fixed name, so both shapes take one road from here. A body carrying its own * `` comes back as nothing: rejecting a row and redrawing it is a * whole-column decision with no lazy form yet, and the caller refuses it. */ export declare function wholeColumnPackBody(gen: GenSpec, packs: ReadonlyMap | undefined, locale: string): { sequences: readonly SequenceSpec[]; output: string; inject: string; } | undefined; /** * The value list of a PLAIN pack — one that declares no weights — or undefined * when the gen is not that. Laid out in equal shares over the column exactly as * a plain text list is; a per-row pick left every value's count to chance, and * inside a `` that chance decided whether the run collects. */ export declare function plainTemplatePack(gen: GenSpec, packs: ReadonlyMap | undefined, locale: string): string[] | undefined; /** * The value list of a PLAIN file — no weights, no quantile read — or undefined. * An unreadable file is deferred, not reported: the lazy contract says a * missing source fails when a row first touches it, never at plan time. */ export declare function plainFileList(gen: GenSpec, weightColumn: string | undefined, dataSources: DataSourceOptions): string[] | undefined; /** * The weighted list a column lays out — the pack's own, or the file's when a * `weight=` column names one — or undefined for a plain list. */ export declare function weightedListOf(gen: GenSpec, weightColumn: string | undefined, weightedPack: { values: string[]; percents: number[]; } | undefined, dataSources: DataSourceOptions): { values: string[]; percents: number[]; } | undefined; /** A plain pack's or plain file's value list — whichever the gen is — or undefined. */ export declare function plainListOf(gen: GenSpec, packs: ReadonlyMap | undefined, locale: string, weightColumn: string | undefined, dataSources: DataSourceOptions): string[] | undefined; export declare function weightedTemplatePack(gen: GenSpec, packs: ReadonlyMap | undefined, locale: string): { values: string[]; percents: number[]; } | undefined; //# sourceMappingURL=stream-weighted.d.ts.map