@fluidframework/tree 2.51.0 → 2.52.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 (579) hide show
  1. package/.vscode/settings.json +0 -1
  2. package/CHANGELOG.md +43 -0
  3. package/api-report/tree.alpha.api.md +3 -2
  4. package/dist/codec/codec.d.ts +2 -1
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +4 -3
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/core/index.d.ts +1 -1
  9. package/dist/core/index.d.ts.map +1 -1
  10. package/dist/core/index.js +3 -2
  11. package/dist/core/index.js.map +1 -1
  12. package/dist/core/rebase/index.d.ts +1 -1
  13. package/dist/core/rebase/index.d.ts.map +1 -1
  14. package/dist/core/rebase/index.js +2 -1
  15. package/dist/core/rebase/index.js.map +1 -1
  16. package/dist/core/rebase/types.d.ts +3 -1
  17. package/dist/core/rebase/types.d.ts.map +1 -1
  18. package/dist/core/rebase/types.js +2 -1
  19. package/dist/core/rebase/types.js.map +1 -1
  20. package/dist/core/schema-stored/schema.d.ts +1 -23
  21. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  22. package/dist/core/schema-stored/schema.js +2 -2
  23. package/dist/core/schema-stored/schema.js.map +1 -1
  24. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  25. package/dist/core/tree/detachedFieldIndex.js +2 -3
  26. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  27. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  28. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  29. package/dist/core/tree/detachedFieldIndexCodecCommon.js +68 -0
  30. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  31. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  32. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  33. package/dist/core/tree/detachedFieldIndexCodecV1.js +55 -0
  34. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  35. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  36. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  37. package/dist/core/tree/detachedFieldIndexCodecV2.js +49 -0
  38. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  39. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  40. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  41. package/dist/core/tree/detachedFieldIndexCodecs.js +26 -0
  42. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  43. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  44. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  45. package/dist/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +18 -13
  46. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  47. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  48. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  49. package/dist/core/tree/detachedFieldIndexFormatV1.js +12 -0
  50. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  51. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  52. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  53. package/dist/core/tree/detachedFieldIndexFormatV2.js +14 -0
  54. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  55. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  56. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +21 -21
  58. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  60. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  62. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  64. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +74 -61
  66. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  68. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/format.js +18 -12
  70. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  71. package/{lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts → dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  72. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  73. package/dist/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +23 -17
  74. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  75. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  76. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -22
  78. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  80. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  81. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  82. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  83. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +14 -2
  84. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  85. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  86. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -2
  87. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  88. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  89. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/index.js +2 -2
  91. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  92. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  93. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  94. package/dist/feature-libraries/default-schema/schemaChecker.js +31 -26
  95. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  96. package/dist/feature-libraries/index.d.ts +1 -2
  97. package/dist/feature-libraries/index.d.ts.map +1 -1
  98. package/dist/feature-libraries/index.js +2 -4
  99. package/dist/feature-libraries/index.js.map +1 -1
  100. package/dist/feature-libraries/modular-schema/comparison.d.ts +5 -6
  101. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  102. package/dist/feature-libraries/modular-schema/comparison.js +15 -16
  103. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  104. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  105. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  106. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  107. package/dist/feature-libraries/object-forest/objectForest.js +2 -3
  108. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  109. package/dist/index.d.ts +1 -1
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +6 -2
  112. package/dist/index.js.map +1 -1
  113. package/dist/packageVersion.d.ts +1 -1
  114. package/dist/packageVersion.js +1 -1
  115. package/dist/packageVersion.js.map +1 -1
  116. package/dist/shared-tree/independentView.d.ts +8 -0
  117. package/dist/shared-tree/independentView.d.ts.map +1 -1
  118. package/dist/shared-tree/independentView.js +23 -11
  119. package/dist/shared-tree/independentView.js.map +1 -1
  120. package/dist/shared-tree/schematizeTree.js +1 -1
  121. package/dist/shared-tree/schematizeTree.js.map +1 -1
  122. package/dist/shared-tree/schematizingTreeView.d.ts +0 -1
  123. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  124. package/dist/shared-tree/schematizingTreeView.js +7 -10
  125. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  126. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  127. package/dist/shared-tree/sharedTree.js +1 -29
  128. package/dist/shared-tree/sharedTree.js.map +1 -1
  129. package/dist/shared-tree/treeAlpha.d.ts +20 -6
  130. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  131. package/dist/shared-tree/treeAlpha.js +9 -4
  132. package/dist/shared-tree/treeAlpha.js.map +1 -1
  133. package/dist/shared-tree/treeCheckout.d.ts +2 -1
  134. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  135. package/dist/shared-tree/treeCheckout.js +32 -0
  136. package/dist/shared-tree/treeCheckout.js.map +1 -1
  137. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  138. package/dist/shared-tree-core/branch.js +1 -1
  139. package/dist/shared-tree-core/branch.js.map +1 -1
  140. package/dist/simple-tree/api/conciseTree.d.ts +2 -2
  141. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  142. package/dist/simple-tree/api/conciseTree.js +6 -6
  143. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  144. package/dist/simple-tree/api/configuration.d.ts +8 -2
  145. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  146. package/dist/simple-tree/api/configuration.js.map +1 -1
  147. package/dist/simple-tree/api/create.d.ts +8 -7
  148. package/dist/simple-tree/api/create.d.ts.map +1 -1
  149. package/dist/simple-tree/api/create.js +35 -22
  150. package/dist/simple-tree/api/create.js.map +1 -1
  151. package/dist/simple-tree/api/customTree.d.ts +25 -4
  152. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  153. package/dist/simple-tree/api/customTree.js +42 -16
  154. package/dist/simple-tree/api/customTree.js.map +1 -1
  155. package/dist/simple-tree/api/discrepancies.d.ts +98 -0
  156. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -0
  157. package/dist/simple-tree/api/discrepancies.js +255 -0
  158. package/dist/simple-tree/api/discrepancies.js.map +1 -0
  159. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  160. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  161. package/dist/simple-tree/api/schemaCompatibilityTester.js +18 -117
  162. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  163. package/dist/simple-tree/api/schemaFactory.d.ts +7 -4
  164. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  165. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  166. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  167. package/dist/simple-tree/api/storedSchema.js +5 -1
  168. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  169. package/dist/simple-tree/api/treeBeta.d.ts +2 -2
  170. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  171. package/dist/simple-tree/api/treeBeta.js +10 -4
  172. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  173. package/dist/simple-tree/api/verboseTree.d.ts +2 -2
  174. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  175. package/dist/simple-tree/api/verboseTree.js +15 -15
  176. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  177. package/dist/simple-tree/core/allowedTypes.d.ts +20 -4
  178. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  179. package/dist/simple-tree/core/allowedTypes.js +45 -13
  180. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  181. package/dist/simple-tree/core/context.d.ts +13 -2
  182. package/dist/simple-tree/core/context.d.ts.map +1 -1
  183. package/dist/simple-tree/core/context.js +22 -9
  184. package/dist/simple-tree/core/context.js.map +1 -1
  185. package/dist/simple-tree/core/index.d.ts +2 -2
  186. package/dist/simple-tree/core/index.d.ts.map +1 -1
  187. package/dist/simple-tree/core/index.js +3 -1
  188. package/dist/simple-tree/core/index.js.map +1 -1
  189. package/dist/simple-tree/core/treeNodeKernel.d.ts +1 -1
  190. package/dist/simple-tree/core/treeNodeKernel.js +1 -1
  191. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  192. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  193. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  194. package/dist/simple-tree/core/treeNodeValid.js +8 -1
  195. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  196. package/dist/simple-tree/core/walkSchema.d.ts +3 -0
  197. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  198. package/dist/simple-tree/core/walkSchema.js +2 -0
  199. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  200. package/dist/simple-tree/createContext.d.ts +2 -0
  201. package/dist/simple-tree/createContext.d.ts.map +1 -1
  202. package/dist/simple-tree/createContext.js +3 -1
  203. package/dist/simple-tree/createContext.js.map +1 -1
  204. package/dist/simple-tree/fieldSchema.d.ts +1 -0
  205. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  206. package/dist/simple-tree/fieldSchema.js +1 -0
  207. package/dist/simple-tree/fieldSchema.js.map +1 -1
  208. package/dist/simple-tree/index.d.ts +4 -4
  209. package/dist/simple-tree/index.d.ts.map +1 -1
  210. package/dist/simple-tree/index.js +7 -8
  211. package/dist/simple-tree/index.js.map +1 -1
  212. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  213. package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
  214. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  215. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  216. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  217. package/dist/simple-tree/node-kinds/index.js +1 -2
  218. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  219. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  220. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  221. package/dist/simple-tree/node-kinds/object/index.js +1 -2
  222. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  223. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -7
  224. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  225. package/dist/simple-tree/node-kinds/object/objectNode.js +4 -18
  226. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  227. package/dist/simple-tree/prepareForInsertion.d.ts +5 -5
  228. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  229. package/dist/simple-tree/prepareForInsertion.js +9 -3
  230. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  231. package/dist/simple-tree/toStoredSchema.d.ts +3 -0
  232. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  233. package/dist/simple-tree/toStoredSchema.js +3 -0
  234. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  235. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  236. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  237. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  238. package/dist/simple-tree/walkFieldSchema.d.ts +1 -0
  239. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  240. package/dist/simple-tree/walkFieldSchema.js +1 -0
  241. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  242. package/lib/codec/codec.d.ts +2 -1
  243. package/lib/codec/codec.d.ts.map +1 -1
  244. package/lib/codec/codec.js +4 -3
  245. package/lib/codec/codec.js.map +1 -1
  246. package/lib/core/index.d.ts +1 -1
  247. package/lib/core/index.d.ts.map +1 -1
  248. package/lib/core/index.js +1 -1
  249. package/lib/core/index.js.map +1 -1
  250. package/lib/core/rebase/index.d.ts +1 -1
  251. package/lib/core/rebase/index.d.ts.map +1 -1
  252. package/lib/core/rebase/index.js +1 -1
  253. package/lib/core/rebase/index.js.map +1 -1
  254. package/lib/core/rebase/types.d.ts +3 -1
  255. package/lib/core/rebase/types.d.ts.map +1 -1
  256. package/lib/core/rebase/types.js +1 -0
  257. package/lib/core/rebase/types.js.map +1 -1
  258. package/lib/core/schema-stored/schema.d.ts +1 -23
  259. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  260. package/lib/core/schema-stored/schema.js +2 -2
  261. package/lib/core/schema-stored/schema.js.map +1 -1
  262. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  263. package/lib/core/tree/detachedFieldIndex.js +2 -3
  264. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  265. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  266. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  267. package/lib/core/tree/detachedFieldIndexCodecCommon.js +64 -0
  268. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  269. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  270. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  271. package/lib/core/tree/detachedFieldIndexCodecV1.js +51 -0
  272. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  273. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  274. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  275. package/lib/core/tree/detachedFieldIndexCodecV2.js +45 -0
  276. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  277. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  278. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  279. package/lib/core/tree/detachedFieldIndexCodecs.js +21 -0
  280. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  281. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  282. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  283. package/lib/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +13 -10
  284. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  285. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  286. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  287. package/lib/core/tree/detachedFieldIndexFormatV1.js +9 -0
  288. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  289. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  290. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  291. package/lib/core/tree/detachedFieldIndexFormatV2.js +11 -0
  292. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  293. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  294. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  295. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +19 -19
  296. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  297. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  298. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  299. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  300. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  301. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  302. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  303. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +70 -57
  304. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  305. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  306. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  307. package/lib/feature-libraries/chunked-forest/codec/format.js +17 -11
  308. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  309. package/{dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts → lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  310. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  311. package/lib/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +21 -15
  312. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  313. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  314. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  315. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +19 -19
  316. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  317. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  318. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  319. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  320. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  321. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +14 -2
  322. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  323. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  324. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -2
  325. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  326. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  327. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  328. package/lib/feature-libraries/default-schema/index.js +1 -1
  329. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  330. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  331. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  332. package/lib/feature-libraries/default-schema/schemaChecker.js +29 -24
  333. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  334. package/lib/feature-libraries/index.d.ts +1 -2
  335. package/lib/feature-libraries/index.d.ts.map +1 -1
  336. package/lib/feature-libraries/index.js +1 -2
  337. package/lib/feature-libraries/index.js.map +1 -1
  338. package/lib/feature-libraries/modular-schema/comparison.d.ts +5 -6
  339. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  340. package/lib/feature-libraries/modular-schema/comparison.js +14 -14
  341. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  343. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  344. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  345. package/lib/feature-libraries/object-forest/objectForest.js +3 -4
  346. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  347. package/lib/index.d.ts +1 -1
  348. package/lib/index.d.ts.map +1 -1
  349. package/lib/index.js +2 -2
  350. package/lib/index.js.map +1 -1
  351. package/lib/packageVersion.d.ts +1 -1
  352. package/lib/packageVersion.js +1 -1
  353. package/lib/packageVersion.js.map +1 -1
  354. package/lib/shared-tree/independentView.d.ts +8 -0
  355. package/lib/shared-tree/independentView.d.ts.map +1 -1
  356. package/lib/shared-tree/independentView.js +21 -10
  357. package/lib/shared-tree/independentView.js.map +1 -1
  358. package/lib/shared-tree/schematizeTree.js +1 -1
  359. package/lib/shared-tree/schematizeTree.js.map +1 -1
  360. package/lib/shared-tree/schematizingTreeView.d.ts +0 -1
  361. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  362. package/lib/shared-tree/schematizingTreeView.js +8 -11
  363. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  364. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  365. package/lib/shared-tree/sharedTree.js +2 -30
  366. package/lib/shared-tree/sharedTree.js.map +1 -1
  367. package/lib/shared-tree/treeAlpha.d.ts +20 -6
  368. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  369. package/lib/shared-tree/treeAlpha.js +10 -5
  370. package/lib/shared-tree/treeAlpha.js.map +1 -1
  371. package/lib/shared-tree/treeCheckout.d.ts +2 -1
  372. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  373. package/lib/shared-tree/treeCheckout.js +33 -1
  374. package/lib/shared-tree/treeCheckout.js.map +1 -1
  375. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  376. package/lib/shared-tree-core/branch.js +1 -1
  377. package/lib/shared-tree-core/branch.js.map +1 -1
  378. package/lib/simple-tree/api/conciseTree.d.ts +2 -2
  379. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  380. package/lib/simple-tree/api/conciseTree.js +6 -6
  381. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  382. package/lib/simple-tree/api/configuration.d.ts +8 -2
  383. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  384. package/lib/simple-tree/api/configuration.js.map +1 -1
  385. package/lib/simple-tree/api/create.d.ts +8 -7
  386. package/lib/simple-tree/api/create.d.ts.map +1 -1
  387. package/lib/simple-tree/api/create.js +38 -25
  388. package/lib/simple-tree/api/create.js.map +1 -1
  389. package/lib/simple-tree/api/customTree.d.ts +25 -4
  390. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  391. package/lib/simple-tree/api/customTree.js +43 -17
  392. package/lib/simple-tree/api/customTree.js.map +1 -1
  393. package/lib/simple-tree/api/discrepancies.d.ts +98 -0
  394. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -0
  395. package/lib/simple-tree/{discrepancies.js → api/discrepancies.js} +80 -206
  396. package/lib/simple-tree/api/discrepancies.js.map +1 -0
  397. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  398. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  399. package/lib/simple-tree/api/schemaCompatibilityTester.js +19 -118
  400. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  401. package/lib/simple-tree/api/schemaFactory.d.ts +7 -4
  402. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  403. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  404. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  405. package/lib/simple-tree/api/storedSchema.js +6 -2
  406. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  407. package/lib/simple-tree/api/treeBeta.d.ts +2 -2
  408. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  409. package/lib/simple-tree/api/treeBeta.js +8 -2
  410. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  411. package/lib/simple-tree/api/verboseTree.d.ts +2 -2
  412. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  413. package/lib/simple-tree/api/verboseTree.js +9 -9
  414. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  415. package/lib/simple-tree/core/allowedTypes.d.ts +20 -4
  416. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  417. package/lib/simple-tree/core/allowedTypes.js +42 -12
  418. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  419. package/lib/simple-tree/core/context.d.ts +13 -2
  420. package/lib/simple-tree/core/context.d.ts.map +1 -1
  421. package/lib/simple-tree/core/context.js +22 -9
  422. package/lib/simple-tree/core/context.js.map +1 -1
  423. package/lib/simple-tree/core/index.d.ts +2 -2
  424. package/lib/simple-tree/core/index.d.ts.map +1 -1
  425. package/lib/simple-tree/core/index.js +2 -2
  426. package/lib/simple-tree/core/index.js.map +1 -1
  427. package/lib/simple-tree/core/treeNodeKernel.d.ts +1 -1
  428. package/lib/simple-tree/core/treeNodeKernel.js +1 -1
  429. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  430. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  431. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  432. package/lib/simple-tree/core/treeNodeValid.js +8 -1
  433. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  434. package/lib/simple-tree/core/walkSchema.d.ts +3 -0
  435. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  436. package/lib/simple-tree/core/walkSchema.js +2 -0
  437. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  438. package/lib/simple-tree/createContext.d.ts +2 -0
  439. package/lib/simple-tree/createContext.d.ts.map +1 -1
  440. package/lib/simple-tree/createContext.js +3 -1
  441. package/lib/simple-tree/createContext.js.map +1 -1
  442. package/lib/simple-tree/fieldSchema.d.ts +1 -0
  443. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  444. package/lib/simple-tree/fieldSchema.js +1 -0
  445. package/lib/simple-tree/fieldSchema.js.map +1 -1
  446. package/lib/simple-tree/index.d.ts +4 -4
  447. package/lib/simple-tree/index.d.ts.map +1 -1
  448. package/lib/simple-tree/index.js +4 -4
  449. package/lib/simple-tree/index.js.map +1 -1
  450. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  451. package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -1
  452. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  453. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  454. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  455. package/lib/simple-tree/node-kinds/index.js +1 -1
  456. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  457. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  458. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  459. package/lib/simple-tree/node-kinds/object/index.js +1 -1
  460. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  461. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -7
  462. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  463. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -16
  464. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  465. package/lib/simple-tree/prepareForInsertion.d.ts +5 -5
  466. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  467. package/lib/simple-tree/prepareForInsertion.js +11 -5
  468. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  469. package/lib/simple-tree/toStoredSchema.d.ts +3 -0
  470. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  471. package/lib/simple-tree/toStoredSchema.js +3 -0
  472. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  473. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  474. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  475. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
  476. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  477. package/lib/simple-tree/walkFieldSchema.d.ts +1 -0
  478. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  479. package/lib/simple-tree/walkFieldSchema.js +1 -0
  480. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  481. package/package.json +23 -23
  482. package/src/codec/codec.ts +4 -3
  483. package/src/core/index.ts +2 -0
  484. package/src/core/rebase/index.ts +2 -0
  485. package/src/core/rebase/types.ts +4 -0
  486. package/src/core/schema-stored/schema.ts +2 -26
  487. package/src/core/tree/detachedFieldIndex.ts +4 -6
  488. package/src/core/tree/detachedFieldIndexCodecCommon.ts +87 -0
  489. package/src/core/tree/{detachedFieldIndexCodec.ts → detachedFieldIndexCodecV1.ts} +22 -68
  490. package/src/core/tree/detachedFieldIndexCodecV2.ts +72 -0
  491. package/src/core/tree/detachedFieldIndexCodecs.ts +44 -0
  492. package/src/core/tree/{detachedFieldIndexFormat.ts → detachedFieldIndexFormatCommon.ts} +32 -23
  493. package/src/core/tree/detachedFieldIndexFormatV1.ts +15 -0
  494. package/src/core/tree/detachedFieldIndexFormatV2.ts +17 -0
  495. package/src/feature-libraries/chunked-forest/codec/README.md +1 -1
  496. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +25 -25
  497. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -6
  498. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +96 -73
  499. package/src/feature-libraries/chunked-forest/codec/format.ts +20 -14
  500. package/src/feature-libraries/chunked-forest/codec/{nodeShape.ts → nodeEncoder.ts} +23 -17
  501. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +34 -34
  502. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +5 -5
  503. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +10 -0
  504. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -2
  505. package/src/feature-libraries/default-schema/index.ts +1 -1
  506. package/src/feature-libraries/default-schema/schemaChecker.ts +47 -30
  507. package/src/feature-libraries/index.ts +1 -3
  508. package/src/feature-libraries/modular-schema/comparison.ts +14 -29
  509. package/src/feature-libraries/object-forest/objectForest.ts +10 -6
  510. package/src/index.ts +5 -0
  511. package/src/packageVersion.ts +1 -1
  512. package/src/shared-tree/independentView.ts +45 -19
  513. package/src/shared-tree/schematizeTree.ts +1 -1
  514. package/src/shared-tree/schematizingTreeView.ts +16 -13
  515. package/src/shared-tree/sharedTree.ts +2 -42
  516. package/src/shared-tree/treeAlpha.ts +30 -18
  517. package/src/shared-tree/treeCheckout.ts +54 -10
  518. package/src/shared-tree-core/branch.ts +1 -6
  519. package/src/simple-tree/api/conciseTree.ts +9 -7
  520. package/src/simple-tree/api/configuration.ts +8 -2
  521. package/src/simple-tree/api/create.ts +49 -36
  522. package/src/simple-tree/api/customTree.ts +59 -20
  523. package/src/simple-tree/{discrepancies.ts → api/discrepancies.ts} +128 -303
  524. package/src/simple-tree/api/schemaCompatibilityTester.ts +27 -151
  525. package/src/simple-tree/api/schemaFactory.ts +7 -4
  526. package/src/simple-tree/api/storedSchema.ts +6 -9
  527. package/src/simple-tree/api/treeBeta.ts +17 -4
  528. package/src/simple-tree/api/verboseTree.ts +17 -8
  529. package/src/simple-tree/core/allowedTypes.ts +54 -21
  530. package/src/simple-tree/core/context.ts +24 -22
  531. package/src/simple-tree/core/index.ts +2 -1
  532. package/src/simple-tree/core/treeNodeKernel.ts +1 -1
  533. package/src/simple-tree/core/treeNodeValid.ts +9 -2
  534. package/src/simple-tree/core/walkSchema.ts +3 -0
  535. package/src/simple-tree/createContext.ts +6 -1
  536. package/src/simple-tree/fieldSchema.ts +1 -0
  537. package/src/simple-tree/index.ts +5 -10
  538. package/src/simple-tree/node-kinds/array/arrayNode.ts +32 -19
  539. package/src/simple-tree/node-kinds/index.ts +0 -1
  540. package/src/simple-tree/node-kinds/object/index.ts +0 -1
  541. package/src/simple-tree/node-kinds/object/objectNode.ts +9 -27
  542. package/src/simple-tree/prepareForInsertion.ts +17 -9
  543. package/src/simple-tree/toStoredSchema.ts +3 -0
  544. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +6 -2
  545. package/src/simple-tree/walkFieldSchema.ts +1 -0
  546. package/dist/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  547. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  548. package/dist/core/tree/detachedFieldIndexCodec.js +0 -100
  549. package/dist/core/tree/detachedFieldIndexCodec.js.map +0 -1
  550. package/dist/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  551. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  552. package/dist/core/tree/detachedFieldIndexFormat.js.map +0 -1
  553. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  554. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  555. package/dist/feature-libraries/initializeForest.d.ts +0 -18
  556. package/dist/feature-libraries/initializeForest.d.ts.map +0 -1
  557. package/dist/feature-libraries/initializeForest.js +0 -35
  558. package/dist/feature-libraries/initializeForest.js.map +0 -1
  559. package/dist/simple-tree/discrepancies.d.ts +0 -167
  560. package/dist/simple-tree/discrepancies.d.ts.map +0 -1
  561. package/dist/simple-tree/discrepancies.js +0 -382
  562. package/dist/simple-tree/discrepancies.js.map +0 -1
  563. package/lib/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  564. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  565. package/lib/core/tree/detachedFieldIndexCodec.js +0 -96
  566. package/lib/core/tree/detachedFieldIndexCodec.js.map +0 -1
  567. package/lib/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  568. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  569. package/lib/core/tree/detachedFieldIndexFormat.js.map +0 -1
  570. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  571. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  572. package/lib/feature-libraries/initializeForest.d.ts +0 -18
  573. package/lib/feature-libraries/initializeForest.d.ts.map +0 -1
  574. package/lib/feature-libraries/initializeForest.js +0 -31
  575. package/lib/feature-libraries/initializeForest.js.map +0 -1
  576. package/lib/simple-tree/discrepancies.d.ts +0 -167
  577. package/lib/simple-tree/discrepancies.d.ts.map +0 -1
  578. package/lib/simple-tree/discrepancies.js.map +0 -1
  579. package/src/feature-libraries/initializeForest.ts +0 -55
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAG9E,+DAK0C;AAI1C,0DAM6B;AAC7B,4DAAsD;AAEtD;;;;GAIG;AACH,MAAa,yBAAyB;IACrC;;OAEG;IACH,YACiB,MAAwB,EACxB,cAA2B;QAD3B,WAAM,GAAN,MAAM,CAAkB;QACxB,mBAAc,GAAd,cAAc,CAAa;IACzC,CAAC;IAEJ;;;;;;;;;OASG;IACI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,KAAK,SAAS,EAAE,CAAC;wBAC3C,MAAM,aAAa,GAClB,gBAAgB,KAAK,SAAS;4BAC7B,CAAC,CAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC;4BACpD,CAAC,CAAC,IAAI,CAAC;wBACT,IAAI,CAAC,aAAa,EAAE,CAAC;4BACpB,yEAAyE;4BACzE,wFAAwF;4BACxF,kDAAkD;4BAClD,yDAAyD;4BACzD,uIAAuI;4BACvI,wJAAwJ;4BACxJ,UAAU,GAAG,KAAK,CAAC;wBACpB,CAAC;oBACF,CAAC;yBAAM,CAAC;wBACP,6FAA6F;wBAC7F,oEAAoE;wBACpE,OAAO,GAAG,KAAK,CAAC;wBAChB,UAAU,GAAG,KAAK,CAAC;oBACpB,CAAC;oBACD,MAAM;gBACP,CAAC;gBACD,KAAK,aAAa,CAAC;gBACnB,KAAK,cAAc,CAAC;gBACpB,KAAK,WAAW,CAAC,CAAC,CAAC;oBAClB,uCAAuC,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACP,CAAC;gBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACf,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;oBACzE,MAAM;gBACP,CAAC;gBACD,aAAa;YACd,CAAC;QACF,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YAChB,IAAA,iBAAM,EACL,IAAA,6BAAkB,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAA,kCAAc,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC5E,KAAK,CAAC,0EAA0E,CAChF,CAAC;QACH,CAAC;QAED,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY,EAAE,OAAO,IAAI,UAAU;SACnC,CAAC;IACH,CAAC;CACD;AArKD,8DAqKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport {\n\tallowsRepoSuperset,\n\tFieldKinds,\n\ttype FullSchemaPolicy,\n\tisNeverTree,\n} from \"../../feature-libraries/index.js\";\nimport type { FieldSchema } from \"../fieldSchema.js\";\n\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\nimport {\n\tcomparePosetElements,\n\tfieldRealizer,\n\tgetAllowedContentDiscrepancies,\n\tPosetComparisonResult,\n\ttype FieldDiscrepancy,\n} from \"../discrepancies.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\n\n/**\n * A collection of View information for schema, including policy.\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\t/**\n\t * @param viewSchemaRoot - Schema for the root field.\n\t */\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly viewSchemaRoot: FieldSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\t\t// View schema allows a superset of documents that stored schema does, hence the document could be upgraded to use a persisted version\n\t\t// of this view schema as its stored schema.\n\t\tlet canUpgrade = true;\n\n\t\tconst updateCompatibilityFromFieldDiscrepancy = (discrepancy: FieldDiscrepancy): void => {\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"allowedTypes\": {\n\t\t\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t\t\t// stored schema.\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.stored.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(this.policy, stored, stored.nodeSchema.get(identifier)),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Stored schema has extra allowed types that the view schema does not.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (discrepancy.view.length > 0) {\n\t\t\t\t\t\t// View schema has extra allowed types that the stored schema does not.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tconst result = comparePosetElements(\n\t\t\t\t\t\tdiscrepancy.stored,\n\t\t\t\t\t\tdiscrepancy.view,\n\t\t\t\t\t\tfieldRealizer,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (result === PosetComparisonResult.Greater) {\n\t\t\t\t\t\t// Stored schema is more relaxed than view schema.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdiscrepancy.view === FieldKinds.forbidden.identifier &&\n\t\t\t\t\t\t\tdiscrepancy.identifier !== undefined &&\n\t\t\t\t\t\t\tthis.policy.allowUnknownOptionalFields(discrepancy.identifier)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t\t\t\t\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Less) {\n\t\t\t\t\t\t// View schema is more relaxed than stored schema.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Incomparable) {\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\": {\n\t\t\t\t\tcanView = false;\n\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(discrepancy);\n\t\t\t}\n\t\t};\n\n\t\tfor (const discrepancy of getAllowedContentDiscrepancies(this.viewSchemaRoot, stored)) {\n\t\t\tif (!canView && !canUpgrade) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"nodeKind\": {\n\t\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(discrepancy.identifier);\n\t\t\t\t\t// We conservatively do not allow node types to change.\n\t\t\t\t\t// The only time this might be valid in the sense that the data canonically converts is converting an object node\n\t\t\t\t\t// to a map node over the union of all the object fields' types.\n\t\t\t\t\tif (discrepancy.stored === undefined) {\n\t\t\t\t\t\t// View schema has added a node type that the stored schema doesn't know about.\n\t\t\t\t\t\t// Note that all cases which trigger this should also trigger an AllowedTypeDiscrepancy (where the type is used).\n\t\t\t\t\t\t// This means this case should be redundant and could be removed in the future if there is a reason to do so\n\t\t\t\t\t\t// (like simplifying enablable type support).\n\t\t\t\t\t\t// See the TODO in getAllowedContentDiscrepancies.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t} else if (discrepancy.view === undefined) {\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever) {\n\t\t\t\t\t\t\t// Stored schema has a node type that the view schema doesn't know about.\n\t\t\t\t\t\t\t// The design of allowUnknownOptionalFields allows adding new optional content to types,\n\t\t\t\t\t\t\t// and the new optional content can use new types.\n\t\t\t\t\t\t\t// Therefore this case needs to be supported for viewing.\n\t\t\t\t\t\t\t// However, it is not supported for upgrade as the stored document must be newer (or at least more general) than the view in this case.\n\t\t\t\t\t\t\t// The fact that there might be removed trees with a root of this type which only appears in the stored schema is why this must set canUpgrade to false.\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Node type exists in both schemas but kind has changed. We conservatively never allow this.\n\t\t\t\t\t\t// See note above about cases where this could be allowed if needed.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\":\n\t\t\t\tcase \"allowedTypes\":\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tupdateCompatibilityFromFieldDiscrepancy(discrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fields\": {\n\t\t\t\t\tdiscrepancy.differences.forEach(updateCompatibilityFromFieldDiscrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\tif (canUpgrade) {\n\t\t\tassert(\n\t\t\t\tallowsRepoSuperset(this.policy, stored, toStoredSchema(this.viewSchemaRoot)),\n\t\t\t\t0xbf2 /* View schema must be a superset of the stored schema to allow upgrade */,\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent: canView && canUpgrade,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA2F;AAG3F,yDAAsE;AACtE,4DAAsD;AAGtD;;;;GAIG;AACH,MAAa,yBAAyB;IACrC;IACC;;OAEG;IACa,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACpC,CAAC;IAEJ;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,qDAAqD;QACrD,MAAM,MAAM,GAAG,8BAAmB,CAAC;QAEnC,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QAEnB,KAAK,MAAM,YAAY,IAAI,IAAA,mDAAgC,EAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YACtF,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;QACP,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,6BAAkB,EACpC,MAAM,EACN,MAAM,EACN,IAAA,kCAAc,EAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CACpC,CAAC;QAEF,+EAA+E;QAC/E,0HAA0H;QAC1H,MAAM,YAAY,GACjB,OAAO;YACP,UAAU;YACV,IAAA,6BAAkB,EAAC,MAAM,EAAE,IAAA,kCAAc,EAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAE1E,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY;SACZ,CAAC;IACH,CAAC;CACD;AAtDD,8DAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport { allowsRepoSuperset, defaultSchemaPolicy } from \"../../feature-libraries/index.js\";\n\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\nimport { getDiscrepanciesInAllowedContent } from \"./discrepancies.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\nimport type { TreeSchema } from \"./configuration.js\";\n\n/**\n * A collection of View information for schema\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\tpublic constructor(\n\t\t/**\n\t\t * Schema for the view\n\t\t */\n\t\tpublic readonly viewSchema: TreeSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// The public API surface assumes defaultSchemaPolicy\n\t\tconst policy = defaultSchemaPolicy;\n\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\n\t\tfor (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {\n\t\t\tcanView = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tconst canUpgrade = allowsRepoSuperset(\n\t\t\tpolicy,\n\t\t\tstored,\n\t\t\ttoStoredSchema(this.viewSchema.root),\n\t\t);\n\n\t\t// If true, then upgrading has no effect on what can be stored in the document.\n\t\t// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.\n\t\tconst isEquivalent =\n\t\t\tcanView &&\n\t\t\tcanUpgrade &&\n\t\t\tallowsRepoSuperset(policy, toStoredSchema(this.viewSchema.root), stored);\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t};\n\t}\n}\n"]}
@@ -55,12 +55,15 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends N
55
55
  * // Then the alleged clone wouldn't actually clone the entire person in either case, it would drop the nickname.
56
56
  * ```
57
57
  *
58
- * If an application wants to be particularly careful to preserve all data on a node when editing it, it can use
59
- * {@link (TreeAlpha:interface).importVerbose|import}/{@link (TreeAlpha:interface).exportVerbose|export} APIs with persistent keys.
58
+ * The existing import and export APIs have similar problems.
59
+ * For example currently the {@link (TreeAlpha:interface).exportVerbose|exportVerbose} API with stored keys preserves unknown optional fields,
60
+ * but {@link Unhydrated} nodes produced by {@link TreeNode} constructors, insertable content, and {@link (TreeAlpha:interface).importVerbose|importVerbose} do not.
61
+ * {@link (TreeBeta:interface).clone} however can be used to clone a node preserving unknown optional fields.
60
62
  *
61
63
  * Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
62
- * this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code
63
- * reaches into a node (either by accessing its fields, spreading it, or some other means) that this problem arises.
64
+ * this problem as SharedTree's implementation stores the entire node in its lower layers.
65
+ * It's only when application code reaches into a node
66
+ * (either by accessing its fields, spreading it, or some other means) that this problem arises.
64
67
  */
65
68
  allowUnknownOptionalFields?: boolean;
66
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAI5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EAGtB,kBAAkB,EAClB,6BAA6B,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B,CAAgC;AAE/D;;GAEG;AACoB,sBAAQ,GAAG,mBAAmB,CAAC,QAAQ,AAA/B,CAAgC;AAE/D;;GAEG;AACoB,+BAAiB,GAAG,mBAAmB,CAAC,iBAAiB,AAAxC,CAAyC;AAEjF;;GAEG;AACoB,+BAAiB,GAAG,mBAAmB,CAAC,iBAAiB,AAAxC,CAAyC;AA6LlF,SAAgB,cAAc,CAC7B,cAAiB,EACjB,YAAwD;IAExD,IAAI,KAAa,CAAC;IAClB,IAAI,CAAC,IAAA,0BAAe,EAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,cAAc,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACP,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAU,EAAE;YAC5C,8DAA8D;YAC9D,IAAA,iBAAM,EAAC,CAAC,IAAA,iBAAM,EAAC,CAAC,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACtD,IAAA,gCAAqB,EAAC,CAAC,CAAC,CAAC;YACzB,OAAO,CAAC,CAAC,UAAU,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,mCAAmC;QACnC,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,8FAA8F;QAC9F,iDAAiD;QACjD,2IAA2I;QAC3I,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,KAAK,GAAG,CAAC;AACtC,CAAC;AAtBD,wCAsBC;AAED;;;;;GAKG;AACH,MAAM,yBAAyB,GAAkB,IAAA,6BAAkB,GAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { TreeValue } from \"../../core/index.js\";\n// This import is required for intellisense in @link doc comments on mouseover in VSCode.\n// eslint-disable-next-line unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars\nimport type { TreeAlpha } from \"../../shared-tree/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n\tcompareSets,\n\tgetOrCreate,\n\tisReadonlyArray,\n} from \"../../util/index.js\";\nimport { normalizeAllowedTypes, markSchemaMostDerived, isLazy } from \"../core/index.js\";\nimport type {\n\tNodeKind,\n\tWithType,\n\tTreeNodeSchema,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaBoth,\n\tUnhydratedFlexTreeNode,\n\tNodeSchemaMetadata,\n\tImplicitAnnotatedAllowedTypes,\n\tUnannotateImplicitAllowedTypes,\n\tImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n} from \"../core/index.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n\ttype LeafSchema,\n} from \"../leafNodeSchema.js\";\nimport {\n\tarraySchema,\n\ttype MapNodeInsertableData,\n\tmapSchema,\n\tobjectSchema,\n\ttype TreeArrayNode,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype TreeMapNode,\n\ttype TreeObjectNode,\n\ttype UnannotateSchemaRecord,\n} from \"../node-kinds/index.js\";\nimport {\n\tFieldKind,\n\ttype FieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype FieldProps,\n\tcreateFieldSchema,\n\ttype DefaultProvider,\n\tgetDefaultProvider,\n\ttype FieldSchemaAlpha,\n\ttype FieldPropsAlpha,\n} from \"../fieldSchema.js\";\n\nimport { createFieldSchemaUnsafe } from \"./schemaFactoryRecursive.js\";\nimport type { System_Unsafe, FieldSchemaAlphaUnsafe } from \"./typesUnsafe.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport type { FlexTreeHydratedContextMinimal } from \"../../feature-libraries/index.js\";\nimport { unhydratedFlexTreeFromInsertable } from \"../unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Gets the leaf domain schema compatible with a given {@link TreeValue}.\n */\nexport function schemaFromValue(value: TreeValue): TreeNodeSchema {\n\tswitch (typeof value) {\n\t\tcase \"boolean\":\n\t\t\treturn booleanSchema;\n\t\tcase \"number\":\n\t\t\treturn numberSchema;\n\t\tcase \"string\":\n\t\t\treturn stringSchema;\n\t\tcase \"object\": {\n\t\t\tif (value === null) {\n\t\t\t\treturn nullSchema;\n\t\t\t}\n\t\t\tassert(isFluidHandle(value), 0x87e /* invalid TreeValue */);\n\t\t\treturn handleSchema;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(value);\n\t}\n}\n\n/**\n * Options when declaring an {@link SchemaFactory.object|object node}'s schema\n *\n * @alpha\n */\nexport interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>\n\textends NodeSchemaOptionsAlpha<TCustomMetadata> {\n\t/**\n\t * Allow nodes typed with this object node schema to contain optional fields that are not present in the schema declaration.\n\t * Such nodes can come into existence either via import APIs (see remarks) or by way of collaboration with another client\n\t * that has upgraded the document's schema to include those optional fields.\n\t *\n\t * @defaultValue `false`\n\t * @remarks\n\t * The advantage of enabling this option is that it allows an application ecosystem with staged rollout to more quickly\n\t * upgrade documents to include schema for new optional features.\n\t *\n\t * However, it does come with trade-offs that applications should weigh carefully when it comes to interactions between\n\t * code and documents.\n\t * When opening such documents, the API presented is still determined by the view schema.\n\t * This can have implications on the behavior of edits or code which uses portions of the view schema,\n\t * since this may inadvertently drop data which is present in those optional fields in the document schema.\n\t *\n\t * Consider the following example:\n\t *\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"com.example\");\n\t * class PersonView extends sf.object(\"Person\", { name: sf.string }, { allowUnknownOptionalFields: true }) {}\n\t * class PersonStored extends sf.object(\"Person\", { name: sf.string, nickname: sf.optional(sf.string) }) {}\n\t *\n\t * // Say we have a document which uses `PersonStored` in its schema, and application code constructs\n\t * // a tree view using `PersonView`. If the application for some reason had implemented a function like this:\n\t * function clonePerson(a: PersonView): PersonView {\n\t * \treturn new PersonView({ name: a.name });\n\t * }\n\t * // ...or even like this:\n\t * function clonePerson(a: PersonView): PersonView {\n\t * return new PersonView({ ...a})\n\t * }\n\t * // Then the alleged clone wouldn't actually clone the entire person in either case, it would drop the nickname.\n\t * ```\n\t *\n\t * If an application wants to be particularly careful to preserve all data on a node when editing it, it can use\n\t * {@link (TreeAlpha:interface).importVerbose|import}/{@link (TreeAlpha:interface).exportVerbose|export} APIs with persistent keys.\n\t *\n\t * Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter\n\t * this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code\n\t * reaches into a node (either by accessing its fields, spreading it, or some other means) that this problem arises.\n\t */\n\tallowUnknownOptionalFields?: boolean;\n}\n\n/**\n * Default options for Object node schema creation.\n * @remarks Omits parameters that are not relevant for common use cases.\n */\nexport const defaultSchemaFactoryObjectOptions: Required<\n\tOmit<SchemaFactoryObjectOptions, \"metadata\" | \"persistedMetadata\">\n> = {\n\tallowUnknownOptionalFields: false,\n};\n\n/**\n * The name of a schema produced by {@link SchemaFactory}, including its optional scope prefix.\n *\n * @system @public\n */\nexport type ScopedSchemaName<\n\tTScope extends string | undefined,\n\tTName extends number | string,\n> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;\n// > = `${TScope extends undefined ? \"\" : `${TScope}.`}${TName}`;\n\n/**\n * Stateless APIs exposed via {@link SchemaFactory} as both instance properties and as statics.\n * @privateRemarks\n * We have no way to make linkable members which exist both as statics and instance properties since API-Extractor does not support this.\n * As a workaround, we have this type as a third place which can be linked.\n * @system @sealed @public\n */\nexport interface SchemaStatics {\n\t/**\n\t * {@link TreeNodeSchema} for holding a JavaScript `string`.\n\t *\n\t * @remarks\n\t * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.\n\t *\n\t * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.\n\t * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\treadonly string: LeafSchema<\"string\", string>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding a JavaScript `number`.\n\t *\n\t * @remarks\n\t * The number is a {@link https://en.wikipedia.org/wiki/Double-precision_floating-point_format | double-precision 64-bit binary format IEEE 754} value, however there are some exceptions:\n\t *\n\t * - `NaN`, and the infinities are converted to `null` (and may therefore only be used where `null` is allowed by the schema).\n\t *\n\t * - `-0` may be converted to `0` in some cases.\n\t *\n\t * These limitations match the limitations of JSON.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\treadonly number: LeafSchema<\"number\", number>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding a boolean.\n\t */\n\treadonly boolean: LeafSchema<\"boolean\", boolean>;\n\n\t/**\n\t * {@link TreeNodeSchema} for JavaScript `null`.\n\t *\n\t * @remarks\n\t * There are good {@link https://www.npmjs.com/package/%40rushstack/eslint-plugin#rushstackno-new-null | reasons to avoid using null} in JavaScript, however sometimes it is desired.\n\t * This {@link TreeNodeSchema} node provides the option to include nulls in trees when desired.\n\t * Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\treadonly null: LeafSchema<\"null\", null>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.\n\t */\n\treadonly handle: LeafSchema<\"handle\", IFluidHandle>;\n\n\t/**\n\t * {@link AllowedTypes} for holding any of the leaf types.\n\t */\n\treadonly leaves: readonly [\n\t\tSchemaStatics[\"string\"],\n\t\tSchemaStatics[\"number\"],\n\t\tSchemaStatics[\"boolean\"],\n\t\tSchemaStatics[\"null\"],\n\t\tSchemaStatics[\"handle\"],\n\t];\n\n\t/**\n\t * Make a field optional instead of the default, which is required.\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 optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => FieldSchema<FieldKind.Optional, T, TCustomMetadata>;\n\n\t/**\n\t * Make a field explicitly required.\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 * @remarks\n\t * Fields are required by default, but this API can be used to make the required nature explicit in the schema,\n\t * and allows associating custom {@link FieldProps | properties} 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 required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;\n\n\t/**\n\t * {@link SchemaStatics.optional} 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 SchemaStatics.optional} 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 optionalRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;\n\n\t/**\n\t * {@link SchemaStatics.required} 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 SchemaStatics.required} 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 requiredRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;\n}\n\nconst defaultOptionalProvider: DefaultProvider = getDefaultProvider(() => []);\n\n// The following overloads for optional and required are used to get around the fact that\n// the compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T when T is known to extend ImplicitAllowedTypes\n\nfunction optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;\n\nfunction optional<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;\n\nfunction optional<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {\n\treturn createFieldSchema(FieldKind.Optional, t, {\n\t\tdefaultProvider: defaultOptionalProvider,\n\t\t...props,\n\t});\n}\n\nfunction required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;\n\nfunction required<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;\n\nfunction required<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {\n\treturn createFieldSchema(FieldKind.Required, t, props);\n}\n\n/**\n * Implementation of {@link SchemaStatics}.\n * @remarks\n * Entries can use more specific types than {@link SchemaStatics} requires to be more useful for non-public consumers.\n * Additional non-public members are in {@link schemaStatics}.\n */\nexport const schemaStaticsBase = {\n\tstring: stringSchema,\n\tnumber: numberSchema,\n\tboolean: booleanSchema,\n\tnull: nullSchema,\n\thandle: handleSchema,\n\tleaves: [stringSchema, numberSchema, booleanSchema, nullSchema, handleSchema],\n\n\toptional,\n\n\trequired,\n\n\toptionalRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata> => {\n\t\treturn createFieldSchemaUnsafe(FieldKind.Optional, t, {\n\t\t\tdefaultProvider: defaultOptionalProvider,\n\t\t\t...props,\n\t\t});\n\t},\n\n\trequiredRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata> => {\n\t\treturn createFieldSchemaUnsafe(FieldKind.Required, t, props);\n\t},\n} as const satisfies SchemaStatics;\n\n/**\n * Unstable extensions to {@link schemaStaticsBase}.\n */\nexport const schemaStatics = {\n\t...schemaStaticsBase,\n\tidentifier: <const TCustomMetadata = unknown>(\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlpha<FieldKind.Identifier, typeof stringSchema, TCustomMetadata> => {\n\t\treturn createFieldSchema(FieldKind.Identifier, stringSchema, props);\n\t},\n} as const;\n\nconst schemaStaticsPublic: SchemaStatics = schemaStatics;\n\n// TODO:\n// SchemaFactory.array references should link to the correct overloads, however the syntax for this does not seems to work currently for methods unless the they are not qualified with the class.\n// API-Extractor requires such links to be qualified with the class, so it can't work.\n// Since linking the overload set as a whole also doesn't work, these have been made non-links for now.\n/**\n * Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.\n *\n * @typeParam TScope - Scope added as a prefix to the name of every schema produced by this factory.\n * @typeParam TName - Type of names used to identify each schema produced in this factory.\n * Typically this is just `string` but it is also possible to use `string` or `number` based enums if you prefer to identify your types that way.\n *\n * @remarks\n * For details related to inputting data constrained by schema (including via assignment), and how non-exact schema types are handled in general refer to {@link Input}.\n * For information about recursive schema support, see methods postfixed with \"recursive\" and {@link ValidateRecursiveSchema}.\n * To apply schema defined with this factory to a tree, see {@link ViewableTree.viewWith} and {@link TreeViewConfiguration}.\n *\n * All schema produced by this factory get a {@link TreeNodeSchemaCore.identifier|unique identifier} by combining the {@link SchemaFactory.scope} with the schema's `Name`.\n * The `Name` part may be explicitly provided as a parameter, or inferred as a structural combination of the provided types.\n * The APIs which use this second approach, structural naming, also deduplicate all equivalent calls.\n * Therefor two calls to `array(allowedTypes)` with the same allowedTypes will return the same {@link TreeNodeSchema} instance.\n * On the other hand, two calls to `array(name, allowedTypes)` will always return different {@link TreeNodeSchema} instances\n * and it is an error to use both in the same tree (since their identifiers are not unique).\n *\n * For \"customizable\" schema (those which can be subclassed to customize them, see details below) some additional rules must be followed:\n *\n * 1. Only a single {@link TreeNodeSchema|schema} can be used from the class hierarchy deriving from the base class produced by this factory.\n * It is legal to subclass the returned class, and even subclass that class,\n * but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.\n * These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.\n *\n * 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.\n *\n * 3. Properties for fields defined in the schema should not be overridden.\n *\n * 4. Additional static members added to schema should pick relatively unique keys to reduce the risk of colliding with implementation details what are not exposed in the API.\n *\n * 5. If exporting the schema from a package which uses API-Extractor, export the base class and derived class separately to work around [a known limitation](https://github.com/microsoft/rushstack/issues/4429).\n *\n * Note:\n * POJO stands for Plain Old JavaScript Object.\n * This means an object that works like a `{}` style object literal.\n * In this case it means the prototype is `Object.prototype` and acts like a set of key value pairs (data, not methods).\n * The usage below generalizes this to include array and map like objects as well.\n *\n * There are two ways to use these APIs:\n *\n * Customizable Approach:\n *\n * 1. Declaration: `class X extends schemaFactory.object(\"x\", {}) {}`\n *\n * 2. Allows adding \"local\" (non-persisted) members: Yes. Members (including methods) can be added to the class.\n *\n * 3. Prototype: The user-defined class.\n *\n * 4. Structurally named Schema: Not Supported.\n *\n * 5. Explicitly named Objects: Supported.\n *\n * 6. Explicitly named Maps and Arrays: Supported: Both declaration approaches can be used.\n *\n * 7. Node.js `assert.deepEqual`: Compares like class instances: equal to other nodes of the same type with the same content, including custom local fields.\n *\n * 8. IntelliSense: Shows and links to user-defined class by name: `X`.\n *\n * 9. Recursion: Supported with special declaration patterns.\n *\n * POJO Emulation Approach:\n *\n * 1. Declaration: `const X = schemaFactory.object(\"x\", {}); type X = NodeFromSchema<typeof X>;`\n *\n * 2. Allows adding \"local\" (non-persisted) members: No. Attempting to set non-field members will result in an error.\n *\n * 3. Prototype: `Object.prototype`, `Map.prototype`, or `Array.prototype` depending on node kind.\n *\n * 4. Structurally named Schema: Supported.\n *\n * 5. Explicitly named Objects: Supported.\n *\n * 6. Explicitly named Maps and Arrays: Not Supported.\n *\n * 7. Node.js `assert.deepEqual`: Compares like plain objects: equal to plain JavaScript objects with the same fields, and other nodes with the same fields, even if the types are different.\n *\n * 8. IntelliSense: Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<\"test.x\">`.\n *\n * 9. Recursion: Unsupported: [Generated `.d.ts` files replace recursive references with `any`](https://github.com/microsoft/TypeScript/issues/55832),\n * breaking the use of recursive schema across compilation boundaries.\n *\n * Note that while \"POJO Emulation\" nodes act a lot like POJO objects, they are not true POJO objects:\n *\n * - Adding new arbitrary fields will error, as well some cases of invalid edits.\n *\n * - They are implemented using proxies.\n *\n * - They have state that is not exposed via enumerable own properties, including a {@link TreeNodeSchema}.\n * This makes libraries like node.js `assert.deepEqual` fail to detect differences in type.\n *\n * - Assigning members has side effects (in this case editing the persisted/shared tree).\n *\n * - Not all operations implied by the prototype will work correctly: stick to the APIs explicitly declared in the TypeScript types.\n *\n * @privateRemarks\n * It's perfectly possible to make `POJO Emulation` mode (or even just hiding the prototype) selectable even when using the custom user class declaration syntax.\n * When doing this, it's still possible to make `instanceof` perform correctly.\n * Allowing (or banning) custom/out-of-schema properties on the class is also possible in both modes: it could be orthogonal.\n * Also for consistency, if keeping the current approach to detecting `POJO Emulation` mode it might make sense to make explicitly named Maps and Arrays do the detection the same as how object does it.\n *\n * Note: the comparison between the customizable and POJO modes is not done in a table because TSDoc does not currently have support for embedded markdown.\n *\n * @see {@link SchemaFactoryAlpha}\n *\n * @sealed @public\n */\nexport class SchemaFactory<\n\tout TScope extends string | undefined = string | undefined,\n\tTName extends number | string = string,\n> implements SchemaStatics\n{\n\t/**\n\t * TODO:\n\t * If users of this generate the same name because two different schema with the same identifier were used,\n\t * the second use can get a cache hit, and reference the wrong schema.\n\t * Such usage should probably return a distinct type or error but currently does not.\n\t * The use of markSchemaMostDerived in structuralName at least ensure an error in the case where the collision is from two types extending the same schema factor class.\n\t */\n\tprivate readonly structuralTypes: Map<string, TreeNodeSchema> = new Map();\n\n\t/**\n\t * Construct a SchemaFactory with a given {@link SchemaFactory.scope|scope}.\n\t * @remarks\n\t * There are no restrictions on mixing schema from different schema factories.\n\t * Typically each library will create one or more SchemaFactories and use them to define its schema.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * Prefix appended to the identifiers of all {@link TreeNodeSchema} produced by this builder.\n\t\t *\n\t\t * @remarks\n\t\t * Generally each independently developed library\n\t\t * (possibly a package, but could also be part of a package or multiple packages developed together)\n\t\t * should get its own unique `scope`.\n\t\t * Then each schema in the library get a name which is unique within the library.\n\t\t * The scope and name are joined (with a period) to form the {@link TreeNodeSchemaCore.identifier|schema identifier}.\n\t\t * Following this pattern allows a single application to depend on multiple libraries which define their own schema, and use them together in a single tree without risk of collisions.\n\t\t * If a library logically contains sub-libraries with their own schema, they can be given a scope nested inside the parent scope, such as \"ParentScope.ChildScope\".\n\t\t *\n\t\t * To avoid collisions between the scopes of libraries\n\t\t * it is recommended that the libraries use {@link https://en.wikipedia.org/wiki/Reverse_domain_name_notation | Reverse domain name notation} or a UUIDv4 for their scope.\n\t\t * If this pattern is followed, application can safely use third party libraries without risk of the schema in them colliding.\n\t\t *\n\t\t * You may opt out of using a scope by passing `undefined`, but note that this increases the risk of collisions.\n\t\t *\n\t\t * @example\n\t\t * Fluid Framework follows this pattern, placing the schema for the built in leaf types in the `com.fluidframework.leaf` scope.\n\t\t * If Fluid Framework publishes more schema in the future, they would be under some other `com.fluidframework` scope.\n\t\t * This ensures that any schema defined by any other library will not conflict with Fluid Framework's schema\n\t\t * as long as the library uses the recommended patterns for how to scope its schema..\n\t\t *\n\t\t * @example\n\t\t * A library could generate a random UUIDv4, like `242c4397-49ed-47e6-8dd0-d5c3bc31778b` and use that as the scope.\n\t\t * Note: do not use this UUID: a new one must be randomly generated when needed to ensure collision resistance.\n\t\t * ```typescript\n\t\t * const factory = new SchemaFactory(\"242c4397-49ed-47e6-8dd0-d5c3bc31778b\");\n\t\t * ```\n\t\t */\n\t\tpublic readonly scope: TScope,\n\t) {}\n\n\tprivate scoped<Name extends TName | string>(name: Name): ScopedSchemaName<TScope, Name> {\n\t\treturn (\n\t\t\tthis.scope === undefined ? `${name}` : `${this.scope}.${name}`\n\t\t) as ScopedSchemaName<TScope, Name>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.string}\n\t */\n\tpublic readonly string = schemaStaticsPublic.string;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.number}\n\t */\n\tpublic readonly number = schemaStaticsPublic.number;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.boolean}\n\t */\n\tpublic readonly boolean = schemaStaticsPublic.boolean;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.null}\n\t */\n\tpublic readonly null = schemaStaticsPublic.null;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.handle}\n\t */\n\tpublic readonly handle = schemaStaticsPublic.handle;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic readonly leaves = schemaStaticsPublic.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.string}\n\t */\n\tpublic static readonly string = schemaStaticsPublic.string;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.number}\n\t */\n\tpublic static readonly number = schemaStaticsPublic.number;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.boolean}\n\t */\n\tpublic static readonly boolean = schemaStaticsPublic.boolean;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.null}\n\t */\n\tpublic static readonly null = schemaStaticsPublic.null;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.handle}\n\t */\n\tpublic static readonly handle = schemaStaticsPublic.handle;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic static readonly leaves = schemaStaticsPublic.leaves;\n\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 */\n\tpublic object<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\t>(\n\t\tname: Name,\n\t\tfields: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tTreeObjectNode<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & InsertableObjectFromSchemaRecord<T>,\n\t\ttrue,\n\t\tT\n\t> {\n\t\t// The compiler can't infer that UnannotateSchemaRecord<T> is equal to T so we have to do a bunch of typing to make the error go away.\n\t\tconst object: TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<UnannotateSchemaRecord<T>, ScopedSchemaName<TScope, Name>>,\n\t\t\tobject & InsertableObjectFromSchemaRecord<UnannotateSchemaRecord<T>>,\n\t\t\ttrue,\n\t\t\tT\n\t\t> = objectSchema(\n\t\t\tthis.scoped(name),\n\t\t\tfields,\n\t\t\ttrue,\n\t\t\tdefaultSchemaFactoryObjectOptions.allowUnknownOptionalFields,\n\t\t);\n\n\t\treturn object as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<RestrictiveStringRecord<ImplicitFieldSchema>>,\n\t\t\tunknown,\n\t\t\ttrue,\n\t\t\tT\n\t\t> as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<T, ScopedSchemaName<TScope, Name>>,\n\t\t\tobject & InsertableObjectFromSchemaRecord<T>,\n\t\t\ttrue,\n\t\t\tT\n\t\t>;\n\t}\n\n\t/**\n\t * Define a structurally typed {@link TreeNodeSchema} for a {@link TreeMapNode}.\n\t *\n\t * @param allowedTypes - The types that may appear as values in the map.\n\t *\n\t * @remarks\n\t * The unique identifier for this Map is defined as a function of the provided types.\n\t * It is still scoped to this SchemaBuilder, but multiple calls with the same arguments will return the same schema object, providing somewhat structural typing.\n\t * This does not support recursive types.\n\t *\n\t * If using these structurally named maps, other types in this schema builder should avoid names of the form `Map<${string}>`.\n\t *\n\t * @example\n\t * The returned schema should be used as a schema directly:\n\t * ```typescript\n\t * const MyMap = factory.map(factory.number);\n\t * type MyMap = NodeFromSchema<typeof MyMap>;\n\t * ```\n\t * Or inline:\n\t * ```typescript\n\t * factory.object(\"Foo\", {myMap: factory.map(factory.number)});\n\t * ```\n\t * @privateRemarks\n\t * See note on array.\n\t */\n\tpublic map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaNonClass<\n\t\tScopedSchemaName<TScope, `Map<${string}>`>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link TreeMapNode}.\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 *\n\t * @example\n\t * ```typescript\n\t * class NamedMap extends factory.map(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic map<Name extends TName, const T extends ImplicitAllowedTypes>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * {@link SchemaFactory.map} implementation.\n\t *\n\t * @privateRemarks\n\t * This should return `TreeNodeSchemaBoth`, however TypeScript gives an error if one of the overloads implicitly up-casts the return type of the implementation.\n\t * This seems like a TypeScript bug getting variance backwards for overload return types since it's erroring when the relation between the overload\n\t * and the implementation is type safe, and forcing an unsafe typing instead.\n\t */\n\tpublic map<const T extends ImplicitAllowedTypes>(\n\t\tnameOrAllowedTypes: TName | ((T & TreeNodeSchema) | readonly TreeNodeSchema[]),\n\t\tallowedTypes?: T,\n\t): TreeNodeSchema<string, NodeKind.Map, TreeMapNode<T>, MapNodeInsertableData<T>, true, T> {\n\t\tif (allowedTypes === undefined) {\n\t\t\tconst types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];\n\t\t\tconst fullName = structuralName(\"Map\", types);\n\t\t\treturn this.getStructuralType(fullName, types, () =>\n\t\t\t\tthis.namedMap(fullName, nameOrAllowedTypes as T, false, true),\n\t\t\t) as TreeNodeSchemaBoth<\n\t\t\t\tstring,\n\t\t\t\tNodeKind.Map,\n\t\t\t\tTreeMapNode<T>,\n\t\t\t\tMapNodeInsertableData<T>,\n\t\t\t\ttrue,\n\t\t\t\tT,\n\t\t\t\tundefined\n\t\t\t>;\n\t\t}\n\t\t// To actually have type safety, assign to the type this method should return before implicitly up-casting when returning.\n\t\tconst out: TreeNodeSchemaBoth<\n\t\t\tstring,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\ttrue,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = this.namedMap(nameOrAllowedTypes as TName, allowedTypes, true, true);\n\t\treturn out;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link (TreeMapNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t */\n\tprivate namedMap<\n\t\tName extends TName | string,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst ImplicitlyConstructable extends boolean,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\tcustomizable: boolean,\n\t\timplicitlyConstructable: ImplicitlyConstructable,\n\t): TreeNodeSchemaBoth<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\tImplicitlyConstructable,\n\t\tT,\n\t\tundefined\n\t> {\n\t\t// The compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T so we have to do a bunch of typing to make the error go away.\n\t\tconst map: TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = mapSchema(\n\t\t\tthis.scoped(name),\n\t\t\tallowedTypes,\n\t\t\timplicitlyConstructable,\n\t\t\t// The current policy is customizable nodes don't get fake prototypes.\n\t\t\t!customizable,\n\t\t\tundefined,\n\t\t);\n\n\t\treturn map as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<ImplicitAllowedTypes>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t> as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * Define a structurally typed {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param allowedTypes - The types that may appear in the array.\n\t *\n\t * @remarks\n\t * The identifier for this Array is defined as a function of the provided types.\n\t * It is still scoped to this SchemaFactory, but multiple calls with the same arguments will return the same schema object, providing somewhat structural typing.\n\t * This does not support recursive types.\n\t *\n\t * If using these structurally named arrays, other types in this schema builder should avoid names of the form `Array<${string}>`.\n\t *\n\t * @example\n\t * The returned schema should be used as a schema directly:\n\t * ```typescript\n\t * const MyArray = factory.array(factory.number);\n\t * type MyArray = NodeFromSchema<typeof MyArray>;\n\t * ```\n\t * Or inline:\n\t * ```typescript\n\t * factory.object(\"Foo\", {myArray: factory.array(factory.number)});\n\t * ```\n\t * @privateRemarks\n\t * The name produced at the type level here is not as specific as it could be, however doing type level sorting and escaping is a real mess.\n\t * There are cases where not having this full type provided will be less than ideal, since TypeScript's structural types will allow assignment between runtime incompatible types at compile time.\n\t * For example attempts to narrow unions of structural arrays by name won't work.\n\t * Planned future changes to move to a class based schema system as well as factor function based node construction should mostly avoid these issues,\n\t * though there may still be some problematic cases even after that work is done.\n\t *\n\t * The return value is a class, but its the type is intentionally not specific enough to indicate it is a class.\n\t * This prevents callers of this from sub-classing it, which is unlikely to work well (due to the ease of accidentally giving two different calls o this different subclasses)\n\t * when working with structural typing.\n\t *\n\t * {@label STRUCTURAL}\n\t */\n\tpublic array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaNonClass<\n\t\tScopedSchemaName<TScope, `Array<${string}>`>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * Define (and add to this library) 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 *\n\t * @example\n\t * ```typescript\n\t * class NamedArray extends factory.array(\"name\", factory.number) {}\n\t * ```\n\t *\n\t * {@label NAMED}\n\t */\n\tpublic array<const Name extends TName, const T extends ImplicitAllowedTypes>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * {@link SchemaFactory.array} implementation.\n\t *\n\t * @privateRemarks\n\t * This should return TreeNodeSchemaBoth: see note on \"map\" implementation for details.\n\t */\n\tpublic array<const T extends ImplicitAllowedTypes>(\n\t\tnameOrAllowedTypes: TName | ((T & TreeNodeSchema) | readonly TreeNodeSchema[]),\n\t\tallowedTypes?: T,\n\t): TreeNodeSchema<\n\t\tScopedSchemaName<TScope, string>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT\n\t> {\n\t\tif (allowedTypes === undefined) {\n\t\t\tconst types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];\n\t\t\tconst fullName = structuralName(\"Array\", types);\n\t\t\treturn this.getStructuralType(fullName, types, () =>\n\t\t\t\tthis.namedArray(fullName, nameOrAllowedTypes as T, false, true),\n\t\t\t) as TreeNodeSchemaClass<\n\t\t\t\tScopedSchemaName<TScope, string>,\n\t\t\t\tNodeKind.Array,\n\t\t\t\tTreeArrayNode<T>,\n\t\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\t\ttrue,\n\t\t\t\tT,\n\t\t\t\tundefined\n\t\t\t>;\n\t\t}\n\t\tconst out: TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, string>,\n\t\t\tNodeKind.Array,\n\t\t\tTreeArrayNode<T>,\n\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\ttrue,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = this.namedArray(nameOrAllowedTypes as TName, allowedTypes, true, true);\n\t\treturn out;\n\t}\n\n\t/**\n\t * Retrieves or creates a structural {@link TreeNodeSchema} with the specified name and types.\n\t *\n\t * @param fullName - The name for the structural schema.\n\t * @param types - The input schema(s) used to define the structural schema.\n\t * @param builder - A function that builds the schema if it does not already exist.\n\t * @returns The structural {@link TreeNodeSchema} associated with the given name and types.\n\t * @throws `UsageError` if a schema structurally named schema with the same name is cached in `structuralTypes` but had different input types.\n\t */\n\tprotected getStructuralType(\n\t\tfullName: string,\n\t\ttypes: TreeNodeSchema | readonly TreeNodeSchema[],\n\t\tbuilder: () => TreeNodeSchema,\n\t): TreeNodeSchema {\n\t\tconst structural = getOrCreate(this.structuralTypes, fullName, builder);\n\t\tconst inputTypes = new Set(normalizeAllowedTypes(types));\n\t\tconst outputTypes = new Set(\n\t\t\tnormalizeAllowedTypes(structural.info as TreeNodeSchema | readonly TreeNodeSchema[]),\n\t\t);\n\t\t// If our cached value had a different set of types then were requested, the user must have caused a collision.\n\t\tconst same = compareSets({ a: inputTypes, b: outputTypes });\n\t\tif (!same) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Structurally named schema collision: two schema named \"${fullName}\" were defined with different input schema.`,\n\t\t\t);\n\t\t}\n\t\treturn structural;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t *\n\t * @remarks\n\t * This is not intended to be used directly, use the overload of `array` which takes a name instead.\n\t * This is only public to work around a compiler limitation.\n\t */\n\tprivate namedArray<\n\t\tName extends TName | string,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst ImplicitlyConstructable extends boolean,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\tcustomizable: boolean,\n\t\timplicitlyConstructable: ImplicitlyConstructable,\n\t): TreeNodeSchemaBoth<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, string>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tImplicitlyConstructable,\n\t\tT,\n\t\tundefined\n\t> {\n\t\tconst array = arraySchema(\n\t\t\tthis.scoped(name),\n\t\t\tallowedTypes,\n\t\t\timplicitlyConstructable,\n\t\t\tcustomizable,\n\t\t);\n\n\t\treturn array as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Array,\n\t\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, string>, NodeKind.Array>,\n\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic readonly optional = schemaStaticsPublic.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic readonly required = schemaStaticsPublic.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic static readonly optional = schemaStaticsPublic.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic static readonly required = schemaStaticsPublic.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic static readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic static readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;\n\n\t/**\n\t * A special readonly field which holds an identifier string for an object node.\n\t * @remarks\n\t * The value of this field, a \"node identifier\", is a string which identifies a node (or nodes) among all nodes in the tree.\n\t * Node identifiers are strings, and can therefore be used as lookup keys in maps or written to a database.\n\t * When the node is constructed, the identifier field does not need to be specified.\n\t * When an identifier is not provided, the SharedTree will generate an identifier for the node automatically.\n\t * The identifier generated by the SharedTree has the following properties:\n\t *\n\t * - It is a UUID which will not collide with other generated UUIDs.\n\t *\n\t * - It is compressed to a space-efficient representation when stored in the document.\n\t * Reading the identifier before inserting the node into a tree prevents the identifier from being stored in its compressed form,\n\t * resulting in a larger storage footprint.\n\t *\n\t * - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.\n\t *\n\t * However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).\n\t * In that case, if the user requires it to be unique, it is up to them to ensure uniqueness.\n\t * User-supplied identifiers may be read immediately, even before insertion into the tree.\n\t *\n\t * A node may have more than one identifier field (though note that this precludes the use of the {@link TreeNodeApi.shortId|Tree.shortId()} API).\n\t */\n\tpublic get identifier(): FieldSchema<FieldKind.Identifier, typeof this.string> {\n\t\tconst defaultIdentifierProvider: DefaultProvider = getDefaultProvider(\n\t\t\t(\n\t\t\t\tcontext: FlexTreeHydratedContextMinimal | \"UseGlobalContext\",\n\t\t\t): UnhydratedFlexTreeNode[] => {\n\t\t\t\tconst id =\n\t\t\t\t\tcontext === \"UseGlobalContext\"\n\t\t\t\t\t\t? globalIdentifierAllocator.decompress(\n\t\t\t\t\t\t\t\tglobalIdentifierAllocator.generateCompressedId(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: context.nodeKeyManager.stabilizeNodeIdentifier(\n\t\t\t\t\t\t\t\tcontext.nodeKeyManager.generateLocalNodeIdentifier(),\n\t\t\t\t\t\t\t);\n\n\t\t\t\treturn [unhydratedFlexTreeFromInsertable(id, this.string)];\n\t\t\t},\n\t\t);\n\t\treturn createFieldSchema(FieldKind.Identifier, this.string, {\n\t\t\tdefaultProvider: defaultIdentifierProvider,\n\t\t});\n\t}\n\n\t/**\n\t * {@link SchemaFactory.object} 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 SchemaFactory.object} 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\t * Additionally `ImplicitlyConstructable` is disabled (forcing use of constructor) to avoid\n\t * `error TS2589: Type instantiation is excessively deep and possibly infinite.`\n\t * which otherwise gets reported at sometimes incorrect source locations that vary based on incremental builds.\n\t */\n\tpublic objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t>(\n\t\tname: Name,\n\t\tt: T,\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> {\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.object(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\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>;\n\t}\n\n\t/**\n\t * `SchemaFactory.array` 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.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t * See also {@link FixRecursiveArraySchema} for additional information specific to recursive arrays schema exports.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic arrayRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t>(name: Name, allowedTypes: T) {\n\t\tconst RecursiveArray = this.namedArray(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\ttrue,\n\t\t\tfalse,\n\t\t);\n\n\t\treturn RecursiveArray as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Array,\n\t\t\tSystem_Unsafe.TreeArrayNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>,\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Iterator for the iterable of content for this node.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Wrapping the constructor parameter for recursive arrays and maps in an inlined object type avoids (for unknown reasons)\n\t\t\t\t * the following compile error when declaring the recursive schema:\n\t\t\t\t * `Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.`\n\t\t\t\t * To benefit from this without impacting the API, the definition of `Iterable` has been inlined as such an object.\n\t\t\t\t *\n\t\t\t\t * If this workaround is kept, ideally this comment would be deduplicated with the other instance of it.\n\t\t\t\t * Unfortunately attempts to do this failed to avoid the compile error this was introduced to solve.\n\t\t\t\t */\n\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\tSystem_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>\n\t\t\t\t>;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * `SchemaFactory.map` 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.map` 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 mapRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t>(name: Name, allowedTypes: T) {\n\t\tconst MapSchema = this.namedMap(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\ttrue,\n\t\t\t// Setting this (implicitlyConstructable) 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\tfalse,\n\t\t);\n\n\t\treturn MapSchema as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tSystem_Unsafe.TreeMapNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\t| {\n\t\t\t\t\t/**\n\t\t\t\t\t * Iterator for the iterable of content for this node.\n\t\t\t\t\t * @privateRemarks\n\t\t\t\t\t * Wrapping the constructor parameter for recursive arrays and maps in an inlined object type avoids (for unknown reasons)\n\t\t\t\t\t * the following compile error when declaring the recursive schema:\n\t\t\t\t\t * `Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.`\n\t\t\t\t\t * To benefit from this without impacting the API, the definition of `Iterable` has been inlined as such an object.\n\t\t\t\t\t *\n\t\t\t\t\t * If this workaround is kept, ideally this comment would be deduplicated with the other instance of it.\n\t\t\t\t\t * Unfortunately attempts to do this failed to avoid the compile error this was introduced to solve.\n\t\t\t\t\t */\n\t\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\t\t[string, System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>]\n\t\t\t\t\t>;\n\t\t\t }\n\t\t\t// Ideally this would be\n\t\t\t// RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t// but doing so breaks recursive types.\n\t\t\t// Instead we do a less nice version:\n\t\t\t| {\n\t\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t },\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n}\n\nexport function structuralName<const T extends string>(\n\tcollectionName: T,\n\tallowedTypes: TreeNodeSchema | readonly TreeNodeSchema[],\n): `${T}<${string}>` {\n\tlet inner: string;\n\tif (!isReadonlyArray(allowedTypes)) {\n\t\treturn structuralName(collectionName, [allowedTypes]);\n\t} else {\n\t\tconst names = allowedTypes.map((t): string => {\n\t\t\t// Ensure that lazy types (functions) don't slip through here.\n\t\t\tassert(!isLazy(t), 0x83d /* invalid type provided */);\n\t\t\tmarkSchemaMostDerived(t);\n\t\t\treturn t.identifier;\n\t\t});\n\t\t// Ensure name is order independent\n\t\tnames.sort();\n\t\t// Ensure name can't have collisions by quoting and escaping any quotes in the names of types.\n\t\t// Using JSON is a simple way to accomplish this.\n\t\t// The outer `[]` around the result were needed so that a single type name \"Any\" would not collide with the \"any\" case which used to exist.\n\t\tinner = JSON.stringify(names);\n\t}\n\treturn `${collectionName}<${inner}>`;\n}\n\n/**\n * Used to allocate default identifiers for unhydrated nodes when no context is available.\n * @remarks\n * The identifiers allocated by this will never be compressed to Short Ids.\n * Using this is only better than creating fully random V4 UUIDs because it reduces the entropy making it possible for things like text compression to work slightly better.\n */\nconst globalIdentifierAllocator: IIdCompressor = createIdCompressor();\n\n/**\n * Additional information to provide to Node Schema creation.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.\n * See {@link NodeSchemaMetadata.custom}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaOptions<out TCustomMetadata = unknown> {\n\t/**\n\t * Optional metadata to associate with the Node Schema.\n\t *\n\t * @remarks\n\t * Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.\n\t * Different clients in the same collaborative session may see different metadata for the same field.\n\t */\n\treadonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;\n}\n\n/**\n * Additional information to provide to Node Schema creation. Includes fields for alpha features.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.\n * See {@link NodeSchemaMetadata.custom}.\n *\n * @alpha\n */\nexport interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown>\n\textends NodeSchemaOptions<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n"]}
1
+ {"version":3,"file":"schemaFactory.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA8E;AAC9E,qEAAuE;AACvE,uEAAsE;AAMtE,kDAM6B;AAC7B,+CAAwF;AAexF,4DAO8B;AAC9B,qDAUgC;AAChC,sDAU2B;AAE3B,2EAAsE;AAGtE,qEAA4E;AAE5E,gGAA0F;AAE1F;;GAEG;AACH,SAAgB,eAAe,CAAC,KAAgB;IAC/C,QAAQ,OAAO,KAAK,EAAE,CAAC;QACtB,KAAK,SAAS;YACb,OAAO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;AACoB,+BAAiB,GAAG,mBAAmB,CAAC,iBAAiB,AAAxC,CAAyC;AA6LlF,SAAgB,cAAc,CAC7B,cAAiB,EACjB,YAAwD;IAExD,IAAI,KAAa,CAAC;IAClB,IAAI,CAAC,IAAA,0BAAe,EAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,cAAc,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACP,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAU,EAAE;YAC5C,8DAA8D;YAC9D,IAAA,iBAAM,EAAC,CAAC,IAAA,iBAAM,EAAC,CAAC,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACtD,IAAA,gCAAqB,EAAC,CAAC,CAAC,CAAC;YACzB,OAAO,CAAC,CAAC,UAAU,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,mCAAmC;QACnC,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,8FAA8F;QAC9F,iDAAiD;QACjD,2IAA2I;QAC3I,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,KAAK,GAAG,CAAC;AACtC,CAAC;AAtBD,wCAsBC;AAED;;;;;GAKG;AACH,MAAM,yBAAyB,GAAkB,IAAA,6BAAkB,GAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { TreeValue } from \"../../core/index.js\";\n// This import is required for intellisense in @link doc comments on mouseover in VSCode.\n// eslint-disable-next-line unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars\nimport type { TreeAlpha } from \"../../shared-tree/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\ttype RestrictiveStringRecord,\n\tcompareSets,\n\tgetOrCreate,\n\tisReadonlyArray,\n} from \"../../util/index.js\";\nimport { normalizeAllowedTypes, markSchemaMostDerived, isLazy } from \"../core/index.js\";\nimport type {\n\tNodeKind,\n\tWithType,\n\tTreeNodeSchema,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaBoth,\n\tUnhydratedFlexTreeNode,\n\tNodeSchemaMetadata,\n\tImplicitAnnotatedAllowedTypes,\n\tUnannotateImplicitAllowedTypes,\n\tImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n} from \"../core/index.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n\ttype LeafSchema,\n} from \"../leafNodeSchema.js\";\nimport {\n\tarraySchema,\n\ttype MapNodeInsertableData,\n\tmapSchema,\n\tobjectSchema,\n\ttype TreeArrayNode,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype TreeMapNode,\n\ttype TreeObjectNode,\n\ttype UnannotateSchemaRecord,\n} from \"../node-kinds/index.js\";\nimport {\n\tFieldKind,\n\ttype FieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype FieldProps,\n\tcreateFieldSchema,\n\ttype DefaultProvider,\n\tgetDefaultProvider,\n\ttype FieldSchemaAlpha,\n\ttype FieldPropsAlpha,\n} from \"../fieldSchema.js\";\n\nimport { createFieldSchemaUnsafe } from \"./schemaFactoryRecursive.js\";\nimport type { System_Unsafe, FieldSchemaAlphaUnsafe } from \"./typesUnsafe.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport type { FlexTreeHydratedContextMinimal } from \"../../feature-libraries/index.js\";\nimport { unhydratedFlexTreeFromInsertable } from \"../unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Gets the leaf domain schema compatible with a given {@link TreeValue}.\n */\nexport function schemaFromValue(value: TreeValue): TreeNodeSchema {\n\tswitch (typeof value) {\n\t\tcase \"boolean\":\n\t\t\treturn booleanSchema;\n\t\tcase \"number\":\n\t\t\treturn numberSchema;\n\t\tcase \"string\":\n\t\t\treturn stringSchema;\n\t\tcase \"object\": {\n\t\t\tif (value === null) {\n\t\t\t\treturn nullSchema;\n\t\t\t}\n\t\t\tassert(isFluidHandle(value), 0x87e /* invalid TreeValue */);\n\t\t\treturn handleSchema;\n\t\t}\n\t\tdefault:\n\t\t\tunreachableCase(value);\n\t}\n}\n\n/**\n * Options when declaring an {@link SchemaFactory.object|object node}'s schema\n *\n * @alpha\n */\nexport interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>\n\textends NodeSchemaOptionsAlpha<TCustomMetadata> {\n\t/**\n\t * Allow nodes typed with this object node schema to contain optional fields that are not present in the schema declaration.\n\t * Such nodes can come into existence either via import APIs (see remarks) or by way of collaboration with another client\n\t * that has upgraded the document's schema to include those optional fields.\n\t *\n\t * @defaultValue `false`\n\t * @remarks\n\t * The advantage of enabling this option is that it allows an application ecosystem with staged rollout to more quickly\n\t * upgrade documents to include schema for new optional features.\n\t *\n\t * However, it does come with trade-offs that applications should weigh carefully when it comes to interactions between\n\t * code and documents.\n\t * When opening such documents, the API presented is still determined by the view schema.\n\t * This can have implications on the behavior of edits or code which uses portions of the view schema,\n\t * since this may inadvertently drop data which is present in those optional fields in the document schema.\n\t *\n\t * Consider the following example:\n\t *\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"com.example\");\n\t * class PersonView extends sf.object(\"Person\", { name: sf.string }, { allowUnknownOptionalFields: true }) {}\n\t * class PersonStored extends sf.object(\"Person\", { name: sf.string, nickname: sf.optional(sf.string) }) {}\n\t *\n\t * // Say we have a document which uses `PersonStored` in its schema, and application code constructs\n\t * // a tree view using `PersonView`. If the application for some reason had implemented a function like this:\n\t * function clonePerson(a: PersonView): PersonView {\n\t * \treturn new PersonView({ name: a.name });\n\t * }\n\t * // ...or even like this:\n\t * function clonePerson(a: PersonView): PersonView {\n\t * return new PersonView({ ...a})\n\t * }\n\t * // Then the alleged clone wouldn't actually clone the entire person in either case, it would drop the nickname.\n\t * ```\n\t *\n\t * The existing import and export APIs have similar problems.\n\t * For example currently the {@link (TreeAlpha:interface).exportVerbose|exportVerbose} API with stored keys preserves unknown optional fields,\n\t * but {@link Unhydrated} nodes produced by {@link TreeNode} constructors, insertable content, and {@link (TreeAlpha:interface).importVerbose|importVerbose} do not.\n\t * {@link (TreeBeta:interface).clone} however can be used to clone a node preserving unknown optional fields.\n\t *\n\t * Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter\n\t * this problem as SharedTree's implementation stores the entire node in its lower layers.\n\t * It's only when application code reaches into a node\n\t * (either by accessing its fields, spreading it, or some other means) that this problem arises.\n\t */\n\tallowUnknownOptionalFields?: boolean;\n}\n\n/**\n * Default options for Object node schema creation.\n * @remarks Omits parameters that are not relevant for common use cases.\n */\nexport const defaultSchemaFactoryObjectOptions: Required<\n\tOmit<SchemaFactoryObjectOptions, \"metadata\" | \"persistedMetadata\">\n> = {\n\tallowUnknownOptionalFields: false,\n};\n\n/**\n * The name of a schema produced by {@link SchemaFactory}, including its optional scope prefix.\n *\n * @system @public\n */\nexport type ScopedSchemaName<\n\tTScope extends string | undefined,\n\tTName extends number | string,\n> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;\n// > = `${TScope extends undefined ? \"\" : `${TScope}.`}${TName}`;\n\n/**\n * Stateless APIs exposed via {@link SchemaFactory} as both instance properties and as statics.\n * @privateRemarks\n * We have no way to make linkable members which exist both as statics and instance properties since API-Extractor does not support this.\n * As a workaround, we have this type as a third place which can be linked.\n * @system @sealed @public\n */\nexport interface SchemaStatics {\n\t/**\n\t * {@link TreeNodeSchema} for holding a JavaScript `string`.\n\t *\n\t * @remarks\n\t * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.\n\t *\n\t * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.\n\t * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\treadonly string: LeafSchema<\"string\", string>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding a JavaScript `number`.\n\t *\n\t * @remarks\n\t * The number is a {@link https://en.wikipedia.org/wiki/Double-precision_floating-point_format | double-precision 64-bit binary format IEEE 754} value, however there are some exceptions:\n\t *\n\t * - `NaN`, and the infinities are converted to `null` (and may therefore only be used where `null` is allowed by the schema).\n\t *\n\t * - `-0` may be converted to `0` in some cases.\n\t *\n\t * These limitations match the limitations of JSON.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\treadonly number: LeafSchema<\"number\", number>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding a boolean.\n\t */\n\treadonly boolean: LeafSchema<\"boolean\", boolean>;\n\n\t/**\n\t * {@link TreeNodeSchema} for JavaScript `null`.\n\t *\n\t * @remarks\n\t * There are good {@link https://www.npmjs.com/package/%40rushstack/eslint-plugin#rushstackno-new-null | reasons to avoid using null} in JavaScript, however sometimes it is desired.\n\t * This {@link TreeNodeSchema} node provides the option to include nulls in trees when desired.\n\t * Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\treadonly null: LeafSchema<\"null\", null>;\n\n\t/**\n\t * {@link TreeNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.\n\t */\n\treadonly handle: LeafSchema<\"handle\", IFluidHandle>;\n\n\t/**\n\t * {@link AllowedTypes} for holding any of the leaf types.\n\t */\n\treadonly leaves: readonly [\n\t\tSchemaStatics[\"string\"],\n\t\tSchemaStatics[\"number\"],\n\t\tSchemaStatics[\"boolean\"],\n\t\tSchemaStatics[\"null\"],\n\t\tSchemaStatics[\"handle\"],\n\t];\n\n\t/**\n\t * Make a field optional instead of the default, which is required.\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 optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => FieldSchema<FieldKind.Optional, T, TCustomMetadata>;\n\n\t/**\n\t * Make a field explicitly required.\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 * @remarks\n\t * Fields are required by default, but this API can be used to make the required nature explicit in the schema,\n\t * and allows associating custom {@link FieldProps | properties} 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 required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;\n\n\t/**\n\t * {@link SchemaStatics.optional} 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 SchemaStatics.optional} 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 optionalRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;\n\n\t/**\n\t * {@link SchemaStatics.required} 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 SchemaStatics.required} 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 requiredRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;\n}\n\nconst defaultOptionalProvider: DefaultProvider = getDefaultProvider(() => []);\n\n// The following overloads for optional and required are used to get around the fact that\n// the compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T when T is known to extend ImplicitAllowedTypes\n\nfunction optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;\n\nfunction optional<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;\n\nfunction optional<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {\n\treturn createFieldSchema(FieldKind.Optional, t, {\n\t\tdefaultProvider: defaultOptionalProvider,\n\t\t...props,\n\t});\n}\n\nfunction required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;\n\nfunction required<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;\n\nfunction required<\n\tconst T extends ImplicitAnnotatedAllowedTypes,\n\tconst TCustomMetadata = unknown,\n>(\n\tt: T,\n\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata> {\n\treturn createFieldSchema(FieldKind.Required, t, props);\n}\n\n/**\n * Implementation of {@link SchemaStatics}.\n * @remarks\n * Entries can use more specific types than {@link SchemaStatics} requires to be more useful for non-public consumers.\n * Additional non-public members are in {@link schemaStatics}.\n */\nexport const schemaStaticsBase = {\n\tstring: stringSchema,\n\tnumber: numberSchema,\n\tboolean: booleanSchema,\n\tnull: nullSchema,\n\thandle: handleSchema,\n\tleaves: [stringSchema, numberSchema, booleanSchema, nullSchema, handleSchema],\n\n\toptional,\n\n\trequired,\n\n\toptionalRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata> => {\n\t\treturn createFieldSchemaUnsafe(FieldKind.Optional, t, {\n\t\t\tdefaultProvider: defaultOptionalProvider,\n\t\t\t...props,\n\t\t});\n\t},\n\n\trequiredRecursive: <\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tconst TCustomMetadata = unknown,\n\t>(\n\t\tt: T,\n\t\tprops?: Omit<FieldPropsAlpha<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata> => {\n\t\treturn createFieldSchemaUnsafe(FieldKind.Required, t, props);\n\t},\n} as const satisfies SchemaStatics;\n\n/**\n * Unstable extensions to {@link schemaStaticsBase}.\n */\nexport const schemaStatics = {\n\t...schemaStaticsBase,\n\tidentifier: <const TCustomMetadata = unknown>(\n\t\tprops?: Omit<FieldProps<TCustomMetadata>, \"defaultProvider\">,\n\t): FieldSchemaAlpha<FieldKind.Identifier, typeof stringSchema, TCustomMetadata> => {\n\t\treturn createFieldSchema(FieldKind.Identifier, stringSchema, props);\n\t},\n} as const;\n\nconst schemaStaticsPublic: SchemaStatics = schemaStatics;\n\n// TODO:\n// SchemaFactory.array references should link to the correct overloads, however the syntax for this does not seems to work currently for methods unless the they are not qualified with the class.\n// API-Extractor requires such links to be qualified with the class, so it can't work.\n// Since linking the overload set as a whole also doesn't work, these have been made non-links for now.\n/**\n * Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.\n *\n * @typeParam TScope - Scope added as a prefix to the name of every schema produced by this factory.\n * @typeParam TName - Type of names used to identify each schema produced in this factory.\n * Typically this is just `string` but it is also possible to use `string` or `number` based enums if you prefer to identify your types that way.\n *\n * @remarks\n * For details related to inputting data constrained by schema (including via assignment), and how non-exact schema types are handled in general refer to {@link Input}.\n * For information about recursive schema support, see methods postfixed with \"recursive\" and {@link ValidateRecursiveSchema}.\n * To apply schema defined with this factory to a tree, see {@link ViewableTree.viewWith} and {@link TreeViewConfiguration}.\n *\n * All schema produced by this factory get a {@link TreeNodeSchemaCore.identifier|unique identifier} by combining the {@link SchemaFactory.scope} with the schema's `Name`.\n * The `Name` part may be explicitly provided as a parameter, or inferred as a structural combination of the provided types.\n * The APIs which use this second approach, structural naming, also deduplicate all equivalent calls.\n * Therefor two calls to `array(allowedTypes)` with the same allowedTypes will return the same {@link TreeNodeSchema} instance.\n * On the other hand, two calls to `array(name, allowedTypes)` will always return different {@link TreeNodeSchema} instances\n * and it is an error to use both in the same tree (since their identifiers are not unique).\n *\n * For \"customizable\" schema (those which can be subclassed to customize them, see details below) some additional rules must be followed:\n *\n * 1. Only a single {@link TreeNodeSchema|schema} can be used from the class hierarchy deriving from the base class produced by this factory.\n * It is legal to subclass the returned class, and even subclass that class,\n * but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.\n * These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.\n *\n * 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.\n *\n * 3. Properties for fields defined in the schema should not be overridden.\n *\n * 4. Additional static members added to schema should pick relatively unique keys to reduce the risk of colliding with implementation details what are not exposed in the API.\n *\n * 5. If exporting the schema from a package which uses API-Extractor, export the base class and derived class separately to work around [a known limitation](https://github.com/microsoft/rushstack/issues/4429).\n *\n * Note:\n * POJO stands for Plain Old JavaScript Object.\n * This means an object that works like a `{}` style object literal.\n * In this case it means the prototype is `Object.prototype` and acts like a set of key value pairs (data, not methods).\n * The usage below generalizes this to include array and map like objects as well.\n *\n * There are two ways to use these APIs:\n *\n * Customizable Approach:\n *\n * 1. Declaration: `class X extends schemaFactory.object(\"x\", {}) {}`\n *\n * 2. Allows adding \"local\" (non-persisted) members: Yes. Members (including methods) can be added to the class.\n *\n * 3. Prototype: The user-defined class.\n *\n * 4. Structurally named Schema: Not Supported.\n *\n * 5. Explicitly named Objects: Supported.\n *\n * 6. Explicitly named Maps and Arrays: Supported: Both declaration approaches can be used.\n *\n * 7. Node.js `assert.deepEqual`: Compares like class instances: equal to other nodes of the same type with the same content, including custom local fields.\n *\n * 8. IntelliSense: Shows and links to user-defined class by name: `X`.\n *\n * 9. Recursion: Supported with special declaration patterns.\n *\n * POJO Emulation Approach:\n *\n * 1. Declaration: `const X = schemaFactory.object(\"x\", {}); type X = NodeFromSchema<typeof X>;`\n *\n * 2. Allows adding \"local\" (non-persisted) members: No. Attempting to set non-field members will result in an error.\n *\n * 3. Prototype: `Object.prototype`, `Map.prototype`, or `Array.prototype` depending on node kind.\n *\n * 4. Structurally named Schema: Supported.\n *\n * 5. Explicitly named Objects: Supported.\n *\n * 6. Explicitly named Maps and Arrays: Not Supported.\n *\n * 7. Node.js `assert.deepEqual`: Compares like plain objects: equal to plain JavaScript objects with the same fields, and other nodes with the same fields, even if the types are different.\n *\n * 8. IntelliSense: Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<\"test.x\">`.\n *\n * 9. Recursion: Unsupported: [Generated `.d.ts` files replace recursive references with `any`](https://github.com/microsoft/TypeScript/issues/55832),\n * breaking the use of recursive schema across compilation boundaries.\n *\n * Note that while \"POJO Emulation\" nodes act a lot like POJO objects, they are not true POJO objects:\n *\n * - Adding new arbitrary fields will error, as well some cases of invalid edits.\n *\n * - They are implemented using proxies.\n *\n * - They have state that is not exposed via enumerable own properties, including a {@link TreeNodeSchema}.\n * This makes libraries like node.js `assert.deepEqual` fail to detect differences in type.\n *\n * - Assigning members has side effects (in this case editing the persisted/shared tree).\n *\n * - Not all operations implied by the prototype will work correctly: stick to the APIs explicitly declared in the TypeScript types.\n *\n * @privateRemarks\n * It's perfectly possible to make `POJO Emulation` mode (or even just hiding the prototype) selectable even when using the custom user class declaration syntax.\n * When doing this, it's still possible to make `instanceof` perform correctly.\n * Allowing (or banning) custom/out-of-schema properties on the class is also possible in both modes: it could be orthogonal.\n * Also for consistency, if keeping the current approach to detecting `POJO Emulation` mode it might make sense to make explicitly named Maps and Arrays do the detection the same as how object does it.\n *\n * Note: the comparison between the customizable and POJO modes is not done in a table because TSDoc does not currently have support for embedded markdown.\n *\n * @see {@link SchemaFactoryAlpha}\n *\n * @sealed @public\n */\nexport class SchemaFactory<\n\tout TScope extends string | undefined = string | undefined,\n\tTName extends number | string = string,\n> implements SchemaStatics\n{\n\t/**\n\t * TODO:\n\t * If users of this generate the same name because two different schema with the same identifier were used,\n\t * the second use can get a cache hit, and reference the wrong schema.\n\t * Such usage should probably return a distinct type or error but currently does not.\n\t * The use of markSchemaMostDerived in structuralName at least ensure an error in the case where the collision is from two types extending the same schema factor class.\n\t */\n\tprivate readonly structuralTypes: Map<string, TreeNodeSchema> = new Map();\n\n\t/**\n\t * Construct a SchemaFactory with a given {@link SchemaFactory.scope|scope}.\n\t * @remarks\n\t * There are no restrictions on mixing schema from different schema factories.\n\t * Typically each library will create one or more SchemaFactories and use them to define its schema.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * Prefix appended to the identifiers of all {@link TreeNodeSchema} produced by this builder.\n\t\t *\n\t\t * @remarks\n\t\t * Generally each independently developed library\n\t\t * (possibly a package, but could also be part of a package or multiple packages developed together)\n\t\t * should get its own unique `scope`.\n\t\t * Then each schema in the library get a name which is unique within the library.\n\t\t * The scope and name are joined (with a period) to form the {@link TreeNodeSchemaCore.identifier|schema identifier}.\n\t\t * Following this pattern allows a single application to depend on multiple libraries which define their own schema, and use them together in a single tree without risk of collisions.\n\t\t * If a library logically contains sub-libraries with their own schema, they can be given a scope nested inside the parent scope, such as \"ParentScope.ChildScope\".\n\t\t *\n\t\t * To avoid collisions between the scopes of libraries\n\t\t * it is recommended that the libraries use {@link https://en.wikipedia.org/wiki/Reverse_domain_name_notation | Reverse domain name notation} or a UUIDv4 for their scope.\n\t\t * If this pattern is followed, application can safely use third party libraries without risk of the schema in them colliding.\n\t\t *\n\t\t * You may opt out of using a scope by passing `undefined`, but note that this increases the risk of collisions.\n\t\t *\n\t\t * @example\n\t\t * Fluid Framework follows this pattern, placing the schema for the built in leaf types in the `com.fluidframework.leaf` scope.\n\t\t * If Fluid Framework publishes more schema in the future, they would be under some other `com.fluidframework` scope.\n\t\t * This ensures that any schema defined by any other library will not conflict with Fluid Framework's schema\n\t\t * as long as the library uses the recommended patterns for how to scope its schema..\n\t\t *\n\t\t * @example\n\t\t * A library could generate a random UUIDv4, like `242c4397-49ed-47e6-8dd0-d5c3bc31778b` and use that as the scope.\n\t\t * Note: do not use this UUID: a new one must be randomly generated when needed to ensure collision resistance.\n\t\t * ```typescript\n\t\t * const factory = new SchemaFactory(\"242c4397-49ed-47e6-8dd0-d5c3bc31778b\");\n\t\t * ```\n\t\t */\n\t\tpublic readonly scope: TScope,\n\t) {}\n\n\tprivate scoped<Name extends TName | string>(name: Name): ScopedSchemaName<TScope, Name> {\n\t\treturn (\n\t\t\tthis.scope === undefined ? `${name}` : `${this.scope}.${name}`\n\t\t) as ScopedSchemaName<TScope, Name>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.string}\n\t */\n\tpublic readonly string = schemaStaticsPublic.string;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.number}\n\t */\n\tpublic readonly number = schemaStaticsPublic.number;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.boolean}\n\t */\n\tpublic readonly boolean = schemaStaticsPublic.boolean;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.null}\n\t */\n\tpublic readonly null = schemaStaticsPublic.null;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.handle}\n\t */\n\tpublic readonly handle = schemaStaticsPublic.handle;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic readonly leaves = schemaStaticsPublic.leaves;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.string}\n\t */\n\tpublic static readonly string = schemaStaticsPublic.string;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.number}\n\t */\n\tpublic static readonly number = schemaStaticsPublic.number;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.boolean}\n\t */\n\tpublic static readonly boolean = schemaStaticsPublic.boolean;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.null}\n\t */\n\tpublic static readonly null = schemaStaticsPublic.null;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.handle}\n\t */\n\tpublic static readonly handle = schemaStaticsPublic.handle;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.leaves}\n\t */\n\tpublic static readonly leaves = schemaStaticsPublic.leaves;\n\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 */\n\tpublic object<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<ImplicitFieldSchema>,\n\t>(\n\t\tname: Name,\n\t\tfields: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Object,\n\t\tTreeObjectNode<T, ScopedSchemaName<TScope, Name>>,\n\t\tobject & InsertableObjectFromSchemaRecord<T>,\n\t\ttrue,\n\t\tT\n\t> {\n\t\t// The compiler can't infer that UnannotateSchemaRecord<T> is equal to T so we have to do a bunch of typing to make the error go away.\n\t\tconst object: TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<UnannotateSchemaRecord<T>, ScopedSchemaName<TScope, Name>>,\n\t\t\tobject & InsertableObjectFromSchemaRecord<UnannotateSchemaRecord<T>>,\n\t\t\ttrue,\n\t\t\tT\n\t\t> = objectSchema(\n\t\t\tthis.scoped(name),\n\t\t\tfields,\n\t\t\ttrue,\n\t\t\tdefaultSchemaFactoryObjectOptions.allowUnknownOptionalFields,\n\t\t);\n\n\t\treturn object as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<RestrictiveStringRecord<ImplicitFieldSchema>>,\n\t\t\tunknown,\n\t\t\ttrue,\n\t\t\tT\n\t\t> as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Object,\n\t\t\tTreeObjectNode<T, ScopedSchemaName<TScope, Name>>,\n\t\t\tobject & InsertableObjectFromSchemaRecord<T>,\n\t\t\ttrue,\n\t\t\tT\n\t\t>;\n\t}\n\n\t/**\n\t * Define a structurally typed {@link TreeNodeSchema} for a {@link TreeMapNode}.\n\t *\n\t * @param allowedTypes - The types that may appear as values in the map.\n\t *\n\t * @remarks\n\t * The unique identifier for this Map is defined as a function of the provided types.\n\t * It is still scoped to this SchemaBuilder, but multiple calls with the same arguments will return the same schema object, providing somewhat structural typing.\n\t * This does not support recursive types.\n\t *\n\t * If using these structurally named maps, other types in this schema builder should avoid names of the form `Map<${string}>`.\n\t *\n\t * @example\n\t * The returned schema should be used as a schema directly:\n\t * ```typescript\n\t * const MyMap = factory.map(factory.number);\n\t * type MyMap = NodeFromSchema<typeof MyMap>;\n\t * ```\n\t * Or inline:\n\t * ```typescript\n\t * factory.object(\"Foo\", {myMap: factory.map(factory.number)});\n\t * ```\n\t * @privateRemarks\n\t * See note on array.\n\t */\n\tpublic map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaNonClass<\n\t\tScopedSchemaName<TScope, `Map<${string}>`>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link TreeMapNode}.\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 *\n\t * @example\n\t * ```typescript\n\t * class NamedMap extends factory.map(\"name\", factory.number) {}\n\t * ```\n\t */\n\tpublic map<Name extends TName, const T extends ImplicitAllowedTypes>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * {@link SchemaFactory.map} implementation.\n\t *\n\t * @privateRemarks\n\t * This should return `TreeNodeSchemaBoth`, however TypeScript gives an error if one of the overloads implicitly up-casts the return type of the implementation.\n\t * This seems like a TypeScript bug getting variance backwards for overload return types since it's erroring when the relation between the overload\n\t * and the implementation is type safe, and forcing an unsafe typing instead.\n\t */\n\tpublic map<const T extends ImplicitAllowedTypes>(\n\t\tnameOrAllowedTypes: TName | ((T & TreeNodeSchema) | readonly TreeNodeSchema[]),\n\t\tallowedTypes?: T,\n\t): TreeNodeSchema<string, NodeKind.Map, TreeMapNode<T>, MapNodeInsertableData<T>, true, T> {\n\t\tif (allowedTypes === undefined) {\n\t\t\tconst types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];\n\t\t\tconst fullName = structuralName(\"Map\", types);\n\t\t\treturn this.getStructuralType(fullName, types, () =>\n\t\t\t\tthis.namedMap(fullName, nameOrAllowedTypes as T, false, true),\n\t\t\t) as TreeNodeSchemaBoth<\n\t\t\t\tstring,\n\t\t\t\tNodeKind.Map,\n\t\t\t\tTreeMapNode<T>,\n\t\t\t\tMapNodeInsertableData<T>,\n\t\t\t\ttrue,\n\t\t\t\tT,\n\t\t\t\tundefined\n\t\t\t>;\n\t\t}\n\t\t// To actually have type safety, assign to the type this method should return before implicitly up-casting when returning.\n\t\tconst out: TreeNodeSchemaBoth<\n\t\t\tstring,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\ttrue,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = this.namedMap(nameOrAllowedTypes as TName, allowedTypes, true, true);\n\t\treturn out;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link (TreeMapNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t */\n\tprivate namedMap<\n\t\tName extends TName | string,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst ImplicitlyConstructable extends boolean,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\tcustomizable: boolean,\n\t\timplicitlyConstructable: ImplicitlyConstructable,\n\t): TreeNodeSchemaBoth<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\tImplicitlyConstructable,\n\t\tT,\n\t\tundefined\n\t> {\n\t\t// The compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T so we have to do a bunch of typing to make the error go away.\n\t\tconst map: TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<UnannotateImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = mapSchema(\n\t\t\tthis.scoped(name),\n\t\t\tallowedTypes,\n\t\t\timplicitlyConstructable,\n\t\t\t// The current policy is customizable nodes don't get fake prototypes.\n\t\t\t!customizable,\n\t\t\tundefined,\n\t\t);\n\n\t\treturn map as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<UnannotateImplicitAllowedTypes<T>> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<ImplicitAllowedTypes>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t> as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * Define a structurally typed {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param allowedTypes - The types that may appear in the array.\n\t *\n\t * @remarks\n\t * The identifier for this Array is defined as a function of the provided types.\n\t * It is still scoped to this SchemaFactory, but multiple calls with the same arguments will return the same schema object, providing somewhat structural typing.\n\t * This does not support recursive types.\n\t *\n\t * If using these structurally named arrays, other types in this schema builder should avoid names of the form `Array<${string}>`.\n\t *\n\t * @example\n\t * The returned schema should be used as a schema directly:\n\t * ```typescript\n\t * const MyArray = factory.array(factory.number);\n\t * type MyArray = NodeFromSchema<typeof MyArray>;\n\t * ```\n\t * Or inline:\n\t * ```typescript\n\t * factory.object(\"Foo\", {myArray: factory.array(factory.number)});\n\t * ```\n\t * @privateRemarks\n\t * The name produced at the type level here is not as specific as it could be, however doing type level sorting and escaping is a real mess.\n\t * There are cases where not having this full type provided will be less than ideal, since TypeScript's structural types will allow assignment between runtime incompatible types at compile time.\n\t * For example attempts to narrow unions of structural arrays by name won't work.\n\t * Planned future changes to move to a class based schema system as well as factor function based node construction should mostly avoid these issues,\n\t * though there may still be some problematic cases even after that work is done.\n\t *\n\t * The return value is a class, but its the type is intentionally not specific enough to indicate it is a class.\n\t * This prevents callers of this from sub-classing it, which is unlikely to work well (due to the ease of accidentally giving two different calls o this different subclasses)\n\t * when working with structural typing.\n\t *\n\t * {@label STRUCTURAL}\n\t */\n\tpublic array<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaNonClass<\n\t\tScopedSchemaName<TScope, `Array<${string}>`>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, `Array<${string}>`>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * Define (and add to this library) 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 *\n\t * @example\n\t * ```typescript\n\t * class NamedArray extends factory.array(\"name\", factory.number) {}\n\t * ```\n\t *\n\t * {@label NAMED}\n\t */\n\tpublic array<const Name extends TName, const T extends ImplicitAllowedTypes>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t): TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT,\n\t\tundefined\n\t>;\n\n\t/**\n\t * {@link SchemaFactory.array} implementation.\n\t *\n\t * @privateRemarks\n\t * This should return TreeNodeSchemaBoth: see note on \"map\" implementation for details.\n\t */\n\tpublic array<const T extends ImplicitAllowedTypes>(\n\t\tnameOrAllowedTypes: TName | ((T & TreeNodeSchema) | readonly TreeNodeSchema[]),\n\t\tallowedTypes?: T,\n\t): TreeNodeSchema<\n\t\tScopedSchemaName<TScope, string>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\ttrue,\n\t\tT\n\t> {\n\t\tif (allowedTypes === undefined) {\n\t\t\tconst types = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];\n\t\t\tconst fullName = structuralName(\"Array\", types);\n\t\t\treturn this.getStructuralType(fullName, types, () =>\n\t\t\t\tthis.namedArray(fullName, nameOrAllowedTypes as T, false, true),\n\t\t\t) as TreeNodeSchemaClass<\n\t\t\t\tScopedSchemaName<TScope, string>,\n\t\t\t\tNodeKind.Array,\n\t\t\t\tTreeArrayNode<T>,\n\t\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\t\ttrue,\n\t\t\t\tT,\n\t\t\t\tundefined\n\t\t\t>;\n\t\t}\n\t\tconst out: TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, string>,\n\t\t\tNodeKind.Array,\n\t\t\tTreeArrayNode<T>,\n\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\ttrue,\n\t\t\tT,\n\t\t\tundefined\n\t\t> = this.namedArray(nameOrAllowedTypes as TName, allowedTypes, true, true);\n\t\treturn out;\n\t}\n\n\t/**\n\t * Retrieves or creates a structural {@link TreeNodeSchema} with the specified name and types.\n\t *\n\t * @param fullName - The name for the structural schema.\n\t * @param types - The input schema(s) used to define the structural schema.\n\t * @param builder - A function that builds the schema if it does not already exist.\n\t * @returns The structural {@link TreeNodeSchema} associated with the given name and types.\n\t * @throws `UsageError` if a schema structurally named schema with the same name is cached in `structuralTypes` but had different input types.\n\t */\n\tprotected getStructuralType(\n\t\tfullName: string,\n\t\ttypes: TreeNodeSchema | readonly TreeNodeSchema[],\n\t\tbuilder: () => TreeNodeSchema,\n\t): TreeNodeSchema {\n\t\tconst structural = getOrCreate(this.structuralTypes, fullName, builder);\n\t\tconst inputTypes = new Set(normalizeAllowedTypes(types));\n\t\tconst outputTypes = new Set(\n\t\t\tnormalizeAllowedTypes(structural.info as TreeNodeSchema | readonly TreeNodeSchema[]),\n\t\t);\n\t\t// If our cached value had a different set of types then were requested, the user must have caused a collision.\n\t\tconst same = compareSets({ a: inputTypes, b: outputTypes });\n\t\tif (!same) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Structurally named schema collision: two schema named \"${fullName}\" were defined with different input schema.`,\n\t\t\t);\n\t\t}\n\t\treturn structural;\n\t}\n\n\t/**\n\t * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n\t *\n\t * @param name - Unique identifier for this schema within this factory's scope.\n\t *\n\t * @remarks\n\t * This is not intended to be used directly, use the overload of `array` which takes a name instead.\n\t * This is only public to work around a compiler limitation.\n\t */\n\tprivate namedArray<\n\t\tName extends TName | string,\n\t\tconst T extends ImplicitAllowedTypes,\n\t\tconst ImplicitlyConstructable extends boolean,\n\t>(\n\t\tname: Name,\n\t\tallowedTypes: T,\n\t\tcustomizable: boolean,\n\t\timplicitlyConstructable: ImplicitlyConstructable,\n\t): TreeNodeSchemaBoth<\n\t\tScopedSchemaName<TScope, Name>,\n\t\tNodeKind.Array,\n\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, string>, NodeKind.Array>,\n\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\tImplicitlyConstructable,\n\t\tT,\n\t\tundefined\n\t> {\n\t\tconst array = arraySchema(\n\t\t\tthis.scoped(name),\n\t\t\tallowedTypes,\n\t\t\timplicitlyConstructable,\n\t\t\tcustomizable,\n\t\t);\n\n\t\treturn array as TreeNodeSchemaBoth<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Array,\n\t\t\tTreeArrayNode<T> & WithType<ScopedSchemaName<TScope, string>, NodeKind.Array>,\n\t\t\tIterable<InsertableTreeNodeFromImplicitAllowedTypes<T>>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic readonly optional = schemaStaticsPublic.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic readonly required = schemaStaticsPublic.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optional}\n\t */\n\tpublic static readonly optional = schemaStaticsPublic.optional;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.required}\n\t */\n\tpublic static readonly required = schemaStaticsPublic.required;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.optionalRecursive}\n\t */\n\tpublic static readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;\n\n\t/**\n\t * {@inheritDoc SchemaStatics.requiredRecursive}\n\t */\n\tpublic static readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;\n\n\t/**\n\t * A special readonly field which holds an identifier string for an object node.\n\t * @remarks\n\t * The value of this field, a \"node identifier\", is a string which identifies a node (or nodes) among all nodes in the tree.\n\t * Node identifiers are strings, and can therefore be used as lookup keys in maps or written to a database.\n\t * When the node is constructed, the identifier field does not need to be specified.\n\t * When an identifier is not provided, the SharedTree will generate an identifier for the node automatically.\n\t * The identifier generated by the SharedTree has the following properties:\n\t *\n\t * - It is a UUID which will not collide with other generated UUIDs.\n\t *\n\t * - It is compressed to a space-efficient representation when stored in the document.\n\t * Reading the identifier before inserting the node into a tree prevents the identifier from being stored in its compressed form,\n\t * resulting in a larger storage footprint.\n\t *\n\t * - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.\n\t *\n\t * However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).\n\t * In that case, if the user requires it to be unique, it is up to them to ensure uniqueness.\n\t * User-supplied identifiers may be read immediately, even before insertion into the tree.\n\t *\n\t * A node may have more than one identifier field (though note that this precludes the use of the {@link TreeNodeApi.shortId|Tree.shortId()} API).\n\t */\n\tpublic get identifier(): FieldSchema<FieldKind.Identifier, typeof this.string> {\n\t\tconst defaultIdentifierProvider: DefaultProvider = getDefaultProvider(\n\t\t\t(\n\t\t\t\tcontext: FlexTreeHydratedContextMinimal | \"UseGlobalContext\",\n\t\t\t): UnhydratedFlexTreeNode[] => {\n\t\t\t\tconst id =\n\t\t\t\t\tcontext === \"UseGlobalContext\"\n\t\t\t\t\t\t? globalIdentifierAllocator.decompress(\n\t\t\t\t\t\t\t\tglobalIdentifierAllocator.generateCompressedId(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: context.nodeKeyManager.stabilizeNodeIdentifier(\n\t\t\t\t\t\t\t\tcontext.nodeKeyManager.generateLocalNodeIdentifier(),\n\t\t\t\t\t\t\t);\n\n\t\t\t\treturn [unhydratedFlexTreeFromInsertable(id, this.string)];\n\t\t\t},\n\t\t);\n\t\treturn createFieldSchema(FieldKind.Identifier, this.string, {\n\t\t\tdefaultProvider: defaultIdentifierProvider,\n\t\t});\n\t}\n\n\t/**\n\t * {@link SchemaFactory.object} 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 SchemaFactory.object} 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\t * Additionally `ImplicitlyConstructable` is disabled (forcing use of constructor) to avoid\n\t * `error TS2589: Type instantiation is excessively deep and possibly infinite.`\n\t * which otherwise gets reported at sometimes incorrect source locations that vary based on incremental builds.\n\t */\n\tpublic objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n\t>(\n\t\tname: Name,\n\t\tt: T,\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> {\n\t\ttype TScopedName = ScopedSchemaName<TScope, Name>;\n\t\treturn this.object(\n\t\t\tname,\n\t\t\tt as T & RestrictiveStringRecord<ImplicitFieldSchema>,\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>;\n\t}\n\n\t/**\n\t * `SchemaFactory.array` 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.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.\n\t * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.\n\t * See also {@link FixRecursiveArraySchema} for additional information specific to recursive arrays schema exports.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic arrayRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t>(name: Name, allowedTypes: T) {\n\t\tconst RecursiveArray = this.namedArray(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\ttrue,\n\t\t\tfalse,\n\t\t);\n\n\t\treturn RecursiveArray as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Array,\n\t\t\tSystem_Unsafe.TreeArrayNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Array>,\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Iterator for the iterable of content for this node.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Wrapping the constructor parameter for recursive arrays and maps in an inlined object type avoids (for unknown reasons)\n\t\t\t\t * the following compile error when declaring the recursive schema:\n\t\t\t\t * `Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.`\n\t\t\t\t * To benefit from this without impacting the API, the definition of `Iterable` has been inlined as such an object.\n\t\t\t\t *\n\t\t\t\t * If this workaround is kept, ideally this comment would be deduplicated with the other instance of it.\n\t\t\t\t * Unfortunately attempts to do this failed to avoid the compile error this was introduced to solve.\n\t\t\t\t */\n\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\tSystem_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>\n\t\t\t\t>;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n\n\t/**\n\t * `SchemaFactory.map` 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.map` 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 mapRecursive<\n\t\tName extends TName,\n\t\tconst T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\t>(name: Name, allowedTypes: T) {\n\t\tconst MapSchema = this.namedMap(\n\t\t\tname,\n\t\t\tallowedTypes as T & ImplicitAllowedTypes,\n\t\t\ttrue,\n\t\t\t// Setting this (implicitlyConstructable) 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\tfalse,\n\t\t);\n\n\t\treturn MapSchema as TreeNodeSchemaClass<\n\t\t\tScopedSchemaName<TScope, Name>,\n\t\t\tNodeKind.Map,\n\t\t\tSystem_Unsafe.TreeMapNodeUnsafe<T> &\n\t\t\t\tWithType<ScopedSchemaName<TScope, Name>, NodeKind.Map>,\n\t\t\t| {\n\t\t\t\t\t/**\n\t\t\t\t\t * Iterator for the iterable of content for this node.\n\t\t\t\t\t * @privateRemarks\n\t\t\t\t\t * Wrapping the constructor parameter for recursive arrays and maps in an inlined object type avoids (for unknown reasons)\n\t\t\t\t\t * the following compile error when declaring the recursive schema:\n\t\t\t\t\t * `Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.`\n\t\t\t\t\t * To benefit from this without impacting the API, the definition of `Iterable` has been inlined as such an object.\n\t\t\t\t\t *\n\t\t\t\t\t * If this workaround is kept, ideally this comment would be deduplicated with the other instance of it.\n\t\t\t\t\t * Unfortunately attempts to do this failed to avoid the compile error this was introduced to solve.\n\t\t\t\t\t */\n\t\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\t\t[string, System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>]\n\t\t\t\t\t>;\n\t\t\t }\n\t\t\t// Ideally this would be\n\t\t\t// RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t// but doing so breaks recursive types.\n\t\t\t// Instead we do a less nice version:\n\t\t\t| {\n\t\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t },\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined\n\t\t>;\n\t}\n}\n\nexport function structuralName<const T extends string>(\n\tcollectionName: T,\n\tallowedTypes: TreeNodeSchema | readonly TreeNodeSchema[],\n): `${T}<${string}>` {\n\tlet inner: string;\n\tif (!isReadonlyArray(allowedTypes)) {\n\t\treturn structuralName(collectionName, [allowedTypes]);\n\t} else {\n\t\tconst names = allowedTypes.map((t): string => {\n\t\t\t// Ensure that lazy types (functions) don't slip through here.\n\t\t\tassert(!isLazy(t), 0x83d /* invalid type provided */);\n\t\t\tmarkSchemaMostDerived(t);\n\t\t\treturn t.identifier;\n\t\t});\n\t\t// Ensure name is order independent\n\t\tnames.sort();\n\t\t// Ensure name can't have collisions by quoting and escaping any quotes in the names of types.\n\t\t// Using JSON is a simple way to accomplish this.\n\t\t// The outer `[]` around the result were needed so that a single type name \"Any\" would not collide with the \"any\" case which used to exist.\n\t\tinner = JSON.stringify(names);\n\t}\n\treturn `${collectionName}<${inner}>`;\n}\n\n/**\n * Used to allocate default identifiers for unhydrated nodes when no context is available.\n * @remarks\n * The identifiers allocated by this will never be compressed to Short Ids.\n * Using this is only better than creating fully random V4 UUIDs because it reduces the entropy making it possible for things like text compression to work slightly better.\n */\nconst globalIdentifierAllocator: IIdCompressor = createIdCompressor();\n\n/**\n * Additional information to provide to Node Schema creation.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.\n * See {@link NodeSchemaMetadata.custom}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaOptions<out TCustomMetadata = unknown> {\n\t/**\n\t * Optional metadata to associate with the Node Schema.\n\t *\n\t * @remarks\n\t * Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.\n\t * Different clients in the same collaborative session may see different metadata for the same field.\n\t */\n\treadonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;\n}\n\n/**\n * Additional information to provide to Node Schema creation. Includes fields for alpha features.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.\n * See {@link NodeSchemaMetadata.custom}.\n *\n * @alpha\n */\nexport interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown>\n\textends NodeSchemaOptions<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"storedSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/storedSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,gBAAgB,EACxB,sBAAsB,EAAE,kBAAkB,GACxC,cAAc,CAIhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,aAAa,GACpB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAUlD"}
1
+ {"version":3,"file":"storedSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/storedSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQ9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,gBAAgB,EACxB,sBAAsB,EAAE,kBAAkB,GACxC,cAAc,CAIhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,aAAa,GACpB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAUlD"}
@@ -10,6 +10,7 @@ const index_js_2 = require("../../feature-libraries/index.js");
10
10
  const index_js_3 = require("../../feature-libraries/schema-index/index.js");
11
11
  const fieldSchema_js_1 = require("../fieldSchema.js");
12
12
  const toStoredSchema_js_1 = require("../toStoredSchema.js");
13
+ const configuration_js_1 = require("./configuration.js");
13
14
  const schemaCompatibilityTester_js_1 = require("./schemaCompatibilityTester.js");
14
15
  /**
15
16
  * Dumps the "persisted" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable format.
@@ -82,7 +83,10 @@ function comparePersistedSchema(persisted, view, options) {
82
83
  // We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.
83
84
  const schemaCodec = (0, index_js_2.makeSchemaCodec)(options, index_js_1.SchemaVersion.v1);
84
85
  const stored = schemaCodec.decode(persisted);
85
- const viewSchema = new schemaCompatibilityTester_js_1.SchemaCompatibilityTester(index_js_2.defaultSchemaPolicy, (0, fieldSchema_js_1.normalizeFieldSchema)(view));
86
+ const config = new configuration_js_1.TreeViewConfigurationAlpha({
87
+ schema: (0, fieldSchema_js_1.normalizeFieldSchema)(view),
88
+ });
89
+ const viewSchema = new schemaCompatibilityTester_js_1.SchemaCompatibilityTester(config);
86
90
  return viewSchema.checkCompatibility(stored);
87
91
  }
88
92
  exports.comparePersistedSchema = comparePersistedSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"storedSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/storedSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kDAAoD;AACpD,+DAI0C;AAC1C,4EAIuD;AAEvD,sDAAmF;AAEnF,4DAA4D;AAE5D,iFAA2E;AAG3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,sBAAsB,CACrC,MAAwB,EACxB,sBAA0C;IAE1C,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,kBAAkB,GAAG,IAAA,uCAA4B,EAAC,sBAAsB,CAAC,CAAC;IAChF,OAAO,IAAA,2BAAgB,EAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACrD,CAAC;AAPD,wDAOC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,sBAAsB,CACrC,SAAyB,EACzB,IAAyB,EACzB,OAAsB;IAEtB,0DAA0D;IAC1D,2JAA2J;IAC3J,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,wBAAa,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAqB,CAAC,CAAC;IACzD,MAAM,UAAU,GAAG,IAAI,wDAAyB,CAC/C,8BAAmB,EACnB,IAAA,qCAAoB,EAAC,IAAI,CAAC,CAC1B,CAAC;IACF,OAAO,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AAdD,wDAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidClientVersion, ICodecOptions } from \"../../codec/index.js\";\nimport { SchemaVersion } from \"../../core/index.js\";\nimport {\n\tdefaultSchemaPolicy,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n} from \"../../feature-libraries/index.js\";\nimport {\n\tclientVersionToSchemaVersion,\n\ttype FormatV1,\n\t// eslint-disable-next-line import/no-internal-modules\n} from \"../../feature-libraries/schema-index/index.js\";\nimport type { JsonCompatible } from \"../../util/index.js\";\nimport { normalizeFieldSchema, type ImplicitFieldSchema } from \"../fieldSchema.js\";\nimport type { SimpleTreeSchema } from \"../simpleSchema.js\";\nimport { simpleToStoredSchema } from \"../toStoredSchema.js\";\n\nimport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\n\n/**\n * Dumps the \"persisted\" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable format.\n *\n * @param schema - The schema to dump.\n *\n * @remarks\n * This can be used to help inspect schema for debugging, and to save a snapshot of schema to help detect and review changes to an applications schema.\n * This format is also compatible with {@link ViewContent.schema}, {@link comparePersistedSchema} and {@link persistedToSimpleSchema}.\n *\n * This only includes the \"persisted\" subset of schema information, which means the portion which gets included in documents.\n * It thus uses \"persisted\" keys, see {@link FieldProps.key}.\n *\n * If two schema have identical \"persisted\" schema, then they are considered {@link SchemaCompatibilityStatus.isEquivalent|equivalent}.\n *\n * See also {@link comparePersistedSchema}.\n *\n * @example\n * An application could use this API to generate a `schema.json` file when it first releases,\n * then test that the schema is sill compatible with documents from that version with a test like :\n * ```typescript\n * assert.deepEqual(extractPersistedSchema(MySchema, FluidClientVersion.v2_0), require(\"./schema.json\"));\n * ```\n *\n * @privateRemarks\n * This currently uses the schema summary format, but that could be changed to something more human readable (particularly if the encoded format becomes less human readable).\n * This intentionally does not leak the format types in the API.\n *\n * Public API surface uses \"persisted\" terminology while internally we use \"stored\".\n * @alpha\n */\nexport function extractPersistedSchema(\n\tschema: SimpleTreeSchema,\n\toldestCompatibleClient: FluidClientVersion,\n): JsonCompatible {\n\tconst stored = simpleToStoredSchema(schema);\n\tconst schemaWriteVersion = clientVersionToSchemaVersion(oldestCompatibleClient);\n\treturn encodeTreeSchema(stored, schemaWriteVersion);\n}\n\n/**\n * Compares two schema extracted using {@link extractPersistedSchema}.\n * Reports the same compatibility that {@link TreeView.compatibility} would report if\n * opening a document that used the `persisted` schema and provided `view` to {@link ViewableTree.viewWith}.\n *\n * @param persisted - Schema persisted for a document. Typically persisted alongside the data and assumed to describe that data.\n * @param view - Schema which would be used to view persisted content.\n * @param options - {@link ICodecOptions} used when parsing the provided schema.\n * @param canInitialize - Passed through to the return value unchanged and otherwise unused.\n * @returns The {@link SchemaCompatibilityStatus} a {@link TreeView} would report for this combination of schema.\n *\n * @remarks\n * This uses the persisted formats for schema, meaning it only includes data which impacts compatibility.\n * It also uses the persisted format so that this API can be used in tests to compare against saved schema from previous versions of the application.\n *\n * @example\n * An application could use {@link extractPersistedSchema} to generate a `schema.json` file for various versions of the app,\n * then test that documents using those schema can be upgraded to work with the current schema using a test like:\n * ```typescript\n * assert(\n * \tcomparePersistedSchema(\n * \t\trequire(\"./schema.json\"),\n * \t\tMySchema,\n * \t\t{ jsonValidator: typeboxValidator },\n * \t\tfalse,\n * \t).canUpgrade,\n * );\n * ```\n * @alpha\n */\nexport function comparePersistedSchema(\n\tpersisted: JsonCompatible,\n\tview: ImplicitFieldSchema,\n\toptions: ICodecOptions,\n): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t// Any version can be passed down to makeSchemaCodec here.\n\t// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\tconst stored = schemaCodec.decode(persisted as FormatV1);\n\tconst viewSchema = new SchemaCompatibilityTester(\n\t\tdefaultSchemaPolicy,\n\t\tnormalizeFieldSchema(view),\n\t);\n\treturn viewSchema.checkCompatibility(stored);\n}\n"]}
1
+ {"version":3,"file":"storedSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/storedSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kDAAoD;AACpD,+DAAqF;AACrF,4EAIuD;AAEvD,sDAAmF;AAEnF,4DAA4D;AAC5D,yDAAgE;AAEhE,iFAA2E;AAG3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,sBAAsB,CACrC,MAAwB,EACxB,sBAA0C;IAE1C,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,kBAAkB,GAAG,IAAA,uCAA4B,EAAC,sBAAsB,CAAC,CAAC;IAChF,OAAO,IAAA,2BAAgB,EAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACrD,CAAC;AAPD,wDAOC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,sBAAsB,CACrC,SAAyB,EACzB,IAAyB,EACzB,OAAsB;IAEtB,0DAA0D;IAC1D,2JAA2J;IAC3J,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,wBAAa,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAqB,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,6CAA0B,CAAC;QAC7C,MAAM,EAAE,IAAA,qCAAoB,EAAC,IAAI,CAAC;KAClC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,IAAI,wDAAyB,CAAC,MAAM,CAAC,CAAC;IACzD,OAAO,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AAdD,wDAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidClientVersion, ICodecOptions } from \"../../codec/index.js\";\nimport { SchemaVersion } from \"../../core/index.js\";\nimport { encodeTreeSchema, makeSchemaCodec } from \"../../feature-libraries/index.js\";\nimport {\n\tclientVersionToSchemaVersion,\n\ttype FormatV1,\n\t// eslint-disable-next-line import/no-internal-modules\n} from \"../../feature-libraries/schema-index/index.js\";\nimport type { JsonCompatible } from \"../../util/index.js\";\nimport { normalizeFieldSchema, type ImplicitFieldSchema } from \"../fieldSchema.js\";\nimport type { SimpleTreeSchema } from \"../simpleSchema.js\";\nimport { simpleToStoredSchema } from \"../toStoredSchema.js\";\nimport { TreeViewConfigurationAlpha } from \"./configuration.js\";\n\nimport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\n\n/**\n * Dumps the \"persisted\" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable format.\n *\n * @param schema - The schema to dump.\n *\n * @remarks\n * This can be used to help inspect schema for debugging, and to save a snapshot of schema to help detect and review changes to an applications schema.\n * This format is also compatible with {@link ViewContent.schema}, {@link comparePersistedSchema} and {@link persistedToSimpleSchema}.\n *\n * This only includes the \"persisted\" subset of schema information, which means the portion which gets included in documents.\n * It thus uses \"persisted\" keys, see {@link FieldProps.key}.\n *\n * If two schema have identical \"persisted\" schema, then they are considered {@link SchemaCompatibilityStatus.isEquivalent|equivalent}.\n *\n * See also {@link comparePersistedSchema}.\n *\n * @example\n * An application could use this API to generate a `schema.json` file when it first releases,\n * then test that the schema is sill compatible with documents from that version with a test like :\n * ```typescript\n * assert.deepEqual(extractPersistedSchema(MySchema, FluidClientVersion.v2_0), require(\"./schema.json\"));\n * ```\n *\n * @privateRemarks\n * This currently uses the schema summary format, but that could be changed to something more human readable (particularly if the encoded format becomes less human readable).\n * This intentionally does not leak the format types in the API.\n *\n * Public API surface uses \"persisted\" terminology while internally we use \"stored\".\n * @alpha\n */\nexport function extractPersistedSchema(\n\tschema: SimpleTreeSchema,\n\toldestCompatibleClient: FluidClientVersion,\n): JsonCompatible {\n\tconst stored = simpleToStoredSchema(schema);\n\tconst schemaWriteVersion = clientVersionToSchemaVersion(oldestCompatibleClient);\n\treturn encodeTreeSchema(stored, schemaWriteVersion);\n}\n\n/**\n * Compares two schema extracted using {@link extractPersistedSchema}.\n * Reports the same compatibility that {@link TreeView.compatibility} would report if\n * opening a document that used the `persisted` schema and provided `view` to {@link ViewableTree.viewWith}.\n *\n * @param persisted - Schema persisted for a document. Typically persisted alongside the data and assumed to describe that data.\n * @param view - Schema which would be used to view persisted content.\n * @param options - {@link ICodecOptions} used when parsing the provided schema.\n * @param canInitialize - Passed through to the return value unchanged and otherwise unused.\n * @returns The {@link SchemaCompatibilityStatus} a {@link TreeView} would report for this combination of schema.\n *\n * @remarks\n * This uses the persisted formats for schema, meaning it only includes data which impacts compatibility.\n * It also uses the persisted format so that this API can be used in tests to compare against saved schema from previous versions of the application.\n *\n * @example\n * An application could use {@link extractPersistedSchema} to generate a `schema.json` file for various versions of the app,\n * then test that documents using those schema can be upgraded to work with the current schema using a test like:\n * ```typescript\n * assert(\n * \tcomparePersistedSchema(\n * \t\trequire(\"./schema.json\"),\n * \t\tMySchema,\n * \t\t{ jsonValidator: typeboxValidator },\n * \t\tfalse,\n * \t).canUpgrade,\n * );\n * ```\n * @alpha\n */\nexport function comparePersistedSchema(\n\tpersisted: JsonCompatible,\n\tview: ImplicitFieldSchema,\n\toptions: ICodecOptions,\n): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t// Any version can be passed down to makeSchemaCodec here.\n\t// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\tconst stored = schemaCodec.decode(persisted as FormatV1);\n\tconst config = new TreeViewConfigurationAlpha({\n\t\tschema: normalizeFieldSchema(view),\n\t});\n\tconst viewSchema = new SchemaCompatibilityTester(config);\n\treturn viewSchema.checkCompatibility(stored);\n}\n"]}
@@ -94,8 +94,8 @@ export interface TreeBeta {
94
94
  *
95
95
  * - The identifiers in the node's subtree will be preserved, i.e., they are not replaced with new values.
96
96
  *
97
- * @privateRemarks
98
- * TODO: AB#43548: How this handles unknown optional fields needs to be figured out, tested and documented.
97
+ * - If the node (or any node in its subtree) contains {@link SchemaFactoryObjectOptions.allowUnknownOptionalFields|unknown optional fields},
98
+ * those fields will be cloned just like the known fields.
99
99
  */
100
100
  clone<const TSchema extends ImplicitFieldSchema>(node: TreeFieldFromImplicitField<TSchema>): TreeFieldFromImplicitField<TSchema>;
101
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"treeBeta.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/treeBeta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,QAAQ,EACb,KAAK,QAAQ,EAEb,KAAK,QAAQ,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK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IAAI,EAAE,KAAK,EACX,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/C,MAAM,IAAI,CAAC;IAEd;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,KAAK,CAAC,OAAO,SAAS,mBAAmB,EAC9C,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACvC,0BAA0B,CAAC,OAAO,CAAC,CAAC;CAoBvC;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,QA+BtB,CAAC"}
@@ -5,7 +5,9 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.TreeBeta = void 0;
8
- const index_js_1 = require("../core/index.js");
8
+ const index_js_1 = require("../../feature-libraries/index.js");
9
+ const index_js_2 = require("../core/index.js");
10
+ const createContext_js_1 = require("../createContext.js");
9
11
  const create_js_1 = require("./create.js");
10
12
  const treeNodeApi_js_1 = require("./treeNodeApi.js");
11
13
  /**
@@ -19,12 +21,16 @@ exports.TreeBeta = {
19
21
  },
20
22
  clone(node) {
21
23
  // The only non-TreeNode cases are {@link TreeLeafValue} and `undefined` (for an empty optional field) which can be returned as is.
22
- if (!(0, index_js_1.isTreeNode)(node)) {
24
+ if (!(0, index_js_2.isTreeNode)(node)) {
23
25
  return node;
24
26
  }
25
- const kernel = (0, index_js_1.getKernel)(node);
27
+ const kernel = (0, index_js_2.getKernel)(node);
26
28
  const cursor = kernel.getOrCreateInnerNode().borrowCursor();
27
- return (0, create_js_1.createFromCursor)(kernel.schema, cursor);
29
+ // To handle when the node transitively contains unknown optional fields,
30
+ // derive the context from the source node's stored schema which has stored schema for any such fields and their contents.
31
+ const flexContext = new index_js_2.UnhydratedContext(index_js_1.defaultSchemaPolicy, kernel.context.flexContext.schema);
32
+ const context = new index_js_2.Context(flexContext, (0, createContext_js_1.getUnhydratedContext)(kernel.schema).schema);
33
+ return (0, create_js_1.createFromCursor)(kernel.schema, cursor, context);
28
34
  },
29
35
  };
30
36
  //# sourceMappingURL=treeBeta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeBeta.js","sourceRoot":"","sources":["../../../src/simple-tree/api/treeBeta.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAO0B;AAG1B,2CAA+C;AAE/C,qDAA+C;AA4I/C;;;;GAIG;AACU,QAAA,QAAQ,GAAa;IACjC,EAAE,CACD,IAAW,EACX,SAAY,EACZ,QAAiD;QAEjD,OAAO,4BAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IACD,KAAK,CACJ,IAAyC;QAEzC,mIAAmI;QACnI,IAAI,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC,YAAY,EAAE,CAAC;QAC5D,OAAO,IAAA,4BAAgB,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAE5C,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tgetKernel,\n\tisTreeNode,\n\ttype NodeKind,\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype WithType,\n} from \"../core/index.js\";\nimport type { ImplicitFieldSchema, TreeFieldFromImplicitField } from \"../fieldSchema.js\";\n\nimport { createFromCursor } from \"./create.js\";\nimport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nimport { treeNodeApi } from \"./treeNodeApi.js\";\n\n// Tests for this file are grouped with those for treeNodeApi.ts as that is where this functionality will eventually land,\n// and where most of the actual implementation is for much of it.\n\n/**\n * Data included for {@link TreeChangeEventsBeta.nodeChanged}.\n * @sealed @beta\n */\nexport interface NodeChangedData<TNode extends TreeNode = TreeNode> {\n\t/**\n\t * When the node changed is an object or Map node, this lists all the properties which changed.\n\t * @remarks\n\t * This only includes changes to the node itself (which would trigger {@link TreeChangeEvents.nodeChanged}).\n\t *\n\t * Set to `undefined` when the {@link NodeKind} does not support this feature (currently just ArrayNodes).\n\t *\n\t * When defined, the set should never be empty, since `nodeChanged` will only be triggered when there is a change, and for the supported node types, the only things that can change are properties.\n\t */\n\treadonly changedProperties?: ReadonlySet<\n\t\t// For Object nodes, make changedProperties required and strongly typed with the property names from the schema:\n\t\tTNode extends WithType<string, NodeKind.Object, infer TInfo>\n\t\t\t? string & keyof TInfo\n\t\t\t: string\n\t>;\n}\n\n/**\n * Extensions to {@link TreeChangeEvents} which are not yet stable.\n *\n * @sealed @beta\n */\nexport interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode>\n\textends TreeChangeEvents {\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, if any of the changes affected the node.\n\t *\n\t * - Object nodes define a change as being when the value of one of its properties changes (i.e., the property's value is set, including when set to `undefined`).\n\t *\n\t * - Array nodes define a change as when an element is added, removed, moved or replaced.\n\t *\n\t * - Map nodes define a change as when an entry is added, updated, or removed.\n\t *\n\t * @remarks\n\t * This event is not emitted when:\n\t *\n\t * - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing\n\t * elements/entries) will emit this event on the array/map node itself, but not on the node that contains the\n\t * array/map node as one of its properties.\n\t *\n\t * - The node is moved to a different location in the tree or removed from the tree.\n\t * In this case the event is emitted on the _parent_ node, not the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When the event is emitted, the tree is guaranteed to be in-schema.\n\t *\n\t * @privateRemarks\n\t * This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.\n\t * For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the\n\t * node, or when the node has to be updated due to resolution of a merge conflict\n\t * (for example a previously applied local change might be undone, then reapplied differently or not at all).\n\t *\n\t * TODO: define and document event ordering (ex: bottom up, with nodeChanged before treeChange on each level).\n\t *\n\t * This defines a property which is a function instead of using the method syntax to avoid function bi-variance issues with the input data to the callback.\n\t */\n\tnodeChanged: (\n\t\tdata: NodeChangedData<TNode> &\n\t\t\t// Make the properties of object, map, and record nodes required:\n\t\t\t(TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record>\n\t\t\t\t? Required<Pick<NodeChangedData<TNode>, \"changedProperties\">>\n\t\t\t\t: unknown),\n\t) => void;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeBeta:variable)} singleton.\n * @system @sealed @beta\n */\nexport interface TreeBeta {\n\t/**\n\t * Register an event listener on the given node.\n\t * @param node - The node whose events should be subscribed to.\n\t * @param eventName - Which event to subscribe to.\n\t * @param listener - The callback to trigger for the event. The tree can be read during the callback, but it is invalid to modify the tree during this callback.\n\t * @returns A callback function which will deregister the event.\n\t * This callback should be called only once.\n\t */\n\ton<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\teventName: K,\n\t\tlistener: NoInfer<TreeChangeEventsBeta<TNode>[K]>,\n\t): () => void;\n\n\t/**\n\t * Clones the persisted data associated with a node.\n\t *\n\t * @param node - The node to clone.\n\t * @returns A new unhydrated node with the same persisted data as the original node.\n\t * @remarks\n\t * Some key things to note:\n\t *\n\t * - Local state, such as properties added to customized schema classes, will not be cloned. However, they will be\n\t * initialized to their default state just as if the node had been created via its constructor.\n\t *\n\t * - Value node types (i.e., numbers, strings, booleans, nulls and Fluid handles) will be returned as is.\n\t *\n\t * - The identifiers in the node's subtree will be preserved, i.e., they are not replaced with new values.\n\t *\n\t * @privateRemarks\n\t * TODO: AB#43548: How this handles unknown optional fields needs to be figured out, tested and documented.\n\t */\n\tclone<const TSchema extends ImplicitFieldSchema>(\n\t\tnode: TreeFieldFromImplicitField<TSchema>,\n\t): TreeFieldFromImplicitField<TSchema>;\n\n\t// TODO: support more clone options\n\t// /**\n\t// * Like {@link TreeBeta.create}, except deeply clones existing nodes.\n\t// * @remarks\n\t// * This only clones the persisted data associated with a node.\n\t// * Local state, such as properties added to customized schema classes, will not be cloned:\n\t// * they will be initialized however they end up after running the constructor, just like if a remote client had inserted the same nodes.\n\t// */\n\t// clone<const TSchema extends ImplicitFieldSchema>(\n\t// \toriginal: TreeFieldFromImplicitField<TSchema>,\n\t// \toptions?: {\n\t// \t\t/**\n\t// \t\t * If set, all identifier's in the cloned tree (See {@link SchemaFactory.identifier}) will be replaced with new ones allocated using the default identifier allocation schema.\n\t// \t\t * Otherwise any identifiers will be preserved as is.\n\t// \t\t */\n\t// \t\treplaceIdentifiers?: true;\n\t// \t},\n\t// ): TreeFieldFromImplicitField<TSchema>;\n}\n\n/**\n * Extensions to {@link (Tree:variable)} which are not yet stable.\n * @see {@link (TreeBeta:interface)}.\n * @beta\n */\nexport const TreeBeta: TreeBeta = {\n\ton<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\teventName: K,\n\t\tlistener: NoInfer<TreeChangeEventsBeta<TNode>[K]>,\n\t): () => void {\n\t\treturn treeNodeApi.on(node, eventName, listener);\n\t},\n\tclone<const TSchema extends ImplicitFieldSchema>(\n\t\tnode: TreeFieldFromImplicitField<TSchema>,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\t// The only non-TreeNode cases are {@link TreeLeafValue} and `undefined` (for an empty optional field) which can be returned as is.\n\t\tif (!isTreeNode(node)) {\n\t\t\treturn node;\n\t\t}\n\n\t\tconst kernel = getKernel(node);\n\t\tconst cursor = kernel.getOrCreateInnerNode().borrowCursor();\n\t\treturn createFromCursor(kernel.schema, cursor) as Unhydrated<\n\t\t\tTreeFieldFromImplicitField<TSchema>\n\t\t>;\n\t},\n};\n"]}
1
+ {"version":3,"file":"treeBeta.js","sourceRoot":"","sources":["../../../src/simple-tree/api/treeBeta.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAuE;AACvE,+CAS0B;AAC1B,0DAA2D;AAG3D,2CAA+C;AAE/C,qDAA+C;AA4I/C;;;;GAIG;AACU,QAAA,QAAQ,GAAa;IACjC,EAAE,CACD,IAAW,EACX,SAAY,EACZ,QAAiD;QAEjD,OAAO,4BAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IACD,KAAK,CACJ,IAAyC;QAEzC,mIAAmI;QACnI,IAAI,CAAC,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC,YAAY,EAAE,CAAC;QAE5D,yEAAyE;QACzE,0HAA0H;QAC1H,MAAM,WAAW,GAAG,IAAI,4BAAiB,CACxC,8BAAmB,EACnB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CACjC,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC,WAAW,EAAE,IAAA,uCAAoB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;QAErF,OAAO,IAAA,4BAAgB,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAErD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { defaultSchemaPolicy } from \"../../feature-libraries/index.js\";\nimport {\n\tContext,\n\tgetKernel,\n\tisTreeNode,\n\tUnhydratedContext,\n\ttype NodeKind,\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype WithType,\n} from \"../core/index.js\";\nimport { getUnhydratedContext } from \"../createContext.js\";\nimport type { ImplicitFieldSchema, TreeFieldFromImplicitField } from \"../fieldSchema.js\";\n\nimport { createFromCursor } from \"./create.js\";\nimport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nimport { treeNodeApi } from \"./treeNodeApi.js\";\n\n// Tests for this file are grouped with those for treeNodeApi.ts as that is where this functionality will eventually land,\n// and where most of the actual implementation is for much of it.\n\n/**\n * Data included for {@link TreeChangeEventsBeta.nodeChanged}.\n * @sealed @beta\n */\nexport interface NodeChangedData<TNode extends TreeNode = TreeNode> {\n\t/**\n\t * When the node changed is an object or Map node, this lists all the properties which changed.\n\t * @remarks\n\t * This only includes changes to the node itself (which would trigger {@link TreeChangeEvents.nodeChanged}).\n\t *\n\t * Set to `undefined` when the {@link NodeKind} does not support this feature (currently just ArrayNodes).\n\t *\n\t * When defined, the set should never be empty, since `nodeChanged` will only be triggered when there is a change, and for the supported node types, the only things that can change are properties.\n\t */\n\treadonly changedProperties?: ReadonlySet<\n\t\t// For Object nodes, make changedProperties required and strongly typed with the property names from the schema:\n\t\tTNode extends WithType<string, NodeKind.Object, infer TInfo>\n\t\t\t? string & keyof TInfo\n\t\t\t: string\n\t>;\n}\n\n/**\n * Extensions to {@link TreeChangeEvents} which are not yet stable.\n *\n * @sealed @beta\n */\nexport interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode>\n\textends TreeChangeEvents {\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, if any of the changes affected the node.\n\t *\n\t * - Object nodes define a change as being when the value of one of its properties changes (i.e., the property's value is set, including when set to `undefined`).\n\t *\n\t * - Array nodes define a change as when an element is added, removed, moved or replaced.\n\t *\n\t * - Map nodes define a change as when an entry is added, updated, or removed.\n\t *\n\t * @remarks\n\t * This event is not emitted when:\n\t *\n\t * - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing\n\t * elements/entries) will emit this event on the array/map node itself, but not on the node that contains the\n\t * array/map node as one of its properties.\n\t *\n\t * - The node is moved to a different location in the tree or removed from the tree.\n\t * In this case the event is emitted on the _parent_ node, not the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When the event is emitted, the tree is guaranteed to be in-schema.\n\t *\n\t * @privateRemarks\n\t * This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.\n\t * For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the\n\t * node, or when the node has to be updated due to resolution of a merge conflict\n\t * (for example a previously applied local change might be undone, then reapplied differently or not at all).\n\t *\n\t * TODO: define and document event ordering (ex: bottom up, with nodeChanged before treeChange on each level).\n\t *\n\t * This defines a property which is a function instead of using the method syntax to avoid function bi-variance issues with the input data to the callback.\n\t */\n\tnodeChanged: (\n\t\tdata: NodeChangedData<TNode> &\n\t\t\t// Make the properties of object, map, and record nodes required:\n\t\t\t(TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record>\n\t\t\t\t? Required<Pick<NodeChangedData<TNode>, \"changedProperties\">>\n\t\t\t\t: unknown),\n\t) => void;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeBeta:variable)} singleton.\n * @system @sealed @beta\n */\nexport interface TreeBeta {\n\t/**\n\t * Register an event listener on the given node.\n\t * @param node - The node whose events should be subscribed to.\n\t * @param eventName - Which event to subscribe to.\n\t * @param listener - The callback to trigger for the event. The tree can be read during the callback, but it is invalid to modify the tree during this callback.\n\t * @returns A callback function which will deregister the event.\n\t * This callback should be called only once.\n\t */\n\ton<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\teventName: K,\n\t\tlistener: NoInfer<TreeChangeEventsBeta<TNode>[K]>,\n\t): () => void;\n\n\t/**\n\t * Clones the persisted data associated with a node.\n\t *\n\t * @param node - The node to clone.\n\t * @returns A new unhydrated node with the same persisted data as the original node.\n\t * @remarks\n\t * Some key things to note:\n\t *\n\t * - Local state, such as properties added to customized schema classes, will not be cloned. However, they will be\n\t * initialized to their default state just as if the node had been created via its constructor.\n\t *\n\t * - Value node types (i.e., numbers, strings, booleans, nulls and Fluid handles) will be returned as is.\n\t *\n\t * - The identifiers in the node's subtree will be preserved, i.e., they are not replaced with new values.\n\t *\n\t * - If the node (or any node in its subtree) contains {@link SchemaFactoryObjectOptions.allowUnknownOptionalFields|unknown optional fields},\n\t * those fields will be cloned just like the known fields.\n\t */\n\tclone<const TSchema extends ImplicitFieldSchema>(\n\t\tnode: TreeFieldFromImplicitField<TSchema>,\n\t): TreeFieldFromImplicitField<TSchema>;\n\n\t// TODO: support more clone options\n\t// /**\n\t// * Like {@link (TreeBeta:interface).create}, except deeply clones existing nodes.\n\t// * @remarks\n\t// * This only clones the persisted data associated with a node.\n\t// * Local state, such as properties added to customized schema classes, will not be cloned:\n\t// * they will be initialized however they end up after running the constructor, just like if a remote client had inserted the same nodes.\n\t// */\n\t// clone<const TSchema extends ImplicitFieldSchema>(\n\t// \toriginal: TreeFieldFromImplicitField<TSchema>,\n\t// \toptions?: {\n\t// \t\t/**\n\t// \t\t * If set, all identifier's in the cloned tree (See {@link SchemaFactory.identifier}) will be replaced with new ones allocated using the default identifier allocation schema.\n\t// \t\t * Otherwise any identifiers will be preserved as is.\n\t// \t\t */\n\t// \t\treplaceIdentifiers?: true;\n\t// \t},\n\t// ): TreeFieldFromImplicitField<TSchema>;\n}\n\n/**\n * Extensions to {@link (Tree:variable)} which are not yet stable.\n * @see {@link (TreeBeta:interface)}.\n * @beta\n */\nexport const TreeBeta: TreeBeta = {\n\ton<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(\n\t\tnode: TNode,\n\t\teventName: K,\n\t\tlistener: NoInfer<TreeChangeEventsBeta<TNode>[K]>,\n\t): () => void {\n\t\treturn treeNodeApi.on(node, eventName, listener);\n\t},\n\tclone<const TSchema extends ImplicitFieldSchema>(\n\t\tnode: TreeFieldFromImplicitField<TSchema>,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\t// The only non-TreeNode cases are {@link TreeLeafValue} and `undefined` (for an empty optional field) which can be returned as is.\n\t\tif (!isTreeNode(node)) {\n\t\t\treturn node;\n\t\t}\n\n\t\tconst kernel = getKernel(node);\n\t\tconst cursor = kernel.getOrCreateInnerNode().borrowCursor();\n\n\t\t// To handle when the node transitively contains unknown optional fields,\n\t\t// derive the context from the source node's stored schema which has stored schema for any such fields and their contents.\n\t\tconst flexContext = new UnhydratedContext(\n\t\t\tdefaultSchemaPolicy,\n\t\t\tkernel.context.flexContext.schema,\n\t\t);\n\t\tconst context = new Context(flexContext, getUnhydratedContext(kernel.schema).schema);\n\n\t\treturn createFromCursor(kernel.schema, cursor, context) as Unhydrated<\n\t\t\tTreeFieldFromImplicitField<TSchema>\n\t\t>;\n\t},\n};\n"]}