/** * Lazy sequence registry for Engine 2 (streaming to disk). * * Each sequence gets a `resolve(i)` computed on demand from the seekable PRNG * / Feistel primitives — memory O(#sequences), not O(count). The render loop * and disk writer are unchanged (they read via `sequenceValueAt`). * * Parent-child (nesting, doc 29): a finite-value (text) sequence lays its * values into a sorted quota plan and scatters them with `permute` — exact * distribution, no array. A child `parent="P.V"` is active exactly on the * rows whose parent slot lands in V's range, and its rank WITHIN that subset * is `slot − lo_V` — a bijection over `[0, M_V)`. That rank is the child's own * population index, so the same construction nests to any depth. * * uniq, in two halves. `uniq="true"` on one sequence is still refused here by * name: it rearranges the gens inside a single compound column, and a lazy * per-row resolver cannot see a finished column. An env-level `` IS done * — see `stream-uniq.ts` — because there each member is its own seekable * column, so the tuples can be streamed past a sort to find the repeats and * only those few rows rearranged. * * This paragraph is worth keeping honest. An earlier version of it described a * mixed-radix construction that had already been deleted, and it stayed long * enough for the documentation to be written from it and promise users a * streaming uniqueness the router never delivered. * * Scope: simple + compound sequences; text/percent (exact), counters, and * independent generators (number/date/regex/symbol/template via a per-row * seekable draw); parent-child; in-sequence + env-level `` (per-row * repair); `` (exact case %, gens + nested mixes per row). Parents must * be finite-value (text) sequences; `parent` must name a value (`P.V`). */ import { type SequenceBuildOptions } from './build.js'; export { StreamUnsupportedError } from './stream-errors.js'; import type { CaseSpec, GenSpec, Sequence, SequenceRegistry, SequenceSpec } from './types.js'; /** What a finite-value sequence exposes so its children can nest under it. */ interface ParentCapable { hasValue(value: string): boolean; /** Subset size (Hamilton quota) for `value` — a child's domain. */ quotaOf(value: string): number; /** Row `i`'s rank within `value`'s subset, or undefined if `i` isn't in it. */ childRankAt(i: number, value: string): number | undefined; } /** Where a sequence's population index for row `i` comes from. */ export interface Domain { readonly size: number; readonly popIndexAt: (i: number) => number | undefined; } /** Env-level `` / `` groups (across separate sequences). */ export interface EnvGroups { readonly uniq: readonly (readonly string[])[]; readonly distinct: readonly (readonly string[])[]; } export declare function buildLazyRegistry(specs: readonly SequenceSpec[], count: number, seed: string, locale: string, now: number, baseOptions?: SequenceBuildOptions, envGroups?: EnvGroups, /** Engine 3: allow percent+uniq via exact-% construction + verification. */ exactUniq?: boolean): SequenceRegistry; interface BuildResult { sequence: Sequence; parentCapable?: ParentCapable; flag?: { name: string; sequence: Sequence; }; } export declare function build(streamId: string, gen: GenSpec, domain: Domain, seed: string, locale: string, now: number, options: SequenceBuildOptions): BuildResult; /** Assemble one ``'s parts (data / gen / nested mix) into a value(i). */ export declare function buildCaseResolver(caseSpec: CaseSpec, streamId: string, caseDomain: Domain, seed: string, locale: string, now: number, options: SequenceBuildOptions): (i: number) => string; //# sourceMappingURL=stream-build.d.ts.map