@fluidframework/tree 2.4.0-297027 → 2.4.0-299374

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 (559) hide show
  1. package/.dependency-cruiser-known-violations.json +0 -14
  2. package/.vscode/settings.json +9 -1
  3. package/api-report/tree.alpha.api.md +178 -21
  4. package/api-report/tree.beta.api.md +46 -21
  5. package/api-report/tree.legacy.alpha.api.md +46 -21
  6. package/api-report/tree.legacy.public.api.md +46 -21
  7. package/api-report/tree.public.api.md +46 -21
  8. package/dist/alpha.d.ts +29 -1
  9. package/dist/beta.d.ts +2 -0
  10. package/dist/codec/codec.d.ts +4 -4
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/noopValidator.d.ts +1 -1
  13. package/dist/codec/noopValidator.js +1 -1
  14. package/dist/codec/noopValidator.js.map +1 -1
  15. package/dist/core/change-family/changeFamily.d.ts +2 -2
  16. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  17. package/dist/core/change-family/changeFamily.js.map +1 -1
  18. package/dist/core/change-family/editBuilder.d.ts +3 -2
  19. package/dist/core/change-family/editBuilder.d.ts.map +1 -1
  20. package/dist/core/change-family/editBuilder.js.map +1 -1
  21. package/dist/core/rebase/changeRebaser.d.ts +2 -1
  22. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  23. package/dist/core/rebase/changeRebaser.js.map +1 -1
  24. package/dist/core/rebase/utils.js +1 -1
  25. package/dist/core/rebase/utils.js.map +1 -1
  26. package/dist/core/tree/anchorSet.d.ts +159 -2
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +54 -12
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/external-utilities/typeboxValidator.d.ts +1 -1
  31. package/dist/external-utilities/typeboxValidator.js +1 -1
  32. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  33. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
  34. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  35. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
  36. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  37. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
  38. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  39. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  40. package/dist/feature-libraries/flex-tree/lazyField.d.ts +4 -0
  41. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  42. package/dist/feature-libraries/flex-tree/lazyField.js +38 -6
  43. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  44. package/dist/feature-libraries/index.d.ts +0 -1
  45. package/dist/feature-libraries/index.d.ts.map +1 -1
  46. package/dist/feature-libraries/index.js +46 -49
  47. package/dist/feature-libraries/index.js.map +1 -1
  48. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  49. package/dist/feature-libraries/mitigatedChangeFamily.js +4 -4
  50. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  51. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  52. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  53. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  54. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +12 -8
  55. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  56. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +179 -60
  57. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  58. package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -9
  59. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  60. package/dist/feature-libraries/optional-field/optionalField.js +9 -7
  61. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  62. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
  63. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  64. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -8
  65. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  66. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  67. package/dist/feature-libraries/sequence-field/compose.js +32 -20
  68. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  69. package/dist/feature-libraries/sequence-field/invert.d.ts +6 -1
  70. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  71. package/dist/feature-libraries/sequence-field/invert.js +25 -9
  72. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  73. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
  74. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  75. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
  76. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  77. package/dist/feature-libraries/treeCompressionUtils.d.ts +1 -1
  78. package/dist/feature-libraries/treeCompressionUtils.js +1 -1
  79. package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
  80. package/dist/index.d.ts +6 -5
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +4 -2
  83. package/dist/index.js.map +1 -1
  84. package/dist/internalTypes.d.ts +2 -2
  85. package/dist/internalTypes.d.ts.map +1 -1
  86. package/dist/internalTypes.js.map +1 -1
  87. package/dist/legacy.d.ts +2 -0
  88. package/dist/packageVersion.d.ts +1 -1
  89. package/dist/packageVersion.js +1 -1
  90. package/dist/packageVersion.js.map +1 -1
  91. package/dist/public.d.ts +2 -0
  92. package/dist/shared-tree/index.d.ts +2 -1
  93. package/dist/shared-tree/index.d.ts.map +1 -1
  94. package/dist/shared-tree/index.js +5 -1
  95. package/dist/shared-tree/index.js.map +1 -1
  96. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  97. package/dist/shared-tree/schematizingTreeView.js +1 -14
  98. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  99. package/dist/shared-tree/sharedTree.d.ts +24 -9
  100. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  101. package/dist/shared-tree/sharedTree.js +21 -9
  102. package/dist/shared-tree/sharedTree.js.map +1 -1
  103. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  104. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  105. package/dist/shared-tree/sharedTreeChangeFamily.js +4 -4
  106. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  107. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
  108. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  109. package/dist/shared-tree/sharedTreeEditBuilder.js +15 -11
  110. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  111. package/dist/shared-tree/treeApi.d.ts +6 -6
  112. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  113. package/dist/shared-tree/treeApi.js.map +1 -1
  114. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  115. package/dist/shared-tree/treeCheckout.js +4 -3
  116. package/dist/shared-tree/treeCheckout.js.map +1 -1
  117. package/dist/shared-tree-core/branch.d.ts +2 -3
  118. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  119. package/dist/shared-tree-core/branch.js +10 -11
  120. package/dist/shared-tree-core/branch.js.map +1 -1
  121. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
  122. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  123. package/dist/shared-tree-core/defaultResubmitMachine.js +4 -4
  124. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  125. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  126. package/dist/shared-tree-core/editManager.js +1 -1
  127. package/dist/shared-tree-core/editManager.js.map +1 -1
  128. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  129. package/dist/shared-tree-core/sharedTreeCore.js +2 -2
  130. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  131. package/dist/simple-tree/api/conciseTree.d.ts +29 -0
  132. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -0
  133. package/dist/simple-tree/api/conciseTree.js +25 -0
  134. package/dist/simple-tree/api/conciseTree.js.map +1 -0
  135. package/dist/simple-tree/api/customTree.d.ts +44 -0
  136. package/dist/simple-tree/api/customTree.d.ts.map +1 -0
  137. package/dist/simple-tree/api/customTree.js +63 -0
  138. package/dist/simple-tree/api/customTree.js.map +1 -0
  139. package/dist/simple-tree/api/index.d.ts +7 -2
  140. package/dist/simple-tree/api/index.d.ts.map +1 -1
  141. package/dist/simple-tree/api/index.js +5 -1
  142. package/dist/simple-tree/api/index.js.map +1 -1
  143. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
  144. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  145. package/dist/simple-tree/api/schemaCreationUtilities.js +43 -15
  146. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  147. package/dist/simple-tree/api/schemaFactory.d.ts +1 -2
  148. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  149. package/dist/simple-tree/api/schemaFactory.js +8 -8
  150. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  151. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
  152. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  153. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  154. package/dist/simple-tree/api/storedSchema.d.ts +78 -0
  155. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -0
  156. package/dist/simple-tree/api/storedSchema.js +107 -0
  157. package/dist/simple-tree/api/storedSchema.js.map +1 -0
  158. package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
  159. package/dist/simple-tree/api/tree.d.ts +12 -3
  160. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  161. package/dist/simple-tree/api/tree.js.map +1 -1
  162. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  163. package/dist/simple-tree/api/treeNodeApi.js +5 -5
  164. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  165. package/dist/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +58 -10
  166. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -0
  167. package/dist/simple-tree/api/typesUnsafe.js.map +1 -0
  168. package/dist/simple-tree/api/verboseTree.d.ts +6 -20
  169. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  170. package/dist/simple-tree/api/verboseTree.js +10 -48
  171. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  172. package/dist/simple-tree/arrayNode.d.ts +14 -3
  173. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  174. package/dist/simple-tree/arrayNode.js +1 -2
  175. package/dist/simple-tree/arrayNode.js.map +1 -1
  176. package/dist/simple-tree/core/index.d.ts +1 -1
  177. package/dist/simple-tree/core/index.d.ts.map +1 -1
  178. package/dist/simple-tree/core/index.js +2 -1
  179. package/dist/simple-tree/core/index.js.map +1 -1
  180. package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -0
  181. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  182. package/dist/simple-tree/core/treeNodeKernel.js +14 -1
  183. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  184. package/dist/simple-tree/core/treeNodeSchema.d.ts +6 -5
  185. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  186. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  187. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  188. package/dist/simple-tree/core/unhydratedFlexTree.js +3 -1
  189. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  190. package/dist/simple-tree/core/withType.d.ts +3 -1
  191. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  192. package/dist/simple-tree/core/withType.js.map +1 -1
  193. package/dist/simple-tree/flexList.d.ts.map +1 -0
  194. package/dist/simple-tree/flexList.js.map +1 -0
  195. package/dist/simple-tree/index.d.ts +6 -7
  196. package/dist/simple-tree/index.d.ts.map +1 -1
  197. package/dist/simple-tree/index.js +5 -3
  198. package/dist/simple-tree/index.js.map +1 -1
  199. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  200. package/dist/simple-tree/mapNode.js +2 -3
  201. package/dist/simple-tree/mapNode.js.map +1 -1
  202. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  203. package/dist/simple-tree/objectNode.js +3 -4
  204. package/dist/simple-tree/objectNode.js.map +1 -1
  205. package/dist/simple-tree/schemaTypes.d.ts +60 -7
  206. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  207. package/dist/simple-tree/schemaTypes.js +11 -6
  208. package/dist/simple-tree/schemaTypes.js.map +1 -1
  209. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  210. package/dist/simple-tree/toFlexSchema.js +13 -15
  211. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  212. package/dist/simple-tree/toMapTree.d.ts +4 -2
  213. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  214. package/dist/simple-tree/toMapTree.js +3 -3
  215. package/dist/simple-tree/toMapTree.js.map +1 -1
  216. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  217. package/dist/simple-tree/treeNodeValid.js +2 -1
  218. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  219. package/dist/treeFactory.d.ts +1 -0
  220. package/dist/treeFactory.d.ts.map +1 -1
  221. package/dist/treeFactory.js +1 -0
  222. package/dist/treeFactory.js.map +1 -1
  223. package/dist/util/utils.d.ts +10 -8
  224. package/dist/util/utils.d.ts.map +1 -1
  225. package/dist/util/utils.js.map +1 -1
  226. package/docs/main/detached-trees.md +8 -8
  227. package/lib/alpha.d.ts +29 -1
  228. package/lib/beta.d.ts +2 -0
  229. package/lib/codec/codec.d.ts +4 -4
  230. package/lib/codec/codec.js.map +1 -1
  231. package/lib/codec/noopValidator.d.ts +1 -1
  232. package/lib/codec/noopValidator.js +1 -1
  233. package/lib/codec/noopValidator.js.map +1 -1
  234. package/lib/core/change-family/changeFamily.d.ts +2 -2
  235. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  236. package/lib/core/change-family/changeFamily.js.map +1 -1
  237. package/lib/core/change-family/editBuilder.d.ts +3 -2
  238. package/lib/core/change-family/editBuilder.d.ts.map +1 -1
  239. package/lib/core/change-family/editBuilder.js.map +1 -1
  240. package/lib/core/rebase/changeRebaser.d.ts +2 -1
  241. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  242. package/lib/core/rebase/changeRebaser.js.map +1 -1
  243. package/lib/core/rebase/utils.js +1 -1
  244. package/lib/core/rebase/utils.js.map +1 -1
  245. package/lib/core/tree/anchorSet.d.ts +159 -2
  246. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  247. package/lib/core/tree/anchorSet.js +54 -12
  248. package/lib/core/tree/anchorSet.js.map +1 -1
  249. package/lib/external-utilities/typeboxValidator.d.ts +1 -1
  250. package/lib/external-utilities/typeboxValidator.js +1 -1
  251. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  252. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
  253. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  254. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
  255. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  256. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
  257. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  258. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  259. package/lib/feature-libraries/flex-tree/lazyField.d.ts +4 -0
  260. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  261. package/lib/feature-libraries/flex-tree/lazyField.js +36 -5
  262. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  263. package/lib/feature-libraries/index.d.ts +0 -1
  264. package/lib/feature-libraries/index.d.ts.map +1 -1
  265. package/lib/feature-libraries/index.js +0 -1
  266. package/lib/feature-libraries/index.js.map +1 -1
  267. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  268. package/lib/feature-libraries/mitigatedChangeFamily.js +4 -4
  269. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  270. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
  271. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  272. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  273. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +12 -8
  274. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  275. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +180 -61
  276. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  277. package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -9
  278. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  279. package/lib/feature-libraries/optional-field/optionalField.js +9 -7
  280. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  281. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
  282. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  283. package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -8
  284. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  285. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  286. package/lib/feature-libraries/sequence-field/compose.js +32 -20
  287. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  288. package/lib/feature-libraries/sequence-field/invert.d.ts +6 -1
  289. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  290. package/lib/feature-libraries/sequence-field/invert.js +25 -9
  291. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  292. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
  293. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  294. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
  295. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  296. package/lib/feature-libraries/treeCompressionUtils.d.ts +1 -1
  297. package/lib/feature-libraries/treeCompressionUtils.js +1 -1
  298. package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
  299. package/lib/index.d.ts +6 -5
  300. package/lib/index.d.ts.map +1 -1
  301. package/lib/index.js +3 -3
  302. package/lib/index.js.map +1 -1
  303. package/lib/internalTypes.d.ts +2 -2
  304. package/lib/internalTypes.d.ts.map +1 -1
  305. package/lib/internalTypes.js.map +1 -1
  306. package/lib/legacy.d.ts +2 -0
  307. package/lib/packageVersion.d.ts +1 -1
  308. package/lib/packageVersion.js +1 -1
  309. package/lib/packageVersion.js.map +1 -1
  310. package/lib/public.d.ts +2 -0
  311. package/lib/shared-tree/index.d.ts +2 -1
  312. package/lib/shared-tree/index.d.ts.map +1 -1
  313. package/lib/shared-tree/index.js +2 -1
  314. package/lib/shared-tree/index.js.map +1 -1
  315. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  316. package/lib/shared-tree/schematizingTreeView.js +2 -15
  317. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  318. package/lib/shared-tree/sharedTree.d.ts +24 -9
  319. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  320. package/lib/shared-tree/sharedTree.js +20 -9
  321. package/lib/shared-tree/sharedTree.js.map +1 -1
  322. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  323. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  324. package/lib/shared-tree/sharedTreeChangeFamily.js +4 -4
  325. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  326. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
  327. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  328. package/lib/shared-tree/sharedTreeEditBuilder.js +15 -11
  329. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  330. package/lib/shared-tree/treeApi.d.ts +6 -6
  331. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  332. package/lib/shared-tree/treeApi.js.map +1 -1
  333. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  334. package/lib/shared-tree/treeCheckout.js +5 -4
  335. package/lib/shared-tree/treeCheckout.js.map +1 -1
  336. package/lib/shared-tree-core/branch.d.ts +2 -3
  337. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  338. package/lib/shared-tree-core/branch.js +11 -12
  339. package/lib/shared-tree-core/branch.js.map +1 -1
  340. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
  341. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  342. package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
  343. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  344. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  345. package/lib/shared-tree-core/editManager.js +2 -2
  346. package/lib/shared-tree-core/editManager.js.map +1 -1
  347. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  348. package/lib/shared-tree-core/sharedTreeCore.js +2 -2
  349. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  350. package/lib/simple-tree/api/conciseTree.d.ts +29 -0
  351. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -0
  352. package/lib/simple-tree/api/conciseTree.js +21 -0
  353. package/lib/simple-tree/api/conciseTree.js.map +1 -0
  354. package/lib/simple-tree/api/customTree.d.ts +44 -0
  355. package/lib/simple-tree/api/customTree.d.ts.map +1 -0
  356. package/lib/simple-tree/api/customTree.js +59 -0
  357. package/lib/simple-tree/api/customTree.js.map +1 -0
  358. package/lib/simple-tree/api/index.d.ts +7 -2
  359. package/lib/simple-tree/api/index.d.ts.map +1 -1
  360. package/lib/simple-tree/api/index.js +1 -0
  361. package/lib/simple-tree/api/index.js.map +1 -1
  362. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
  363. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  364. package/lib/simple-tree/api/schemaCreationUtilities.js +43 -15
  365. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  366. package/lib/simple-tree/api/schemaFactory.d.ts +1 -2
  367. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  368. package/lib/simple-tree/api/schemaFactory.js +1 -1
  369. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  370. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
  371. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  372. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  373. package/lib/simple-tree/api/storedSchema.d.ts +78 -0
  374. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -0
  375. package/lib/simple-tree/api/storedSchema.js +101 -0
  376. package/lib/simple-tree/api/storedSchema.js.map +1 -0
  377. package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
  378. package/lib/simple-tree/api/tree.d.ts +12 -3
  379. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  380. package/lib/simple-tree/api/tree.js.map +1 -1
  381. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  382. package/lib/simple-tree/api/treeNodeApi.js +3 -3
  383. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  384. package/lib/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +58 -10
  385. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -0
  386. package/lib/simple-tree/api/typesUnsafe.js.map +1 -0
  387. package/lib/simple-tree/api/verboseTree.d.ts +6 -20
  388. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  389. package/lib/simple-tree/api/verboseTree.js +11 -49
  390. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  391. package/lib/simple-tree/arrayNode.d.ts +14 -3
  392. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  393. package/lib/simple-tree/arrayNode.js +1 -2
  394. package/lib/simple-tree/arrayNode.js.map +1 -1
  395. package/lib/simple-tree/core/index.d.ts +1 -1
  396. package/lib/simple-tree/core/index.d.ts.map +1 -1
  397. package/lib/simple-tree/core/index.js +1 -1
  398. package/lib/simple-tree/core/index.js.map +1 -1
  399. package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -0
  400. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  401. package/lib/simple-tree/core/treeNodeKernel.js +12 -0
  402. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  403. package/lib/simple-tree/core/treeNodeSchema.d.ts +6 -5
  404. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  405. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  406. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  407. package/lib/simple-tree/core/unhydratedFlexTree.js +3 -1
  408. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  409. package/lib/simple-tree/core/withType.d.ts +3 -1
  410. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  411. package/lib/simple-tree/core/withType.js.map +1 -1
  412. package/lib/simple-tree/flexList.d.ts.map +1 -0
  413. package/lib/simple-tree/flexList.js.map +1 -0
  414. package/lib/simple-tree/index.d.ts +6 -7
  415. package/lib/simple-tree/index.d.ts.map +1 -1
  416. package/lib/simple-tree/index.js +3 -4
  417. package/lib/simple-tree/index.js.map +1 -1
  418. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  419. package/lib/simple-tree/mapNode.js +1 -2
  420. package/lib/simple-tree/mapNode.js.map +1 -1
  421. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  422. package/lib/simple-tree/objectNode.js +1 -2
  423. package/lib/simple-tree/objectNode.js.map +1 -1
  424. package/lib/simple-tree/schemaTypes.d.ts +60 -7
  425. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  426. package/lib/simple-tree/schemaTypes.js +6 -1
  427. package/lib/simple-tree/schemaTypes.js.map +1 -1
  428. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  429. package/lib/simple-tree/toFlexSchema.js +1 -3
  430. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  431. package/lib/simple-tree/toMapTree.d.ts +4 -2
  432. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  433. package/lib/simple-tree/toMapTree.js +3 -3
  434. package/lib/simple-tree/toMapTree.js.map +1 -1
  435. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  436. package/lib/simple-tree/treeNodeValid.js +2 -1
  437. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  438. package/lib/treeFactory.d.ts +1 -0
  439. package/lib/treeFactory.d.ts.map +1 -1
  440. package/lib/treeFactory.js +1 -0
  441. package/lib/treeFactory.js.map +1 -1
  442. package/lib/util/utils.d.ts +10 -8
  443. package/lib/util/utils.d.ts.map +1 -1
  444. package/lib/util/utils.js.map +1 -1
  445. package/package.json +44 -27
  446. package/src/codec/codec.ts +4 -4
  447. package/src/codec/noopValidator.ts +1 -1
  448. package/src/core/change-family/changeFamily.ts +5 -2
  449. package/src/core/change-family/editBuilder.ts +3 -2
  450. package/src/core/rebase/changeRebaser.ts +6 -1
  451. package/src/core/rebase/utils.ts +1 -1
  452. package/src/core/tree/anchorSet.ts +63 -13
  453. package/src/external-utilities/typeboxValidator.ts +1 -1
  454. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +92 -47
  455. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +7 -7
  456. package/src/feature-libraries/flex-tree/lazyField.ts +44 -7
  457. package/src/feature-libraries/index.ts +0 -10
  458. package/src/feature-libraries/mitigatedChangeFamily.ts +11 -4
  459. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -0
  460. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +218 -175
  461. package/src/feature-libraries/optional-field/optionalField.ts +21 -17
  462. package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -10
  463. package/src/feature-libraries/sequence-field/compose.ts +67 -58
  464. package/src/feature-libraries/sequence-field/invert.ts +30 -6
  465. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +65 -19
  466. package/src/feature-libraries/treeCompressionUtils.ts +1 -1
  467. package/src/index.ts +26 -6
  468. package/src/internalTypes.ts +4 -1
  469. package/src/packageVersion.ts +1 -1
  470. package/src/shared-tree/index.ts +5 -0
  471. package/src/shared-tree/schematizingTreeView.ts +7 -16
  472. package/src/shared-tree/sharedTree.ts +55 -23
  473. package/src/shared-tree/sharedTreeChangeFamily.ts +5 -1
  474. package/src/shared-tree/sharedTreeEditBuilder.ts +23 -12
  475. package/src/shared-tree/treeApi.ts +19 -9
  476. package/src/shared-tree/treeCheckout.ts +7 -6
  477. package/src/shared-tree-core/branch.ts +11 -14
  478. package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
  479. package/src/shared-tree-core/editManager.ts +2 -1
  480. package/src/shared-tree-core/sharedTreeCore.ts +4 -2
  481. package/src/simple-tree/api/conciseTree.ts +58 -0
  482. package/src/simple-tree/api/customTree.ts +119 -0
  483. package/src/simple-tree/api/index.ts +39 -1
  484. package/src/simple-tree/api/schemaCreationUtilities.ts +55 -36
  485. package/src/simple-tree/api/schemaFactory.ts +4 -6
  486. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -2
  487. package/src/simple-tree/api/storedSchema.ts +126 -0
  488. package/src/simple-tree/api/tree.ts +24 -2
  489. package/src/simple-tree/api/treeNodeApi.ts +3 -8
  490. package/src/simple-tree/{typesUnsafe.ts → api/typesUnsafe.ts} +95 -21
  491. package/src/simple-tree/api/verboseTree.ts +21 -76
  492. package/src/simple-tree/arrayNode.ts +35 -15
  493. package/src/simple-tree/core/index.ts +1 -0
  494. package/src/simple-tree/core/treeNodeKernel.ts +13 -0
  495. package/src/simple-tree/core/treeNodeSchema.ts +7 -5
  496. package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
  497. package/src/simple-tree/core/withType.ts +10 -1
  498. package/src/simple-tree/index.ts +41 -21
  499. package/src/simple-tree/mapNode.ts +1 -1
  500. package/src/simple-tree/objectNode.ts +1 -1
  501. package/src/simple-tree/schemaTypes.ts +70 -11
  502. package/src/simple-tree/toFlexSchema.ts +1 -3
  503. package/src/simple-tree/toMapTree.ts +7 -4
  504. package/src/simple-tree/treeNodeValid.ts +2 -1
  505. package/src/treeFactory.ts +1 -0
  506. package/src/util/utils.ts +10 -8
  507. package/dist/feature-libraries/flex-tree/unboxed.d.ts +0 -12
  508. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
  509. package/dist/feature-libraries/flex-tree/unboxed.js +0 -20
  510. package/dist/feature-libraries/flex-tree/unboxed.js.map +0 -1
  511. package/dist/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
  512. package/dist/feature-libraries/typed-schema/flexList.js.map +0 -1
  513. package/dist/feature-libraries/typed-schema/index.d.ts +0 -7
  514. package/dist/feature-libraries/typed-schema/index.d.ts.map +0 -1
  515. package/dist/feature-libraries/typed-schema/index.js +0 -12
  516. package/dist/feature-libraries/typed-schema/index.js.map +0 -1
  517. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
  518. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
  519. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -7
  520. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
  521. package/dist/simple-tree/proxyBinding.d.ts +0 -15
  522. package/dist/simple-tree/proxyBinding.d.ts.map +0 -1
  523. package/dist/simple-tree/proxyBinding.js +0 -22
  524. package/dist/simple-tree/proxyBinding.js.map +0 -1
  525. package/dist/simple-tree/typesUnsafe.d.ts.map +0 -1
  526. package/dist/simple-tree/typesUnsafe.js.map +0 -1
  527. package/lib/feature-libraries/flex-tree/unboxed.d.ts +0 -12
  528. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
  529. package/lib/feature-libraries/flex-tree/unboxed.js +0 -16
  530. package/lib/feature-libraries/flex-tree/unboxed.js.map +0 -1
  531. package/lib/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
  532. package/lib/feature-libraries/typed-schema/flexList.js.map +0 -1
  533. package/lib/feature-libraries/typed-schema/index.d.ts +0 -7
  534. package/lib/feature-libraries/typed-schema/index.d.ts.map +0 -1
  535. package/lib/feature-libraries/typed-schema/index.js +0 -6
  536. package/lib/feature-libraries/typed-schema/index.js.map +0 -1
  537. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
  538. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
  539. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +0 -6
  540. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
  541. package/lib/simple-tree/proxyBinding.d.ts +0 -15
  542. package/lib/simple-tree/proxyBinding.d.ts.map +0 -1
  543. package/lib/simple-tree/proxyBinding.js +0 -18
  544. package/lib/simple-tree/proxyBinding.js.map +0 -1
  545. package/lib/simple-tree/typesUnsafe.d.ts.map +0 -1
  546. package/lib/simple-tree/typesUnsafe.js.map +0 -1
  547. package/src/feature-libraries/flex-tree/unboxed.ts +0 -24
  548. package/src/feature-libraries/typed-schema/README.md +0 -6
  549. package/src/feature-libraries/typed-schema/index.ts +0 -16
  550. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -14
  551. package/src/simple-tree/proxyBinding.ts +0 -20
  552. /package/dist/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
  553. /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
  554. /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
  555. /package/lib/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
  556. /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
  557. /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
  558. /package/src/simple-tree/{ProxyBinding.md → core/TreeNodeBinding.md} +0 -0
  559. /package/src/{feature-libraries/typed-schema → simple-tree}/flexList.ts +0 -0
@@ -0,0 +1,58 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { IFluidHandle } from "@fluidframework/core-interfaces";
7
+
8
+ import type { ITreeCursor } from "../../core/index.js";
9
+ import type { TreeLeafValue, ImplicitAllowedTypes } from "../schemaTypes.js";
10
+ import type { TreeNodeSchema } from "../core/index.js";
11
+ import { customFromCursorInner, type EncodeOptions } from "./customTree.js";
12
+ import { getUnhydratedContext } from "../createContext.js";
13
+
14
+ /**
15
+ * Concise encoding of a {@link TreeNode} or {@link TreeLeafValue}.
16
+ * @remarks
17
+ * This is "concise" meaning that explicit type information is omitted.
18
+ * If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity},
19
+ * types will be lossless and compatible with {@link TreeBeta.create} (unless the options are used to customize it).
20
+ *
21
+ * Every {@link TreeNode} is an array or object.
22
+ * Any IFluidHandle values have been replaced by `THandle`.
23
+ * @privateRemarks
24
+ * This can store all possible simple trees,
25
+ * but it can not store all possible trees representable by our internal representations like FlexTree and JsonableTree.
26
+ */
27
+ export type ConciseTree<THandle = IFluidHandle> =
28
+ | Exclude<TreeLeafValue, IFluidHandle>
29
+ | THandle
30
+ | ConciseTree<THandle>[]
31
+ | {
32
+ [key: string]: ConciseTree<THandle>;
33
+ };
34
+
35
+ /**
36
+ * Used to read a node cursor as a ConciseTree.
37
+ */
38
+ export function conciseFromCursor<TCustom>(
39
+ reader: ITreeCursor,
40
+ rootSchema: ImplicitAllowedTypes,
41
+ options: EncodeOptions<TCustom>,
42
+ ): ConciseTree<TCustom> {
43
+ const config: Required<EncodeOptions<TCustom>> = {
44
+ useStoredKeys: false,
45
+ ...options,
46
+ };
47
+
48
+ const schemaMap = getUnhydratedContext(rootSchema).schema;
49
+ return conciseFromCursorInner(reader, config, schemaMap);
50
+ }
51
+
52
+ function conciseFromCursorInner<TCustom>(
53
+ reader: ITreeCursor,
54
+ options: Required<EncodeOptions<TCustom>>,
55
+ schema: ReadonlyMap<string, TreeNodeSchema>,
56
+ ): ConciseTree<TCustom> {
57
+ return customFromCursorInner(reader, options, schema, conciseFromCursorInner);
58
+ }
@@ -0,0 +1,119 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { IFluidHandle } from "@fluidframework/core-interfaces";
7
+ import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
8
+ import { assert } from "@fluidframework/core-utils/internal";
9
+
10
+ import {
11
+ EmptyKey,
12
+ forEachField,
13
+ inCursorField,
14
+ mapCursorField,
15
+ type ITreeCursor,
16
+ } from "../../core/index.js";
17
+ import { fail } from "../../util/index.js";
18
+ import type { TreeLeafValue } from "../schemaTypes.js";
19
+ import { NodeKind, type TreeNodeSchema } from "../core/index.js";
20
+ import {
21
+ booleanSchema,
22
+ handleSchema,
23
+ nullSchema,
24
+ numberSchema,
25
+ stringSchema,
26
+ } from "../leafNodeSchema.js";
27
+ import { isObjectNodeSchema } from "../objectNodeTypes.js";
28
+
29
+ /**
30
+ * Options for how to encode a tree.
31
+ */
32
+ export interface EncodeOptions<TCustom> {
33
+ /**
34
+ * How to encode any {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles} in the tree.
35
+ * @remarks
36
+ * See note on {@link ParseOptions.valueConverter}.
37
+ */
38
+ valueConverter(data: IFluidHandle): TCustom;
39
+ /**
40
+ * If true, interpret the input keys of object nodes as stored keys.
41
+ * If false, interpret them as property keys.
42
+ * @defaultValue false.
43
+ */
44
+ readonly useStoredKeys?: boolean;
45
+ }
46
+
47
+ /**
48
+ * Tree representation with fields as properties and customized handle and child representations.
49
+ */
50
+ export type CustomTree<TChild, THandle> = CustomTreeNode<TChild> | CustomTreeValue<THandle>;
51
+
52
+ /**
53
+ * TreeLeafValue except the handle type is customized.
54
+ */
55
+ export type CustomTreeValue<THandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle;
56
+
57
+ /**
58
+ * Tree node representation with fields as properties and customized child representation.
59
+ */
60
+ export type CustomTreeNode<TChild> = TChild[] | { [key: string]: TChild };
61
+
62
+ /**
63
+ * Builds an {@link CustomTree} from a cursor in Nodes mode.
64
+ */
65
+ export function customFromCursorInner<TChild, THandle>(
66
+ reader: ITreeCursor,
67
+ options: Required<EncodeOptions<THandle>>,
68
+ schema: ReadonlyMap<string, TreeNodeSchema>,
69
+ childHandler: (
70
+ reader: ITreeCursor,
71
+ options: Required<EncodeOptions<THandle>>,
72
+ schema: ReadonlyMap<string, TreeNodeSchema>,
73
+ ) => TChild,
74
+ ): CustomTree<TChild, THandle> {
75
+ const type = reader.type;
76
+ const nodeSchema = schema.get(type) ?? fail("missing schema for type in cursor");
77
+
78
+ switch (type) {
79
+ case numberSchema.identifier:
80
+ case booleanSchema.identifier:
81
+ case nullSchema.identifier:
82
+ case stringSchema.identifier:
83
+ assert(reader.value !== undefined, "out of schema: missing value");
84
+ assert(!isFluidHandle(reader.value), "out of schema: unexpected FluidHandle");
85
+ return reader.value;
86
+ case handleSchema.identifier:
87
+ assert(reader.value !== undefined, "out of schema: missing value");
88
+ assert(isFluidHandle(reader.value), "out of schema: expected FluidHandle");
89
+ return options.valueConverter(reader.value);
90
+ default: {
91
+ assert(reader.value === undefined, "out of schema: unexpected value");
92
+ if (nodeSchema.kind === NodeKind.Array) {
93
+ const fields = inCursorField(reader, EmptyKey, () =>
94
+ mapCursorField(reader, () => childHandler(reader, options, schema)),
95
+ );
96
+ return fields;
97
+ } else {
98
+ const fields: Record<string, TChild> = {};
99
+ forEachField(reader, () => {
100
+ const children = mapCursorField(reader, () => childHandler(reader, options, schema));
101
+ if (children.length === 1) {
102
+ const storedKey = reader.getFieldKey();
103
+ const key =
104
+ isObjectNodeSchema(nodeSchema) && !options.useStoredKeys
105
+ ? nodeSchema.storedKeyToPropertyKey.get(storedKey) ??
106
+ fail("missing property key")
107
+ : storedKey;
108
+ // Length is checked above.
109
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
110
+ fields[key] = children[0]!;
111
+ } else {
112
+ assert(children.length === 0, 0xa19 /* invalid children number */);
113
+ }
114
+ });
115
+ return fields;
116
+ }
117
+ }
118
+ }
119
+ }
@@ -12,6 +12,7 @@ export {
12
12
  type ITreeViewConfiguration,
13
13
  type SchemaCompatibilityStatus,
14
14
  type ITreeConfigurationOptions,
15
+ type TreeViewAlpha,
15
16
  } from "./tree.js";
16
17
  export { SchemaFactory, type ScopedSchemaName } from "./schemaFactory.js";
17
18
  export type {
@@ -23,7 +24,6 @@ export {
23
24
  enumFromStrings,
24
25
  singletonSchema,
25
26
  typedObjectValues,
26
- type EmptyObject,
27
27
  } from "./schemaCreationUtilities.js";
28
28
  export { treeNodeApi, type TreeNodeApi } from "./treeNodeApi.js";
29
29
  export { createFromInsertable, cursorFromInsertable } from "./create.js";
@@ -46,9 +46,47 @@ export {
46
46
  export { getJsonSchema } from "./getJsonSchema.js";
47
47
  export { getSimpleSchema } from "./getSimpleSchema.js";
48
48
  export { ViewSchema } from "./view.js";
49
+ export type {
50
+ Unenforced,
51
+ FieldHasDefaultUnsafe,
52
+ ObjectFromSchemaRecordUnsafe,
53
+ TreeObjectNodeUnsafe,
54
+ TreeFieldFromImplicitFieldUnsafe,
55
+ TreeNodeFromImplicitAllowedTypesUnsafe,
56
+ FieldSchemaUnsafe,
57
+ InsertableTreeNodeFromImplicitAllowedTypesUnsafe,
58
+ TreeArrayNodeUnsafe,
59
+ TreeMapNodeUnsafe,
60
+ InsertableObjectFromSchemaRecordUnsafe,
61
+ InsertableTreeFieldFromImplicitFieldUnsafe,
62
+ InsertableTypedNodeUnsafe,
63
+ NodeBuilderDataUnsafe,
64
+ NodeFromSchemaUnsafe,
65
+ ReadonlyMapInlined,
66
+ TreeNodeSchemaClassUnsafe,
67
+ TreeNodeSchemaUnsafe,
68
+ AllowedTypesUnsafe,
69
+ TreeNodeSchemaNonClassUnsafe,
70
+ } from "./typesUnsafe.js";
71
+
72
+ export type {
73
+ VerboseTreeNode,
74
+ ParseOptions,
75
+ VerboseTree,
76
+ } from "./verboseTree.js";
77
+
78
+ export type { EncodeOptions } from "./customTree.js";
79
+
80
+ export type { ConciseTree } from "./conciseTree.js";
49
81
 
50
82
  export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
51
83
 
84
+ export {
85
+ extractPersistedSchema,
86
+ comparePersistedSchemaInternal,
87
+ comparePersistedSchema,
88
+ } from "./storedSchema.js";
89
+
52
90
  // Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
53
91
  // These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
54
92
  export {
@@ -9,27 +9,29 @@ import { fail } from "../../util/index.js";
9
9
 
10
10
  import type { SchemaFactory, ScopedSchemaName } from "./schemaFactory.js";
11
11
  import type { NodeFromSchema } from "../schemaTypes.js";
12
- import type { NodeKind, TreeNodeSchemaClass, TreeNode } from "../core/index.js";
13
12
  import type {
14
- InsertableObjectFromSchemaRecord,
15
- ObjectFromSchemaRecord,
16
- } from "../objectNode.js";
17
-
18
- /**
19
- * Empty Object for use in type computations that should contribute no fields when `&`ed with another type.
20
- * @internal
13
+ InternalTreeNode,
14
+ NodeKind,
15
+ TreeNode,
16
+ TreeNodeSchemaClass,
17
+ } from "../core/index.js";
18
+
19
+ /*
20
+ * This file does two things:
21
+ *
22
+ * 1. Provides tools for making schema for cases like enums.
23
+ *
24
+ * 2. Demonstrates the kinds of schema utilities apps can write.
25
+ * Nothing in here needs access to package internal APIs.
21
26
  */
22
- // Using {} instead of interface {} or Record<string, never> for empty object here produces better IntelliSense in the generated types than `Record<string, never>` recommended by the linter.
23
- // Making this a type instead of an interface prevents it from showing up in IntelliSense, and also avoids breaking the typing somehow.
24
- // eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/consistent-type-definitions
25
- export type EmptyObject = {};
26
27
 
27
28
  /**
28
29
  * Create a schema for a node with no state.
29
30
  * @remarks
30
31
  * This is commonly used in unions when the only information needed is which kind of node the value is.
31
32
  * Enums are a common example of this pattern.
32
- * @internal
33
+ * @see {@link adaptEnum}
34
+ * @alpha
33
35
  */
34
36
  // Return type is intentionally derived.
35
37
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
@@ -38,7 +40,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
38
40
  name: TName,
39
41
  ) {
40
42
  class SingletonSchema extends factory.object(name, {}) {
41
- public constructor(data?: EmptyObject) {
43
+ public constructor(data?: InternalTreeNode) {
42
44
  super(data ?? {});
43
45
  }
44
46
  public get value(): TName {
@@ -46,9 +48,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
46
48
  }
47
49
  }
48
50
 
49
- type NodeType = object &
50
- TreeNode &
51
- ObjectFromSchemaRecord<EmptyObject> & { readonly value: TName };
51
+ type NodeType = TreeNode & { readonly value: TName };
52
52
 
53
53
  // Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly "__#124291@#brand": unknown;`
54
54
  // for the private brand field of TreeNode.
@@ -59,7 +59,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
59
59
  ScopedSchemaName<TScope, TName>,
60
60
  NodeKind.Object,
61
61
  NodeType,
62
- object & InsertableObjectFromSchemaRecord<EmptyObject>,
62
+ never,
63
63
  true
64
64
  > &
65
65
  (new () => NodeType) = SingletonSchema;
@@ -71,33 +71,50 @@ export function singletonSchema<TScope extends string, TName extends string | nu
71
71
  * Converts an enum into a collection of schema which can be used in a union.
72
72
  * @remarks
73
73
  * Currently only supports `string` enums.
74
+ * The string value of the enum is used as the name of the schema: callers must ensure that it is stable and unique.
75
+ * Consider making a dedicated schema factory with a nested scope to avoid the enum members colliding with other schema.
74
76
  * @example
75
77
  * ```typescript
78
+ * const schemaFactory = new SchemaFactory("com.myApp");
79
+ * // An enum for use in the tree. Must have string keys.
76
80
  * enum Mode {
77
81
  * a = "A",
78
82
  * b = "B",
79
83
  * }
80
- * const ModeNodes = adaptEnum(schema, Mode);
84
+ * // Define the schema for each member of the enum using a nested scope to group them together.
85
+ * const ModeNodes = adaptEnum(new SchemaFactory(`${schemaFactory.scope}.Mode`), Mode);
86
+ * // Defined the types of the nodes which correspond to this the schema.
81
87
  * type ModeNodes = NodeFromSchema<(typeof ModeNodes)[keyof typeof ModeNodes]>;
82
- * const nodeFromString: ModeNodes = ModeNodes(Mode.a);
83
- * const nodeFromSchema: ModeNodes = new ModeNodes.a();
84
- * const nameFromNode: Mode = nodeFromSchema.value;
88
+ * // An example schema which has an enum as a child.
85
89
  * class Parent extends schemaFactory.object("Parent", {
90
+ * // typedObjectValues extracts a list of all the fields of ModeNodes, which are the schema for each enum member.
91
+ * // This means any member of the enum is allowed in this field.
86
92
  * mode: typedObjectValues(ModeNodes),
87
93
  * }) {}
94
+ *
95
+ * // Example usage of enum-based nodes, showing what type to use and that `.value` can be used to read out the enum value.
96
+ * function getValue(node: ModeNodes): Mode {
97
+ * return node.value;
98
+ * }
99
+ *
100
+ * // Example constructing a tree containing an enum node from an enum value.
101
+ * // The syntax `new ModeNodes.a()` is also supported.
102
+ * function setValue(node: Parent): void {
103
+ * node.mode = ModeNodes(Mode.a);
104
+ * }
88
105
  * ```
89
106
  * @privateRemarks
90
107
  * TODO:
91
- * Extends this to support numeric enums.
92
- * Maybe require an explicit nested scope to group them under, or at least a warning about collisions.
93
- * Maybe just provide `SchemaFactory.nested` to east creating nested scopes?
94
- * @internal
108
+ * Extend this to support numeric enums.
109
+ * Maybe provide `SchemaFactory.nested` to ease creating nested scopes?
110
+ * @see {@link enumFromStrings} for a similar function that works on arrays of strings instead of an enum.
111
+ * @alpha
95
112
  */
96
113
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
97
- export function adaptEnum<TScope extends string, const TEnum extends Record<string, string>>(
98
- factory: SchemaFactory<TScope>,
99
- members: TEnum,
100
- ) {
114
+ export function adaptEnum<
115
+ TScope extends string,
116
+ const TEnum extends Record<string, string | number>,
117
+ >(factory: SchemaFactory<TScope>, members: TEnum) {
101
118
  type Values = TEnum[keyof TEnum];
102
119
  const values = Object.values(members) as Values[];
103
120
  const inverse = new Map(Object.entries(members).map(([key, value]) => [value, key])) as Map<
@@ -116,7 +133,7 @@ export function adaptEnum<TScope extends string, const TEnum extends Record<stri
116
133
  };
117
134
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
118
135
  const factoryOut = <TValue extends Values>(value: TValue) => {
119
- return new out[inverse.get(value) ?? fail("missing enum value")]({}) as NodeFromSchema<
136
+ return new out[inverse.get(value) ?? fail("missing enum value")]() as NodeFromSchema<
120
137
  ReturnType<typeof singletonSchema<TScope, TValue>>
121
138
  >;
122
139
  };
@@ -135,7 +152,9 @@ export function adaptEnum<TScope extends string, const TEnum extends Record<stri
135
152
 
136
153
  /**
137
154
  * `Object.values`, but with more specific types.
138
- * @internal
155
+ * @remarks
156
+ * Useful with collections of schema, like those returned by {@link adaptEnum} or {@link enumFromStrings}.
157
+ * @alpha
139
158
  */
140
159
  export function typedObjectValues<TKey extends string, TValues>(
141
160
  object: Record<TKey, TValues>,
@@ -160,7 +179,8 @@ export function typedObjectValues<TKey extends string, TValues>(
160
179
  *
161
180
  * class Parent extends schemaFactory.object("Parent", { mode: typedObjectValues(Mode) }) {}
162
181
  * ```
163
- * @internal
182
+ * @see {@link adaptEnum} for a similar function that works on enums instead of arrays of strings.
183
+ * @alpha
164
184
  */
165
185
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
166
186
  export function enumFromStrings<TScope extends string, const Members extends string>(
@@ -175,7 +195,7 @@ export function enumFromStrings<TScope extends string, const Members extends str
175
195
  type TOut = Record<Members, ReturnType<typeof singletonSchema<TScope, Members>>>;
176
196
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
177
197
  const factoryOut = <TValue extends Members>(value: TValue) => {
178
- return new out[value]({}) as NodeFromSchema<
198
+ return new out[value]() as NodeFromSchema<
179
199
  ReturnType<typeof singletonSchema<TScope, TValue>>
180
200
  >;
181
201
  };
@@ -192,8 +212,7 @@ export function enumFromStrings<TScope extends string, const Members extends str
192
212
  return out;
193
213
  }
194
214
 
195
- // TODO: Why does this one generate an invalid d.ts file if exported?
196
- // Tracked by https://github.com/microsoft/TypeScript/issues/58688
215
+ // TODO: This generates an invalid d.ts file if exported due to a bug https://github.com/microsoft/TypeScript/issues/58688.
197
216
  // TODO: replace enumFromStrings above with this simpler implementation when the TypeScript bug is resolved.
198
217
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
199
218
  function _enumFromStrings2<TScope extends string, const Members extends readonly string[]>(
@@ -12,11 +12,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
12
12
  import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
13
13
 
14
14
  import type { TreeValue } from "../../core/index.js";
15
- import {
16
- type NodeKeyManager,
17
- type Unenforced,
18
- isLazy,
19
- } from "../../feature-libraries/index.js";
15
+ import type { NodeKeyManager } from "../../feature-libraries/index.js";
20
16
  import {
21
17
  type RestrictiveStringRecord,
22
18
  getOrCreate,
@@ -73,9 +69,11 @@ import type {
73
69
  TreeArrayNodeUnsafe,
74
70
  TreeMapNodeUnsafe,
75
71
  TreeObjectNodeUnsafe,
76
- } from "../typesUnsafe.js";
72
+ Unenforced,
73
+ } from "./typesUnsafe.js";
77
74
  import { createFieldSchemaUnsafe } from "./schemaFactoryRecursive.js";
78
75
  import { TreeNodeValid } from "../treeNodeValid.js";
76
+ import { isLazy } from "../flexList.js";
79
77
  /**
80
78
  * Gets the leaf domain schema compatible with a given {@link TreeValue}.
81
79
  */
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { Unenforced } from "../../feature-libraries/index.js";
7
6
  import type { RestrictiveStringRecord } from "../../util/index.js";
8
7
  import type { InsertableObjectFromSchemaRecord } from "../objectNode.js";
9
8
 
@@ -22,7 +21,7 @@ import type {
22
21
  WithType,
23
22
  TreeNode,
24
23
  } from "../core/index.js";
25
- import type { FieldSchemaUnsafe } from "../typesUnsafe.js";
24
+ import type { FieldSchemaUnsafe, Unenforced } from "./typesUnsafe.js";
26
25
 
27
26
  export function createFieldSchemaUnsafe<
28
27
  Kind extends FieldKind,
@@ -0,0 +1,126 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { ICodecOptions } from "../../codec/index.js";
7
+ import { Compatibility, type TreeStoredSchema } from "../../core/index.js";
8
+ import {
9
+ defaultSchemaPolicy,
10
+ encodeTreeSchema,
11
+ makeSchemaCodec,
12
+ } from "../../feature-libraries/index.js";
13
+ // eslint-disable-next-line import/no-internal-modules
14
+ import type { Format } from "../../feature-libraries/schema-index/index.js";
15
+ import type { JsonCompatible } from "../../util/index.js";
16
+ import type { ImplicitFieldSchema } from "../schemaTypes.js";
17
+ import { toStoredSchema } from "../toFlexSchema.js";
18
+ import type { SchemaCompatibilityStatus } from "./tree.js";
19
+ import { ViewSchema } from "./view.js";
20
+
21
+ /**
22
+ * Dumps the "persisted" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable, but unspecified format.
23
+ *
24
+ * @remarks
25
+ * 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.
26
+ *
27
+ * This format may change across major versions of this package: such changes are considered breaking.
28
+ * Beyond that, no compatibility guarantee is provided for this format: it should never be relied upon to load data, it should only be used for comparing outputs from this function.
29
+ *
30
+ * This only includes the "persisted" subset of schema information, which means the portion which gets included in documents.
31
+ * It thus uses "persisted" keys, see {@link FieldProps.key}.
32
+ *
33
+ * If two schema have identical "persisted" schema, then they are considered {@link SchemaCompatibilityStatus.isEquivalent|equivalent}.
34
+ *
35
+ * See also {@link comparePersistedSchema}.
36
+ *
37
+ * @example
38
+ * An application could use this API to generate a `schema.json` file when it first releases,
39
+ * then test that the schema is sill compatible with documents from that version with a test like :
40
+ * ```typescript
41
+ * assert.deepEqual(extractPersistedSchema(MySchema), require("./schema.json"));
42
+ * ```
43
+ *
44
+ * @privateRemarks
45
+ * 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).
46
+ * This intentionally does not leak the format types in the API.
47
+ *
48
+ * Public API surface uses "persisted" terminology while internally we use "stored".
49
+ * @alpha
50
+ */
51
+ export function extractPersistedSchema(schema: ImplicitFieldSchema): JsonCompatible {
52
+ const stored = toStoredSchema(schema);
53
+ return encodeTreeSchema(stored);
54
+ }
55
+
56
+ /**
57
+ * Compares two schema extracted using {@link extractPersistedSchema}.
58
+ * Reports the same compatibility that {@link TreeView.compatibility} would report if
59
+ * opening a document that used the `persisted` schema and provided `view` to {@link ViewableTree.viewWith}.
60
+ *
61
+ * @param persisted - Schema persisted for a document. Typically persisted alongside the data and assumed to describe that data.
62
+ * @param view - Schema which would be used to view persisted content. Use {@link extractPersistedSchema} to convert the view schema into this format.
63
+ * @param options - {@link ICodecOptions} used when parsing the provided schema.
64
+ * @param canInitialize - Passed through to the return value unchanged and otherwise unused.
65
+ * @returns The {@link SchemaCompatibilityStatus} a {@link TreeView} would report for this combination of schema.
66
+ *
67
+ * @remarks
68
+ * This uses the persisted formats for schema, meaning it only includes data which impacts compatibility.
69
+ * 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.
70
+ *
71
+ * @example
72
+ * An application could use {@link extractPersistedSchema} to generate a `schema.json` file for various versions of the app,
73
+ * then test that documents using those schema can be upgraded to work with the current schema using a test like:
74
+ * ```typescript
75
+ * assert(
76
+ * comparePersistedSchema(
77
+ * require("./schema.json"),
78
+ * extractPersistedSchema(MySchema),
79
+ * { jsonValidator: typeboxValidator },
80
+ * false,
81
+ * ).canUpgrade,
82
+ * );
83
+ * ```
84
+ * @alpha
85
+ */
86
+ export function comparePersistedSchema(
87
+ persisted: JsonCompatible,
88
+ view: JsonCompatible,
89
+ options: ICodecOptions,
90
+ canInitialize: boolean,
91
+ ): SchemaCompatibilityStatus {
92
+ const schemaCodec = makeSchemaCodec(options);
93
+ const stored = schemaCodec.decode(persisted as Format);
94
+ const viewParsed = schemaCodec.decode(view as Format);
95
+ const viewSchema = new ViewSchema(defaultSchemaPolicy, {}, viewParsed);
96
+ return comparePersistedSchemaInternal(stored, viewSchema, canInitialize);
97
+ }
98
+
99
+ /**
100
+ * Compute compatibility for viewing a document with `stored` schema using `viewSchema`.
101
+ * `canInitialize` is passed through to the return value unchanged and otherwise unused.
102
+ */
103
+ export function comparePersistedSchemaInternal(
104
+ stored: TreeStoredSchema,
105
+ viewSchema: ViewSchema,
106
+ canInitialize: boolean,
107
+ ): SchemaCompatibilityStatus {
108
+ const result = viewSchema.checkCompatibility(stored);
109
+
110
+ // TODO: AB#8121: Weaken this check to support viewing under additional circumstances.
111
+ // In the near term, this should support viewing documents with additional optional fields in their schema on object types.
112
+ // Longer-term (as demand arises), we could also add APIs to constructing view schema to allow for more flexibility
113
+ // (e.g. out-of-schema content handlers could allow support for viewing docs which have extra allowed types in a particular field)
114
+ const canView =
115
+ result.write === Compatibility.Compatible && result.read === Compatibility.Compatible;
116
+ const canUpgrade = result.read === Compatibility.Compatible;
117
+ const isEquivalent = canView && canUpgrade;
118
+ const compatibility: SchemaCompatibilityStatus = {
119
+ canView,
120
+ canUpgrade,
121
+ isEquivalent,
122
+ canInitialize,
123
+ };
124
+
125
+ return compatibility;
126
+ }
@@ -11,11 +11,14 @@ import type { Listenable } from "../../events/index.js";
11
11
 
12
12
  import {
13
13
  type ImplicitFieldSchema,
14
+ type InsertableField,
14
15
  type InsertableTreeFieldFromImplicitField,
15
16
  type TreeFieldFromImplicitField,
17
+ type TreeLeafValue,
18
+ type UnsafeUnknownSchema,
16
19
  FieldKind,
17
20
  } from "../schemaTypes.js";
18
- import { NodeKind, type TreeNodeSchema } from "../core/index.js";
21
+ import { NodeKind, type TreeNode, type TreeNodeSchema } from "../core/index.js";
19
22
  import { toStoredSchema } from "../toFlexSchema.js";
20
23
  import { LeafNodeSchema } from "../leafNodeSchema.js";
21
24
  import { assert } from "@fluidframework/core-utils/internal";
@@ -363,7 +366,7 @@ export function checkUnion(union: Iterable<TreeNodeSchema>, errors: string[]): v
363
366
  * Thus this design was chosen at the risk of apps blindly accessing `root` then breaking unexpectedly when the document is incompatible.
364
367
  * @sealed @public
365
368
  */
366
- export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposable {
369
+ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends IDisposable {
367
370
  /**
368
371
  * The current root of the tree.
369
372
  *
@@ -424,6 +427,25 @@ export interface TreeView<TSchema extends ImplicitFieldSchema> extends IDisposab
424
427
  readonly schema: TSchema;
425
428
  }
426
429
 
430
+ /**
431
+ * {@link TreeView} with proposed changes to the schema aware typing to allow use with `UnsafeUnknownSchema`.
432
+ * @alpha
433
+ */
434
+ export interface TreeViewAlpha<
435
+ in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,
436
+ > extends Omit<
437
+ TreeView<TSchema extends ImplicitFieldSchema ? TSchema : ImplicitFieldSchema>,
438
+ "root" | "initialize"
439
+ > {
440
+ get root(): TSchema extends ImplicitFieldSchema
441
+ ? TreeFieldFromImplicitField<TSchema>
442
+ : TreeLeafValue | TreeNode;
443
+
444
+ set root(newRoot: InsertableField<TSchema>);
445
+
446
+ initialize(content: InsertableField<TSchema>): void;
447
+ }
448
+
427
449
  /**
428
450
  * Information about a view schema's compatibility with the document's stored schema.
429
451
  *
@@ -6,15 +6,8 @@
6
6
  import { assert, oob } from "@fluidframework/core-utils/internal";
7
7
 
8
8
  import { EmptyKey, rootFieldKey } from "../../core/index.js";
9
- import {
10
- type LazyItem,
11
- type TreeStatus,
12
- isLazy,
13
- isTreeValue,
14
- FieldKinds,
15
- } from "../../feature-libraries/index.js";
9
+ import { type TreeStatus, isTreeValue, FieldKinds } from "../../feature-libraries/index.js";
16
10
  import { fail, extractFromOpaque, isReadonlyArray } from "../../util/index.js";
17
- import { getOrCreateInnerNode } from "../proxyBinding.js";
18
11
  import {
19
12
  type TreeLeafValue,
20
13
  type ImplicitFieldSchema,
@@ -43,8 +36,10 @@ import {
43
36
  getOrCreateNodeFromInnerNode,
44
37
  UnhydratedFlexTreeNode,
45
38
  typeSchemaSymbol,
39
+ getOrCreateInnerNode,
46
40
  } from "../core/index.js";
47
41
  import { isObjectNodeSchema } from "../objectNodeTypes.js";
42
+ import { isLazy, type LazyItem } from "../flexList.js";
48
43
 
49
44
  /**
50
45
  * Provides various functions for analyzing {@link TreeNode}s.