@ghostry/fabricator 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Bound.js +74 -1
- package/dist/esm/Distribution/index.js +103 -2
- package/dist/esm/Enumeration/Enumerate.js +10 -5
- package/dist/esm/Enumeration/Plan.js +2 -2
- package/dist/esm/Error/index.js +96 -27
- package/dist/esm/Fabricator/Constructor.js +7 -5
- package/dist/esm/Instance/Core.js +3 -0
- package/dist/esm/Primitive/array/Admits.js +18 -0
- package/dist/esm/Primitive/array/Fabricator.js +20 -2
- package/dist/esm/Primitive/array/Registry.js +32 -0
- package/dist/esm/Primitive/array/Schema.js +8 -0
- package/dist/esm/Primitive/bigint/Admits.js +11 -0
- package/dist/esm/Primitive/bigint/Fabricator.js +16 -23
- package/dist/esm/Primitive/bigint/Registry.js +17 -6
- package/dist/esm/Primitive/bigint/Schema.js +8 -0
- package/dist/esm/Primitive/date/Admits.js +22 -0
- package/dist/esm/Primitive/date/Defaults.js +27 -1
- package/dist/esm/Primitive/date/Fabricator.js +32 -34
- package/dist/esm/Primitive/date/Registry.js +80 -13
- package/dist/esm/Primitive/date/Schema.js +8 -0
- package/dist/esm/Primitive/enum/Fabricator.js +14 -2
- package/dist/esm/Primitive/enum/Registry.js +38 -25
- package/dist/esm/Primitive/index.js +1 -0
- package/dist/esm/Primitive/number/Admits.js +27 -0
- package/dist/esm/Primitive/number/Fabricator.js +18 -9
- package/dist/esm/Primitive/number/Registry.js +55 -4
- package/dist/esm/Primitive/number/Schema.js +10 -3
- package/dist/esm/Primitive/object/Fabricator.js +2 -0
- package/dist/esm/Primitive/record/Admits.js +42 -0
- package/dist/esm/Primitive/record/Fabricator.js +49 -19
- package/dist/esm/Primitive/record/Registry.js +29 -0
- package/dist/esm/Primitive/record/Schema.js +8 -0
- package/dist/esm/Primitive/recursive/Fabricator.js +3 -2
- package/dist/esm/Primitive/recursive/Terminate.js +16 -2
- package/dist/esm/Primitive/string/Admits.js +26 -0
- package/dist/esm/Primitive/string/Capacity.js +81 -0
- package/dist/esm/Primitive/string/Fabricator.js +23 -43
- package/dist/esm/Primitive/string/Registry.js +31 -9
- package/dist/esm/Primitive/string/Schema.js +10 -3
- package/dist/esm/Primitive/string/Sources.js +41 -0
- package/dist/esm/Primitive/unique/Registry.js +22 -0
- package/dist/esm/Primitive/unique/index.js +2 -0
- package/dist/esm/Types.js +2 -1
- package/dist/esm/Unique/Capacity.js +85 -0
- package/dist/esm/Unique/Distinct.js +187 -0
- package/dist/esm/Unique/Key.js +70 -0
- package/dist/esm/Unique/Override.js +23 -0
- package/dist/esm/Unique/Strategy.js +173 -0
- package/dist/esm/internal.js +1 -0
- package/dist/types/Adapter/Core.d.ts +2 -2
- package/dist/types/Adapter/Types.d.ts +1 -1
- package/dist/types/Bound.d.ts +67 -1
- package/dist/types/Distribution/index.d.ts +83 -1
- package/dist/types/Enumeration/Enumerate.d.ts +3 -3
- package/dist/types/Enumeration/Plan.d.ts +1 -1
- package/dist/types/Enumeration/Types.d.ts +14 -5
- package/dist/types/Error/index.d.ts +283 -0
- package/dist/types/Fabricator/Constructor.d.ts +9 -5
- package/dist/types/Fabricator/Fabricate.d.ts +5 -5
- package/dist/types/Fabricator/Types.d.ts +19 -6
- package/dist/types/Harnessing/Core.d.ts +3 -3
- package/dist/types/Harnessing/Salt.d.ts +1 -1
- package/dist/types/Harnessing/Types.d.ts +2 -2
- package/dist/types/Instance/Core.d.ts +4 -4
- package/dist/types/Instance/Stack/Async.d.ts +1 -1
- package/dist/types/Instance/Stack/Sync.d.ts +1 -1
- package/dist/types/Instance/Stack/Visible.d.ts +2 -2
- package/dist/types/Instance/Types.d.ts +19 -5
- package/dist/types/Primitive/always/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/always/Registry.d.ts +2 -2
- package/dist/types/Primitive/always/Schema.d.ts +4 -4
- package/dist/types/Primitive/always/Types.d.ts +2 -2
- package/dist/types/Primitive/always/index.d.ts +5 -5
- package/dist/types/Primitive/array/Admits.d.ts +7 -0
- package/dist/types/Primitive/array/Fabricator.d.ts +7 -7
- package/dist/types/Primitive/array/Registry.d.ts +40 -3
- package/dist/types/Primitive/array/Schema.d.ts +10 -5
- package/dist/types/Primitive/array/Types.d.ts +37 -5
- package/dist/types/Primitive/array/index.d.ts +5 -5
- package/dist/types/Primitive/bigint/Admits.d.ts +7 -0
- package/dist/types/Primitive/bigint/Fabricator.d.ts +8 -6
- package/dist/types/Primitive/bigint/Registry.d.ts +24 -4
- package/dist/types/Primitive/bigint/Schema.d.ts +13 -5
- package/dist/types/Primitive/bigint/Types.d.ts +30 -6
- package/dist/types/Primitive/bigint/index.d.ts +5 -5
- package/dist/types/Primitive/boolean/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/boolean/Registry.d.ts +2 -2
- package/dist/types/Primitive/boolean/Schema.d.ts +5 -5
- package/dist/types/Primitive/boolean/Types.d.ts +3 -3
- package/dist/types/Primitive/boolean/index.d.ts +6 -6
- package/dist/types/Primitive/choice/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/choice/Registry.d.ts +2 -2
- package/dist/types/Primitive/choice/Schema.d.ts +5 -5
- package/dist/types/Primitive/choice/Types.d.ts +4 -4
- package/dist/types/Primitive/choice/index.d.ts +5 -5
- package/dist/types/Primitive/date/Admits.d.ts +7 -0
- package/dist/types/Primitive/date/Defaults.d.ts +22 -1
- package/dist/types/Primitive/date/Fabricator.d.ts +8 -6
- package/dist/types/Primitive/date/Registry.d.ts +49 -13
- package/dist/types/Primitive/date/Schema.d.ts +14 -5
- package/dist/types/Primitive/date/Types.d.ts +57 -8
- package/dist/types/Primitive/date/index.d.ts +5 -5
- package/dist/types/Primitive/derive/Fabricator.d.ts +7 -7
- package/dist/types/Primitive/derive/Registry.d.ts +2 -2
- package/dist/types/Primitive/derive/Schema.d.ts +6 -6
- package/dist/types/Primitive/derive/Types.d.ts +6 -6
- package/dist/types/Primitive/derive/index.d.ts +5 -5
- package/dist/types/Primitive/enum/Fabricator.d.ts +8 -6
- package/dist/types/Primitive/enum/Registry.d.ts +22 -2
- package/dist/types/Primitive/enum/Schema.d.ts +5 -5
- package/dist/types/Primitive/enum/Types.d.ts +8 -3
- package/dist/types/Primitive/enum/index.d.ts +5 -5
- package/dist/types/Primitive/index.d.ts +28 -27
- package/dist/types/Primitive/namespace.d.ts +21 -21
- package/dist/types/Primitive/null/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/null/Registry.d.ts +1 -1
- package/dist/types/Primitive/null/Schema.d.ts +4 -4
- package/dist/types/Primitive/null/Types.d.ts +2 -2
- package/dist/types/Primitive/null/index.d.ts +5 -5
- package/dist/types/Primitive/nullable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/nullable/Registry.d.ts +2 -2
- package/dist/types/Primitive/nullable/Schema.d.ts +6 -6
- package/dist/types/Primitive/nullable/Types.d.ts +5 -5
- package/dist/types/Primitive/nullable/index.d.ts +6 -6
- package/dist/types/Primitive/nullish/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/nullish/Registry.d.ts +2 -2
- package/dist/types/Primitive/nullish/Schema.d.ts +6 -6
- package/dist/types/Primitive/nullish/Types.d.ts +5 -5
- package/dist/types/Primitive/nullish/index.d.ts +6 -6
- package/dist/types/Primitive/number/Admits.d.ts +9 -0
- package/dist/types/Primitive/number/Defaults.d.ts +1 -1
- package/dist/types/Primitive/number/Fabricator.d.ts +8 -6
- package/dist/types/Primitive/number/Registry.d.ts +45 -4
- package/dist/types/Primitive/number/Schema.d.ts +14 -6
- package/dist/types/Primitive/number/Types.d.ts +36 -14
- package/dist/types/Primitive/number/index.d.ts +5 -5
- package/dist/types/Primitive/object/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/object/Registry.d.ts +4 -4
- package/dist/types/Primitive/object/Schema.d.ts +8 -8
- package/dist/types/Primitive/object/Types.d.ts +6 -6
- package/dist/types/Primitive/object/compute/Fabricator.d.ts +7 -7
- package/dist/types/Primitive/object/compute/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/compute/Schema.d.ts +7 -7
- package/dist/types/Primitive/object/compute/Types.d.ts +3 -3
- package/dist/types/Primitive/object/compute/index.d.ts +5 -5
- package/dist/types/Primitive/object/index.d.ts +8 -8
- package/dist/types/Primitive/object/omit/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/omit/index.d.ts +2 -2
- package/dist/types/Primitive/object/omittable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/object/omittable/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/omittable/Schema.d.ts +6 -6
- package/dist/types/Primitive/object/omittable/Types.d.ts +5 -5
- package/dist/types/Primitive/object/omittable/index.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/optional/Schema.d.ts +6 -6
- package/dist/types/Primitive/object/optional/Types.d.ts +5 -5
- package/dist/types/Primitive/object/optional/index.d.ts +6 -6
- package/dist/types/Primitive/object/pick/Registry.d.ts +2 -2
- package/dist/types/Primitive/object/pick/index.d.ts +2 -2
- package/dist/types/Primitive/opaque/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/opaque/Registry.d.ts +2 -2
- package/dist/types/Primitive/opaque/Schema.d.ts +4 -4
- package/dist/types/Primitive/opaque/Types.d.ts +3 -3
- package/dist/types/Primitive/opaque/index.d.ts +5 -5
- package/dist/types/Primitive/record/Admits.d.ts +18 -0
- package/dist/types/Primitive/record/Fabricator.d.ts +7 -7
- package/dist/types/Primitive/record/Registry.d.ts +20 -3
- package/dist/types/Primitive/record/Schema.d.ts +12 -5
- package/dist/types/Primitive/record/Types.d.ts +64 -10
- package/dist/types/Primitive/record/index.d.ts +5 -5
- package/dist/types/Primitive/recursive/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/recursive/Registry.d.ts +4 -4
- package/dist/types/Primitive/recursive/Schema.d.ts +4 -4
- package/dist/types/Primitive/recursive/Terminate.d.ts +8 -1
- package/dist/types/Primitive/recursive/Types.d.ts +3 -3
- package/dist/types/Primitive/recursive/index.d.ts +6 -6
- package/dist/types/Primitive/recursive/self/Fabricator.d.ts +5 -5
- package/dist/types/Primitive/recursive/self/Registry.d.ts +1 -1
- package/dist/types/Primitive/recursive/self/Schema.d.ts +4 -4
- package/dist/types/Primitive/recursive/self/Types.d.ts +2 -2
- package/dist/types/Primitive/recursive/self/index.d.ts +5 -5
- package/dist/types/Primitive/string/Admits.d.ts +8 -0
- package/dist/types/Primitive/string/Capacity.d.ts +36 -0
- package/dist/types/Primitive/string/Constants.d.ts +1 -1
- package/dist/types/Primitive/string/Fabricator.d.ts +8 -6
- package/dist/types/Primitive/string/Registry.d.ts +29 -8
- package/dist/types/Primitive/string/Schema.d.ts +32 -6
- package/dist/types/Primitive/string/Sources.d.ts +16 -0
- package/dist/types/Primitive/string/Types.d.ts +39 -19
- package/dist/types/Primitive/string/index.d.ts +6 -6
- package/dist/types/Primitive/symbol/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/symbol/Registry.d.ts +2 -2
- package/dist/types/Primitive/symbol/Schema.d.ts +5 -5
- package/dist/types/Primitive/symbol/Types.d.ts +3 -3
- package/dist/types/Primitive/symbol/index.d.ts +5 -5
- package/dist/types/Primitive/tuple/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/tuple/Registry.d.ts +2 -2
- package/dist/types/Primitive/tuple/Schema.d.ts +5 -5
- package/dist/types/Primitive/tuple/Types.d.ts +4 -4
- package/dist/types/Primitive/tuple/index.d.ts +5 -5
- package/dist/types/Primitive/undefinable/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/undefinable/Registry.d.ts +2 -2
- package/dist/types/Primitive/undefinable/Schema.d.ts +6 -6
- package/dist/types/Primitive/undefinable/Types.d.ts +5 -5
- package/dist/types/Primitive/undefinable/index.d.ts +6 -6
- package/dist/types/Primitive/undefined/Fabricator.d.ts +6 -6
- package/dist/types/Primitive/undefined/Registry.d.ts +1 -1
- package/dist/types/Primitive/undefined/Schema.d.ts +4 -4
- package/dist/types/Primitive/undefined/Types.d.ts +2 -2
- package/dist/types/Primitive/undefined/index.d.ts +5 -5
- package/dist/types/Primitive/unique/Registry.d.ts +39 -0
- package/dist/types/Primitive/unique/index.d.ts +2 -0
- package/dist/types/Random/Generator/sfc32.d.ts +1 -1
- package/dist/types/Random/Types.d.ts +1 -1
- package/dist/types/Random/index.d.ts +1 -1
- package/dist/types/Schema/Core.d.ts +5 -5
- package/dist/types/Schema/Registry.d.ts +3 -3
- package/dist/types/Schema/Satisfies.d.ts +3 -3
- package/dist/types/Schema/Types.d.ts +5 -5
- package/dist/types/Types.d.ts +11 -2
- package/dist/types/Unique/Capacity.d.ts +29 -0
- package/dist/types/Unique/Distinct.d.ts +95 -0
- package/dist/types/Unique/Key.d.ts +29 -0
- package/dist/types/Unique/Override.d.ts +16 -0
- package/dist/types/Unique/Strategy.d.ts +135 -0
- package/dist/types/Utility/Core.d.ts +2 -2
- package/dist/types/Utility/DeepMerge.d.ts +2 -2
- package/dist/types/Utility/ShallowMerge.d.ts +2 -2
- package/dist/types/adapting.d.ts +3 -3
- package/dist/types/harnessing.d.ts +2 -2
- package/dist/types/index.d.ts +40 -27
- package/dist/types/internal.d.ts +16 -15
- package/package.json +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { InputLength, Length } from "../../Bound";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
5
|
-
import type { classes } from "./Constants";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { AdmittedEnds, InputAdmittedEnds, InputLength, Length } from "../../Bound.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
5
|
+
import type { classes } from "./Constants.ts";
|
|
6
|
+
import type { Redraws } from "../../Unique/Strategy.ts";
|
|
6
7
|
/** An inclusive range of Unicode code points. */
|
|
7
8
|
export type CodepointRange = {
|
|
8
9
|
from: number;
|
|
@@ -28,25 +29,42 @@ export type InputWhereby = {
|
|
|
28
29
|
length: InputLength;
|
|
29
30
|
composition?: Composition;
|
|
30
31
|
};
|
|
32
|
+
/** `T.unique.string`'s `.whereby`: the same input, plus {@link Redraws}. */
|
|
33
|
+
export type InputUniqueWhereby = InputWhereby & Redraws;
|
|
34
|
+
/** `redraws` is set only through {@link InputUniqueWhereby}. */
|
|
31
35
|
export type Whereby = {
|
|
32
36
|
length: Length;
|
|
33
37
|
composition?: Composition;
|
|
38
|
+
redraws?: number | undefined;
|
|
34
39
|
};
|
|
35
|
-
export type Fabricated = string;
|
|
36
40
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
* `.admits(...)`'s input: the length an adapter states, widening what `whereby`
|
|
42
|
+
* draws. An end is replaced, `Infinity` (or `-Infinity` for `min`) states no
|
|
43
|
+
* limit, and an omitted end keeps what is admitted already.
|
|
44
|
+
*/
|
|
45
|
+
export type InputAdmits = {
|
|
46
|
+
length?: InputAdmittedEnds<number> | undefined;
|
|
47
|
+
} & Keywords;
|
|
48
|
+
/**
|
|
49
|
+
* JSON-Schema keywords for what the strings are, which adapters forward to
|
|
50
|
+
* their target: `toTypeBox` to `Type.String(...)`, a future `toZod` to
|
|
51
|
+
* `z.string()` refinements. Unlike a length they are not checked against what
|
|
52
|
+
* is drawn — like `.adapt`, the caller vouches that fabricated values match,
|
|
53
|
+
* usually by fabricating through `.as(produce)`. A keyword left out keeps what
|
|
54
|
+
* is admitted already.
|
|
45
55
|
*/
|
|
46
|
-
export type
|
|
47
|
-
format?: string;
|
|
48
|
-
pattern?: string;
|
|
56
|
+
export type Keywords = {
|
|
57
|
+
format?: string | undefined;
|
|
58
|
+
pattern?: string | undefined;
|
|
49
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* `[Meta].admits`, set only by `.admits(...)` and complete once set: an absent
|
|
62
|
+
* end states no limit (`Admits.ts`'s `toAdmits`).
|
|
63
|
+
*/
|
|
64
|
+
export type Admits = {
|
|
65
|
+
length: AdmittedEnds<number>;
|
|
66
|
+
} & Keywords;
|
|
67
|
+
export type Fabricated = string;
|
|
50
68
|
/**
|
|
51
69
|
* A length and optional composition, drawn via `whereby`. There is no natural
|
|
52
70
|
* bound to fuzz a string to, so unlike `number`/`date` the builder itself has
|
|
@@ -58,11 +76,13 @@ export type JsonSchema = {
|
|
|
58
76
|
*/
|
|
59
77
|
export type Meta = {
|
|
60
78
|
whereby: Whereby;
|
|
61
|
-
|
|
79
|
+
admits?: Admits | undefined;
|
|
80
|
+
unique?: true;
|
|
62
81
|
produce?: never;
|
|
63
82
|
} | {
|
|
64
83
|
whereby?: Whereby;
|
|
65
|
-
|
|
84
|
+
admits?: Admits | undefined;
|
|
85
|
+
unique?: true;
|
|
66
86
|
produce: Produce<Fabricated>;
|
|
67
87
|
};
|
|
68
88
|
export type Core<$Meta extends Meta = Meta, $Adaptations extends Adaptations = {}> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./Constants";
|
|
2
|
-
export * from "./Fabricator";
|
|
3
|
-
export * from "./Registry";
|
|
4
|
-
export { default } from "./Registry";
|
|
5
|
-
export * from "./Schema";
|
|
6
|
-
export * from "./Types";
|
|
1
|
+
export * from "./Constants.ts";
|
|
2
|
+
export * from "./Fabricator.ts";
|
|
3
|
+
export * from "./Registry.ts";
|
|
4
|
+
export { default } from "./Registry.ts";
|
|
5
|
+
export * from "./Schema.ts";
|
|
6
|
+
export * from "./Types.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<_ extends Fabricator> = Fabricated;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import { Schema } from "./Schema";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import { Schema } from "./Schema.ts";
|
|
3
3
|
type ThisRegistry = Schema<{}, Adaptations> & {
|
|
4
4
|
keyed: (key: string) => Schema<{
|
|
5
5
|
key: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Core, Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Core, Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* `$Meta` is generic (defaulting to the full `Meta` union) so builder return
|
|
8
8
|
* types stay narrow — see `number/Schema.ts`. `$Adaptations` is threaded
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Produce } from "../../Random/Types";
|
|
3
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
3
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
4
4
|
export type Fabricated = symbol;
|
|
5
5
|
/**
|
|
6
6
|
* A symbol keyed via `keyed`, or unkeyed if `key` is absent, optionally
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Types";
|
|
2
|
-
export * from "./Schema";
|
|
3
|
-
export * from "./Fabricator";
|
|
4
|
-
export * from "./Registry";
|
|
5
|
-
export { default } from "./Registry";
|
|
1
|
+
export * from "./Types.ts";
|
|
2
|
+
export * from "./Schema.ts";
|
|
3
|
+
export * from "./Fabricator.ts";
|
|
4
|
+
export * from "./Registry.ts";
|
|
5
|
+
export { default } from "./Registry.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Children, Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Items, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Children, Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Items, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<$Fabricator extends Fabricator> = $Fabricator extends Fabricator<infer $Schema extends {
|
|
8
8
|
[Meta]: ThisMeta;
|
|
9
9
|
}> ? Fabricated<$Schema[typeof Meta]["items"]> : never;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Schema } from "./Schema";
|
|
2
|
-
import type { Items } from "./Types";
|
|
1
|
+
import { Schema } from "./Schema.ts";
|
|
2
|
+
import type { Items } from "./Types.ts";
|
|
3
3
|
export default function <const $Items extends Items>(items: $Items): Schema<$Items>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { Core, Fabricated, Items } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { Core, Fabricated, Items } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Buildable `tuple` recipe: a fixed-length list of slot schemas, each
|
|
8
8
|
* fabricated independently — see `Fabricator.ts` for why that independence (one
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Produce } from "../../Random/Types";
|
|
3
|
-
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types";
|
|
4
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
3
|
+
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types.ts";
|
|
4
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
5
5
|
/** The schema occupying a single tuple slot. */
|
|
6
6
|
export type Item = AnySchema;
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Types";
|
|
2
|
-
export * from "./Schema";
|
|
3
|
-
export * from "./Fabricator";
|
|
4
|
-
export * from "./Registry";
|
|
5
|
-
export { default } from "./Registry";
|
|
1
|
+
export * from "./Types.ts";
|
|
2
|
+
export * from "./Schema.ts";
|
|
3
|
+
export * from "./Fabricator.ts";
|
|
4
|
+
export * from "./Registry.ts";
|
|
5
|
+
export { default } from "./Registry.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { Fabricator as BaseFabricator, FabricatorContext } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Children, Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Definition, Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Fabricator as BaseFabricator, FabricatorContext } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Children, Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Definition, Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<$Fabricator extends Fabricator> = $Fabricator extends Fabricator<infer $Schema> ? Fabricated<$Schema[typeof Meta]["definition"]> : never;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Schema } from "./Schema";
|
|
2
|
-
import type { Definition } from "./Types";
|
|
1
|
+
import { Schema } from "./Schema.ts";
|
|
2
|
+
import type { Definition } from "./Types.ts";
|
|
3
3
|
export default function <const $Definition extends Definition>(definition: $Definition): Schema<$Definition>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import type { Produce } from "../../Random/Types";
|
|
4
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
5
|
-
import type { AnySchema } from "../../Schema/Types";
|
|
6
|
-
import type { Core, Definition, Fabricated, Weights } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
4
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
5
|
+
import type { AnySchema } from "../../Schema/Types.ts";
|
|
6
|
+
import type { Core, Definition, Fabricated, Weights } from "./Types.ts";
|
|
7
7
|
/**
|
|
8
8
|
* The buildable recipe for an `undefinable`: a single wrapped Schema, drawn (or
|
|
9
9
|
* not) each fabrication.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Produce } from "../../Random/Types";
|
|
3
|
-
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types";
|
|
4
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Produce } from "../../Random/Types.ts";
|
|
3
|
+
import type { AnySchema, Fabricated as FabricatedBy } from "../../Schema/Types.ts";
|
|
4
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
5
5
|
/** The wrapped schema — the value type produced when the roll isn't `undefined`. */
|
|
6
6
|
export type Definition = AnySchema;
|
|
7
7
|
export type Fabricated<$Definition extends Definition, $Bindings extends unknown[] = []> = FabricatedBy<$Definition, $Bindings> | undefined;
|
|
8
|
-
export type { Outcome } from "./Outcomes";
|
|
8
|
+
export type { Outcome } from "./Outcomes.ts";
|
|
9
9
|
/**
|
|
10
10
|
* Relative weights for `.weighted(...)`, keyed by `Outcome`. Keys optional — an
|
|
11
11
|
* omitted key falls back to baseline `1`, the same weight the 50/50 split
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./Fabricator";
|
|
2
|
-
export * from "./Outcomes";
|
|
3
|
-
export * from "./Registry";
|
|
4
|
-
export { default } from "./Registry";
|
|
5
|
-
export * from "./Schema";
|
|
6
|
-
export * from "./Types";
|
|
1
|
+
export * from "./Fabricator.ts";
|
|
2
|
+
export * from "./Outcomes.ts";
|
|
3
|
+
export * from "./Registry.ts";
|
|
4
|
+
export { default } from "./Registry.ts";
|
|
5
|
+
export * from "./Schema.ts";
|
|
6
|
+
export * from "./Types.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AdaptationsOf } from "../../Adapter/Types";
|
|
2
|
-
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types";
|
|
3
|
-
import type { Trace } from "../../Random/Types";
|
|
4
|
-
import { Kind, Meta, type Adaptation } from "../../Types";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
|
-
import type { Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import type { AdaptationsOf } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { FabricatorContext, NaiveFabricator } from "../../Fabricator/Types.ts";
|
|
3
|
+
import type { Trace } from "../../Random/Types.ts";
|
|
4
|
+
import { Kind, Meta, type Adaptation } from "../../Types.ts";
|
|
5
|
+
import { Schema } from "./Schema.ts";
|
|
6
|
+
import type { Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
7
7
|
export type Fabrication<_ extends Fabricator> = Fabricated;
|
|
8
8
|
export type Fabricator<$Schema extends {
|
|
9
9
|
[Meta]: ThisMeta;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type AdaptationEntry } from "../../Adapter/Core";
|
|
2
|
-
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types";
|
|
3
|
-
import { type SatisfiesThis } from "../../Schema/Satisfies";
|
|
4
|
-
import type { Core, Fabricated, Meta as ThisMeta } from "./Types";
|
|
1
|
+
import { type AdaptationEntry } from "../../Adapter/Core.ts";
|
|
2
|
+
import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../Adapter/Types.ts";
|
|
3
|
+
import { type SatisfiesThis } from "../../Schema/Satisfies.ts";
|
|
4
|
+
import type { Core, Fabricated, Meta as ThisMeta } from "./Types.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Nothing to configure (see `Types.ts`'s `Meta`), so `adapt` is this kind's
|
|
7
7
|
* only mapping method — an external library that spells "undefined" differently
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Adaptations } from "../../Adapter/Types";
|
|
2
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
|
|
1
|
+
import type { Adaptations } from "../../Adapter/Types.ts";
|
|
2
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
|
|
3
3
|
export type Fabricated = undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Nothing to configure: `undefined` has exactly one possible value, so there is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Fabricator";
|
|
2
|
-
export * from "./Registry";
|
|
3
|
-
export { default } from "./Registry";
|
|
4
|
-
export * from "./Schema";
|
|
5
|
-
export * from "./Types";
|
|
1
|
+
export * from "./Fabricator.ts";
|
|
2
|
+
export * from "./Registry.ts";
|
|
3
|
+
export { default } from "./Registry.ts";
|
|
4
|
+
export * from "./Schema.ts";
|
|
5
|
+
export * from "./Types.ts";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { unique as array } from "../array/Registry.ts";
|
|
2
|
+
import { unique as bigint } from "../bigint/Registry.ts";
|
|
3
|
+
import { unique as date } from "../date/Registry.ts";
|
|
4
|
+
import { unique as enumeration } from "../enum/Registry.ts";
|
|
5
|
+
import { unique as number } from "../number/Registry.ts";
|
|
6
|
+
import { unique as record } from "../record/Registry.ts";
|
|
7
|
+
import { unique as string } from "../string/Registry.ts";
|
|
8
|
+
/**
|
|
9
|
+
* `T.unique`: the builders whose Schemas promise distinct values. Not a kind —
|
|
10
|
+
* each builder returns an ordinary Schema of its own kind with `unique` on
|
|
11
|
+
* `[Meta]`, so dispatch, `Fabricated`, and adapters treat it as that kind. Two
|
|
12
|
+
* shapes:
|
|
13
|
+
*
|
|
14
|
+
* - **Leaves** (`enum`, `number`, `bigint`, `string`, `date`) never repeat a
|
|
15
|
+
* value for their built Fabricator's lifetime — across every `.fabricate()`
|
|
16
|
+
* call, and across every `fabricate(schema)` call in one scope.
|
|
17
|
+
* - **Collections** (`array`, `record`) hold distinct members within each value
|
|
18
|
+
* they fabricate, and are free to repeat across values.
|
|
19
|
+
*
|
|
20
|
+
* Each kind's own `Registry.ts` builds its variant beside its ordinary one, so
|
|
21
|
+
* the kind-specific checks and labels stay with the kind; this module only
|
|
22
|
+
* assembles them. See AGENTS.md's "Uniqueness".
|
|
23
|
+
*/
|
|
24
|
+
type ThisRegistry = {
|
|
25
|
+
readonly enum: typeof enumeration;
|
|
26
|
+
/**
|
|
27
|
+
* A getter, like `T.number`: each read is a fresh Schema (AGENTS.md's
|
|
28
|
+
* "Registry entries are getters").
|
|
29
|
+
*/
|
|
30
|
+
readonly number: ReturnType<typeof number>;
|
|
31
|
+
readonly bigint: typeof bigint;
|
|
32
|
+
readonly string: typeof string;
|
|
33
|
+
/** A getter, like `T.date` — see `number`. */
|
|
34
|
+
readonly date: ReturnType<typeof date>;
|
|
35
|
+
readonly array: typeof array;
|
|
36
|
+
readonly record: typeof record;
|
|
37
|
+
};
|
|
38
|
+
declare const registry: ThisRegistry;
|
|
39
|
+
export default registry;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Algorithm, Layered, NumberGenerator, Options, RandomSource, Salt, Stream, Trace } from "./Types";
|
|
1
|
+
import type { Algorithm, Layered, NumberGenerator, Options, RandomSource, Salt, Stream, Trace } from "./Types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Build the library's built-in PRNG from a seed — the genuine article, not a
|
|
4
4
|
* caller-supplied {@link Salt}: by the time anything reaches here the salt is
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Adaptations } from "../Adapter/Types";
|
|
2
|
-
import type { Kind as SchemaKind } from "../Primitive";
|
|
3
|
-
import { Adaptation, Kind, Meta, type Buildable, type Produced, type Produces } from "../Types";
|
|
4
|
-
import { type PlainObject } from "../Utility/Types";
|
|
5
|
-
import type { AnySchema } from "./Types";
|
|
1
|
+
import type { Adaptations } from "../Adapter/Types.ts";
|
|
2
|
+
import type { Kind as SchemaKind } from "../Primitive/index.ts";
|
|
3
|
+
import { Adaptation, Kind, Meta, type Buildable, type Produced, type Produces } from "../Types.ts";
|
|
4
|
+
import { type PlainObject } from "../Utility/Types.ts";
|
|
5
|
+
import type { AnySchema } from "./Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Normalize a Schema, a builder namespace, or an already-built Fabricator into
|
|
8
8
|
* a clean, storable Schema — keeping only `[Kind]`/ `[Meta]`/`[Adaptation]` and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as primitives from "../Primitive";
|
|
2
|
-
import { deepMerge, type DeepMerge } from "../Utility/DeepMerge";
|
|
3
|
-
import { type PlainObject } from "../Utility/Types";
|
|
1
|
+
import * as primitives from "../Primitive/index.ts";
|
|
2
|
+
import { deepMerge, type DeepMerge } from "../Utility/DeepMerge.ts";
|
|
3
|
+
import { type PlainObject } from "../Utility/Types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* A kind whose `Registry.ts` default export takes no arguments returns a bare
|
|
6
6
|
* Schema, which `builders` installs behind a getter; every builder takes at
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { NaiveFabricator } from "../Fabricator/Types";
|
|
2
|
-
import type { Buildable, Produced, Produces } from "../Types";
|
|
3
|
-
import type { Fabricated } from "./Types";
|
|
1
|
+
import type { NaiveFabricator } from "../Fabricator/Types.ts";
|
|
2
|
+
import type { Buildable, Produced, Produces } from "../Types.ts";
|
|
3
|
+
import type { Fabricated } from "./Types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* The `this`-parameter constraint every kind's `.satisfies<$Target>()`
|
|
6
6
|
* intersects onto the receiver, so a mismatch names both sides on the call that
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Adaptations } from "../Adapter/Types";
|
|
2
|
-
import type { NaiveFabricator } from "../Fabricator/Types";
|
|
3
|
-
import type { Kind as SchemaKind } from "../Primitive";
|
|
4
|
-
import type { Adaptation, Kind, Meta, Produced, Produces } from "../Types";
|
|
5
|
-
import type { PlainObject } from "../Utility/Types";
|
|
1
|
+
import type { Adaptations } from "../Adapter/Types.ts";
|
|
2
|
+
import type { NaiveFabricator } from "../Fabricator/Types.ts";
|
|
3
|
+
import type { Kind as SchemaKind } from "../Primitive/index.ts";
|
|
4
|
+
import type { Adaptation, Kind, Meta, Produced, Produces } from "../Types.ts";
|
|
5
|
+
import type { PlainObject } from "../Utility/Types.ts";
|
|
6
6
|
/**
|
|
7
7
|
* The broadest Schema constraint: some kind, some config. Used by compound
|
|
8
8
|
* kinds (`object`/`array`) for their nested fields instead of the library-wide
|
package/dist/types/Types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Fabricator } from "./Fabricator/Types";
|
|
2
|
-
import type { AnySchema } from "./Schema/Types";
|
|
1
|
+
import type { Fabricator } from "./Fabricator/Types.ts";
|
|
2
|
+
import type { AnySchema } from "./Schema/Types.ts";
|
|
3
3
|
export declare const Kind: unique symbol;
|
|
4
4
|
export declare const Meta: unique symbol;
|
|
5
5
|
export declare const Produces: unique symbol;
|
|
@@ -83,6 +83,15 @@ export declare const Adaptation: unique symbol;
|
|
|
83
83
|
* distinguishes the two outcomes).
|
|
84
84
|
*/
|
|
85
85
|
export declare const Omitted: unique symbol;
|
|
86
|
+
/**
|
|
87
|
+
* Marks a value as already produced, carried only by a built `T.unique.*` leaf
|
|
88
|
+
* (`Unique/Distinct.ts`'s `Tracker`). A per-call override skips that leaf's
|
|
89
|
+
* draw, so `object/Fabricator.ts` hands the override value here through
|
|
90
|
+
* `Unique/Override.ts`'s `recordOverride`, and no later draw repeats it.
|
|
91
|
+
* Recording only — claiming a value already produced is not an error, since the
|
|
92
|
+
* caller asked for it.
|
|
93
|
+
*/
|
|
94
|
+
export declare const Claim: unique symbol;
|
|
86
95
|
/**
|
|
87
96
|
* Everything `construct()`/`toTypeBox()` accept as a starting point: a
|
|
88
97
|
* not-yet-built Schema, or something already built into a Fabricator.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Buildable } from "../Types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* How many times one built Fabricator of `schema` can `fabricate()` before a
|
|
4
|
+
* `T.unique.*` leaf runs out, or `undefined` when no leaf has a known limit.
|
|
5
|
+
* The answer for a fresh Fabricator: it does not count what an existing one has
|
|
6
|
+
* already drawn.
|
|
7
|
+
*/
|
|
8
|
+
export type Capacity = (schema: Buildable) => bigint | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Walk `schema` — the Schema, not a build, so nothing is constructed, no
|
|
11
|
+
* ordinal is taken, and an object's hidden fields are seen — and take the
|
|
12
|
+
* tightest limit any unique leaf sets. A leaf allows `capacity / draws`
|
|
13
|
+
* fabrications, `draws` being the most times one fabrication can reach it: one,
|
|
14
|
+
* multiplied by `length.max`/`size.max` for each array or record above it.
|
|
15
|
+
*
|
|
16
|
+
* Conservative where a leaf may not draw at all: one behind a presence wrapper
|
|
17
|
+
* or a `choice` option is counted as drawing every time. Not counted, since
|
|
18
|
+
* they never limit one Fabricator's fabrications:
|
|
19
|
+
*
|
|
20
|
+
* - a unique collection's members, distinct only within each value and checked
|
|
21
|
+
* against the length at construction;
|
|
22
|
+
* - anything under `T.recursive`, whose expansions each build afresh;
|
|
23
|
+
* - a `[Fixed]` field and an `object.compute` source, which never draw;
|
|
24
|
+
* - any node with `.as(...)`, whose producer replaces everything beneath it;
|
|
25
|
+
* - a leaf of unknown size, such as a continuous `T.unique.number` range.
|
|
26
|
+
*
|
|
27
|
+
* `clock` resolves a `date` leaf's `past`/`future` end.
|
|
28
|
+
*/
|
|
29
|
+
export declare function toCapacity(schema: Buildable, clock: number): bigint | undefined;
|