1 | import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
|
2 | /**
|
3 | * Constraints to be applied on {@link array}
|
4 | * @remarks Since 2.4.0
|
5 | * @public
|
6 | */
|
7 | export interface ArrayConstraints {
|
8 | /**
|
9 | * Lower bound of the generated array size
|
10 | * @remarks Since 2.4.0
|
11 | */
|
12 | minLength?: number;
|
13 | /**
|
14 | * Upper bound of the generated array size
|
15 | * @remarks Since 2.4.0
|
16 | */
|
17 | maxLength?: number;
|
18 | }
|
19 | /**
|
20 | * For arrays of values coming from `arb`
|
21 | * @param arb - Arbitrary used to generate the values inside the array
|
22 | * @remarks Since 0.0.1
|
23 | * @public
|
24 | */
|
25 | declare function array<T>(arb: Arbitrary<T>): Arbitrary<T[]>;
|
26 | /**
|
27 | * For arrays of values coming from `arb` having an upper bound size
|
28 | *
|
29 | * @param arb - Arbitrary used to generate the values inside the array
|
30 | * @param maxLength - Upper bound of the generated array size
|
31 | *
|
32 | * @deprecated
|
33 | * Superceded by `fc.array(arb, {maxLength})` - 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 array<T>(arb: Arbitrary<T>, maxLength: number): Arbitrary<T[]>;
|
40 | /**
|
41 | * For arrays of values coming from `arb` having lower and upper bound size
|
42 | *
|
43 | * @param arb - Arbitrary used to generate the values inside the array
|
44 | * @param minLength - Lower bound of the generated array size
|
45 | * @param maxLength - Upper bound of the generated array size
|
46 | *
|
47 | * @deprecated
|
48 | * Superceded by `fc.array(arb, {minLength, maxLength})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
|
49 | * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
|
50 | *
|
51 | * @remarks Since 0.0.7
|
52 | * @public
|
53 | */
|
54 | declare function array<T>(arb: Arbitrary<T>, minLength: number, maxLength: number): Arbitrary<T[]>;
|
55 | /**
|
56 | * For arrays of values coming from `arb` having lower and upper bound size
|
57 | *
|
58 | * @param arb - Arbitrary used to generate the values inside the array
|
59 | * @param constraints - Constraints to apply when building instances
|
60 | *
|
61 | * @remarks Since 2.4.0
|
62 | * @public
|
63 | */
|
64 | declare function array<T>(arb: Arbitrary<T>, constraints: ArrayConstraints): Arbitrary<T[]>;
|
65 | export { array };
|