import type { Timestamp } from '../lib/timestamp.ts'; type IntArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array; /** * A collection of random-number-generating functions. * * ## Usage * * ``` * const floatOneToTen = ctx.random() * 10; * const randomBytes = ctx.random.fill(new Uint8Array(16)); * const intOneToTen = ctx.random.integerInRange(0, 10); * const shuffledCards = ctx.random.shuffle(cards); * ``` */ export interface Random { /** * Returns a random floating-point number in the range `[0.0, 1.0)`. * * The returned float will have 53 bits of randomness. */ (): number; /** * Like `crypto.getRandomValues()`. Fills a `TypedArray` with random integers * in a uniform distribution, mutating and returning it. */ fill(array: T): T; /** * Shuffles an array in place using an unbiased Fisher-Yates shuffle, then * returns the same array. */ shuffle(array: T[]): T[]; /** * Returns a random unsigned 32-bit integer in a uniform distribution in the * range `[0, 2**32)`. */ uint32(): number; /** * Returns an integer in the range `[min, max]`. */ integerInRange(min: number, max: number): number; /** * Returns a bigint in the range `[min, max]`. */ bigintInRange(min: bigint, max: bigint): bigint; } export declare function makeRandomFromSeed(seed: Timestamp | number | bigint | Uint8Array): Random; export declare function makeRandom(seed: Timestamp): Random; export {}; //# sourceMappingURL=rng.d.ts.map