@ghostry/fabricator 0.0.14 → 0.0.16

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.
Files changed (194) hide show
  1. package/dist/esm/Error/index.js +14 -9
  2. package/dist/esm/Fabricator/Constructor.js +44 -37
  3. package/dist/esm/Primitive/object/Fabricator.js +45 -43
  4. package/dist/esm/Primitive/object/Registry.js +41 -84
  5. package/dist/esm/Primitive/object/Stages.js +73 -0
  6. package/dist/esm/Primitive/object/compute/Fabricator.js +1 -7
  7. package/dist/esm/Primitive/object/compute/Registry.js +2 -4
  8. package/dist/esm/Primitive/recursive/Terminate.js +5 -13
  9. package/dist/esm/Unique/Capacity.js +2 -8
  10. package/dist/esm/Utility/ShallowMerge.js +1 -13
  11. package/dist/types/Adapter/Core.d.ts +2 -2
  12. package/dist/types/Adapter/Types.d.ts +1 -1
  13. package/dist/types/Bound.d.ts +1 -1
  14. package/dist/types/Distribution/index.d.ts +1 -1
  15. package/dist/types/Enumeration/Enumerate.d.ts +3 -3
  16. package/dist/types/Enumeration/Plan.d.ts +1 -1
  17. package/dist/types/Enumeration/Types.d.ts +4 -4
  18. package/dist/types/Error/index.d.ts +27 -18
  19. package/dist/types/Fabricator/Constructor.d.ts +4 -4
  20. package/dist/types/Fabricator/Fabricate.d.ts +5 -5
  21. package/dist/types/Fabricator/Types.d.ts +6 -6
  22. package/dist/types/Harnessing/Core.d.ts +3 -3
  23. package/dist/types/Harnessing/Salt.d.ts +1 -1
  24. package/dist/types/Harnessing/Types.d.ts +2 -2
  25. package/dist/types/Instance/Core.d.ts +4 -4
  26. package/dist/types/Instance/Stack/Async.d.ts +10 -6
  27. package/dist/types/Instance/Stack/Sync.d.ts +1 -1
  28. package/dist/types/Instance/Stack/Visible.d.ts +2 -2
  29. package/dist/types/Instance/Types.d.ts +6 -6
  30. package/dist/types/Primitive/always/Fabricator.d.ts +6 -6
  31. package/dist/types/Primitive/always/Registry.d.ts +2 -2
  32. package/dist/types/Primitive/always/Schema.d.ts +4 -4
  33. package/dist/types/Primitive/always/Types.d.ts +2 -2
  34. package/dist/types/Primitive/always/index.d.ts +5 -5
  35. package/dist/types/Primitive/array/Admits.d.ts +1 -1
  36. package/dist/types/Primitive/array/Fabricator.d.ts +6 -6
  37. package/dist/types/Primitive/array/Registry.d.ts +4 -4
  38. package/dist/types/Primitive/array/Schema.d.ts +5 -5
  39. package/dist/types/Primitive/array/Types.d.ts +6 -6
  40. package/dist/types/Primitive/array/index.d.ts +5 -5
  41. package/dist/types/Primitive/bigint/Admits.d.ts +1 -1
  42. package/dist/types/Primitive/bigint/Fabricator.d.ts +6 -6
  43. package/dist/types/Primitive/bigint/Registry.d.ts +4 -4
  44. package/dist/types/Primitive/bigint/Schema.d.ts +5 -5
  45. package/dist/types/Primitive/bigint/Types.d.ts +4 -4
  46. package/dist/types/Primitive/bigint/index.d.ts +5 -5
  47. package/dist/types/Primitive/boolean/Fabricator.d.ts +6 -6
  48. package/dist/types/Primitive/boolean/Registry.d.ts +2 -2
  49. package/dist/types/Primitive/boolean/Schema.d.ts +5 -5
  50. package/dist/types/Primitive/boolean/Types.d.ts +3 -3
  51. package/dist/types/Primitive/boolean/index.d.ts +6 -6
  52. package/dist/types/Primitive/choice/Fabricator.d.ts +6 -6
  53. package/dist/types/Primitive/choice/Registry.d.ts +2 -2
  54. package/dist/types/Primitive/choice/Schema.d.ts +5 -5
  55. package/dist/types/Primitive/choice/Types.d.ts +4 -4
  56. package/dist/types/Primitive/choice/index.d.ts +5 -5
  57. package/dist/types/Primitive/date/Admits.d.ts +1 -1
  58. package/dist/types/Primitive/date/Defaults.d.ts +2 -2
  59. package/dist/types/Primitive/date/Fabricator.d.ts +6 -6
  60. package/dist/types/Primitive/date/Registry.d.ts +3 -3
  61. package/dist/types/Primitive/date/Schema.d.ts +5 -5
  62. package/dist/types/Primitive/date/Types.d.ts +6 -6
  63. package/dist/types/Primitive/date/index.d.ts +5 -5
  64. package/dist/types/Primitive/derive/Fabricator.d.ts +7 -7
  65. package/dist/types/Primitive/derive/Registry.d.ts +2 -2
  66. package/dist/types/Primitive/derive/Schema.d.ts +6 -6
  67. package/dist/types/Primitive/derive/Types.d.ts +6 -6
  68. package/dist/types/Primitive/derive/index.d.ts +5 -5
  69. package/dist/types/Primitive/enum/Fabricator.d.ts +6 -6
  70. package/dist/types/Primitive/enum/Registry.d.ts +2 -2
  71. package/dist/types/Primitive/enum/Schema.d.ts +5 -5
  72. package/dist/types/Primitive/enum/Types.d.ts +3 -3
  73. package/dist/types/Primitive/enum/index.d.ts +5 -5
  74. package/dist/types/Primitive/index.d.ts +28 -28
  75. package/dist/types/Primitive/namespace.d.ts +21 -21
  76. package/dist/types/Primitive/null/Fabricator.d.ts +6 -6
  77. package/dist/types/Primitive/null/Registry.d.ts +1 -1
  78. package/dist/types/Primitive/null/Schema.d.ts +4 -4
  79. package/dist/types/Primitive/null/Types.d.ts +2 -2
  80. package/dist/types/Primitive/null/index.d.ts +5 -5
  81. package/dist/types/Primitive/nullable/Fabricator.d.ts +6 -6
  82. package/dist/types/Primitive/nullable/Registry.d.ts +2 -2
  83. package/dist/types/Primitive/nullable/Schema.d.ts +6 -6
  84. package/dist/types/Primitive/nullable/Types.d.ts +5 -5
  85. package/dist/types/Primitive/nullable/index.d.ts +6 -6
  86. package/dist/types/Primitive/nullish/Fabricator.d.ts +6 -6
  87. package/dist/types/Primitive/nullish/Registry.d.ts +2 -2
  88. package/dist/types/Primitive/nullish/Schema.d.ts +6 -6
  89. package/dist/types/Primitive/nullish/Types.d.ts +5 -5
  90. package/dist/types/Primitive/nullish/index.d.ts +6 -6
  91. package/dist/types/Primitive/number/Admits.d.ts +1 -1
  92. package/dist/types/Primitive/number/Defaults.d.ts +1 -1
  93. package/dist/types/Primitive/number/Fabricator.d.ts +6 -6
  94. package/dist/types/Primitive/number/Registry.d.ts +5 -5
  95. package/dist/types/Primitive/number/Schema.d.ts +5 -5
  96. package/dist/types/Primitive/number/Types.d.ts +6 -6
  97. package/dist/types/Primitive/number/index.d.ts +5 -5
  98. package/dist/types/Primitive/object/Fabricator.d.ts +20 -24
  99. package/dist/types/Primitive/object/Registry.d.ts +9 -11
  100. package/dist/types/Primitive/object/Schema.d.ts +22 -14
  101. package/dist/types/Primitive/object/Stages.d.ts +68 -0
  102. package/dist/types/Primitive/object/Types.d.ts +112 -18
  103. package/dist/types/Primitive/object/compute/Fabricator.d.ts +13 -14
  104. package/dist/types/Primitive/object/compute/Registry.d.ts +2 -2
  105. package/dist/types/Primitive/object/compute/Schema.d.ts +7 -7
  106. package/dist/types/Primitive/object/compute/Types.d.ts +9 -10
  107. package/dist/types/Primitive/object/compute/index.d.ts +5 -5
  108. package/dist/types/Primitive/object/index.d.ts +8 -8
  109. package/dist/types/Primitive/object/omit/Registry.d.ts +2 -2
  110. package/dist/types/Primitive/object/omit/index.d.ts +2 -2
  111. package/dist/types/Primitive/object/omittable/Fabricator.d.ts +6 -6
  112. package/dist/types/Primitive/object/omittable/Registry.d.ts +2 -2
  113. package/dist/types/Primitive/object/omittable/Schema.d.ts +6 -6
  114. package/dist/types/Primitive/object/omittable/Types.d.ts +5 -5
  115. package/dist/types/Primitive/object/omittable/index.d.ts +6 -6
  116. package/dist/types/Primitive/object/optional/Fabricator.d.ts +6 -6
  117. package/dist/types/Primitive/object/optional/Registry.d.ts +2 -2
  118. package/dist/types/Primitive/object/optional/Schema.d.ts +6 -6
  119. package/dist/types/Primitive/object/optional/Types.d.ts +5 -5
  120. package/dist/types/Primitive/object/optional/index.d.ts +6 -6
  121. package/dist/types/Primitive/object/pick/Registry.d.ts +2 -2
  122. package/dist/types/Primitive/object/pick/index.d.ts +2 -2
  123. package/dist/types/Primitive/opaque/Fabricator.d.ts +6 -6
  124. package/dist/types/Primitive/opaque/Registry.d.ts +2 -2
  125. package/dist/types/Primitive/opaque/Schema.d.ts +4 -4
  126. package/dist/types/Primitive/opaque/Types.d.ts +3 -3
  127. package/dist/types/Primitive/opaque/index.d.ts +5 -5
  128. package/dist/types/Primitive/record/Admits.d.ts +2 -2
  129. package/dist/types/Primitive/record/Fabricator.d.ts +6 -6
  130. package/dist/types/Primitive/record/Registry.d.ts +3 -3
  131. package/dist/types/Primitive/record/Schema.d.ts +5 -5
  132. package/dist/types/Primitive/record/Types.d.ts +6 -6
  133. package/dist/types/Primitive/record/index.d.ts +5 -5
  134. package/dist/types/Primitive/recursive/Fabricator.d.ts +6 -6
  135. package/dist/types/Primitive/recursive/Registry.d.ts +4 -4
  136. package/dist/types/Primitive/recursive/Schema.d.ts +4 -4
  137. package/dist/types/Primitive/recursive/Terminate.d.ts +1 -1
  138. package/dist/types/Primitive/recursive/Types.d.ts +3 -3
  139. package/dist/types/Primitive/recursive/index.d.ts +6 -6
  140. package/dist/types/Primitive/recursive/self/Fabricator.d.ts +5 -5
  141. package/dist/types/Primitive/recursive/self/Registry.d.ts +1 -1
  142. package/dist/types/Primitive/recursive/self/Schema.d.ts +4 -4
  143. package/dist/types/Primitive/recursive/self/Types.d.ts +2 -2
  144. package/dist/types/Primitive/recursive/self/index.d.ts +5 -5
  145. package/dist/types/Primitive/string/Admits.d.ts +1 -1
  146. package/dist/types/Primitive/string/Capacity.d.ts +1 -1
  147. package/dist/types/Primitive/string/Constants.d.ts +1 -1
  148. package/dist/types/Primitive/string/Fabricator.d.ts +6 -6
  149. package/dist/types/Primitive/string/Registry.d.ts +4 -4
  150. package/dist/types/Primitive/string/Schema.d.ts +5 -5
  151. package/dist/types/Primitive/string/Sources.d.ts +1 -1
  152. package/dist/types/Primitive/string/Types.d.ts +6 -6
  153. package/dist/types/Primitive/string/index.d.ts +6 -6
  154. package/dist/types/Primitive/symbol/Fabricator.d.ts +6 -6
  155. package/dist/types/Primitive/symbol/Registry.d.ts +2 -2
  156. package/dist/types/Primitive/symbol/Schema.d.ts +5 -5
  157. package/dist/types/Primitive/symbol/Types.d.ts +3 -3
  158. package/dist/types/Primitive/symbol/index.d.ts +5 -5
  159. package/dist/types/Primitive/tuple/Fabricator.d.ts +6 -6
  160. package/dist/types/Primitive/tuple/Registry.d.ts +2 -2
  161. package/dist/types/Primitive/tuple/Schema.d.ts +5 -5
  162. package/dist/types/Primitive/tuple/Types.d.ts +4 -4
  163. package/dist/types/Primitive/tuple/index.d.ts +5 -5
  164. package/dist/types/Primitive/undefinable/Fabricator.d.ts +6 -6
  165. package/dist/types/Primitive/undefinable/Registry.d.ts +2 -2
  166. package/dist/types/Primitive/undefinable/Schema.d.ts +6 -6
  167. package/dist/types/Primitive/undefinable/Types.d.ts +5 -5
  168. package/dist/types/Primitive/undefinable/index.d.ts +6 -6
  169. package/dist/types/Primitive/undefined/Fabricator.d.ts +6 -6
  170. package/dist/types/Primitive/undefined/Registry.d.ts +1 -1
  171. package/dist/types/Primitive/undefined/Schema.d.ts +4 -4
  172. package/dist/types/Primitive/undefined/Types.d.ts +2 -2
  173. package/dist/types/Primitive/undefined/index.d.ts +5 -5
  174. package/dist/types/Primitive/unique/Registry.d.ts +7 -7
  175. package/dist/types/Primitive/unique/index.d.ts +2 -2
  176. package/dist/types/Random/Generator/sfc32.d.ts +1 -1
  177. package/dist/types/Random/Types.d.ts +1 -1
  178. package/dist/types/Random/index.d.ts +1 -1
  179. package/dist/types/Schema/Core.d.ts +5 -5
  180. package/dist/types/Schema/Registry.d.ts +3 -3
  181. package/dist/types/Schema/Satisfies.d.ts +3 -3
  182. package/dist/types/Schema/Types.d.ts +5 -5
  183. package/dist/types/Types.d.ts +2 -2
  184. package/dist/types/Unique/Capacity.d.ts +1 -1
  185. package/dist/types/Unique/Distinct.d.ts +6 -6
  186. package/dist/types/Unique/Strategy.d.ts +5 -5
  187. package/dist/types/Utility/Core.d.ts +2 -2
  188. package/dist/types/Utility/DeepMerge.d.ts +2 -2
  189. package/dist/types/Utility/ShallowMerge.d.ts +7 -3
  190. package/dist/types/adapting.d.ts +3 -3
  191. package/dist/types/harnessing.d.ts +2 -2
  192. package/dist/types/index.d.ts +30 -30
  193. package/dist/types/internal.d.ts +16 -16
  194. package/package.json +2 -3
@@ -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 { Claim, 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 { Claim, 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,8 +1,8 @@
1
- import type { Adaptations } from "../../Adapter/Types";
2
- import { default as bigint } from "../bigint";
3
- import { unique as uniqueBigint } from "../bigint/Registry";
4
- import { Schema } from "./Schema";
5
- import type { InputUniqueWhereby, InputWhereby, Whereby } from "./Types";
1
+ import type { Adaptations } from "../../Adapter/Types.ts";
2
+ import { default as bigint } from "../bigint/index.ts";
3
+ import { unique as uniqueBigint } from "../bigint/Registry.ts";
4
+ import { Schema } from "./Schema.ts";
5
+ import type { InputUniqueWhereby, InputWhereby, Whereby } from "./Types.ts";
6
6
  type ThisRegistry = Schema<{}, Adaptations> & {
7
7
  /**
8
8
  * A `number` drawn from `[min, max]`, either end optional. Pass a
@@ -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, Admits, InputAdmits } 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, Admits, InputAdmits } from "./Types.ts";
6
6
  /**
7
7
  * Buildable `number` recipe: a range/distribution (`whereby`, absent for the
8
8
  * full-range bare form), `integer` for whole-number semantics, a `sequence`
@@ -1,9 +1,9 @@
1
- import type { Adaptations } from "../../Adapter/Types";
2
- import type { AdmittedEnds, Bound, InputAdmittedEnds, InputBound } from "../../Bound";
3
- import type { Distribution } from "../../Distribution";
4
- import type { Produce } from "../../Random/Types";
5
- import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types";
6
- import type { Redraws } from "../../Unique/Strategy";
1
+ import type { Adaptations } from "../../Adapter/Types.ts";
2
+ import type { AdmittedEnds, Bound, InputAdmittedEnds, InputBound } from "../../Bound.ts";
3
+ import type { Distribution } from "../../Distribution/index.ts";
4
+ import type { Produce } from "../../Random/Types.ts";
5
+ import type { Adaptation, Kind, Meta, Produced, Produces } from "../../Types.ts";
6
+ import type { Redraws } from "../../Unique/Strategy.ts";
7
7
  /**
8
8
  * Call-site `{ min, max }` — scalars are inclusive. Either end may be omitted;
9
9
  * a missing end is unbounded (the same policy as a bare `T.number`), not a
@@ -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 type { Schema } from "./Schema";
6
- import type { Definition, Fabricated, Override, 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 type { Schema } from "./Schema.ts";
6
+ import type { Definition, Fabricated, Override, 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;
@@ -36,8 +36,8 @@ export type Fields = Record<string, BaseFabricator<unknown>>;
36
36
  * built by `Constructor.ts` — which owns recursion into nested Schemas, so
37
37
  * `object` never calls `construct()` and there's no import cycle with
38
38
  * `Constructor.ts`. Schema-baked `.override()`-marked fields (`[Fixed]` in
39
- * `Types.ts`) are already resolved into literal-valued `fields` entries before
40
- * they reach here. `fabricate`'s `overrides` (below) is a separate per-call
39
+ * `Types.ts`) are already resolved into literal-valued entries before they
40
+ * reach here. `fabricate`'s `overrides` (below) is a separate per-call
41
41
  * mechanism; the two compose.
42
42
  *
43
43
  * `schema` is echoed as `.schema` unchanged — callers wanting a
@@ -45,20 +45,16 @@ export type Fields = Record<string, BaseFabricator<unknown>>;
45
45
  * `Constructor.ts`'s `make` passes `object.rehydrate(...)` so a top-level built
46
46
  * Fabricator's `.schema` still composes.
47
47
  *
48
- * A compute-kind field (from `.refine()`) needs the rest of the object already
49
- * fabricated (`object/compute/Fabricator.ts`), which isn't available until
50
- * every ordinary field has resolved. Two phases: ordinary fields first, then
51
- * compute fields against the accumulated result, in dependency order — each
52
- * after every compute field among its `dependencies` (`compute/Types.ts`) —
53
- * unless covered by `overrides`, in which case it resolves in phase 1 like any
54
- * other overridden field. Dependency order rather than definition order is what
55
- * lets `hidden` live in its own map: a hidden compute field can sit between two
56
- * visible ones in the chain, and no fixed visible/hidden order resolves that.
57
- *
58
- * `hidden` is `[Meta].hidden` built (`Types.ts`'s `Meta`): fabricated in both
59
- * phases exactly like `fields`, so compute fields can read them, then deleted
60
- * before returning. Per-call `overrides` only reach `fields` — `.override()`
61
- * rejects a hidden key, and `{ validate: false }` must not let one through.
62
- * `[Children]` stays `fields` alone, so enumeration never pins a hidden field.
48
+ * `stages` is `[Meta].stages` built (`Stages.ts`), and `fields` is each visible
49
+ * key's current version out of it, which is also `[Children]`, so enumeration
50
+ * never pins a hidden field or an earlier version. Two phases: every ordinary
51
+ * entry first, then the compute entries in stage order. A compute entry only
52
+ * reads earlier stages, so stage order is already dependency order. Each is
53
+ * handed exactly its `dependencies`, each at the version current before its
54
+ * stage, with an absent one left out. Hidden entries and earlier versions are
55
+ * fabricated like any other and never emitted. Per-call `overrides` reach only
56
+ * the visible current versions — `.override()` rejects a hidden key, and `{
57
+ * validate: false }` must not let one through — so a compute field reading an
58
+ * earlier version of an overridden key still reads that version.
63
59
  */
64
- export declare function Fabricator<$Definition extends Definition>(context: FabricatorContext<Schema<$Definition>>, fields: Fields, hidden?: Fields): Fabricator<Schema<$Definition>>;
60
+ export declare function Fabricator<$Definition extends Definition>(context: FabricatorContext<Schema<$Definition>>, fields: Fields, stages: ReadonlyArray<Fields>): Fabricator<Schema<$Definition>>;
@@ -1,7 +1,7 @@
1
- import type { Adaptations } from "../../Adapter/Types";
2
- import { Adaptation, Meta } from "../../Types";
3
- import { Schema } from "./Schema";
4
- import type { Definition, Subsettable, Meta as ThisMeta } from "./Types";
1
+ import type { Adaptations } from "../../Adapter/Types.ts";
2
+ import { Adaptation, Meta } from "../../Types.ts";
3
+ import { Schema } from "./Schema.ts";
4
+ import type { Definition, PlainFields, Subsettable, Meta as ThisMeta } from "./Types.ts";
5
5
  /**
6
6
  * Rebuild a full `object` Schema — with `extend`/`refine` restored — from
7
7
  * anything already reduced to this kind's `[Meta]` (a bare Schema, or a built
@@ -23,17 +23,15 @@ export declare function rehydrate<$Definition extends Definition, $Adaptations e
23
23
  * Shared body of `T.pick`/`T.omit` (`pick/Registry.ts`, `omit/Registry.ts`),
24
24
  * kept here because it rebuilds through `make`. A pure Schema → Schema
25
25
  * transform, like `.override()`: the result is an ordinary `object` Schema over
26
- * the kept fields, in source order. A dependency of a kept compute field that
27
- * is not itself kept moves to `[Meta].hidden` — fabricated, so the resolver can
28
- * read it, but never emitted. A dropped field nothing depends on is gone
29
- * entirely.
26
+ * the kept fields, in source order. `make`'s `prune` keeps every version a kept
27
+ * compute field reads, hidden — fabricated, so the resolver can read it, but
28
+ * never emitted — and drops everything else.
30
29
  *
31
30
  * The source's own `produce` (`.as(...)`) and whole-object `[Adaptation]` are
32
31
  * not carried: both describe the source's full shape, not this one. Field
33
32
  * entries are reused as they are, so a kept or hidden field's own adaptation
34
- * and `[Fixed]` override come along. `refinements` is filtered down to the kept
35
- * fields.
33
+ * and `[Fixed]` override come along.
36
34
  */
37
35
  export declare function subset(source: Subsettable, keys: ReadonlyArray<string>, operation: "pick" | "omit"): Schema<any>;
38
- declare const _default: <const $Definition extends Definition>(definition: $Definition) => Schema<$Definition>;
36
+ declare const _default: <const $Definition extends Definition & PlainFields<$Definition>>(definition: $Definition) => Schema<$Definition>;
39
37
  export default _default;
@@ -1,22 +1,30 @@
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 { ShallowMerge } from "../../Utility/ShallowMerge";
7
- import type { Computer } from "./compute/Schema";
8
- import type { Core, Definition, Extender, Fabricated, Override, Refinement } 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 { ShallowMerge } from "../../Utility/ShallowMerge.ts";
7
+ import type { Computer } from "./compute/Schema.ts";
8
+ import type { Core, Definition, Extender, Extension, Fabricated, Override, Rebase, Rebased, Refinement } from "./Types.ts";
9
9
  export type Refiner<$Definition extends Definition, $Refinement extends Refinement<$Definition>> = (params: {
10
10
  base: Schema<$Definition>;
11
11
  compute: Computer<$Definition>;
12
12
  }) => $Refinement;
13
13
  export interface Schema<$Definition extends Definition = Definition, $Adaptations extends Adaptations = {}> extends Core<$Definition, $Adaptations> {
14
- extend: <const $Extension extends Definition>(extender: Extender<$Definition, $Extension>) => Schema<ShallowMerge<$Definition, $Extension>, $Adaptations>;
14
+ extend: <const $Extension extends Definition & Extension<$Definition, $Extension>>(extender: Extender<$Definition, $Extension>) => Schema<ShallowMerge<$Definition, $Extension>, $Adaptations>;
15
15
  refine: <const $Refinement extends Refinement<$Definition>>(refiner: Refiner<$Definition, $Refinement>) => Schema<ShallowMerge<$Definition, $Refinement>, $Adaptations>;
16
16
  override: (override: Override<$Definition>) => Schema<$Definition, $Adaptations>;
17
+ /**
18
+ * Replace each named field's original version — the one every `.refine()`
19
+ * since read, or replaced from — with the given schema: a reverse override.
20
+ * `.override()` and `.extend()` reach only a field's current version, so this
21
+ * is how a finished schema's computed field gets a different input. See
22
+ * `Registry.ts`'s `rebase`.
23
+ */
24
+ rebase: <const $Rebase extends Definition & Rebase<$Definition, $Rebase>>(fields: $Rebase) => Schema<Rebased<$Definition, $Rebase>, $Adaptations>;
17
25
  /**
18
26
  * Layer an opaque production on this schema's existing `[Meta]` — carrying
19
- * `definition`/`refinements` forward, not discarding them, so
27
+ * `definition`/`stages` forward, not discarding them, so
20
28
  * `extend`/`refine`/`override` keep working (they drop the custom producer
21
29
  * again, falling back to definition-based fabrication) and a later `.as(...)`
22
30
  * (or future validation of `produce`) still has the definition to check
@@ -42,10 +50,10 @@ export interface Schema<$Definition extends Definition = Definition, $Adaptation
42
50
  /**
43
51
  * Unlike every other kind, `adapt` is _not_ added here but by `Registry.ts`'s
44
52
  * `make` alongside `extend`/`refine`/`override`: those three rebuild from
45
- * `definition`/`refinements` rather than deriving from this object, so the
46
- * adaptation map has to be threaded through `make` itself or chaining one of
47
- * them would drop it (see `make`'s `adapt`). `as` and `satisfies` are the
48
- * methods this factory attaches, so they are what the parameter omits.
53
+ * `stages` rather than deriving from this object, so the adaptation map has to
54
+ * be threaded through `make` itself or chaining one of them would drop it (see
55
+ * `make`'s `adapt`). `as` and `satisfies` are the methods this factory
56
+ * attaches, so they are what the parameter omits.
49
57
  */
50
58
  export declare function Schema<$Definition extends Definition, $Adaptations extends Adaptations = {}>(schema: Omit<Schema<$Definition, $Adaptations>, "as" | "satisfies">): Schema<$Definition, $Adaptations>;
51
59
  export declare function isObjectSchema(candidate: AnySchema): candidate is Schema;
@@ -0,0 +1,68 @@
1
+ import { Fixed, Kind, Meta } from "../../Types.ts";
2
+ import type { Definition } from "./Types.ts";
3
+ /**
4
+ * An `object`'s fields by `.refine()` stage (`Types.ts`'s `Meta`): stage 0
5
+ * holds the `T.object(...)` fields, and each `.refine()` appends one holding
6
+ * its compute fields. A key has one entry per version, in the stage that
7
+ * created that version.
8
+ */
9
+ export type Stages = ReadonlyArray<Definition>;
10
+ /**
11
+ * A stage entry, or the Fabricator built from one: all {@link readsOf} looks at.
12
+ */
13
+ type Entry = {
14
+ readonly [Kind]: string;
15
+ readonly [Meta]?: unknown;
16
+ readonly [Fixed]?: unknown;
17
+ };
18
+ /**
19
+ * The index of the latest stage before `before` with an entry for `key`, or
20
+ * `-1`. With `before` left out, that is the key's current version. A compute
21
+ * field in stage `i` reads each dependency from `stageOf(stages, key, i)`.
22
+ */
23
+ export declare function stageOf(stages: ReadonlyArray<object>, key: string, before?: number): number;
24
+ /**
25
+ * The index of the earliest stage with an entry for `key`, or `-1`: the version
26
+ * every later one replaced, which `.rebase()` replaces.
27
+ */
28
+ export declare function firstStageOf(stages: ReadonlyArray<object>, key: string): number;
29
+ /**
30
+ * Every key with an entry in `stages`: each of `order` (the visible keys), then
31
+ * each hidden one in stage order.
32
+ */
33
+ export declare function stageKeys(stages: Stages, order: ReadonlyArray<string>): ReadonlyArray<string>;
34
+ /**
35
+ * The fields an entry reads: a compute field's `dependencies`
36
+ * (`compute/Types.ts`), unless `.override()` fixed its value, in which case its
37
+ * resolver never runs. Every other entry reads nothing.
38
+ */
39
+ export declare function readsOf(entry: Entry): ReadonlyArray<string>;
40
+ /**
41
+ * The visible view `[Meta].definition` holds: each key of `order`, in that
42
+ * order, at its current version.
43
+ */
44
+ export declare function toDefinition(stages: Stages, order: ReadonlyArray<string>): Definition;
45
+ /**
46
+ * `entries` written over `stages` where each key stands: a key that already has
47
+ * an entry replaces its current version in place, so every compute field
48
+ * reading that version reads the new entry. Any other key goes into the last
49
+ * stage, which no compute field reads from: a compute field only reads earlier
50
+ * stages, and later ones see it as current.
51
+ */
52
+ export declare function withEntries(stages: Stages, entries: Definition): Stages;
53
+ /**
54
+ * `entries` written over each key's earliest version where it stands
55
+ * (`.rebase()`), so every compute field reading that version, including one
56
+ * that replaced the key, reads the new entry. Later versions are untouched.
57
+ * Every key must already have an entry.
58
+ */
59
+ export declare function withOriginals(stages: Stages, entries: Definition): Stages;
60
+ /**
61
+ * Keep only the entries something reads: the current version of each key in
62
+ * `order`, and, transitively, the version each kept compute field reads of its
63
+ * dependencies. Every other entry and every empty stage is dropped. Dropping
64
+ * never changes what a kept compute field reads: the version it reads is the
65
+ * latest before its stage, and that one is kept.
66
+ */
67
+ export declare function prune(stages: Stages, order: ReadonlyArray<string>): Stages;
68
+ export {};
@@ -1,9 +1,10 @@
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 { Kind, Meta, type Adaptation, type Omitted, type Produced, type Produces } from "../../Types";
5
- import { type Pretty } from "../../Utility/Types";
6
- import type { Schema as ComputeSchema } from "./compute/Schema";
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 { Kind, Meta, type Adaptation, type Omitted, type Produced, type Produces } from "../../Types.ts";
5
+ import { type Pretty } from "../../Utility/Types.ts";
6
+ import type { Schema as ComputeSchema } from "./compute/Schema.ts";
7
+ import type { Stages } from "./Stages.ts";
7
8
  export type Definition<$Schema = AnySchema> = {
8
9
  [_ in string]: $Schema;
9
10
  };
@@ -17,7 +18,95 @@ export type Refinement<$Definition extends Definition> = Definition<ComputeSchem
17
18
  export type Extender<$Definition extends Definition, $Extension extends Definition> = (params: {
18
19
  base: $Definition;
19
20
  }) => $Extension;
20
- export type Refinements = ReadonlyArray<Definition>;
21
+ /**
22
+ * What `T.object(...)`/`.extend(...)` expect in place of a compute entry, so
23
+ * the type error reads as the fix. `Registry.ts` throws
24
+ * `ComputeOutsideRefineError` for one that gets past the type.
25
+ */
26
+ type ComputeOutsideRefine = "Add computed fields with `.refine(({ compute }) => ...)`";
27
+ /**
28
+ * Checked structurally, like `Override`: a compute `Schema` would bring
29
+ * `refine`'s contravariance with it.
30
+ */
31
+ type IsCompute<$Entry> = $Entry extends {
32
+ [Kind]: "object.compute";
33
+ } ? true : false;
34
+ /**
35
+ * `T.object(...)`'s fields, each compute entry swapped for
36
+ * {@link ComputeOutsideRefine}: a compute field reads the object as of the
37
+ * `.refine()` stage that minted it, so it only enters through that stage.
38
+ */
39
+ export type PlainFields<$Definition extends Definition> = {
40
+ [$K in keyof $Definition]: IsCompute<$Definition[$K]> extends true ? ComputeOutsideRefine : $Definition[$K];
41
+ };
42
+ /**
43
+ * What a compute entry's resolver is handed, or `{}` for any other entry: not
44
+ * `never`, whose `keyof` is every key.
45
+ */
46
+ type ReaderInput<$Entry> = $Entry extends {
47
+ [Kind]: "object.compute";
48
+ [Meta]: {
49
+ resolve: (params: {
50
+ fabricated: infer $Input;
51
+ }) => any;
52
+ };
53
+ } ? $Input : {};
54
+ /**
55
+ * Every key some compute entry of `$Definition` reads, other than the entry at
56
+ * that key itself: one that replaced its key reads the previous version, which
57
+ * `.extend()` never touches.
58
+ */
59
+ type ReadKeys<$Definition extends Definition> = {
60
+ [$K in keyof $Definition]: Exclude<keyof ReaderInput<$Definition[$K]>, $K>;
61
+ }[keyof $Definition];
62
+ /**
63
+ * What `.extend(...)` may return: {@link PlainFields}, and a field some compute
64
+ * entry reads keeps a type that reader can take. `.extend()` replaces a field
65
+ * where it stands, so a reader would otherwise be handed a value its resolver
66
+ * was not typed for. A field nothing reads may change type freely.
67
+ */
68
+ export type Extension<$Definition extends Definition, $Extension extends Definition> = {
69
+ [$K in keyof $Extension]: IsCompute<$Extension[$K]> extends true ? ComputeOutsideRefine : $K extends ReadKeys<$Definition> & keyof $Definition ? [FabricatedBy<$Extension[$K]>] extends [FabricatedBy<$Definition[$K]>] ? $Extension[$K] : `"${$K & string}" is read by a computed field, so it must keep its type` : $Extension[$K];
70
+ };
71
+ /**
72
+ * Whether every compute entry of `$Definition` reading `$Key` — its own entry
73
+ * included, which reads the version `.rebase()` replaces — can take `$Value`
74
+ * for it. The type does not say which version each one reads, so one reading a
75
+ * later version, whose type a `.refine()` changed, constrains it too.
76
+ */
77
+ type ReadersAccept<$Definition extends Definition, $Key extends PropertyKey, $Value> = false extends {
78
+ [$R in keyof $Definition]: $Key extends keyof ReaderInput<$Definition[$R]> ? [$Value] extends [ReaderInput<$Definition[$R]>[$Key]] ? true : false : true;
79
+ }[keyof $Definition] ? false : true;
80
+ /**
81
+ * Every key some compute entry of `$Definition` reads, its own key included.
82
+ * Unlike {@link ReadKeys}, this reaches a hidden key a visible compute entry
83
+ * reads, which `$Definition` itself no longer names.
84
+ */
85
+ type InputKeys<$Definition extends Definition> = {
86
+ [$K in keyof $Definition]: keyof ReaderInput<$Definition[$K]>;
87
+ }[keyof $Definition];
88
+ /**
89
+ * What `.rebase(...)` may take: {@link PlainFields} naming only visible keys and
90
+ * keys a visible compute entry reads (hidden ones included), each of a type
91
+ * every compute entry reading that key can take.
92
+ */
93
+ export type Rebase<$Definition extends Definition, $Rebase extends Definition> = {
94
+ [$K in keyof $Rebase]: IsCompute<$Rebase[$K]> extends true ? ComputeOutsideRefine : $K extends keyof $Definition | InputKeys<$Definition> ? ReadersAccept<$Definition, $K, FabricatedBy<$Rebase[$K]>> extends true ? $Rebase[$K] : `"${$K & string}" is read by a computed field, so it must keep its type` : `"${$K & string}" is not a field of this object`;
95
+ };
96
+ /**
97
+ * The definition `.rebase(...)` produces. It replaces each named key's earliest
98
+ * version, so the visible entry changes only when that was the current one:
99
+ *
100
+ * - not a compute entry: no `.refine()` replaced it, so it was the only version,
101
+ * and the rebased entry takes its place;
102
+ * - a compute entry reading its own key: it replaced an earlier version it still
103
+ * reads, which is the one rebased, so it stays;
104
+ * - any other compute entry: whether an earlier version survived depends on what
105
+ * else read it, which the type cannot see, so it is either.
106
+ */
107
+ export type Rebased<$Definition extends Definition, $Rebase extends Definition> = {
108
+ [$K in keyof $Definition]: $K extends keyof $Rebase ? IsCompute<$Definition[$K]> extends true ? $K extends keyof ReaderInput<$Definition[$K]> ? $Definition[$K] : $Definition[$K] | $Rebase[$K] : $Rebase[$K] : $Definition[$K];
109
+ };
21
110
  /**
22
111
  * Every `object.omittable`- or `object.optional`-kind field's key, so
23
112
  * `Fabricated` can mark exactly those `?:` instead of required — matching
@@ -62,25 +151,30 @@ export type Override<$Definition extends Definition> = Pretty<{
62
151
  } ? FabricatedBy<$Definition[$K]> | typeof Omitted : FabricatedBy<$Definition[$K]>;
63
152
  }>;
64
153
  /**
65
- * `definition`/`refinements` stay required regardless of `produce` — an opaque
66
- * `as` production layers on top rather than replacing them, so
154
+ * `definition`/`stages` stay required regardless of `produce` — an opaque `as`
155
+ * production layers on top rather than replacing them, so
67
156
  * `extend`/`refine`/`override` and `ToTypeBox`'s structural derivation keep
68
157
  * working, and a prior definition survives `as` for future validation of
69
158
  * `produce`.
70
159
  *
71
- * `hidden` holds fields that are fabricated but never emitted: the dependencies
72
- * of a kept compute field that `T.pick`/`T.omit` (`Registry.ts`) dropped from
73
- * `definition`. Absent when there are none. It sits outside `definition` so
74
- * that everything reading `definition` — the `Fabricated`/`Override` types,
75
- * `.override()`'s key check, `[Children]` (and so enumeration), and every
76
- * adapter — never sees a hidden field. Only `Constructor.ts`'s `make`,
77
- * `Fabricator.ts`'s `fabricate`, and `recursive/Terminate.ts` read it.
160
+ * `stages` (`Stages.ts`) is every field entry by `.refine()` stage, one entry
161
+ * per version of a key: stage 0 holds the `T.object(...)` fields, and each
162
+ * `.refine()` appends a stage holding its compute fields. A compute field reads
163
+ * each dependency from the latest stage before its own. `definition` is the
164
+ * visible view derived from it in `Registry.ts`'s `make`: each visible key at
165
+ * its current version. A key `stages` has and `definition` does not is hidden,
166
+ * fabricated because a compute field reads it but never emitted: a dependency
167
+ * `T.pick`/`T.omit` dropped, or an earlier version of a key a later `.refine()`
168
+ * replaced. Everything that reads `definition` — the `Fabricated`/`Override`
169
+ * types, `.override()`'s key check, `[Children]` (and so enumeration), and
170
+ * every adapter — never sees one. Only `Constructor.ts`'s `make`,
171
+ * `Fabricator.ts`'s `fabricate`, `recursive/Terminate.ts`, and
172
+ * `Unique/Capacity.ts` read `stages`.
78
173
  */
79
174
  export type Meta<$Definition extends Definition = Definition> = {
80
175
  definition: $Definition;
81
- refinements: Refinements;
176
+ stages: Stages;
82
177
  produce?: Produce<Fabricated<$Definition>>;
83
- hidden?: Definition;
84
178
  };
85
179
  /**
86
180
  * What `T.pick`/`T.omit` accept: an `object` Schema or a built `object`
@@ -1,10 +1,10 @@
1
- import type { Adaptations } from "../../../Adapter/Types";
2
- import type { Fabricator as BaseFabricator, FabricatorContext } from "../../../Fabricator/Types";
3
- import type { Trace } from "../../../Random/Types";
4
- import { Kind, Meta, type Adaptation } from "../../../Types";
5
- import { type PlainObject } from "../../../Utility/Types";
6
- import type { Schema } from "./Schema";
7
- import type { Resolved, Source, Meta as ThisMeta } from "./Types";
1
+ import type { Adaptations } 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 { Kind, Meta, type Adaptation } from "../../../Types.ts";
5
+ import { type PlainObject } from "../../../Utility/Types.ts";
6
+ import type { Schema } from "./Schema.ts";
7
+ import type { Resolved, Source, Meta as ThisMeta } from "./Types.ts";
8
8
  export type Fabrication<$Fabricator extends Fabricator<any, Source>> = $Fabricator extends Fabricator<any, infer $Source> ? Resolved<$Source> : never;
9
9
  export type Fabricator<$Fabricated, $Source extends Source, $Adaptations extends Adaptations = {}> = {
10
10
  [Kind]: "object.compute";
@@ -19,13 +19,12 @@ export declare function isObjectComputeFabricator(candidate: BaseFabricator<unkn
19
19
  /**
20
20
  * Turn an `object.compute` Schema into a live Fabricator. Unlike every other
21
21
  * kind, there's nothing of `source` to build here — a computed field's value
22
- * comes entirely from `resolve`, given the rest of the object. The node still
23
- * records `trace` so it can be rebuilt from a parent field's captured trace;
24
- * `.fabricate()` without the parent object throws `DetachedComputeError`.
22
+ * comes entirely from `resolve`, given the fields it reads. Only an `object`'s
23
+ * stage entries are built this way (`Constructor.ts`'s `buildField`); anywhere
24
+ * else is `DetachedComputeError` at build time, and so is `.fabricate()`
25
+ * without the fields.
25
26
  *
26
- * The parent hands over everything it has fabricated so far; a `narrowed` field
27
- * (`.from([...])`) passes its resolver only its `dependencies`, and only those
28
- * present, so an omitted dependency stays absent rather than becoming
29
- * `undefined`. Narrowing here keeps `object/Fabricator.ts` unaware of it.
27
+ * `object/Fabricator.ts` hands over exactly `[Meta].dependencies`, each at the
28
+ * version this field reads, so nothing is narrowed here.
30
29
  */
31
30
  export declare function Fabricator<$Fabricated extends PlainObject, $Source extends Source>(context: FabricatorContext<Schema<$Fabricated, $Source>>): Fabricator<$Fabricated, $Source>;
@@ -1,5 +1,5 @@
1
- import type { Definition } from "../Types";
2
- import { type Computer } from "./Schema";
1
+ import type { Definition } from "../Types.ts";
2
+ import { type Computer } from "./Schema.ts";
3
3
  /**
4
4
  * `base` is the keys of the `.refine()` stage's base definition — what a plain
5
5
  * `.as` resolver depends on, and what `.from([...])` may name. Checked at
@@ -1,10 +1,10 @@
1
- import { type AdaptationEntry } from "../../../Adapter/Core";
2
- import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../../Adapter/Types";
3
- import type { AnySchema } from "../../../Schema/Types";
4
- import { type SatisfiesThis } from "../../../Schema/Satisfies";
5
- import type { Pretty } from "../../../Utility/Types";
6
- import type * as object from "../Types";
7
- import type { Core, Resolved, Source } from "./Types";
1
+ import { type AdaptationEntry } from "../../../Adapter/Core.ts";
2
+ import type { Adaptations, Adapter, Adapting, WithAdaptations } from "../../../Adapter/Types.ts";
3
+ import type { AnySchema } from "../../../Schema/Types.ts";
4
+ import { type SatisfiesThis } from "../../../Schema/Satisfies.ts";
5
+ import type { Pretty } from "../../../Utility/Types.ts";
6
+ import type * as object from "../Types.ts";
7
+ import type { Core, Resolved, Source } from "./Types.ts";
8
8
  /**
9
9
  * The fields a `.from([...])` resolver is handed: only the named ones, each
10
10
  * keeping its own `?:` (an omittable or optional dependency may be absent).
@@ -1,6 +1,6 @@
1
- import type { Adaptations } from "../../../Adapter/Types";
2
- import type { AnySchema, Fabricated as FabricatedBy } from "../../../Schema/Types";
3
- import { Kind, type Adaptation, type Meta, type Produced, type Produces } from "../../../Types";
1
+ import type { Adaptations } from "../../../Adapter/Types.ts";
2
+ import type { AnySchema, Fabricated as FabricatedBy } from "../../../Schema/Types.ts";
3
+ import { Kind, type Adaptation, type Meta, type Produced, type Produces } from "../../../Types.ts";
4
4
  /**
5
5
  * A builder that can mint a Schema via `as` — e.g. `T.string`, `T.bigint`.
6
6
  * `compute` accepts one alongside a plain Schema so a caller needn't satisfy a
@@ -41,12 +41,12 @@ export type Resolved<$Source, $Bindings extends unknown[] = []> = FabricatedBy<D
41
41
  * is handed.
42
42
  *
43
43
  * `dependencies` is always present, so every compute field has a known set of
44
- * fields it reads: the keys named by `.from([...])`, or, without one, every key
45
- * of the `.refine()` stage's base — exactly what the resolver's type lets it
46
- * read. `object/Fabricator.ts` resolves compute fields in dependency order from
47
- * it, and `T.pick`/`T.omit` (`object/Registry.ts`) keep exactly those fields
48
- * fabricated. `narrowed` is whether the resolver is handed only its
49
- * `dependencies` (from `.from`) or the whole object fabricated so far.
44
+ * fields it reads: the keys named by `.from([...])`, or, without one, every
45
+ * visible key of the `.refine()` stage's base — exactly what the resolver's
46
+ * type lets it read. The enclosing object hands the resolver exactly those
47
+ * fields, each at the version current before this field's stage
48
+ * (`object/Stages.ts`), and leaves out an omitted one rather than passing
49
+ * `undefined`. `T.pick`/`T.omit` keep exactly those versions fabricated.
50
50
  */
51
51
  export type Meta<$Fabricated, $Source extends Source> = {
52
52
  source: $Source;
@@ -54,7 +54,6 @@ export type Meta<$Fabricated, $Source extends Source> = {
54
54
  fabricated: $Fabricated;
55
55
  }) => Resolved<$Source>;
56
56
  dependencies: ReadonlyArray<string>;
57
- narrowed: boolean;
58
57
  };
59
58
  export interface Core<$Fabricated, $Source extends Source, $Adaptations extends Adaptations = {}> {
60
59
  [Kind]: "object.compute";
@@ -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,8 +1,8 @@
1
- export * from "./Types";
2
- export * from "./Schema";
3
- export * from "./Fabricator";
4
- export * from "./Registry";
5
- export { default } from "./Registry";
6
- export * as compute from "./compute";
7
- export * as omittable from "./omittable";
8
- export * as optional from "./optional";
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";
6
+ export * as compute from "./compute/index.ts";
7
+ export * as omittable from "./omittable/index.ts";
8
+ export * as optional from "./optional/index.ts";
@@ -1,5 +1,5 @@
1
- import type { Schema } from "../Schema";
2
- import type { DefinitionOf, Subsettable } from "../Types";
1
+ import type { Schema } from "../Schema.ts";
2
+ import type { DefinitionOf, Subsettable } from "../Types.ts";
3
3
  /**
4
4
  * `T.omit(source, keys)`: an `object` Schema without `keys`. `T.pick`'s
5
5
  * inverse, and not a kind either — see `subset` in `object/Registry.ts`.
@@ -1,2 +1,2 @@
1
- export * from "./Registry";
2
- export { default } from "./Registry";
1
+ export * from "./Registry.ts";
2
+ export { default } from "./Registry.ts";