@fluidframework/tree 2.63.0-359461 → 2.63.0-359962

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 (510) hide show
  1. package/.mocharc.cjs +9 -1
  2. package/api-report/tree.alpha.api.md +126 -96
  3. package/api-report/tree.beta.api.md +37 -2
  4. package/api-report/tree.legacy.beta.api.md +37 -2
  5. package/api-report/tree.legacy.public.api.md +9 -2
  6. package/api-report/tree.public.api.md +9 -2
  7. package/dist/alpha.d.ts +18 -13
  8. package/dist/beta.d.ts +5 -0
  9. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +67 -13
  10. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  11. package/dist/feature-libraries/chunked-forest/chunkTree.js +70 -35
  12. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  13. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
  14. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  15. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  16. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +23 -0
  17. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -0
  18. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js +15 -0
  19. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -0
  20. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -0
  21. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  22. package/dist/feature-libraries/chunked-forest/codec/index.js +3 -1
  23. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  24. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  25. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +3 -2
  26. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  27. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  28. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  29. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  30. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  31. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -1
  32. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  33. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  34. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  35. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  36. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -3
  37. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  38. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -11
  39. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  40. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -6
  41. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  42. package/dist/feature-libraries/index.d.ts +1 -1
  43. package/dist/feature-libraries/index.d.ts.map +1 -1
  44. package/dist/feature-libraries/index.js +2 -1
  45. package/dist/feature-libraries/index.js.map +1 -1
  46. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  47. package/dist/feature-libraries/treeCursorUtils.js +17 -15
  48. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/jsonDomainSchema.d.ts +5 -5
  53. package/dist/jsonDomainSchema.js +5 -5
  54. package/dist/jsonDomainSchema.js.map +1 -1
  55. package/dist/legacy.d.ts +5 -0
  56. package/dist/packageVersion.d.ts +1 -1
  57. package/dist/packageVersion.js +1 -1
  58. package/dist/packageVersion.js.map +1 -1
  59. package/dist/public.d.ts +1 -0
  60. package/dist/serializableDomainSchema.d.ts +6 -6
  61. package/dist/serializableDomainSchema.js +5 -5
  62. package/dist/serializableDomainSchema.js.map +1 -1
  63. package/dist/shared-tree/independentView.d.ts.map +1 -1
  64. package/dist/shared-tree/independentView.js +2 -2
  65. package/dist/shared-tree/independentView.js.map +1 -1
  66. package/dist/shared-tree/schematizingTreeView.d.ts +5 -0
  67. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  68. package/dist/shared-tree/schematizingTreeView.js +38 -8
  69. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  70. package/dist/shared-tree/sharedTree.d.ts +6 -8
  71. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  72. package/dist/shared-tree/sharedTree.js +6 -8
  73. package/dist/shared-tree/sharedTree.js.map +1 -1
  74. package/dist/shared-tree/tree.js +1 -1
  75. package/dist/shared-tree/tree.js.map +1 -1
  76. package/dist/shared-tree/treeAlpha.d.ts +20 -28
  77. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  78. package/dist/shared-tree/treeAlpha.js +6 -31
  79. package/dist/shared-tree/treeAlpha.js.map +1 -1
  80. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  81. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  82. package/dist/simple-tree/api/configuration.d.ts +0 -3
  83. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  84. package/dist/simple-tree/api/configuration.js +1 -4
  85. package/dist/simple-tree/api/configuration.js.map +1 -1
  86. package/dist/simple-tree/api/customTree.d.ts +7 -7
  87. package/dist/simple-tree/api/customTree.js +5 -5
  88. package/dist/simple-tree/api/customTree.js.map +1 -1
  89. package/dist/simple-tree/api/discrepancies.js +2 -2
  90. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  91. package/dist/simple-tree/api/index.d.ts +3 -3
  92. package/dist/simple-tree/api/index.d.ts.map +1 -1
  93. package/dist/simple-tree/api/index.js +4 -1
  94. package/dist/simple-tree/api/index.js.map +1 -1
  95. package/dist/simple-tree/api/schemaFactory.d.ts +12 -4
  96. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  97. package/dist/simple-tree/api/schemaFactory.js +3 -8
  98. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  99. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +64 -28
  100. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  101. package/dist/simple-tree/api/schemaFactoryAlpha.js +42 -11
  102. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  103. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +13 -2
  104. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  105. package/dist/simple-tree/api/schemaFactoryBeta.js +14 -0
  106. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  107. package/dist/simple-tree/api/schemaStatics.d.ts +9 -14
  108. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  109. package/dist/simple-tree/api/schemaStatics.js +12 -12
  110. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  111. package/dist/simple-tree/api/storedSchema.d.ts +2 -2
  112. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  113. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  114. package/dist/simple-tree/api/tree.d.ts +3 -3
  115. package/dist/simple-tree/api/tree.js.map +1 -1
  116. package/dist/simple-tree/api/treeBeta.d.ts +52 -2
  117. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  118. package/dist/simple-tree/api/treeBeta.js +37 -2
  119. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  120. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  121. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  122. package/dist/simple-tree/api/typesUnsafe.d.ts +60 -1
  123. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  124. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  125. package/dist/simple-tree/core/allowedTypes.d.ts +120 -62
  126. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  127. package/dist/simple-tree/core/allowedTypes.js +162 -84
  128. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  129. package/dist/simple-tree/core/context.d.ts +2 -2
  130. package/dist/simple-tree/core/context.d.ts.map +1 -1
  131. package/dist/simple-tree/core/context.js.map +1 -1
  132. package/dist/simple-tree/core/index.d.ts +3 -3
  133. package/dist/simple-tree/core/index.d.ts.map +1 -1
  134. package/dist/simple-tree/core/index.js +5 -4
  135. package/dist/simple-tree/core/index.js.map +1 -1
  136. package/dist/simple-tree/core/toStored.d.ts +3 -3
  137. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  138. package/dist/simple-tree/core/toStored.js +2 -2
  139. package/dist/simple-tree/core/toStored.js.map +1 -1
  140. package/dist/simple-tree/core/treeNode.d.ts +1 -1
  141. package/dist/simple-tree/core/treeNode.js +1 -1
  142. package/dist/simple-tree/core/treeNode.js.map +1 -1
  143. package/dist/simple-tree/core/treeNodeKernel.d.ts +7 -11
  144. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  145. package/dist/simple-tree/core/treeNodeKernel.js +24 -47
  146. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  147. package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -3
  148. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  149. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  150. package/dist/simple-tree/core/treeNodeValid.d.ts +2 -2
  151. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  152. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  153. package/dist/simple-tree/core/walkSchema.d.ts +3 -3
  154. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  155. package/dist/simple-tree/core/walkSchema.js +1 -1
  156. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  157. package/dist/simple-tree/createContext.js +2 -2
  158. package/dist/simple-tree/createContext.js.map +1 -1
  159. package/dist/simple-tree/fieldSchema.d.ts +9 -32
  160. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  161. package/dist/simple-tree/fieldSchema.js +12 -20
  162. package/dist/simple-tree/fieldSchema.js.map +1 -1
  163. package/dist/simple-tree/getTreeNodeForField.js +1 -1
  164. package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
  165. package/dist/simple-tree/index.d.ts +4 -4
  166. package/dist/simple-tree/index.d.ts.map +1 -1
  167. package/dist/simple-tree/index.js +7 -3
  168. package/dist/simple-tree/index.js.map +1 -1
  169. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +2 -2
  170. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  171. package/dist/simple-tree/node-kinds/array/arrayNode.js +7 -8
  172. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  173. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  174. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  175. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  176. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  177. package/dist/simple-tree/node-kinds/common.js +2 -2
  178. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  179. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  180. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  181. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  182. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  183. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  184. package/dist/simple-tree/node-kinds/map/mapNode.js +5 -5
  185. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  186. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  187. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  188. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  189. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  190. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  191. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  192. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +5 -18
  193. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  194. package/dist/simple-tree/node-kinds/object/objectNode.js +8 -18
  195. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  196. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +4 -11
  197. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  198. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  199. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +3 -3
  200. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  201. package/dist/simple-tree/node-kinds/record/recordNode.js +9 -9
  202. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  203. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +5 -5
  204. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  205. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  206. package/dist/simple-tree/prepareForInsertion.d.ts +39 -7
  207. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  208. package/dist/simple-tree/prepareForInsertion.js +43 -15
  209. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  210. package/dist/simple-tree/toStoredSchema.d.ts +8 -8
  211. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  212. package/dist/simple-tree/toStoredSchema.js +5 -5
  213. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  214. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  215. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  216. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  217. package/dist/simple-tree/unsafeUnknownSchema.d.ts.map +1 -1
  218. package/dist/simple-tree/unsafeUnknownSchema.js.map +1 -1
  219. package/dist/simple-tree/walkFieldSchema.js +1 -1
  220. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  221. package/dist/tableSchema.d.ts +19 -19
  222. package/dist/tableSchema.d.ts.map +1 -1
  223. package/dist/tableSchema.js +2 -2
  224. package/dist/tableSchema.js.map +1 -1
  225. package/lib/alpha.d.ts +18 -13
  226. package/lib/beta.d.ts +5 -0
  227. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +67 -13
  228. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  229. package/lib/feature-libraries/chunked-forest/chunkTree.js +68 -32
  230. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  231. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +5 -5
  232. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  233. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  234. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +23 -0
  235. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -0
  236. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js +11 -0
  237. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -0
  238. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -0
  239. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  240. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -0
  241. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  242. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  243. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +3 -2
  244. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  245. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  246. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  247. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  248. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  249. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -1
  250. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  251. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  252. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -3
  253. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  254. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -3
  255. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  256. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -11
  257. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  258. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -6
  259. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  260. package/lib/feature-libraries/index.d.ts +1 -1
  261. package/lib/feature-libraries/index.d.ts.map +1 -1
  262. package/lib/feature-libraries/index.js +1 -1
  263. package/lib/feature-libraries/index.js.map +1 -1
  264. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  265. package/lib/feature-libraries/treeCursorUtils.js +17 -15
  266. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  267. package/lib/index.d.ts +1 -1
  268. package/lib/index.d.ts.map +1 -1
  269. package/lib/index.js.map +1 -1
  270. package/lib/jsonDomainSchema.d.ts +5 -5
  271. package/lib/jsonDomainSchema.js +5 -5
  272. package/lib/jsonDomainSchema.js.map +1 -1
  273. package/lib/legacy.d.ts +5 -0
  274. package/lib/packageVersion.d.ts +1 -1
  275. package/lib/packageVersion.js +1 -1
  276. package/lib/packageVersion.js.map +1 -1
  277. package/lib/public.d.ts +1 -0
  278. package/lib/serializableDomainSchema.d.ts +6 -6
  279. package/lib/serializableDomainSchema.js +5 -5
  280. package/lib/serializableDomainSchema.js.map +1 -1
  281. package/lib/shared-tree/independentView.d.ts.map +1 -1
  282. package/lib/shared-tree/independentView.js +3 -3
  283. package/lib/shared-tree/independentView.js.map +1 -1
  284. package/lib/shared-tree/schematizingTreeView.d.ts +5 -0
  285. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  286. package/lib/shared-tree/schematizingTreeView.js +41 -11
  287. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  288. package/lib/shared-tree/sharedTree.d.ts +6 -8
  289. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  290. package/lib/shared-tree/sharedTree.js +7 -9
  291. package/lib/shared-tree/sharedTree.js.map +1 -1
  292. package/lib/shared-tree/tree.js +2 -2
  293. package/lib/shared-tree/tree.js.map +1 -1
  294. package/lib/shared-tree/treeAlpha.d.ts +20 -28
  295. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  296. package/lib/shared-tree/treeAlpha.js +5 -30
  297. package/lib/shared-tree/treeAlpha.js.map +1 -1
  298. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  299. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  300. package/lib/simple-tree/api/configuration.d.ts +0 -3
  301. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  302. package/lib/simple-tree/api/configuration.js +2 -5
  303. package/lib/simple-tree/api/configuration.js.map +1 -1
  304. package/lib/simple-tree/api/customTree.d.ts +7 -7
  305. package/lib/simple-tree/api/customTree.js +5 -5
  306. package/lib/simple-tree/api/customTree.js.map +1 -1
  307. package/lib/simple-tree/api/discrepancies.js +3 -3
  308. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  309. package/lib/simple-tree/api/index.d.ts +3 -3
  310. package/lib/simple-tree/api/index.d.ts.map +1 -1
  311. package/lib/simple-tree/api/index.js +1 -1
  312. package/lib/simple-tree/api/index.js.map +1 -1
  313. package/lib/simple-tree/api/schemaFactory.d.ts +12 -4
  314. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  315. package/lib/simple-tree/api/schemaFactory.js +3 -8
  316. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  317. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +64 -28
  318. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  319. package/lib/simple-tree/api/schemaFactoryAlpha.js +43 -12
  320. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  321. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +13 -2
  322. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  323. package/lib/simple-tree/api/schemaFactoryBeta.js +16 -2
  324. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  325. package/lib/simple-tree/api/schemaStatics.d.ts +9 -14
  326. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  327. package/lib/simple-tree/api/schemaStatics.js +12 -12
  328. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  329. package/lib/simple-tree/api/storedSchema.d.ts +2 -2
  330. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  331. package/lib/simple-tree/api/storedSchema.js +1 -1
  332. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  333. package/lib/simple-tree/api/tree.d.ts +3 -3
  334. package/lib/simple-tree/api/tree.js.map +1 -1
  335. package/lib/simple-tree/api/treeBeta.d.ts +52 -2
  336. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  337. package/lib/simple-tree/api/treeBeta.js +34 -2
  338. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  339. package/lib/simple-tree/api/treeNodeApi.js +5 -5
  340. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  341. package/lib/simple-tree/api/typesUnsafe.d.ts +60 -1
  342. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  343. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  344. package/lib/simple-tree/core/allowedTypes.d.ts +120 -62
  345. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  346. package/lib/simple-tree/core/allowedTypes.js +158 -80
  347. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  348. package/lib/simple-tree/core/context.d.ts +2 -2
  349. package/lib/simple-tree/core/context.d.ts.map +1 -1
  350. package/lib/simple-tree/core/context.js.map +1 -1
  351. package/lib/simple-tree/core/index.d.ts +3 -3
  352. package/lib/simple-tree/core/index.d.ts.map +1 -1
  353. package/lib/simple-tree/core/index.js +2 -2
  354. package/lib/simple-tree/core/index.js.map +1 -1
  355. package/lib/simple-tree/core/toStored.d.ts +3 -3
  356. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  357. package/lib/simple-tree/core/toStored.js +3 -3
  358. package/lib/simple-tree/core/toStored.js.map +1 -1
  359. package/lib/simple-tree/core/treeNode.d.ts +1 -1
  360. package/lib/simple-tree/core/treeNode.js +1 -1
  361. package/lib/simple-tree/core/treeNode.js.map +1 -1
  362. package/lib/simple-tree/core/treeNodeKernel.d.ts +7 -11
  363. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  364. package/lib/simple-tree/core/treeNodeKernel.js +23 -46
  365. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  366. package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -3
  367. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  368. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  369. package/lib/simple-tree/core/treeNodeValid.d.ts +2 -2
  370. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  371. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  372. package/lib/simple-tree/core/walkSchema.d.ts +3 -3
  373. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  374. package/lib/simple-tree/core/walkSchema.js +2 -2
  375. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  376. package/lib/simple-tree/createContext.js +3 -3
  377. package/lib/simple-tree/createContext.js.map +1 -1
  378. package/lib/simple-tree/fieldSchema.d.ts +9 -32
  379. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  380. package/lib/simple-tree/fieldSchema.js +13 -21
  381. package/lib/simple-tree/fieldSchema.js.map +1 -1
  382. package/lib/simple-tree/getTreeNodeForField.js +1 -1
  383. package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
  384. package/lib/simple-tree/index.d.ts +4 -4
  385. package/lib/simple-tree/index.d.ts.map +1 -1
  386. package/lib/simple-tree/index.js +2 -2
  387. package/lib/simple-tree/index.js.map +1 -1
  388. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +2 -2
  389. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  390. package/lib/simple-tree/node-kinds/array/arrayNode.js +8 -9
  391. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  392. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
  393. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  394. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  395. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  396. package/lib/simple-tree/node-kinds/common.js +3 -3
  397. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  398. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  399. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  400. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  401. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  402. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  403. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -6
  404. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  405. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
  406. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  407. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  408. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  409. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  410. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  411. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +5 -18
  412. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  413. package/lib/simple-tree/node-kinds/object/objectNode.js +9 -18
  414. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  415. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +4 -11
  416. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  417. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  418. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +3 -3
  419. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  420. package/lib/simple-tree/node-kinds/record/recordNode.js +10 -10
  421. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  422. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +5 -5
  423. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  424. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  425. package/lib/simple-tree/prepareForInsertion.d.ts +39 -7
  426. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  427. package/lib/simple-tree/prepareForInsertion.js +45 -17
  428. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  429. package/lib/simple-tree/toStoredSchema.d.ts +8 -8
  430. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  431. package/lib/simple-tree/toStoredSchema.js +5 -5
  432. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  433. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  434. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  435. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
  436. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  437. package/lib/simple-tree/unsafeUnknownSchema.d.ts.map +1 -1
  438. package/lib/simple-tree/unsafeUnknownSchema.js.map +1 -1
  439. package/lib/simple-tree/walkFieldSchema.js +1 -1
  440. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  441. package/lib/tableSchema.d.ts +19 -19
  442. package/lib/tableSchema.d.ts.map +1 -1
  443. package/lib/tableSchema.js +2 -2
  444. package/lib/tableSchema.js.map +1 -1
  445. package/package.json +23 -21
  446. package/src/feature-libraries/chunked-forest/chunkTree.ts +112 -45
  447. package/src/feature-libraries/chunked-forest/codec/codecs.ts +4 -9
  448. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +33 -0
  449. package/src/feature-libraries/chunked-forest/codec/index.ts +4 -0
  450. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +4 -7
  451. package/src/feature-libraries/chunked-forest/index.ts +2 -0
  452. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +1 -1
  453. package/src/feature-libraries/forest-summary/forestSummarizer.ts +8 -12
  454. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +3 -12
  455. package/src/feature-libraries/index.ts +2 -0
  456. package/src/feature-libraries/treeCursorUtils.ts +34 -19
  457. package/src/index.ts +14 -10
  458. package/src/jsonDomainSchema.ts +5 -5
  459. package/src/packageVersion.ts +1 -1
  460. package/src/serializableDomainSchema.ts +6 -6
  461. package/src/shared-tree/independentView.ts +3 -0
  462. package/src/shared-tree/schematizingTreeView.ts +58 -9
  463. package/src/shared-tree/sharedTree.ts +33 -20
  464. package/src/shared-tree/tree.ts +2 -2
  465. package/src/shared-tree/treeAlpha.ts +35 -84
  466. package/src/simple-tree/api/conciseTree.ts +1 -1
  467. package/src/simple-tree/api/configuration.ts +3 -7
  468. package/src/simple-tree/api/customTree.ts +7 -7
  469. package/src/simple-tree/api/discrepancies.ts +3 -3
  470. package/src/simple-tree/api/index.ts +17 -2
  471. package/src/simple-tree/api/schemaFactory.ts +18 -73
  472. package/src/simple-tree/api/schemaFactoryAlpha.ts +118 -25
  473. package/src/simple-tree/api/schemaFactoryBeta.ts +76 -1
  474. package/src/simple-tree/api/schemaStatics.ts +19 -61
  475. package/src/simple-tree/api/storedSchema.ts +2 -6
  476. package/src/simple-tree/api/tree.ts +3 -3
  477. package/src/simple-tree/api/treeBeta.ts +137 -4
  478. package/src/simple-tree/api/treeNodeApi.ts +5 -5
  479. package/src/simple-tree/api/typesUnsafe.ts +81 -0
  480. package/src/simple-tree/core/TreeNodeBinding.md +14 -70
  481. package/src/simple-tree/core/allowedTypes.ts +355 -159
  482. package/src/simple-tree/core/context.ts +2 -2
  483. package/src/simple-tree/core/index.ts +11 -9
  484. package/src/simple-tree/core/toStored.ts +7 -5
  485. package/src/simple-tree/core/treeNode.ts +1 -1
  486. package/src/simple-tree/core/treeNodeKernel.ts +25 -59
  487. package/src/simple-tree/core/treeNodeSchema.ts +3 -6
  488. package/src/simple-tree/core/treeNodeValid.ts +2 -2
  489. package/src/simple-tree/core/walkSchema.ts +9 -5
  490. package/src/simple-tree/createContext.ts +3 -3
  491. package/src/simple-tree/fieldSchema.ts +24 -98
  492. package/src/simple-tree/getTreeNodeForField.ts +1 -1
  493. package/src/simple-tree/index.ts +19 -11
  494. package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -17
  495. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +7 -8
  496. package/src/simple-tree/node-kinds/common.ts +5 -3
  497. package/src/simple-tree/node-kinds/index.ts +0 -2
  498. package/src/simple-tree/node-kinds/map/mapNode.ts +8 -16
  499. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +7 -8
  500. package/src/simple-tree/node-kinds/object/index.ts +0 -2
  501. package/src/simple-tree/node-kinds/object/objectNode.ts +17 -55
  502. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +5 -19
  503. package/src/simple-tree/node-kinds/record/recordNode.ts +16 -23
  504. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +7 -11
  505. package/src/simple-tree/prepareForInsertion.ts +92 -30
  506. package/src/simple-tree/toStoredSchema.ts +8 -9
  507. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -6
  508. package/src/simple-tree/unsafeUnknownSchema.ts +2 -3
  509. package/src/simple-tree/walkFieldSchema.ts +1 -1
  510. package/src/tableSchema.ts +24 -37
package/src/index.ts CHANGED
@@ -94,7 +94,8 @@ export {
94
94
  SchemaFactory,
95
95
  SchemaFactoryBeta,
96
96
  SchemaFactoryAlpha,
97
- type SchemaFactoryObjectOptions,
97
+ type ObjectSchemaOptionsAlpha,
98
+ type ObjectSchemaOptions,
98
99
  type ImplicitFieldSchema,
99
100
  type TreeFieldFromImplicitField,
100
101
  type TreeChangeEvents,
@@ -136,6 +137,13 @@ export {
136
137
  type ArrayNodeCustomizableSchemaUnsafe,
137
138
  type MapNodeCustomizableSchemaUnsafe,
138
139
  type TreeRecordNodeUnsafe,
140
+ type UnannotateAllowedTypeUnsafe,
141
+ type AnnotatedAllowedTypeUnsafe,
142
+ type AnnotatedAllowedTypesUnsafe,
143
+ type AllowedTypesFullUnsafe,
144
+ type AllowedTypesFullFromMixedUnsafe,
145
+ type UnannotateAllowedTypesListUnsafe,
146
+ type AnnotateAllowedTypesListUnsafe,
139
147
  // System types (not in Internal types for various reasons, like doc links or cannot be named errors).
140
148
  type typeSchemaSymbol,
141
149
  type TreeNodeSchemaNonClass,
@@ -163,21 +171,16 @@ export {
163
171
  type FactoryContentObject,
164
172
  type ReadableField,
165
173
  type ReadSchema,
166
- type ImplicitAnnotatedAllowedTypes,
167
- type ImplicitAnnotatedFieldSchema,
168
174
  type AnnotatedAllowedType,
169
175
  type AnnotatedAllowedTypes,
170
- type NormalizedAnnotatedAllowedTypes,
176
+ type AllowedTypesFullEvaluated,
171
177
  type AllowedTypeMetadata,
172
178
  type AllowedTypesMetadata,
173
- type InsertableObjectFromAnnotatedSchemaRecord,
174
- type UnannotateImplicitAllowedTypes,
175
- type UnannotateAllowedTypes,
176
- type UnannotateAllowedType,
177
179
  type UnannotateAllowedTypesList,
178
- type UnannotateImplicitFieldSchema,
179
- type UnannotateSchemaRecord,
180
180
  type SchemaStaticsAlpha,
181
+ type AnnotateAllowedTypesList,
182
+ type AllowedTypesFull,
183
+ type AllowedTypesFullFromMixed,
181
184
  // Beta APIs
182
185
  TreeBeta,
183
186
  type TreeChangeEventsBeta,
@@ -273,6 +276,7 @@ export {
273
276
  KeyEncodingOptions,
274
277
  type TreeParsingOptions,
275
278
  type SchemaFactory_base,
279
+ type NumberKeys,
276
280
  } from "./simple-tree/index.js";
277
281
  export {
278
282
  SharedTree,
@@ -37,7 +37,7 @@ const sf = new SchemaFactoryAlpha("com.fluidframework.json");
37
37
  *
38
38
  * 2. The order of fields on an object is not preserved. The resulting order is arbitrary.
39
39
  *
40
- * JSON data can be imported from JSON into this format using `JSON.parse` then {@link (TreeAlpha:interface).importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.
40
+ * JSON data can be imported from JSON into this format using `JSON.parse` then {@link (TreeBeta:interface).importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.
41
41
  *
42
42
  * @alpha
43
43
  */
@@ -63,7 +63,7 @@ export namespace JsonAsTree {
63
63
  * {@link AllowedTypes} for any content allowed in the {@link JsonAsTree} domain.
64
64
  * @example
65
65
  * ```typescript
66
- * const tree = TreeAlpha.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });
66
+ * const tree = TreeBeta.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });
67
67
  * ```
68
68
  * @privateRemarks
69
69
  * The order here should not matter for any functionality related reasons.
@@ -95,7 +95,7 @@ export namespace JsonAsTree {
95
95
  * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
96
96
  * const fromArray = new JsonAsTreeObject([["a", 0]]);
97
97
  * // Using `importConcise` can work better for JSON data:
98
- * const imported = TreeAlpha.importConcise(JsonAsTree.Object, { a: 0 });
98
+ * const imported = TreeBeta.importConcise(JsonAsTree.Object, { a: 0 });
99
99
  * // Node API is like a Map:
100
100
  * const value = imported.get("a");
101
101
  * ```
@@ -128,13 +128,13 @@ export namespace JsonAsTree {
128
128
  /**
129
129
  * Arbitrary JSON array as a {@link TreeNode}.
130
130
  * @remarks
131
- * This can be imported using {@link (TreeAlpha:interface).importConcise}.
131
+ * This can be imported using {@link (TreeBeta:interface).importConcise}.
132
132
  * @example
133
133
  * ```typescript
134
134
  * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
135
135
  * const usingConstructor = new JsonAsTree.Array(["a", 0, new JsonAsTree.Array([1])]);
136
136
  * // Using `importConcise` can work better for JSON data:
137
- * const imported = TreeAlpha.importConcise(JsonAsTree.Array, ["a", 0, [1]]);
137
+ * const imported = TreeBeta.importConcise(JsonAsTree.Array, ["a", 0, [1]]);
138
138
  * // Node API is like an Array:
139
139
  * const inner: JsonAsTree.Tree = imported[2];
140
140
  * assert(Tree.is(inner, JsonAsTree.Array));
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.63.0-359461";
9
+ export const pkgVersion = "2.63.0-359962";
@@ -23,14 +23,14 @@ const sf = new SchemaFactoryAlpha("com.fluidframework.serializable");
23
23
  * @remarks
24
24
  * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
25
25
  *
26
- * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeAlpha:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
26
+ * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeBeta:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
27
27
  * @alpha
28
28
  */
29
29
  export namespace FluidSerializableAsTree {
30
30
  /**
31
31
  * Data which can be serialized by Fluid.
32
32
  * @remarks
33
- * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeAlpha:interface).importConcise}.
33
+ * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeBeta:interface).importConcise}.
34
34
  * @alpha
35
35
  */
36
36
  export type Data = JsonCompatible<IFluidHandle>;
@@ -39,7 +39,7 @@ export namespace FluidSerializableAsTree {
39
39
  * {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.
40
40
  * @example
41
41
  * ```typescript
42
- * const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
42
+ * const tree = TreeBeta.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
43
43
  * ```
44
44
  * @alpha
45
45
  */
@@ -69,7 +69,7 @@ export namespace FluidSerializableAsTree {
69
69
  * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
70
70
  * const fromArray = new JsonAsTreeObject([["a", 0]]);
71
71
  * // Using `importConcise` can work better for Fluid Serializable data:
72
- * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Object, { a: 0 });
72
+ * const imported = TreeBeta.importConcise(FluidSerializableAsTree.Object, { a: 0 });
73
73
  * // Node API is like a Map:
74
74
  * const value = imported.get("a");
75
75
  * ```
@@ -102,13 +102,13 @@ export namespace FluidSerializableAsTree {
102
102
  /**
103
103
  * Arbitrary Fluid Serializable array as a {@link TreeNode}.
104
104
  * @remarks
105
- * This can be imported using {@link (TreeAlpha:interface).importConcise}.
105
+ * This can be imported using {@link (TreeBeta:interface).importConcise}.
106
106
  * @example
107
107
  * ```typescript
108
108
  * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
109
109
  * const usingConstructor = new FluidSerializableAsTree.Array(["a", 0, new FluidSerializableAsTree.Array([1])]);
110
110
  * // Using `importConcise` can work better for Fluid Serializable data:
111
- * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Array, ["a", 0, [1]]);
111
+ * const imported = TreeBeta.importConcise(FluidSerializableAsTree.Array, ["a", 0, [1]]);
112
112
  * // Node API is like an Array:
113
113
  * const inner: FluidSerializableAsTree.Tree = imported[2];
114
114
  * assert(Tree.is(inner, FluidSerializableAsTree.Array));
@@ -26,6 +26,7 @@ import {
26
26
  type FieldBatchEncodingContext,
27
27
  defaultSchemaPolicy,
28
28
  TreeCompressionStrategy,
29
+ defaultIncrementalEncodingPolicy,
29
30
  } from "../feature-libraries/index.js";
30
31
  // eslint-disable-next-line import/no-internal-modules
31
32
  import type { Format } from "../feature-libraries/schema-index/formatV1.js";
@@ -67,6 +68,7 @@ export function independentView<const TSchema extends ImplicitFieldSchema>(
67
68
  options.forest ?? defaultSharedTreeOptions.forest,
68
69
  schema,
69
70
  idCompressor,
71
+ defaultIncrementalEncodingPolicy,
70
72
  );
71
73
  const checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {
72
74
  forest,
@@ -144,6 +146,7 @@ export function independentInitializedViewInternal<const TSchema extends Implici
144
146
  options.forest ?? defaultSharedTreeOptions.forest,
145
147
  schemaRepository,
146
148
  idCompressor,
149
+ defaultIncrementalEncodingPolicy,
147
150
  );
148
151
 
149
152
  const checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {
@@ -12,13 +12,17 @@ import type {
12
12
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
13
13
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
14
14
 
15
- import { anchorSlot } from "../core/index.js";
15
+ import { anchorSlot, rootFieldKey } from "../core/index.js";
16
16
  import {
17
17
  type NodeIdentifierManager,
18
18
  defaultSchemaPolicy,
19
19
  cursorForMapTreeField,
20
20
  TreeStatus,
21
21
  Context,
22
+ type FlexTreeOptionalField,
23
+ type FlexTreeUnknownUnboxed,
24
+ FieldKinds,
25
+ type FlexTreeRequiredField,
22
26
  } from "../feature-libraries/index.js";
23
27
  import {
24
28
  type ImplicitFieldSchema,
@@ -38,7 +42,7 @@ import {
38
42
  type UnsafeUnknownSchema,
39
43
  type TreeBranch,
40
44
  type TreeBranchEvents,
41
- getOrCreateInnerNode,
45
+ getInnerNode,
42
46
  getKernel,
43
47
  type VoidTransactionCallbackStatus,
44
48
  type TransactionCallbackStatus,
@@ -117,6 +121,11 @@ export class SchematizingSimpleTreeView<
117
121
  */
118
122
  private midUpgrade = false;
119
123
 
124
+ /**
125
+ * Hydration work deferred until Context has been created.
126
+ */
127
+ private pendingHydration?: () => void;
128
+
120
129
  private readonly rootFieldSchema: FieldSchema;
121
130
  public readonly breaker: Breakable;
122
131
 
@@ -174,6 +183,13 @@ export class SchematizingSimpleTreeView<
174
183
 
175
184
  this.runSchemaEdit(() => {
176
185
  const schema = toInitialSchema(this.config.schema);
186
+ // This has to be the contextless version, since when "initialize" is called (right after this),
187
+ // it will do a schema change which would dispose of the current context (see inside `update`).
188
+ // Thus using the current context (if any) would hydrate nodes then
189
+ // immediately dispose them instead of having them actually be useable after initialize.
190
+ // For this to work,
191
+ // the hydration must be deferred until after the content is inserted into the tree and the final schema change is done (for required roots),
192
+ // but before any user event could could run.
177
193
  const mapTree = prepareForInsertionContextless(
178
194
  content as InsertableContent | undefined,
179
195
  this.rootFieldSchema,
@@ -183,6 +199,19 @@ export class SchematizingSimpleTreeView<
183
199
  },
184
200
  this,
185
201
  schema.rootFieldSchema,
202
+ (batches, doHydration) => {
203
+ assert(this.pendingHydration === undefined, "pendingHydration already set");
204
+ this.pendingHydration = () => {
205
+ assert(batches.length <= 1, "initialize should at most one hydration batch");
206
+ for (const batch of batches) {
207
+ doHydration(batch, {
208
+ parent: undefined,
209
+ parentField: rootFieldKey,
210
+ parentIndex: 0,
211
+ });
212
+ }
213
+ };
214
+ },
186
215
  );
187
216
 
188
217
  this.checkout.transaction.start();
@@ -336,7 +365,7 @@ export class SchematizingSimpleTreeView<
336
365
  new HydratedContext(
337
366
  this.flexTreeContext,
338
367
  HydratedContext.schemaMapFromRootSchema(
339
- this.rootFieldSchema.annotatedAllowedTypesNormalized,
368
+ this.rootFieldSchema.allowedTypesFull.evaluate(),
340
369
  ),
341
370
  ),
342
371
  );
@@ -350,7 +379,10 @@ export class SchematizingSimpleTreeView<
350
379
  // TODO: provide a better event: this.view.flexTree.on(????) and/or integrate with with the normal event code paths.
351
380
 
352
381
  // Track what the root was before to be able to detect changes.
353
- let lastRoot: ReadableField<TRootSchema> = this.root;
382
+ // This uses the flex tree root to avoid demanding the simple-tree TreeNode when it might not be hydrated yet.
383
+ let lastRoot: FlexTreeUnknownUnboxed | undefined = (
384
+ this.flexTreeContext.root as FlexTreeOptionalField
385
+ ).content;
354
386
 
355
387
  this.flexTreeViewUnregisterCallbacks.add(
356
388
  this.checkout.events.on("afterBatch", () => {
@@ -359,8 +391,8 @@ export class SchematizingSimpleTreeView<
359
391
  // - The rootChanged event will already be raised at the end of the current upgrade
360
392
  // - It doesn't matter that `lastRoot` isn't updated in this case, because `update` will be called again before the upgrade
361
393
  // completes (at which point this callback and the `lastRoot` captured here will be out of scope anyway)
362
- if (!this.midUpgrade && lastRoot !== this.root) {
363
- lastRoot = this.root;
394
+ if (!this.midUpgrade && lastRoot !== this.flexRoot.content) {
395
+ lastRoot = this.flexRoot.content;
364
396
  this.events.emit("rootChanged");
365
397
  }
366
398
  }),
@@ -374,6 +406,10 @@ export class SchematizingSimpleTreeView<
374
406
  );
375
407
 
376
408
  if (!this.midUpgrade) {
409
+ assert(
410
+ this.pendingHydration === undefined,
411
+ "no nodes should be pending hydration when triggering events that could access nodes",
412
+ );
377
413
  this.events.emit("schemaChanged");
378
414
  this.events.emit("rootChanged");
379
415
  }
@@ -386,6 +422,9 @@ export class SchematizingSimpleTreeView<
386
422
  } finally {
387
423
  this.midUpgrade = false;
388
424
  }
425
+ // Ensure hydration is flushed before events run which could access nodes.
426
+ this.pendingHydration?.();
427
+ this.pendingHydration = undefined;
389
428
  this.events.emit("schemaChanged");
390
429
  this.events.emit("rootChanged");
391
430
  }
@@ -426,7 +465,7 @@ export class SchematizingSimpleTreeView<
426
465
  }
427
466
  }
428
467
 
429
- public get root(): ReadableField<TRootSchema> {
468
+ private get flexRoot(): FlexTreeOptionalField | FlexTreeRequiredField {
430
469
  this.breaker.use();
431
470
  if (!this.compatibility.canView) {
432
471
  throw new UsageError(
@@ -434,7 +473,17 @@ export class SchematizingSimpleTreeView<
434
473
  );
435
474
  }
436
475
  const view = this.getFlexTreeContext();
437
- return tryGetTreeNodeForField(view.root) as ReadableField<TRootSchema>;
476
+ assert(
477
+ view.root.is(FieldKinds.optional) ||
478
+ view.root.is(FieldKinds.required) ||
479
+ view.root.is(FieldKinds.identifier),
480
+ "unexpected root field kind",
481
+ );
482
+ return view.root;
483
+ }
484
+
485
+ public get root(): ReadableField<TRootSchema> {
486
+ return tryGetTreeNodeForField(this.flexRoot) as ReadableField<TRootSchema>;
438
487
  }
439
488
 
440
489
  public set root(newRoot: InsertableField<TRootSchema>) {
@@ -499,7 +548,7 @@ export function addConstraintsToTransaction(
499
548
  for (const constraint of constraints) {
500
549
  switch (constraint.type) {
501
550
  case "nodeInDocument": {
502
- const node = getOrCreateInnerNode(constraint.node);
551
+ const node = getInnerNode(constraint.node);
503
552
  const nodeStatus = getKernel(constraint.node).getStatus();
504
553
  if (nodeStatus !== TreeStatus.InDocument) {
505
554
  const revertText = constraintsOnRevert ? " on revert" : "";
@@ -38,7 +38,6 @@ import {
38
38
  type SchemaFormatVersion,
39
39
  SchemaVersion,
40
40
  type TreeFieldStoredSchema,
41
- type TreeNodeSchemaIdentifier,
42
41
  type TreeNodeStoredSchema,
43
42
  type TreeStoredSchema,
44
43
  TreeStoredSchemaRepository,
@@ -55,6 +54,7 @@ import {
55
54
  TreeCompressionStrategy,
56
55
  buildChunkedForest,
57
56
  buildForest,
57
+ defaultIncrementalEncodingPolicy,
58
58
  defaultSchemaPolicy,
59
59
  getCodecTreeForFieldBatchFormat,
60
60
  getCodecTreeForForestFormat,
@@ -64,6 +64,7 @@ import {
64
64
  makeMitigatedChangeFamily,
65
65
  makeSchemaCodec,
66
66
  makeTreeChunker,
67
+ type IncrementalEncodingPolicy,
67
68
  type FieldBatchFormatVersion,
68
69
  type ForestFormatVersion,
69
70
  type TreeCompressionStrategyPrivate,
@@ -305,7 +306,13 @@ export class SharedTreeKernel
305
306
  const options = { ...defaultSharedTreeOptions, ...optionsParam };
306
307
  const codecVersions = getCodecVersions(options.formatVersion);
307
308
  const schema = new TreeStoredSchemaRepository();
308
- const forest = buildConfiguredForest(breaker, options.forest, schema, idCompressor);
309
+ const forest = buildConfiguredForest(
310
+ breaker,
311
+ options.forest,
312
+ schema,
313
+ idCompressor,
314
+ options.shouldEncodeIncrementally,
315
+ );
309
316
  const revisionTagCodec = new RevisionTagCodec(idCompressor);
310
317
  const removedRoots = makeDetachedFieldIndex(
311
318
  "repair",
@@ -339,7 +346,7 @@ export class SharedTreeKernel
339
346
  encoderContext,
340
347
  options,
341
348
  idCompressor,
342
- options.shouldEncodeFieldIncrementally,
349
+ options.shouldEncodeIncrementally,
343
350
  );
344
351
  const removedRootsSummarizer = new DetachedFieldIndexSummarizer(removedRoots);
345
352
  const innerChangeFamily = new SharedTreeChangeFamily(
@@ -794,16 +801,11 @@ export interface SharedTreeOptionsInternal
794
801
  Partial<SharedTreeFormatOptionsInternal> {
795
802
  disposeForksAfterTransaction?: boolean;
796
803
  /**
797
- * Returns whether a field should be incrementally encoded.
798
- * @param nodeIdentifier - The identifier of the node containing the field.
799
- * @param fieldKey - The key of the field to check.
804
+ * Returns whether a node / field should be incrementally encoded.
800
805
  * @remarks
801
- * The policy for which fields should get incremental encoding should eventually be specified some other way.
806
+ * See {@link IncrementalEncodingPolicy}.
802
807
  */
803
- shouldEncodeFieldIncrementally?(
804
- nodeIdentifier: TreeNodeSchemaIdentifier,
805
- fieldKey: FieldKey,
806
- ): boolean;
808
+ shouldEncodeIncrementally?: IncrementalEncodingPolicy;
807
809
  }
808
810
  /**
809
811
  * Configuration options for SharedTree's internal tree storage.
@@ -882,8 +884,17 @@ export const ForestTypeReference = toForestType(
882
884
  * @beta
883
885
  */
884
886
  export const ForestTypeOptimized = toForestType(
885
- (breaker: Breakable, schema: TreeStoredSchemaSubscription, idCompressor: IIdCompressor) =>
886
- buildChunkedForest(makeTreeChunker(schema, defaultSchemaPolicy), undefined, idCompressor),
887
+ (
888
+ breaker: Breakable,
889
+ schema: TreeStoredSchemaSubscription,
890
+ idCompressor: IIdCompressor,
891
+ shouldEncodeIncrementally: IncrementalEncodingPolicy,
892
+ ) =>
893
+ buildChunkedForest(
894
+ makeTreeChunker(schema, defaultSchemaPolicy, shouldEncodeIncrementally),
895
+ undefined,
896
+ idCompressor,
897
+ ),
887
898
  );
888
899
 
889
900
  /**
@@ -904,6 +915,7 @@ type ForestFactory = (
904
915
  breaker: Breakable,
905
916
  schema: TreeStoredSchemaSubscription,
906
917
  idCompressor: IIdCompressor,
918
+ shouldEncodeIncrementally: IncrementalEncodingPolicy,
907
919
  ) => IEditableForest;
908
920
 
909
921
  function toForestType(factory: ForestFactory): ForestType {
@@ -918,8 +930,14 @@ export function buildConfiguredForest(
918
930
  factory: ForestType,
919
931
  schema: TreeStoredSchemaSubscription,
920
932
  idCompressor: IIdCompressor,
933
+ shouldEncodeIncrementally: IncrementalEncodingPolicy,
921
934
  ): IEditableForest {
922
- return (factory as unknown as ForestFactory)(breaker, schema, idCompressor);
935
+ return (factory as unknown as ForestFactory)(
936
+ breaker,
937
+ schema,
938
+ idCompressor,
939
+ shouldEncodeIncrementally,
940
+ );
923
941
  }
924
942
 
925
943
  export const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {
@@ -929,12 +947,7 @@ export const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {
929
947
  treeEncodeType: TreeCompressionStrategy.Compressed,
930
948
  formatVersion: SharedTreeFormatVersion.v3,
931
949
  disposeForksAfterTransaction: true,
932
- shouldEncodeFieldIncrementally: (
933
- nodeIdentifier: TreeNodeSchemaIdentifier,
934
- fieldKey: FieldKey,
935
- ): boolean => {
936
- return false;
937
- },
950
+ shouldEncodeIncrementally: defaultIncrementalEncodingPolicy,
938
951
  };
939
952
 
940
953
  function exportSimpleFieldSchemaStored(schema: TreeFieldStoredSchema): SimpleFieldSchema {
@@ -11,7 +11,7 @@ import {
11
11
  type TreeNode,
12
12
  type TreeNodeApi,
13
13
  type TreeView,
14
- getOrCreateInnerNode,
14
+ getInnerNode,
15
15
  treeNodeApi,
16
16
  rollback,
17
17
  type TransactionConstraint,
@@ -447,7 +447,7 @@ export function runTransaction<
447
447
  } else {
448
448
  const node = treeOrNode as TNode;
449
449
  const t = transaction as (node: TNode) => TResult | typeof rollback;
450
- const context = getOrCreateInnerNode(node).context;
450
+ const context = getInnerNode(node).context;
451
451
  if (context.isHydrated() === false) {
452
452
  throw new UsageError(
453
453
  "Transactions cannot be run on Unhydrated nodes. Transactions apply to a TreeView and Unhydrated nodes are not part of a TreeView.",