/** * Deterministic PRNG + sampling primitives backing the CEL `randomSample` * function. * * STABILITY CONTRACT — DO NOT CHANGE THESE ALGORITHMS. * The same seed must produce the same sample on every runtime and every SDK * version: the backend (server) and frontend (client) rely on agreeing outputs, * and customers rely on seeds for reproducible workflow runs. Golden-value * tests in tests/lib/cel/prng.test.ts pin the exact outputs. */ /** A source of random floats in [0, 1). */ export type RandomSource = () => number; /** * mulberry32: fast 32-bit PRNG with exact, platform-independent output. * `seed` is coerced to uint32 (via `>>> 0`); use {@link normalizeSeed} to * convert arbitrary CEL ints before calling this. */ export declare function mulberry32(seed: number): RandomSource; /** Normalize a CEL int (bigint or number) to a uint32 PRNG seed. */ export declare function normalizeSeed(seed: bigint | number): number; /** * Sample `count` distinct elements via partial Fisher–Yates. * `count` is clamped to [0, list.length]; the input list is not mutated. */ export declare function sampleWithoutReplacement(list: readonly T[], count: number, rand: RandomSource): T[]; /** `count` independent draws; duplicates allowed. Returns [] if the list is empty or count <= 0. */ export declare function sampleWithReplacement(list: readonly T[], count: number, rand: RandomSource): T[]; //# sourceMappingURL=prng.d.mts.map