/** * `uniq="true"` enforcement, and the redraw that rescues an unlucky draw. * * Split out of `build.ts` when that file hit its line ceiling; the logic here * is self-contained apart from one hook. `enforceUniqRedrawing` needs to draw * fresh values, which `build.ts` knows how to do and this module must not * import back — so the caller passes a `Redraw` closure over its own PRNG, * locale and context. */ import type { GenSpec, SequenceSpec } from './types.js'; /** Draw `count` fresh values for one field, from the caller's PRNG stream. */ export type Redraw = (gen: GenSpec, count: number) => string[]; /** * `uniq="true"`, and a redraw when the FIRST draw happened to be unarrangeable. * * `enforceUniq` may only rearrange the values already drawn — rearranging is * what keeps `percent=` exact. But when nothing pins the proportions, an * uneven draw is an accident of sampling, not something to protect, and the * old behaviour was to refuse the whole run over it: * * 4 values × 8 values, count=20 -> 32 combinations exist * drawn: a1×7 a2×6 a3×3 a4×4 -> "its data supports at most 19" * * The lists were never the problem. So: draw again and try again. * * This only runs where the old code THREW, so no config that works today * changes by a byte — a successful run consumes exactly the PRNG values it * always did. When the columns come from an exact quota (`percent=`, a * weighted pack) the redraw returns the same multiset in a different order, * which cannot help; that is detected after one attempt and reported as what * it is, rather than retried seven more times for nothing. */ export declare function enforceUniqRedrawing(spec: SequenceSpec, produced: Map, applicableCount: number, redraw: Redraw): void; //# sourceMappingURL=enforce-uniq.d.ts.map