UNPKG

1.82 kBTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2import { JsonSharedConstraints } from './_internals/helpers/JsonConstraintsBuilder';
3export { JsonSharedConstraints };
4/**
5 * For any JSON compliant values
6 *
7 * Keys and string values rely on {@link string}
8 *
9 * As `JSON.parse` preserves `-0`, `jsonObject` can also have `-0` as a value.
10 * `jsonObject` must be seen as: any value that could have been built by doing a `JSON.parse` on a given string.
11 *
12 * @remarks Since 1.2.3
13 * @public
14 */
15declare function jsonObject(): Arbitrary<unknown>;
16/**
17 * For any JSON compliant values with a maximal depth
18 *
19 * Keys and string values rely on {@link string}
20 *
21 * As `JSON.parse` preserves `-0`, `jsonObject` can also have `-0` as a value.
22 * `jsonObject` must be seen as: any value that could have been built by doing a `JSON.parse` on a given string.
23 *
24 * @param maxDepth - Maximal depth of the generated values
25 *
26 * @deprecated
27 * Superceded by `fc.jsonObject({maxDepth})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
28 * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
29 *
30 * @remarks Since 1.2.3
31 * @public
32 */
33declare function jsonObject(maxDepth: number): Arbitrary<unknown>;
34/**
35 * For any JSON compliant values
36 *
37 * Keys and string values rely on {@link string}
38 *
39 * As `JSON.parse` preserves `-0`, `jsonObject` can also have `-0` as a value.
40 * `jsonObject` must be seen as: any value that could have been built by doing a `JSON.parse` on a given string.
41 *
42 * @param constraints - Constraints to be applied onto the generated instance
43 *
44 * @remarks Since 2.5.0
45 * @public
46 */
47declare function jsonObject(constraints: JsonSharedConstraints): Arbitrary<unknown>;
48export { jsonObject };