UNPKG

1.38 kBTypeScriptView Raw
1import { ArbitraryWithContextualShrink } from '../check/arbitrary/definition/ArbitraryWithContextualShrink';
2/**
3 * Constraints to be applied on {@link bigInt}
4 * @remarks Since 2.6.0
5 * @public
6 */
7export interface BigIntConstraints {
8 /**
9 * Lower bound for the generated bigints (eg.: -5n, 0n, BigInt(Number.MIN_SAFE_INTEGER))
10 * @remarks Since 2.6.0
11 */
12 min?: bigint;
13 /**
14 * Upper bound for the generated bigints (eg.: -2n, 2147483647n, BigInt(Number.MAX_SAFE_INTEGER))
15 * @remarks Since 2.6.0
16 */
17 max?: bigint;
18}
19/**
20 * For bigint
21 * @remarks Since 1.9.0
22 * @public
23 */
24declare function bigInt(): ArbitraryWithContextualShrink<bigint>;
25/**
26 * For bigint between min (included) and max (included)
27 *
28 * @param min - Lower bound for the generated bigints (eg.: -5n, 0n, BigInt(Number.MIN_SAFE_INTEGER))
29 * @param max - Upper bound for the generated bigints (eg.: -2n, 2147483647n, BigInt(Number.MAX_SAFE_INTEGER))
30 *
31 * @remarks Since 1.9.0
32 * @public
33 */
34declare function bigInt(min: bigint, max: bigint): ArbitraryWithContextualShrink<bigint>;
35/**
36 * For bigint between min (included) and max (included)
37 *
38 * @param constraints - Constraints to apply when building instances
39 *
40 * @remarks Since 2.6.0
41 * @public
42 */
43declare function bigInt(constraints: BigIntConstraints): ArbitraryWithContextualShrink<bigint>;
44export { bigInt };