1 | import { ArbitraryWithContextualShrink } from '../check/arbitrary/definition/ArbitraryWithContextualShrink';
|
2 | /**
|
3 | * Constraints to be applied on {@link integer}
|
4 | * @remarks Since 2.6.0
|
5 | * @public
|
6 | */
|
7 | export interface IntegerConstraints {
|
8 | /**
|
9 | * Lower bound for the generated integers (included)
|
10 | * @defaultValue -0x80000000
|
11 | * @remarks Since 2.6.0
|
12 | */
|
13 | min?: number;
|
14 | /**
|
15 | * Upper bound for the generated integers (included)
|
16 | * @defaultValue 0x7fffffff
|
17 | * @remarks Since 2.6.0
|
18 | */
|
19 | max?: number;
|
20 | }
|
21 | /**
|
22 | * For integers between -2147483648 (included) and 2147483647 (included)
|
23 | * @remarks Since 0.0.1
|
24 | * @public
|
25 | */
|
26 | declare function integer(): ArbitraryWithContextualShrink<number>;
|
27 | /**
|
28 | * For integers between -2147483648 (included) and max (included)
|
29 | *
|
30 | * @param max - Upper bound for the generated integers (eg.: 2147483647, Number.MAX_SAFE_INTEGER)
|
31 | *
|
32 | * @deprecated
|
33 | * Superceded by `fc.integer({max})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
|
34 | * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
|
35 | *
|
36 | * @remarks Since 0.0.1
|
37 | * @public
|
38 | */
|
39 | declare function integer(max: number): ArbitraryWithContextualShrink<number>;
|
40 | /**
|
41 | * For integers between min (included) and max (included)
|
42 | *
|
43 | * @param min - Lower bound for the generated integers (eg.: 0, Number.MIN_SAFE_INTEGER)
|
44 | * @param max - Upper bound for the generated integers (eg.: 2147483647, Number.MAX_SAFE_INTEGER)
|
45 | *
|
46 | * @remarks You may prefer to use `fc.integer({min, max})` instead.
|
47 | * @remarks Since 0.0.1
|
48 | * @public
|
49 | */
|
50 | declare function integer(min: number, max: number): ArbitraryWithContextualShrink<number>;
|
51 | /**
|
52 | * For integers between min (included) and max (included)
|
53 | *
|
54 | * @param constraints - Constraints to apply when building instances
|
55 | *
|
56 | * @remarks Since 2.6.0
|
57 | * @public
|
58 | */
|
59 | declare function integer(constraints: IntegerConstraints): ArbitraryWithContextualShrink<number>;
|
60 | export { integer };
|