1 | import type { RandomGenerator } from 'pure-rand';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare class Random {
|
9 | private static MIN_INT;
|
10 | private static MAX_INT;
|
11 | private static DBL_FACTOR;
|
12 | private static DBL_DIVISOR;
|
13 | |
14 |
|
15 |
|
16 |
|
17 | constructor(sourceRng: RandomGenerator);
|
18 | /**
|
19 | * Clone the random number generator
|
20 | */
|
21 | clone(): Random;
|
22 | /**
|
23 | * Generate an integer having `bits` random bits
|
24 | * @param bits - Number of bits to generate
|
25 | */
|
26 | next(bits: number): number;
|
27 | /**
|
28 | * Generate a random boolean
|
29 | */
|
30 | nextBoolean(): boolean;
|
31 | /**
|
32 | * Generate a random integer (32 bits)
|
33 | */
|
34 | nextInt(): number;
|
35 | /**
|
36 | * Generate a random integer between min (included) and max (included)
|
37 | * @param min - Minimal integer value
|
38 | * @param max - Maximal integer value
|
39 | */
|
40 | nextInt(min: number, max: number): number;
|
41 | /**
|
42 | * Generate a random bigint between min (included) and max (included)
|
43 | * @param min - Minimal bigint value
|
44 | * @param max - Maximal bigint value
|
45 | */
|
46 | nextBigInt(min: bigint, max: bigint): bigint;
|
47 | /**
|
48 | * Generate a random ArrayInt between min (included) and max (included)
|
49 | * @param min - Minimal ArrayInt value
|
50 | * @param max - Maximal ArrayInt value
|
51 | */
|
52 | nextArrayInt(min: {
|
53 | sign: 1 | -1;
|
54 | data: number[];
|
55 | }, max: {
|
56 | sign: 1 | -1;
|
57 | data: number[];
|
58 | }): {
|
59 | sign: 1 | -1;
|
60 | data: number[];
|
61 | };
|
62 | |
63 |
|
64 |
|
65 | nextDouble(): number;
|
66 | |
67 |
|
68 |
|
69 | getState(): readonly number[] | undefined;
|
70 | }
|