UNPKG

1.16 kBTypeScriptView Raw
1import { ArbitraryWithContextualShrink } from '../check/arbitrary/definition/ArbitraryWithContextualShrink';
2/**
3 * Constraints to be applied on {@link nat}
4 * @remarks Since 2.6.0
5 * @public
6 */
7export interface NatConstraints {
8 /**
9 * Upper bound for the generated postive integers (included)
10 * @defaultValue 0x7fffffff
11 * @remarks Since 2.6.0
12 */
13 max?: number;
14}
15/**
16 * For positive integers between 0 (included) and 2147483647 (included)
17 * @remarks Since 0.0.1
18 * @public
19 */
20declare function nat(): ArbitraryWithContextualShrink<number>;
21/**
22 * For positive integers between 0 (included) and max (included)
23 *
24 * @param max - Upper bound for the generated integers
25 *
26 * @remarks You may prefer to use `fc.nat({max})` instead.
27 * @remarks Since 0.0.1
28 * @public
29 */
30declare function nat(max: number): ArbitraryWithContextualShrink<number>;
31/**
32 * For positive integers between 0 (included) and max (included)
33 *
34 * @param constraints - Constraints to apply when building instances
35 *
36 * @remarks Since 2.6.0
37 * @public
38 */
39declare function nat(constraints: NatConstraints): ArbitraryWithContextualShrink<number>;
40export { nat };