@fluidframework/tree 2.93.0 → 2.101.0

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 (273) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/INCREMENTAL_SUMMARY.md +89 -0
  3. package/README.md +6 -0
  4. package/api-report/tree.alpha.api.md +6 -1
  5. package/api-report/tree.beta.api.md +3 -1
  6. package/api-report/tree.legacy.beta.api.md +3 -1
  7. package/dist/core/change-family/changeFamily.d.ts +23 -0
  8. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  9. package/dist/core/change-family/changeFamily.js.map +1 -1
  10. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  11. package/dist/core/tree/detachedFieldIndexCodecV1.js +2 -0
  12. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  13. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  14. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -0
  15. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  16. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +25 -1
  17. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  18. package/dist/feature-libraries/chunked-forest/basicChunk.js +71 -18
  19. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  20. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -4
  21. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  22. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +31 -4
  23. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  24. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +27 -0
  25. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  26. package/dist/feature-libraries/chunked-forest/codec/codecs.js +5 -2
  27. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  28. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +10 -2
  29. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +7 -2
  31. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +1 -2
  33. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +0 -1
  35. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +1 -1
  37. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/format/index.js +2 -1
  39. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +10 -2
  41. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
  42. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +15 -1
  43. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -1
  46. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +3 -3
  48. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +8 -8
  50. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +6 -1
  52. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  53. package/dist/feature-libraries/chunked-forest/uniformChunk.js +25 -1
  54. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  55. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -0
  56. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  57. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +76 -22
  58. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  59. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -14
  60. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  61. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -17
  62. package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  63. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  64. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -0
  65. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  66. package/dist/packageVersion.d.ts +1 -1
  67. package/dist/packageVersion.d.ts.map +1 -1
  68. package/dist/packageVersion.js +1 -1
  69. package/dist/packageVersion.js.map +1 -1
  70. package/dist/shared-tree/independentView.d.ts.map +1 -1
  71. package/dist/shared-tree/independentView.js +2 -0
  72. package/dist/shared-tree/independentView.js.map +1 -1
  73. package/dist/shared-tree/sharedTree.d.ts +35 -1
  74. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  75. package/dist/shared-tree/sharedTree.js +6 -0
  76. package/dist/shared-tree/sharedTree.js.map +1 -1
  77. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -0
  78. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  79. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  80. package/dist/shared-tree/treeAlpha.js +2 -0
  81. package/dist/shared-tree/treeAlpha.js.map +1 -1
  82. package/dist/shared-tree/treeCheckout.d.ts +1 -1
  83. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  84. package/dist/shared-tree/treeCheckout.js +2 -0
  85. package/dist/shared-tree/treeCheckout.js.map +1 -1
  86. package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -0
  87. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  88. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  89. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +14 -0
  90. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  91. package/dist/shared-tree-core/editManagerCodecsCommons.js +14 -0
  92. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  93. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -0
  94. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  95. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  96. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -0
  97. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  98. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  99. package/dist/shared-tree-core/editManagerSummarizer.d.ts +9 -1
  100. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  101. package/dist/shared-tree-core/editManagerSummarizer.js +20 -5
  102. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  103. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  104. package/dist/shared-tree-core/messageCodecV1ToV4.js +4 -0
  105. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  106. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  107. package/dist/shared-tree-core/messageCodecVSharedBranches.js +4 -0
  108. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  109. package/dist/shared-tree-core/sharedTreeCore.d.ts +4 -0
  110. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  111. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  112. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  113. package/dist/simple-tree/api/schemaFactory.d.ts +3 -3
  114. package/dist/simple-tree/api/schemaFactory.js +3 -3
  115. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  116. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
  117. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  118. package/dist/simple-tree/api/schemaFactoryAlpha.js +9 -0
  119. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  120. package/dist/tableSchema.d.ts.map +1 -1
  121. package/dist/tableSchema.js +102 -20
  122. package/dist/tableSchema.js.map +1 -1
  123. package/docs/user-facing/isolated-declarations.md +147 -0
  124. package/lib/core/change-family/changeFamily.d.ts +23 -0
  125. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  126. package/lib/core/change-family/changeFamily.js.map +1 -1
  127. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  128. package/lib/core/tree/detachedFieldIndexCodecV1.js +2 -0
  129. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  130. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  131. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -0
  132. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  133. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +25 -1
  134. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  135. package/lib/feature-libraries/chunked-forest/basicChunk.js +72 -19
  136. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  137. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +13 -4
  138. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  139. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +32 -5
  140. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  141. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +27 -0
  142. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  143. package/lib/feature-libraries/chunked-forest/codec/codecs.js +6 -3
  144. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  145. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +10 -2
  146. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  147. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +8 -3
  148. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  149. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +1 -2
  150. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
  151. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +0 -1
  152. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
  153. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +1 -1
  154. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -1
  155. package/lib/feature-libraries/chunked-forest/codec/format/index.js +1 -1
  156. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -1
  157. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +10 -2
  158. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -1
  159. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +13 -0
  160. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -1
  161. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  162. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +9 -1
  163. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  164. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +3 -3
  165. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  166. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +8 -8
  167. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  168. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +6 -1
  169. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  170. package/lib/feature-libraries/chunked-forest/uniformChunk.js +26 -2
  171. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  172. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -0
  173. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  174. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +76 -22
  175. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  176. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +2 -14
  177. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
  178. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -17
  179. package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
  180. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  181. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -0
  182. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  183. package/lib/packageVersion.d.ts +1 -1
  184. package/lib/packageVersion.d.ts.map +1 -1
  185. package/lib/packageVersion.js +1 -1
  186. package/lib/packageVersion.js.map +1 -1
  187. package/lib/shared-tree/independentView.d.ts.map +1 -1
  188. package/lib/shared-tree/independentView.js +2 -0
  189. package/lib/shared-tree/independentView.js.map +1 -1
  190. package/lib/shared-tree/sharedTree.d.ts +35 -1
  191. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  192. package/lib/shared-tree/sharedTree.js +6 -0
  193. package/lib/shared-tree/sharedTree.js.map +1 -1
  194. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -0
  195. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  196. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  197. package/lib/shared-tree/treeAlpha.js +2 -0
  198. package/lib/shared-tree/treeAlpha.js.map +1 -1
  199. package/lib/shared-tree/treeCheckout.d.ts +1 -1
  200. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  201. package/lib/shared-tree/treeCheckout.js +2 -0
  202. package/lib/shared-tree/treeCheckout.js.map +1 -1
  203. package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -0
  204. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  205. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  206. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +14 -0
  207. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  208. package/lib/shared-tree-core/editManagerCodecsCommons.js +14 -0
  209. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  210. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -0
  211. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  212. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  213. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -0
  214. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  215. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  216. package/lib/shared-tree-core/editManagerSummarizer.d.ts +9 -1
  217. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  218. package/lib/shared-tree-core/editManagerSummarizer.js +20 -5
  219. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  220. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  221. package/lib/shared-tree-core/messageCodecV1ToV4.js +4 -0
  222. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  223. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  224. package/lib/shared-tree-core/messageCodecVSharedBranches.js +4 -0
  225. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  226. package/lib/shared-tree-core/sharedTreeCore.d.ts +4 -0
  227. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  228. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  229. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  230. package/lib/simple-tree/api/schemaFactory.d.ts +3 -3
  231. package/lib/simple-tree/api/schemaFactory.js +3 -3
  232. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  233. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
  234. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  235. package/lib/simple-tree/api/schemaFactoryAlpha.js +9 -0
  236. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  237. package/lib/tableSchema.d.ts.map +1 -1
  238. package/lib/tableSchema.js +103 -21
  239. package/lib/tableSchema.js.map +1 -1
  240. package/package.json +24 -24
  241. package/src/core/change-family/changeFamily.ts +25 -0
  242. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -0
  243. package/src/core/tree/detachedFieldIndexCodecV2.ts +2 -0
  244. package/src/feature-libraries/chunked-forest/basicChunk.ts +76 -20
  245. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +61 -12
  246. package/src/feature-libraries/chunked-forest/codec/codecs.ts +34 -1
  247. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +9 -3
  248. package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +0 -1
  249. package/src/feature-libraries/chunked-forest/codec/format/index.ts +1 -0
  250. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +15 -0
  251. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +9 -1
  252. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -1
  253. package/src/feature-libraries/chunked-forest/uniformChunk.ts +32 -2
  254. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +116 -31
  255. package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +3 -21
  256. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +4 -0
  257. package/src/packageVersion.ts +1 -1
  258. package/src/shared-tree/independentView.ts +2 -0
  259. package/src/shared-tree/sharedTree.ts +41 -1
  260. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -0
  261. package/src/shared-tree/treeAlpha.ts +2 -0
  262. package/src/shared-tree/treeCheckout.ts +2 -0
  263. package/src/shared-tree-core/editManagerCodecs.ts +3 -0
  264. package/src/shared-tree-core/editManagerCodecsCommons.ts +29 -0
  265. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -0
  266. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -0
  267. package/src/shared-tree-core/editManagerSummarizer.ts +17 -5
  268. package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -0
  269. package/src/shared-tree-core/messageCodecVSharedBranches.ts +5 -1
  270. package/src/shared-tree-core/sharedTreeCore.ts +8 -1
  271. package/src/simple-tree/api/schemaFactory.ts +3 -3
  272. package/src/simple-tree/api/schemaFactoryAlpha.ts +34 -3
  273. package/src/tableSchema.ts +134 -35
@@ -53,6 +53,7 @@ const schemaStaticsAlpha = {
53
53
  withDefault,
54
54
  withDefaultRecursive: withDefault,
55
55
  stagedOptional,
56
+ stagedOptionalRecursive: stagedOptional,
56
57
  };
57
58
  /**
58
59
  * {@link SchemaFactory} with additional alpha APIs.
@@ -98,6 +99,10 @@ export class SchemaFactoryAlpha extends SchemaFactoryBeta {
98
99
  * {@inheritdoc SchemaStaticsAlpha.stagedOptional}
99
100
  */
100
101
  this.stagedOptional = schemaStaticsAlpha.stagedOptional;
102
+ /**
103
+ * {@inheritdoc SchemaStaticsAlpha.stagedOptionalRecursive}
104
+ */
105
+ this.stagedOptionalRecursive = schemaStaticsAlpha.stagedOptionalRecursive;
101
106
  }
102
107
  /**
103
108
  * Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.
@@ -258,4 +263,8 @@ SchemaFactoryAlpha.withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursiv
258
263
  * {@inheritdoc SchemaStaticsAlpha.stagedOptional}
259
264
  */
260
265
  SchemaFactoryAlpha.stagedOptional = schemaStaticsAlpha.stagedOptional;
266
+ /**
267
+ * {@inheritdoc SchemaStaticsAlpha.stagedOptionalRecursive}
268
+ */
269
+ SchemaFactoryAlpha.stagedOptionalRecursive = schemaStaticsAlpha.stagedOptionalRecursive;
261
270
  //# sourceMappingURL=schemaFactoryAlpha.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFactoryAlpha.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactoryAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAKN,qBAAqB,EACrB,UAAU,EACV,mBAAmB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,qGAAqG;AACrG,gHAAgH;AAChH,OAAO,EAIN,SAAS,EAIT,kBAAkB,EAClB,iBAAiB,GAEjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAGN,WAAW,EAEX,SAAS,EAGT,YAAY,EAEZ,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAE9F,OAAO,EACN,iCAAiC,EACjC,MAAM,GAIN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA2JzC,MAAM,WAAW,GAAG,CAKnB,WAAsD,EACtD,YAA0F,EAMz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AI;YAClB,iFAAiF;YACjF,8GAA8G;YAC9G,uBAAuB,EAAE,KAAK;YAC9B,WAAW,EAAE,OAAO;SACpB,CAAC,CAAC;QAEH,OAAO,YAgBN,CAAC;IACH,CAAC;IAED;;OAEG;IACI,kBAAkB,CAGvB,IAAO;QACR,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAmB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACrE,CAAC;;AArRD;;GAEG;AAC6B,yBAAM,GAAG,aAAa,CAAC,MAAM,AAAvB,CAAwB;AAE9D;;GAEG;AAC6B,2BAAQ,GAAG,aAAa,CAAC,QAAQ,AAAzB,CAA0B;AAElE;;GAEG;AAC6B,2BAAQ,GAAG,aAAa,CAAC,QAAQ,AAAzB,CAA0B;AAElE;;GAEG;AAC6B,oCAAiB,GAAG,aAAa,CAAC,iBAAiB,AAAlC,CAAmC;AAEpF;;GAEG;AAC6B,oCAAiB,GAAG,aAAa,CAAC,iBAAiB,AAAlC,CAAmC;AAEpF;;GAEG;AACoB,6BAAU,GAAG,aAAa,CAAC,UAAU,AAA3B,CAA4B;AAgC7D;;GAEG;AACoB,8BAAW,GAAG,kBAAkB,CAAC,WAAW,AAAjC,CAAkC;AAOpE;;GAEG;AACoB,uCAAoB,GAAG,kBAAkB,CAAC,oBAAoB,AAA1C,CAA2C;AAOtF;;GAEG;AACoB,iCAAc,GAAG,kBAAkB,CAAC,cAAc,AAApC,CAAqC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RestrictiveStringRecord } from \"../../util/index.js\";\nimport {\n\ttype NodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype ImplicitAllowedTypes,\n\ttype WithType,\n\tnormalizeAllowedTypes,\n\tisTreeNode,\n\tcreateSchemaUpgrade,\n} from \"../core/index.js\";\n// These imports prevent a large number of type references in the API reports from showing up as *_2.\n/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */\nimport {\n\ttype FieldProps,\n\ttype FieldSchemaAlpha,\n\ttype FieldPropsAlpha,\n\tFieldKind,\n\ttype ImplicitFieldSchema,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tgetDefaultProvider,\n\tcreateFieldSchema,\n\ttype DefaultProvider,\n} from \"../fieldSchema.js\";\nimport type { LeafSchema } from \"../leafNodeSchema.js\";\nimport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodeCustomizableSchemaAlpha,\n\tarraySchema,\n\ttype MapNodeCustomizableSchema,\n\tmapSchema,\n\ttype ObjectNodeSchema,\n\ttype ObjectNodeSchemaWorkaround,\n\tobjectSchema,\n\ttype RecordNodeCustomizableSchema,\n\trecordSchema,\n} from \"../node-kinds/index.js\";\nimport type { SchemaType, SimpleObjectNodeSchema } from \"../simpleSchema.js\";\nimport type { SimpleLeafNodeSchema } from \"../simpleSchema.js\";\nimport { unhydratedFlexTreeFromInsertableNode } from \"../unhydratedFlexTreeFromInsertable.js\";\n\nimport {\n\tdefaultSchemaFactoryObjectOptions,\n\tscoped,\n\ttype NodeSchemaOptionsAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ScopedSchemaName,\n} from \"./schemaFactory.js\";\nimport { SchemaFactoryBeta } from \"./schemaFactoryBeta.js\";\nimport { schemaStatics } from \"./schemaStatics.js\";\nimport { TreeBeta } from \"./treeBeta.js\";\nimport type {\n\tArrayNodeCustomizableSchemaUnsafe,\n\tFieldSchemaAlphaUnsafe,\n\tInsertableObjectFromSchemaRecordAlphaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnenforced,\n} from \"./typesUnsafe.js\";\n/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */\n\n/**\n * A provider for values in tree nodes.\n *\n * @remarks\n * This type represents two ways to provide node values:\n *\n * 1. **A value**: Provide any value directly (number, string, object, array, etc.). When a value is provided,\n * the data is copied for each use to ensure independence between instances. The value must be of an allowed type for the field.\n *\n * 2. **A generator function**: A function that returns a value. The function is called each time a default is needed,\n * allowing for dynamic defaults or explicit control over value creation. The return value must be of an allowed type for the field.\n *\n * Values should be preferred over generator functions when possible, as they are simpler and more efficient.\n * Generator functions should be used when the default value needs to be dynamic or when it is not possible to provide a value directly.\n *\n * @example\n * ```typescript\n * // Provide a value directly\n * factory.withDefault(factory.required(factory.string), \"default\")\n * factory.withDefault(factory.optional(Person), new Person({ name: \"Guest\" }))\n *\n * // Use a generator function\n * factory.withDefault(factory.required(factory.string), () => crypto.randomUUID())\n * factory.withDefault(factory.optional(Person), () => new Person({ name: \"Guest\" }))\n * ```\n *\n * @alpha @sealed\n */\nexport type NodeProvider<T> = T | (() => T);\n\n/**\n * Stateless APIs exposed via {@link SchemaFactoryBeta} as both instance properties and as statics.\n * @see {@link SchemaStatics} for why this is useful.\n * @system @sealed @alpha\n */\nexport interface SchemaStaticsAlpha {\n\t/**\n\t * Creates a field schema with a default value. Fields with defaults (whether required or optional) are recognized by the type system as optional in constructors,\n\t * allowing them to be omitted when creating new nodes.\n\t *\n\t * @param fieldSchema - The field schema to add a default to (e.g., `factory.required(factory.string)` or `factory.optional(factory.number)`)\n\t * @param defaultValue - A {@link NodeProvider} specifying the default value.\n\t *\n\t * @example\n\t * ```typescript\n\t * const MySchema = factory.objectAlpha(\"MyObject\", {\n\t * // Provide values directly\n\t * name: factory.withDefault(factory.required(factory.string), \"untitled\"),\n\t * count: factory.withDefault(factory.required(factory.number), 0),\n\t * metadata: factory.withDefault(factory.optional(Metadata), new Metadata({ version: 1 })),\n\t *\n\t * // Use generator functions for dynamic values\n\t * timestamp: factory.withDefault(factory.required(factory.number), () => Date.now()),\n\t * id: factory.withDefault(factory.required(factory.string), () => crypto.randomUUID()),\n\t * });\n\t *\n\t * const obj1 = new MySchema({}); // All defaults applied\n\t * const obj2 = new MySchema({ name: \"custom\" }); // name=\"custom\", other defaults applied\n\t * ```\n\t *\n\t * @privateRemarks\n\t * This function wraps an existing field schema and adds a default value provider to it.\n\t * The default value will be used when constructing nodes if the field is not explicitly provided or set to `undefined`.\n\t *\n\t * Defaults are evaluated eagerly during node construction, unlike identifier defaults which require context.\n\t */\n\treadonly withDefault: <\n\t\tKind extends FieldKind,\n\t\tTypes extends ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>(\n\t\tfieldSchema: FieldSchema<Kind, Types, TCustomMetadata>,\n\t\tdefaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>,\n\t) => FieldSchemaAlpha<\n\t\tKind,\n\t\tTypes,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n\t>;\n\t/**\n\t * Creates a field schema that is Optional in the view but behaves as Required in the stored schema\n\t * during the rollout period of an optional-field migration.\n\t *\n\t * @remarks\n\t * Use this to incrementally migrate a required field to optional without a coordinated deployment.\n\t * The migration path is:\n\t *\n\t * 1. Start with `sf.required(T)` — all clients require the field.\n\t * 2. Deploy `sf.stagedOptional(T)` — new clients can read documents where the field is present or absent, but the stored schema stays Required (so old clients are unaffected). Writing `undefined` is blocked at runtime.\n\t * 3. Deploy `sf.optional(T)` once all clients support the staged optional field — the stored schema becomes Optional and the field can be cleared.\n\t *\n\t * Analogous to {@link SchemaStaticsBeta.staged} for allowed types, but for field optionality.\n\t *\n\t * @param t - The types allowed under the field.\n\t * @param props - Optional properties to associate with the field.\n\t *\n\t * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n\t * See {@link FieldSchemaMetadata.custom}.\n\t */\n\treadonly stagedOptional: <\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<\n\t\t\tFieldPropsAlpha<TCustomMetadata>,\n\t\t\t\"defaultProvider\" | \"stagedOptionalUpgrade\"\n\t\t>,\n\t) => FieldSchemaAlpha<\n\t\tFieldKind.Optional,\n\t\tT,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata>\n\t>;\n\n\t/**\n\t * {@link SchemaStaticsAlpha.withDefault} except tweaked to work better for recursive types.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * This version of {@link SchemaStaticsAlpha.withDefault} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\twithDefaultRecursive: <\n\t\tKind extends FieldKind,\n\t\tTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tTCustomMetadata = unknown,\n\t>(\n\t\tfieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>,\n\t\tdefaultValue: Unenforced<\n\t\t\tNodeProvider<\n\t\t\t\tSystem_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<\n\t\t\t\t\tSystem_Unsafe.FieldSchemaUnsafe<Kind, Types>\n\t\t\t\t>\n\t\t\t>\n\t\t>,\n\t) => FieldSchemaAlphaUnsafe<\n\t\tKind,\n\t\tTypes,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n\t>;\n}\n\nconst withDefault = <\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tfieldSchema: FieldSchema<Kind, Types, TCustomMetadata>,\n\tdefaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>,\n): FieldSchemaAlpha<\n\tKind,\n\tTypes,\n\tTCustomMetadata,\n\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n> => {\n\tconst typedFieldSchema = fieldSchema as FieldSchemaAlpha<Kind, Types, TCustomMetadata>;\n\n\t// create the default provider function, it is called eagerly during node construction\n\tconst defaultProvider = getDefaultProvider(() => {\n\t\t// Resolve the value: if it's a function, call it; otherwise use it directly\n\t\tlet insertableValue =\n\t\t\ttypeof defaultValue === \"function\" ? (defaultValue as () => unknown)() : defaultValue;\n\n\t\t// If the value is an already-constructed TreeNode (e.g., from a generator function that\n\t\t// returns the same instance repeatedly), clone it to ensure each use gets a fresh instance.\n\t\t// This prevents multi-parenting errors.\n\t\tif (isTreeNode(insertableValue)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tinsertableValue = TreeBeta.clone(insertableValue as any);\n\t\t}\n\n\t\t// For optional fields with an undefined default, return an empty array (no value).\n\t\tif (insertableValue === undefined) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Convert the insertable value to an unhydrated flex tree.\n\t\t// For insertable data, this creates a fresh tree structure.\n\t\tconst allowedTypeSet = normalizeAllowedTypes(typedFieldSchema.allowedTypes).evaluateSet();\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\treturn [unhydratedFlexTreeFromInsertableNode(insertableValue as any, allowedTypeSet)];\n\t});\n\n\t// create a new field schema with the default provider\n\tconst propsWithDefault = {\n\t\t...typedFieldSchema.props,\n\t\tdefaultProvider,\n\t};\n\n\treturn createFieldSchema(\n\t\ttypedFieldSchema.kind,\n\t\ttypedFieldSchema.allowedTypes,\n\t\tpropsWithDefault,\n\t);\n};\n\nconst stagedOptional = <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\" | \"stagedOptionalUpgrade\">,\n): FieldSchemaAlpha<\n\tFieldKind.Optional,\n\tT,\n\tTCustomMetadata,\n\tFieldPropsAlpha<TCustomMetadata>\n> => {\n\treturn createFieldSchema(FieldKind.Optional, t, {\n\t\tdefaultProvider: getDefaultProvider(() => []),\n\t\t...props,\n\t\tstagedOptionalUpgrade: createSchemaUpgrade(),\n\t});\n};\n\nconst schemaStaticsAlpha: SchemaStaticsAlpha = {\n\twithDefault,\n\n\twithDefaultRecursive: withDefault as SchemaStaticsAlpha[\"withDefaultRecursive\"],\n\n\tstagedOptional,\n};\n\n/**\n * {@link SchemaFactory} with additional alpha APIs.\n *\n * @alpha\n * @privateRemarks\n * When building schema, when `options` is not provided, `TCustomMetadata` is inferred as `unknown`.\n * If desired, this could be made to infer `undefined` instead by adding overloads for everything,\n * but currently it is not worth the maintenance overhead as there is no use case which this is known to be helpful for.\n */\nexport class SchemaFactoryAlpha<\n\tout TScope extends string | undefined = string | undefined,\n\tTName extends number | string = string,\n> extends SchemaFactoryBeta<TScope, TName> {\n\t/**\n\t * Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n\t * @param options - Additional options for the schema.\n\t */\n\tpublic objectAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tfields: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): ObjectNodeSchemaWorkaround<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn objectSchema(scoped<TScope, TName, Name>(this, name), fields, true, {\n\t\t\t...defaultSchemaFactoryObjectOptions,\n\t\t\t...options,\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritdoc SchemaFactory.objectRecursive}\n\t */\n\tpublic override objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tt: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>,\n\t\tfalse,\n\t\tT,\n\t\tnever,\n\t\tTCustomMetadata\n\t> &\n\t\tSimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> &\n\t\t// We can't just use non generic `ObjectNodeSchema` here since \"Base constructors must all have the same return type\".\n\t\t// We also can't just use generic `ObjectNodeSchema` here and not `TreeNodeSchemaClass` since that doesn't work with unsafe recursive types.\n\t\t// ObjectNodeSchema<\n\t\t// \tScopedSchemaName<TScope, Name>,\n\t\t// \t// T & RestrictiveStringRecord<ImplicitFieldSchema> would be nice to use here, but it breaks the recursive type self references.\n\t\t// \tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t// \tfalse,\n\t\t// \tTCustomMetadata\n\t\t// >\n\t\tPick<ObjectNodeSchema, \"fields\"> {\n\t\t// TODO: syntax highting is vs code is broken here. Don't trust it. Use the compiler instead.\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.objectAlpha(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\toptions,\n\t\t) as unknown as TreeNodeSchemaClass<\n\t\t\tTScopedName,\n\t\t\tNodeKind.Object,\n\t\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, TScopedName>,\n\t\t\tobject & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>,\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\t\tObjectNodeSchema<\n\t\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\t\tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\t\tfalse,\n\t\t\t\tTCustomMetadata\n\t\t\t>;\n\t}\n\n\t/**\n\t * Alpha version of {@link SchemaFactory.objectRecursive} that supports field defaults via {@link SchemaStaticsAlpha.withDefaultRecursive}.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * Use this instead of {@link SchemaFactory.objectRecursive} when fields use {@link SchemaStaticsAlpha.withDefaultRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\tpublic objectRecursiveAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tt: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & InsertableObjectFromSchemaRecordAlphaUnsafe<T>,\n\t\tfalse,\n\t\tT,\n\t\tnever,\n\t\tTCustomMetadata\n\t> &\n\t\tSimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> &\n\t\tPick<ObjectNodeSchema, \"fields\"> {\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.objectAlpha(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\toptions,\n\t\t) as unknown as TreeNodeSchemaClass<\n\t\t\tTScopedName,\n\t\t\tNodeKind.Object,\n\t\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, TScopedName>,\n\t\t\tobject & InsertableObjectFromSchemaRecordAlphaUnsafe<T>,\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\t\tObjectNodeSchema<\n\t\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\t\tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\t\tfalse,\n\t\t\t\tTCustomMetadata\n\t\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic static override readonly leaves = schemaStatics.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic static override readonly optional = schemaStatics.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic static override readonly required = schemaStatics.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic static override readonly optionalRecursive = schemaStatics.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic static override readonly requiredRecursive = schemaStatics.requiredRecursive;\n\n\t/**\n\t * Like {@link SchemaFactory.identifier} but static and a factory function that can be provided {@link FieldProps}.\n\t */\n\tpublic static readonly identifier = schemaStatics.identifier;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic override readonly leaves = schemaStatics.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic override readonly optional = schemaStatics.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic override readonly required = schemaStatics.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic override readonly optionalRecursive = schemaStatics.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic override readonly requiredRecursive = schemaStatics.requiredRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic readonly withDefault = schemaStaticsAlpha.withDefault;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic static readonly withDefault = schemaStaticsAlpha.withDefault;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic readonly withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic static readonly withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptional}\n\t */\n\tpublic readonly stagedOptional = schemaStaticsAlpha.stagedOptional;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptional}\n\t */\n\tpublic static readonly stagedOptional = schemaStaticsAlpha.stagedOptional;\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link TreeMapNodeAlpha}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear as values in the map.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedMap extends factory.map(\"name\", factory.number, {\n\t * \tmetadata: { description: \"A map of numbers\" }\n\t * }) {}\n\t * ```\n\t */\n\tpublic mapAlpha<\n\t\tName extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn mapSchema(\n\t\t\tscoped<TScope, TName, Name>(this, name),\n\t\t\tallowedTypes,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaFactory.objectRecursive}\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override mapRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\treturn this.mapAlpha(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\toptions,\n\t\t) as unknown as MapNodeCustomizableSchemaUnsafe<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchemaClass} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear in the array.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedArray extends factory.arrayAlpha(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic arrayAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): ArrayNodeCustomizableSchemaAlpha<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tT,\n\t\ttrue,\n\t\tTCustomMetadata\n\t> {\n\t\treturn arraySchema(\n\t\t\tscoped<TScope, TName, Name>(this, name),\n\t\t\tallowedTypes,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\toptions ?? {},\n\t\t) as unknown as ArrayNodeCustomizableSchemaAlpha<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\ttrue,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * {@link SchemaFactory.arrayRecursive} but with support for some alpha features.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override arrayRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\treturn this.arrayAlpha(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\toptions,\n\t\t) as unknown as ArrayNodeCustomizableSchemaUnsafe<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * Define (and add to this library) a {@link TreeNodeSchemaClass} for a {@link (TreeRecordNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear in the record.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedRecord extends factory.recordAlpha(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic recordAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn recordSchema({\n\t\t\tidentifier: scoped<TScope, TName, Name>(this, name),\n\t\t\tinfo: allowedTypes,\n\t\t\tcustomizable: true,\n\t\t\timplicitlyConstructable: true,\n\t\t\tnodeOptions: options,\n\t\t});\n\t}\n\n\t/**\n\t * {@link SchemaFactoryBeta.(record:2)} except tweaked to work better for recursive types.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * This version of `SchemaFactory.record` uses the same workarounds as {@link SchemaFactory.objectRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override recordRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\tconst RecordSchema = recordSchema({\n\t\t\tidentifier: scoped<TScope, TName, Name>(this, name),\n\t\t\tinfo: allowedTypes as T & ImplicitAllowedTypes,\n\t\t\tcustomizable: true,\n\t\t\t// Setting this to true seems to work ok currently, but not for other node kinds.\n\t\t\t// Supporting this could be fragile and might break other future changes, so it's being kept as false for now.\n\t\t\timplicitlyConstructable: false,\n\t\t\tnodeOptions: options,\n\t\t});\n\n\t\treturn RecordSchema as TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<TScope, Name>,\n\t\t\t/* Kind */ NodeKind.Record,\n\t\t\t/* TNode */ TreeRecordNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>,\n\t\t\t/* TInsertable */ {\n\t\t\t\t// Ideally this would be\n\t\t\t\t// RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t\t// but doing so breaks recursive types.\n\t\t\t\t// Instead we do a less nice version:\n\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t},\n\t\t\t/* ImplicitlyConstructable */ false,\n\t\t\t/* Info */ T,\n\t\t\t/* TConstructorExtra */ undefined,\n\t\t\t/* TCustomMetadata */ TCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaFactoryBeta.scopedFactory}\n\t */\n\tpublic scopedFactoryAlpha<\n\t\tconst T extends TName,\n\t\tTNameInner extends number | string = string,\n\t>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner> {\n\t\treturn new SchemaFactoryAlpha(scoped<TScope, TName, T>(this, name));\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaFactoryAlpha.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactoryAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAKN,qBAAqB,EACrB,UAAU,EACV,mBAAmB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,qGAAqG;AACrG,gHAAgH;AAChH,OAAO,EAIN,SAAS,EAIT,kBAAkB,EAClB,iBAAiB,GAEjB,MAAM,mBAAmB,CAAC;AAE3B,OA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AC,WAAW,AAAjC,CAAkC;AAOpE;;GAEG;AACoB,uCAAoB,GAAG,kBAAkB,CAAC,oBAAoB,AAA1C,CAA2C;AAOtF;;GAEG;AACoB,iCAAc,GAAG,kBAAkB,CAAC,cAAc,AAApC,CAAqC;AAO1E;;GAEG;AACoB,0CAAuB,GAAG,kBAAkB,CAAC,uBAAuB,AAA7C,CAA8C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { RestrictiveStringRecord } from \"../../util/index.js\";\nimport {\n\ttype NodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype ImplicitAllowedTypes,\n\ttype WithType,\n\tnormalizeAllowedTypes,\n\tisTreeNode,\n\tcreateSchemaUpgrade,\n} from \"../core/index.js\";\n// These imports prevent a large number of type references in the API reports from showing up as *_2.\n/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */\nimport {\n\ttype FieldProps,\n\ttype FieldSchemaAlpha,\n\ttype FieldPropsAlpha,\n\tFieldKind,\n\ttype ImplicitFieldSchema,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype FieldSchema,\n\tgetDefaultProvider,\n\tcreateFieldSchema,\n\ttype DefaultProvider,\n} from \"../fieldSchema.js\";\nimport type { LeafSchema } from \"../leafNodeSchema.js\";\nimport {\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodeCustomizableSchemaAlpha,\n\tarraySchema,\n\ttype MapNodeCustomizableSchema,\n\tmapSchema,\n\ttype ObjectNodeSchema,\n\ttype ObjectNodeSchemaWorkaround,\n\tobjectSchema,\n\ttype RecordNodeCustomizableSchema,\n\trecordSchema,\n} from \"../node-kinds/index.js\";\nimport type { SchemaType, SimpleObjectNodeSchema } from \"../simpleSchema.js\";\nimport type { SimpleLeafNodeSchema } from \"../simpleSchema.js\";\nimport { unhydratedFlexTreeFromInsertableNode } from \"../unhydratedFlexTreeFromInsertable.js\";\n\nimport {\n\tdefaultSchemaFactoryObjectOptions,\n\tscoped,\n\ttype NodeSchemaOptionsAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ScopedSchemaName,\n} from \"./schemaFactory.js\";\nimport { SchemaFactoryBeta } from \"./schemaFactoryBeta.js\";\nimport { schemaStatics } from \"./schemaStatics.js\";\nimport { TreeBeta } from \"./treeBeta.js\";\nimport type {\n\tArrayNodeCustomizableSchemaUnsafe,\n\tFieldSchemaAlphaUnsafe,\n\tInsertableObjectFromSchemaRecordAlphaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnenforced,\n} from \"./typesUnsafe.js\";\n/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */\n\n/**\n * A provider for values in tree nodes.\n *\n * @remarks\n * This type represents two ways to provide node values:\n *\n * 1. **A value**: Provide any value directly (number, string, object, array, etc.). When a value is provided,\n * the data is copied for each use to ensure independence between instances. The value must be of an allowed type for the field.\n *\n * 2. **A generator function**: A function that returns a value. The function is called each time a default is needed,\n * allowing for dynamic defaults or explicit control over value creation. The return value must be of an allowed type for the field.\n *\n * Values should be preferred over generator functions when possible, as they are simpler and more efficient.\n * Generator functions should be used when the default value needs to be dynamic or when it is not possible to provide a value directly.\n *\n * @example\n * ```typescript\n * // Provide a value directly\n * factory.withDefault(factory.required(factory.string), \"default\")\n * factory.withDefault(factory.optional(Person), new Person({ name: \"Guest\" }))\n *\n * // Use a generator function\n * factory.withDefault(factory.required(factory.string), () => crypto.randomUUID())\n * factory.withDefault(factory.optional(Person), () => new Person({ name: \"Guest\" }))\n * ```\n *\n * @alpha @sealed\n */\nexport type NodeProvider<T> = T | (() => T);\n\n/**\n * Stateless APIs exposed via {@link SchemaFactoryBeta} as both instance properties and as statics.\n * @see {@link SchemaStatics} for why this is useful.\n * @system @sealed @alpha\n */\nexport interface SchemaStaticsAlpha {\n\t/**\n\t * Creates a field schema with a default value. Fields with defaults (whether required or optional) are recognized by the type system as optional in constructors,\n\t * allowing them to be omitted when creating new nodes.\n\t *\n\t * @param fieldSchema - The field schema to add a default to (e.g., `factory.required(factory.string)` or `factory.optional(factory.number)`)\n\t * @param defaultValue - A {@link NodeProvider} specifying the default value.\n\t *\n\t * @example\n\t * ```typescript\n\t * const MySchema = factory.objectAlpha(\"MyObject\", {\n\t * // Provide values directly\n\t * name: factory.withDefault(factory.required(factory.string), \"untitled\"),\n\t * count: factory.withDefault(factory.required(factory.number), 0),\n\t * metadata: factory.withDefault(factory.optional(Metadata), new Metadata({ version: 1 })),\n\t *\n\t * // Use generator functions for dynamic values\n\t * timestamp: factory.withDefault(factory.required(factory.number), () => Date.now()),\n\t * id: factory.withDefault(factory.required(factory.string), () => crypto.randomUUID()),\n\t * });\n\t *\n\t * const obj1 = new MySchema({}); // All defaults applied\n\t * const obj2 = new MySchema({ name: \"custom\" }); // name=\"custom\", other defaults applied\n\t * ```\n\t *\n\t * @privateRemarks\n\t * This function wraps an existing field schema and adds a default value provider to it.\n\t * The default value will be used when constructing nodes if the field is not explicitly provided or set to `undefined`.\n\t *\n\t * Defaults are evaluated eagerly during node construction, unlike identifier defaults which require context.\n\t */\n\treadonly withDefault: <\n\t\tKind extends FieldKind,\n\t\tTypes extends ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>(\n\t\tfieldSchema: FieldSchema<Kind, Types, TCustomMetadata>,\n\t\tdefaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>,\n\t) => FieldSchemaAlpha<\n\t\tKind,\n\t\tTypes,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n\t>;\n\t/**\n\t * Creates a field schema that is Optional in the view but behaves as Required in the stored schema\n\t * during the rollout period of an optional-field migration.\n\t *\n\t * @remarks\n\t * Use this to incrementally migrate a required field to optional without a coordinated deployment.\n\t * The migration path is:\n\t *\n\t * 1. Start with `sf.required(T)` — all clients require the field.\n\t * 2. Deploy `sf.stagedOptional(T)` — new clients can read documents where the field is present or absent, but the stored schema stays Required (so old clients are unaffected). Setting the field to `undefined` is rejected because the stored schema still declares the field as required.\n\t * 3. Deploy `sf.optional(T)` once all clients support the staged optional field — the stored schema becomes Optional and the field can be cleared.\n\t *\n\t * Analogous to {@link SchemaStaticsBeta.staged} for allowed types, but for field optionality.\n\t *\n\t * @param t - The types allowed under the field.\n\t * @param props - Optional properties to associate with the field.\n\t *\n\t * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n\t * See {@link FieldSchemaMetadata.custom}.\n\t */\n\treadonly stagedOptional: <\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<\n\t\t\tFieldPropsAlpha<TCustomMetadata>,\n\t\t\t\"defaultProvider\" | \"stagedOptionalUpgrade\"\n\t\t>,\n\t) => FieldSchemaAlpha<\n\t\tFieldKind.Optional,\n\t\tT,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata>\n\t>;\n\t/**\n\t * {@link SchemaStaticsAlpha.stagedOptional} except tweaked to work better for recursive types.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * This version of {@link SchemaStaticsAlpha.stagedOptional} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\treadonly stagedOptionalRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<\n\t\t\tFieldPropsAlpha<TCustomMetadata>,\n\t\t\t\"defaultProvider\" | \"stagedOptionalUpgrade\"\n\t\t>,\n\t) => FieldSchemaAlphaUnsafe<\n\t\tFieldKind.Optional,\n\t\tT,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata>\n\t>;\n\n\t/**\n\t * {@link SchemaStaticsAlpha.withDefault} except tweaked to work better for recursive types.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * This version of {@link SchemaStaticsAlpha.withDefault} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\twithDefaultRecursive: <\n\t\tKind extends FieldKind,\n\t\tTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tTCustomMetadata = unknown,\n\t>(\n\t\tfieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>,\n\t\tdefaultValue: Unenforced<\n\t\t\tNodeProvider<\n\t\t\t\tSystem_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<\n\t\t\t\t\tSystem_Unsafe.FieldSchemaUnsafe<Kind, Types>\n\t\t\t\t>\n\t\t\t>\n\t\t>,\n\t) => FieldSchemaAlphaUnsafe<\n\t\tKind,\n\t\tTypes,\n\t\tTCustomMetadata,\n\t\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n\t>;\n}\n\nconst withDefault = <\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tfieldSchema: FieldSchema<Kind, Types, TCustomMetadata>,\n\tdefaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>,\n): FieldSchemaAlpha<\n\tKind,\n\tTypes,\n\tTCustomMetadata,\n\tFieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }\n> => {\n\tconst typedFieldSchema = fieldSchema as FieldSchemaAlpha<Kind, Types, TCustomMetadata>;\n\n\t// create the default provider function, it is called eagerly during node construction\n\tconst defaultProvider = getDefaultProvider(() => {\n\t\t// Resolve the value: if it's a function, call it; otherwise use it directly\n\t\tlet insertableValue =\n\t\t\ttypeof defaultValue === \"function\" ? (defaultValue as () => unknown)() : defaultValue;\n\n\t\t// If the value is an already-constructed TreeNode (e.g., from a generator function that\n\t\t// returns the same instance repeatedly), clone it to ensure each use gets a fresh instance.\n\t\t// This prevents multi-parenting errors.\n\t\tif (isTreeNode(insertableValue)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tinsertableValue = TreeBeta.clone(insertableValue as any);\n\t\t}\n\n\t\t// For optional fields with an undefined default, return an empty array (no value).\n\t\tif (insertableValue === undefined) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Convert the insertable value to an unhydrated flex tree.\n\t\t// For insertable data, this creates a fresh tree structure.\n\t\tconst allowedTypeSet = normalizeAllowedTypes(typedFieldSchema.allowedTypes).evaluateSet();\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\treturn [unhydratedFlexTreeFromInsertableNode(insertableValue as any, allowedTypeSet)];\n\t});\n\n\t// create a new field schema with the default provider\n\tconst propsWithDefault = {\n\t\t...typedFieldSchema.props,\n\t\tdefaultProvider,\n\t};\n\n\treturn createFieldSchema(\n\t\ttypedFieldSchema.kind,\n\t\ttypedFieldSchema.allowedTypes,\n\t\tpropsWithDefault,\n\t);\n};\n\nconst stagedOptional = <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\" | \"stagedOptionalUpgrade\">,\n): FieldSchemaAlpha<\n\tFieldKind.Optional,\n\tT,\n\tTCustomMetadata,\n\tFieldPropsAlpha<TCustomMetadata>\n> => {\n\treturn createFieldSchema(FieldKind.Optional, t, {\n\t\tdefaultProvider: getDefaultProvider(() => []),\n\t\t...props,\n\t\tstagedOptionalUpgrade: createSchemaUpgrade(),\n\t});\n};\n\nconst schemaStaticsAlpha: SchemaStaticsAlpha = {\n\twithDefault,\n\twithDefaultRecursive: withDefault as SchemaStaticsAlpha[\"withDefaultRecursive\"],\n\tstagedOptional,\n\tstagedOptionalRecursive: stagedOptional as SchemaStaticsAlpha[\"stagedOptionalRecursive\"],\n};\n\n/**\n * {@link SchemaFactory} with additional alpha APIs.\n *\n * @alpha\n * @privateRemarks\n * When building schema, when `options` is not provided, `TCustomMetadata` is inferred as `unknown`.\n * If desired, this could be made to infer `undefined` instead by adding overloads for everything,\n * but currently it is not worth the maintenance overhead as there is no use case which this is known to be helpful for.\n */\nexport class SchemaFactoryAlpha<\n\tout TScope extends string | undefined = string | undefined,\n\tTName extends number | string = string,\n> extends SchemaFactoryBeta<TScope, TName> {\n\t/**\n\t * Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.\n\t * @param options - Additional options for the schema.\n\t */\n\tpublic objectAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tfields: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): ObjectNodeSchemaWorkaround<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn objectSchema(scoped<TScope, TName, Name>(this, name), fields, true, {\n\t\t\t...defaultSchemaFactoryObjectOptions,\n\t\t\t...options,\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritdoc SchemaFactory.objectRecursive}\n\t */\n\tpublic override objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tt: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>,\n\t\tfalse,\n\t\tT,\n\t\tnever,\n\t\tTCustomMetadata\n\t> &\n\t\tSimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> &\n\t\t// We can't just use non generic `ObjectNodeSchema` here since \"Base constructors must all have the same return type\".\n\t\t// We also can't just use generic `ObjectNodeSchema` here and not `TreeNodeSchemaClass` since that doesn't work with unsafe recursive types.\n\t\t// ObjectNodeSchema<\n\t\t// \tScopedSchemaName<TScope, Name>,\n\t\t// \t// T & RestrictiveStringRecord<ImplicitFieldSchema> would be nice to use here, but it breaks the recursive type self references.\n\t\t// \tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t// \tfalse,\n\t\t// \tTCustomMetadata\n\t\t// >\n\t\tPick<ObjectNodeSchema, \"fields\"> {\n\t\t// TODO: syntax highting is vs code is broken here. Don't trust it. Use the compiler instead.\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.objectAlpha(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\toptions,\n\t\t) as unknown as TreeNodeSchemaClass<\n\t\t\tTScopedName,\n\t\t\tNodeKind.Object,\n\t\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, TScopedName>,\n\t\t\tobject & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>,\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\t\tObjectNodeSchema<\n\t\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\t\tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\t\tfalse,\n\t\t\t\tTCustomMetadata\n\t\t\t>;\n\t}\n\n\t/**\n\t * Alpha version of {@link SchemaFactory.objectRecursive} that supports field defaults via {@link SchemaStaticsAlpha.withDefaultRecursive}.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * Use this instead of {@link SchemaFactory.objectRecursive} when fields use {@link SchemaStaticsAlpha.withDefaultRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\tpublic objectRecursiveAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tt: T,\n\t\toptions?: ObjectSchemaOptionsAlpha<TCustomMetadata>,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & InsertableObjectFromSchemaRecordAlphaUnsafe<T>,\n\t\tfalse,\n\t\tT,\n\t\tnever,\n\t\tTCustomMetadata\n\t> &\n\t\tSimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> &\n\t\tPick<ObjectNodeSchema, \"fields\"> {\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.objectAlpha(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\toptions,\n\t\t) as unknown as TreeNodeSchemaClass<\n\t\t\tTScopedName,\n\t\t\tNodeKind.Object,\n\t\t\tSystem_Unsafe.TreeObjectNodeUnsafe<T, TScopedName>,\n\t\t\tobject & InsertableObjectFromSchemaRecordAlphaUnsafe<T>,\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> &\n\t\t\tObjectNodeSchema<\n\t\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\t\tRestrictiveStringRecord<ImplicitFieldSchema>,\n\t\t\t\tfalse,\n\t\t\t\tTCustomMetadata\n\t\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic static override readonly leaves = schemaStatics.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic static override readonly optional = schemaStatics.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic static override readonly required = schemaStatics.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic static override readonly optionalRecursive = schemaStatics.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic static override readonly requiredRecursive = schemaStatics.requiredRecursive;\n\n\t/**\n\t * Like {@link SchemaFactory.identifier} but static and a factory function that can be provided {@link FieldProps}.\n\t */\n\tpublic static readonly identifier = schemaStatics.identifier;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic override readonly leaves = schemaStatics.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic override readonly optional = schemaStatics.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic override readonly required = schemaStatics.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic override readonly optionalRecursive = schemaStatics.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic override readonly requiredRecursive = schemaStatics.requiredRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic readonly withDefault = schemaStaticsAlpha.withDefault;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic static readonly withDefault = schemaStaticsAlpha.withDefault;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic readonly withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.withDefault}\n\t */\n\tpublic static readonly withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptional}\n\t */\n\tpublic readonly stagedOptional = schemaStaticsAlpha.stagedOptional;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptional}\n\t */\n\tpublic static readonly stagedOptional = schemaStaticsAlpha.stagedOptional;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptionalRecursive}\n\t */\n\tpublic readonly stagedOptionalRecursive = schemaStaticsAlpha.stagedOptionalRecursive;\n\n\t/**\n\t * {@inheritdoc SchemaStaticsAlpha.stagedOptionalRecursive}\n\t */\n\tpublic static readonly stagedOptionalRecursive = schemaStaticsAlpha.stagedOptionalRecursive;\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link TreeMapNodeAlpha}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear as values in the map.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedMap extends factory.map(\"name\", factory.number, {\n\t * \tmetadata: { description: \"A map of numbers\" }\n\t * }) {}\n\t * ```\n\t */\n\tpublic mapAlpha<\n\t\tName extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn mapSchema(\n\t\t\tscoped<TScope, TName, Name>(this, name),\n\t\t\tallowedTypes,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaFactory.objectRecursive}\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override mapRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\treturn this.mapAlpha(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\toptions,\n\t\t) as unknown as MapNodeCustomizableSchemaUnsafe<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchemaClass} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear in the array.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedArray extends factory.arrayAlpha(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic arrayAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): ArrayNodeCustomizableSchemaAlpha<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tT,\n\t\ttrue,\n\t\tTCustomMetadata\n\t> {\n\t\treturn arraySchema(\n\t\t\tscoped<TScope, TName, Name>(this, name),\n\t\t\tallowedTypes,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\toptions ?? {},\n\t\t) as unknown as ArrayNodeCustomizableSchemaAlpha<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\ttrue,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * {@link SchemaFactory.arrayRecursive} but with support for some alpha features.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override arrayRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\treturn this.arrayAlpha(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\toptions,\n\t\t) as unknown as ArrayNodeCustomizableSchemaUnsafe<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tT,\n\t\t\tTCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * Define (and add to this library) a {@link TreeNodeSchemaClass} for a {@link (TreeRecordNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t * @param allowedTypes - The types that may appear in the record.\n\t * @param options - Additional options for the schema.\n\t *\n\t * @example\n\t * ```typescript\n\t * class NamedRecord extends factory.recordAlpha(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic recordAlpha<\n\t\tconst Name extends TName,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\toptions?: NodeSchemaOptionsAlpha<TCustomMetadata>,\n\t): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {\n\t\treturn recordSchema({\n\t\t\tidentifier: scoped<TScope, TName, Name>(this, name),\n\t\t\tinfo: allowedTypes,\n\t\t\tcustomizable: true,\n\t\t\timplicitlyConstructable: true,\n\t\t\tnodeOptions: options,\n\t\t});\n\t}\n\n\t/**\n\t * {@link SchemaFactoryBeta.(record:2)} except tweaked to work better for recursive types.\n\t * Use with {@link ValidateRecursiveSchema} for improved type safety.\n\t * @remarks\n\t * This version of `SchemaFactory.record` uses the same workarounds as {@link SchemaFactory.objectRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override recordRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>) {\n\t\tconst RecordSchema = recordSchema({\n\t\t\tidentifier: scoped<TScope, TName, Name>(this, name),\n\t\t\tinfo: allowedTypes as T & ImplicitAllowedTypes,\n\t\t\tcustomizable: true,\n\t\t\t// Setting this to true seems to work ok currently, but not for other node kinds.\n\t\t\t// Supporting this could be fragile and might break other future changes, so it's being kept as false for now.\n\t\t\timplicitlyConstructable: false,\n\t\t\tnodeOptions: options,\n\t\t});\n\n\t\treturn RecordSchema as TreeNodeSchemaClass<\n\t\t\t/* Name */ ScopedSchemaName<TScope, Name>,\n\t\t\t/* Kind */ NodeKind.Record,\n\t\t\t/* TNode */ TreeRecordNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>,\n\t\t\t/* TInsertable */ {\n\t\t\t\t// Ideally this would be\n\t\t\t\t// RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t\t// but doing so breaks recursive types.\n\t\t\t\t// Instead we do a less nice version:\n\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t},\n\t\t\t/* ImplicitlyConstructable */ false,\n\t\t\t/* Info */ T,\n\t\t\t/* TConstructorExtra */ undefined,\n\t\t\t/* TCustomMetadata */ TCustomMetadata\n\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaFactoryBeta.scopedFactory}\n\t */\n\tpublic scopedFactoryAlpha<\n\t\tconst T extends TName,\n\t\tTNameInner extends number | string = string,\n\t>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner> {\n\t\treturn new SchemaFactoryAlpha(scoped<TScope, TName, T>(this, name));\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tableSchema.d.ts","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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AAU,SAAS,MAAM,EAC/B,KAAK,CAAC,KAAK,SAAS,oBAAoB,EACxC,KAAK,CAAC,OAAO,SAAS,kBAAkB,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,EAC5E,KAAK,CAAC,IAAI,SAAS,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,EAEtE,MAAM,EAAE,kBAAkB,CAAC,uBAAuB,CACjD,UAAU,EACV,iBAAiB,CAAC,UAAU,CAAC,EAC7B,KAAK,CACL,GAAG;QACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;KACnB,GACC,kBAAkB,CAAC,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;CA4BxE"}
@@ -7,10 +7,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
7
7
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8
8
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9
9
  };
10
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
+ if (kind === "m") throw new TypeError("Private method is not writable");
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
+ };
10
16
  import { fail } from "@fluidframework/core-utils/internal";
11
17
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
12
18
  import { EmptyKey } from "./core/index.js";
13
- import { TreeAlpha } from "./shared-tree/index.js";
19
+ import { Tree, TreeAlpha } from "./shared-tree/index.js";
14
20
  import { TreeArrayNode, SchemaFactory, scoped, withBufferedTreeEvents, objectSchema, eraseSchemaDetailsSubclassable, createCustomizedFluidFrameworkScopedFactory, } from "./simple-tree/index.js";
15
21
  import { validateIndex, validateIndexRange } from "./util/index.js";
16
22
  /**
@@ -141,7 +147,7 @@ export var System_TableSchema;
141
147
  */
142
148
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Return type is too complex to be reasonable to specify
143
149
  function createTableSchema(inputSchemaFactory, _cellSchema, columnSchema, rowSchema) {
144
- var _Table_instances, _a, _Table_applyEditsInBatch, _Table_tryGetColumn, _Table_getColumn, _Table_tryGetRow, _Table_getRow, _Table_validateNewColumns, _Table_validateNewRows;
150
+ var _Table_instances, _a, _Table_rowCache, _Table_rowCacheUnsubscribe, _Table_columnCache, _Table_columnCacheUnsubscribe, _Table_applyEditsInBatch, _Table_getColumnCache, _Table_tryGetColumn, _Table_getColumn, _Table_getRowCache, _Table_tryGetRow, _Table_getRow, _Table_validateNewColumns, _Table_validateNewRows;
145
151
  const schemaFactory = createTableScopedFactory(inputSchemaFactory);
146
152
  /**
147
153
  * {@link Table} inner fields.
@@ -183,6 +189,50 @@ export var System_TableSchema;
183
189
  constructor(node) {
184
190
  super(node ?? { table: { columns: [], rows: [] } });
185
191
  _Table_instances.add(this);
192
+ // #region ID lookup caches
193
+ // Looking up rows/columns by string ID is a hot path (every getCell / setCell / etc. call goes
194
+ // through #tryGetRow or #tryGetColumn). Rather than scanning the arrays linearly on every call,
195
+ // we maintain lazily-built Maps from ID → node.
196
+ //
197
+ // Cache invalidation:
198
+ // Each cache is marked stale (reset to `undefined`) by a `nodeChanged` listener registered on
199
+ // the corresponding array node (this.table.rows / this.table.columns). `nodeChanged` fires on
200
+ // an array node whenever an element is inserted, removed, or moved — exactly the set of
201
+ // operations that could change which ID maps to which node. The event fires after the full
202
+ // batch of edits has been applied (including remote edits received from collaborators), so the
203
+ // cache is always rebuilt from a consistent, in-schema state.
204
+ // TODO: Consider if we should do more fine-grained invalidation here. E.g. look at the specific deltas
205
+ // returned by the `nodeChanged` event and only invalidate entries as needed.
206
+ //
207
+ // Listener lifetime:
208
+ // The listener is registered exactly once per cache (guarded by the non-undefined check on the
209
+ // stored unsubscribe callback). Subsequent cache rebuilds after invalidation reuse the same
210
+ // listener — no additional subscriptions accumulate. The unsubscribe callback is stored so
211
+ // that explicit cleanup is possible in the future if needed.
212
+ /**
213
+ * Cache from row ID → row node for O(1) lookups in {@link Table.#tryGetRow}.
214
+ * `undefined` means the cache is stale and must be rebuilt before use.
215
+ */
216
+ _Table_rowCache.set(this, undefined);
217
+ /**
218
+ * Unsubscribe function for the `nodeChanged` listener on `this.table.rows`.
219
+ * `undefined` means the listener has not yet been registered (first cache build is pending).
220
+ * After the first build, this is always defined and the listener remains active for the
221
+ * lifetime of the Table node.
222
+ */
223
+ _Table_rowCacheUnsubscribe.set(this, undefined);
224
+ /**
225
+ * Cache from column ID → column node for O(1) lookups in {@link Table.#tryGetColumn}.
226
+ * `undefined` means the cache is stale and must be rebuilt before use.
227
+ */
228
+ _Table_columnCache.set(this, undefined);
229
+ /**
230
+ * Unsubscribe function for the `nodeChanged` listener on `this.table.columns`.
231
+ * `undefined` means the listener has not yet been registered (first cache build is pending).
232
+ * After the first build, this is always defined and the listener remains active for the
233
+ * lifetime of the Table node.
234
+ */
235
+ _Table_columnCacheUnsubscribe.set(this, undefined);
186
236
  }
187
237
  static create(initialContents) {
188
238
  // #region Input validation
@@ -565,7 +615,7 @@ export var System_TableSchema;
565
615
  throw new UsageError(`The specified row node with ID "${rowOrIdOrIndex.id}" does not exist in the table.`);
566
616
  }
567
617
  }
568
- _a = Table, _Table_instances = new WeakSet(), _Table_applyEditsInBatch = function _Table_applyEditsInBatch(options) {
618
+ _a = Table, _Table_rowCache = new WeakMap(), _Table_rowCacheUnsubscribe = new WeakMap(), _Table_columnCache = new WeakMap(), _Table_columnCacheUnsubscribe = new WeakMap(), _Table_instances = new WeakSet(), _Table_applyEditsInBatch = function _Table_applyEditsInBatch(options) {
569
619
  const { applyEdits, preconditions, preconditionsOnRevert } = options;
570
620
  const branch = TreeAlpha.branch(this);
571
621
  // Ensure events are paused until all of the edits are applied.
@@ -587,6 +637,26 @@ export var System_TableSchema;
587
637
  }, preconditions === undefined ? undefined : { preconditions });
588
638
  }
589
639
  });
640
+ }, _Table_getColumnCache = function _Table_getColumnCache() {
641
+ let cache = __classPrivateFieldGet(this, _Table_columnCache, "f");
642
+ if (cache === undefined) {
643
+ cache = new Map();
644
+ for (const column of this.table.columns) {
645
+ // TypeScript is unable to narrow array element types correctly here.
646
+ // See: https://github.com/microsoft/TypeScript/issues/52144
647
+ cache.set(column.id, column);
648
+ }
649
+ __classPrivateFieldSet(this, _Table_columnCache, cache, "f");
650
+ // Register the invalidation listener once. The `nodeChanged` event fires on the
651
+ // array node itself after any structural change (insert / remove / move), which is
652
+ // exactly the set of changes that can alter the ID → node mapping.
653
+ if (__classPrivateFieldGet(this, _Table_columnCacheUnsubscribe, "f") === undefined) {
654
+ __classPrivateFieldSet(this, _Table_columnCacheUnsubscribe, Tree.on(this.columns, "nodeChanged", () => {
655
+ __classPrivateFieldSet(this, _Table_columnCache, undefined, "f");
656
+ }), "f");
657
+ }
658
+ }
659
+ return cache;
590
660
  }, _Table_tryGetColumn = function _Table_tryGetColumn(columnOrIdOrIndex) {
591
661
  if (typeof columnOrIdOrIndex === "number") {
592
662
  if (columnOrIdOrIndex < 0 || columnOrIdOrIndex >= this.table.columns.length) {
@@ -596,23 +666,39 @@ export var System_TableSchema;
596
666
  // See: https://github.com/microsoft/TypeScript/issues/52144
597
667
  return this.table.columns[columnOrIdOrIndex];
598
668
  }
669
+ const columnCache = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this);
599
670
  if (typeof columnOrIdOrIndex === "string") {
600
- const columnId = columnOrIdOrIndex;
601
- // TypeScript is unable to narrow the types correctly here, hence the casts.
602
- // See: https://github.com/microsoft/TypeScript/issues/52144
603
- return this.table.columns.find((col) => col.id === columnId);
671
+ return columnCache.get(columnOrIdOrIndex);
604
672
  }
605
673
  // If the user provided a node, ensure it actually exists in this table.
606
- if (!this.table.columns.includes(columnOrIdOrIndex)) {
607
- return undefined;
608
- }
609
- return columnOrIdOrIndex;
674
+ const cached = columnCache.get(columnOrIdOrIndex.id);
675
+ return cached === columnOrIdOrIndex ? columnOrIdOrIndex : undefined;
610
676
  }, _Table_getColumn = function _Table_getColumn(columnOrIdOrIndex) {
611
677
  const column = __classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetColumn).call(this, columnOrIdOrIndex);
612
678
  if (column === undefined) {
613
679
  _a._throwMissingColumnError(columnOrIdOrIndex);
614
680
  }
615
681
  return column;
682
+ }, _Table_getRowCache = function _Table_getRowCache() {
683
+ let cache = __classPrivateFieldGet(this, _Table_rowCache, "f");
684
+ if (cache === undefined) {
685
+ cache = new Map();
686
+ for (const row of this.table.rows) {
687
+ // TypeScript is unable to narrow array element types correctly here.
688
+ // See: https://github.com/microsoft/TypeScript/issues/52144
689
+ cache.set(row.id, row);
690
+ }
691
+ __classPrivateFieldSet(this, _Table_rowCache, cache, "f");
692
+ // Register the invalidation listener once. The `nodeChanged` event fires on the
693
+ // array node itself after any structural change (insert / remove / move), which is
694
+ // exactly the set of changes that can alter the ID → node mapping.
695
+ if (__classPrivateFieldGet(this, _Table_rowCacheUnsubscribe, "f") === undefined) {
696
+ __classPrivateFieldSet(this, _Table_rowCacheUnsubscribe, Tree.on(this.rows, "nodeChanged", () => {
697
+ __classPrivateFieldSet(this, _Table_rowCache, undefined, "f");
698
+ }), "f");
699
+ }
700
+ }
701
+ return cache;
616
702
  }, _Table_tryGetRow = function _Table_tryGetRow(rowOrIdOrIndex) {
617
703
  if (typeof rowOrIdOrIndex === "number") {
618
704
  if (rowOrIdOrIndex < 0 || rowOrIdOrIndex >= this.table.rows.length) {
@@ -622,17 +708,13 @@ export var System_TableSchema;
622
708
  // See: https://github.com/microsoft/TypeScript/issues/52144
623
709
  return this.table.rows[rowOrIdOrIndex];
624
710
  }
711
+ const rowCache = __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this);
625
712
  if (typeof rowOrIdOrIndex === "string") {
626
- const rowId = rowOrIdOrIndex;
627
- // TypeScript is unable to narrow the types correctly here, hence the casts.
628
- // See: https://github.com/microsoft/TypeScript/issues/52144
629
- return this.table.rows.find((row) => row.id === rowId);
713
+ return rowCache.get(rowOrIdOrIndex);
630
714
  }
631
715
  // If the user provided a node, ensure it actually exists in this table.
632
- if (!this.table.rows.includes(rowOrIdOrIndex)) {
633
- return undefined;
634
- }
635
- return rowOrIdOrIndex;
716
+ const cached = rowCache.get(rowOrIdOrIndex.id);
717
+ return cached === rowOrIdOrIndex ? rowOrIdOrIndex : undefined;
636
718
  }, _Table_getRow = function _Table_getRow(rowOrIdOrIndex) {
637
719
  const row = __classPrivateFieldGet(this, _Table_instances, "m", _Table_tryGetRow).call(this, rowOrIdOrIndex);
638
720
  if (row === undefined) {
@@ -640,9 +722,9 @@ export var System_TableSchema;
640
722
  }
641
723
  return row;
642
724
  }, _Table_validateNewColumns = function _Table_validateNewColumns(newColumns) {
643
- return _a._validateNewColumns(newColumns, new Set(this.table.columns.map((column) => column.id)));
725
+ return _a._validateNewColumns(newColumns, __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
644
726
  }, _Table_validateNewRows = function _Table_validateNewRows(newRows) {
645
- return _a._validateNewRows(newRows, new Set(this.table.rows.map((row) => row.id)), new Set(this.table.columns.map((column) => column.id)));
727
+ return _a._validateNewRows(newRows, __classPrivateFieldGet(this, _Table_instances, "m", _Table_getRowCache).call(this), __classPrivateFieldGet(this, _Table_instances, "m", _Table_getColumnCache).call(this));
646
728
  };
647
729
  // Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
648
730
  // for the private brand field of TreeNode.