UNPKG

1.33 kBTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2import { ObjectConstraints } from './_internals/helpers/QualifiedObjectConstraints';
3export { ObjectConstraints };
4/**
5 * For any type of values
6 *
7 * You may use {@link sample} to preview the values that will be generated
8 *
9 * @example
10 * ```javascript
11 * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
12 * ```
13 *
14 * @remarks Since 0.0.7
15 * @public
16 */
17declare function anything(): Arbitrary<unknown>;
18/**
19 * For any type of values following the constraints defined by `settings`
20 *
21 * You may use {@link sample} to preview the values that will be generated
22 *
23 * @example
24 * ```javascript
25 * null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
26 * ```
27 *
28 * @example
29 * ```typescript
30 * // Using custom settings
31 * fc.anything({
32 * key: fc.char(),
33 * values: [fc.integer(10,20), fc.constant(42)],
34 * maxDepth: 2
35 * });
36 * // Can build entries such as:
37 * // - 19
38 * // - [{"2":12,"k":15,"A":42}]
39 * // - {"4":[19,13,14,14,42,11,20,11],"6":42,"7":16,"L":10,"'":[20,11],"e":[42,20,42,14,13,17]}
40 * // - [42,42,42]...
41 * ```
42 *
43 * @param constraints - Constraints to apply when building instances
44 *
45 * @remarks Since 0.0.7
46 * @public
47 */
48declare function anything(constraints: ObjectConstraints): Arbitrary<unknown>;
49export { anything };