@fluidframework/tree 2.22.1 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/.vscode/extensions.json +1 -0
  2. package/CHANGELOG.md +47 -0
  3. package/api-report/tree.alpha.api.md +31 -0
  4. package/dist/alpha.d.ts +1 -0
  5. package/dist/codec/codec.js +3 -3
  6. package/dist/codec/codec.js.map +1 -1
  7. package/dist/codec/discriminatedUnions.d.ts.map +1 -1
  8. package/dist/codec/discriminatedUnions.js +1 -1
  9. package/dist/codec/discriminatedUnions.js.map +1 -1
  10. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  11. package/dist/core/schema-stored/schema.js +3 -3
  12. package/dist/core/schema-stored/schema.js.map +1 -1
  13. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  14. package/dist/core/tree/anchorSet.js +18 -13
  15. package/dist/core/tree/anchorSet.js.map +1 -1
  16. package/dist/core/tree/treeTextFormat.js +1 -1
  17. package/dist/core/tree/treeTextFormat.js.map +1 -1
  18. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  19. package/dist/feature-libraries/chunked-forest/basicChunk.js +11 -8
  20. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  21. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -2
  22. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  23. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -3
  24. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  25. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
  26. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  27. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  28. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  29. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
  31. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
  34. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  35. package/dist/feature-libraries/chunked-forest/emptyChunk.js +14 -14
  36. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  37. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/uniformChunk.js +6 -4
  39. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  40. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  41. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  42. package/dist/feature-libraries/default-schema/schemaChecker.js +1 -1
  43. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  44. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  45. package/dist/feature-libraries/flex-tree/lazyField.js +4 -3
  46. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  47. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  48. package/dist/feature-libraries/flex-tree/lazyNode.js +5 -4
  49. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  50. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  51. package/dist/feature-libraries/indexing/anchorTreeIndex.js +1 -1
  52. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  53. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  54. package/dist/feature-libraries/modular-schema/comparison.js +6 -4
  55. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  56. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  57. package/dist/feature-libraries/modular-schema/isNeverTree.js +4 -4
  58. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  59. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
  60. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  61. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  62. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -11
  63. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  64. package/dist/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
  65. package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  66. package/dist/feature-libraries/object-forest/objectForest.js +1 -1
  67. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  68. package/dist/feature-libraries/schema-index/codec.js +1 -1
  69. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  70. package/dist/feature-libraries/sequence-field/compose.js +1 -1
  71. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  72. package/dist/feature-libraries/sequence-field/invert.js +1 -1
  73. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  74. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  75. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  76. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  77. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  78. package/dist/feature-libraries/sequence-field/utils.js +1 -1
  79. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  80. package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  81. package/dist/feature-libraries/treeCursorUtils.js +6 -4
  82. package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
  83. package/dist/index.d.ts +3 -1
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +5 -1
  86. package/dist/index.js.map +1 -1
  87. package/dist/jsonDomainSchema.d.ts +113 -0
  88. package/dist/jsonDomainSchema.d.ts.map +1 -0
  89. package/dist/jsonDomainSchema.js +101 -0
  90. package/dist/jsonDomainSchema.js.map +1 -0
  91. package/dist/packageVersion.d.ts +1 -1
  92. package/dist/packageVersion.js +1 -1
  93. package/dist/packageVersion.js.map +1 -1
  94. package/dist/serializableDomainSchema.d.ts +108 -0
  95. package/dist/serializableDomainSchema.d.ts.map +1 -0
  96. package/dist/serializableDomainSchema.js +90 -0
  97. package/dist/serializableDomainSchema.js.map +1 -0
  98. package/dist/shared-tree/index.d.ts +1 -1
  99. package/dist/shared-tree/index.d.ts.map +1 -1
  100. package/dist/shared-tree/index.js.map +1 -1
  101. package/dist/shared-tree/schematizeTree.js +1 -1
  102. package/dist/shared-tree/schematizeTree.js.map +1 -1
  103. package/dist/shared-tree/sharedTree.d.ts +37 -20
  104. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  105. package/dist/shared-tree/sharedTree.js +17 -17
  106. package/dist/shared-tree/sharedTree.js.map +1 -1
  107. package/dist/shared-tree/sharedTreeChangeFamily.js +1 -1
  108. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  109. package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
  110. package/dist/shared-tree/treeApiAlpha.js +4 -4
  111. package/dist/shared-tree/treeApiAlpha.js.map +1 -1
  112. package/dist/shared-tree/treeCheckout.js +1 -1
  113. package/dist/shared-tree/treeCheckout.js.map +1 -1
  114. package/dist/shared-tree-core/editManager.d.ts +11 -2
  115. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  116. package/dist/shared-tree-core/editManager.js +70 -34
  117. package/dist/shared-tree-core/editManager.js.map +1 -1
  118. package/dist/shared-tree-core/resubmitMachine.d.ts +2 -0
  119. package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  120. package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
  121. package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -3
  122. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  123. package/dist/shared-tree-core/sharedTreeCore.js +42 -7
  124. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  125. package/dist/simple-tree/api/customTree.js +3 -3
  126. package/dist/simple-tree/api/customTree.js.map +1 -1
  127. package/dist/simple-tree/api/schemaCreationUtilities.js +1 -1
  128. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  129. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  130. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  131. package/dist/simple-tree/api/simpleTreeIndex.js +3 -3
  132. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  133. package/dist/simple-tree/api/tree.js +1 -1
  134. package/dist/simple-tree/api/tree.js.map +1 -1
  135. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  136. package/dist/simple-tree/api/treeNodeApi.js +9 -5
  137. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  138. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  139. package/dist/simple-tree/api/verboseTree.js +5 -4
  140. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  141. package/dist/simple-tree/api/view.js +1 -1
  142. package/dist/simple-tree/api/view.js.map +1 -1
  143. package/dist/simple-tree/arrayNode.js +2 -2
  144. package/dist/simple-tree/arrayNode.js.map +1 -1
  145. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  146. package/dist/simple-tree/core/getOrCreateNode.js +1 -1
  147. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  148. package/dist/simple-tree/core/schemaCaching.js +1 -1
  149. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  150. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  151. package/dist/simple-tree/core/treeNodeKernel.js +6 -6
  152. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  153. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  154. package/dist/simple-tree/core/unhydratedFlexTree.js +5 -5
  155. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  156. package/dist/simple-tree/objectNode.js +2 -2
  157. package/dist/simple-tree/objectNode.js.map +1 -1
  158. package/dist/simple-tree/proxies.js +1 -1
  159. package/dist/simple-tree/proxies.js.map +1 -1
  160. package/dist/simple-tree/toMapTree.js +3 -3
  161. package/dist/simple-tree/toMapTree.js.map +1 -1
  162. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  163. package/dist/simple-tree/toStoredSchema.js +2 -1
  164. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  165. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  166. package/dist/simple-tree/treeNodeValid.js +5 -2
  167. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  168. package/dist/util/idAllocator.js +1 -1
  169. package/dist/util/idAllocator.js.map +1 -1
  170. package/dist/util/index.d.ts +2 -2
  171. package/dist/util/index.d.ts.map +1 -1
  172. package/dist/util/index.js +5 -4
  173. package/dist/util/index.js.map +1 -1
  174. package/dist/util/nestedMap.d.ts +2 -10
  175. package/dist/util/nestedMap.d.ts.map +1 -1
  176. package/dist/util/nestedMap.js +9 -28
  177. package/dist/util/nestedMap.js.map +1 -1
  178. package/dist/util/utils.d.ts +23 -6
  179. package/dist/util/utils.d.ts.map +1 -1
  180. package/dist/util/utils.js +46 -13
  181. package/dist/util/utils.js.map +1 -1
  182. package/lib/alpha.d.ts +1 -0
  183. package/lib/codec/codec.js +3 -3
  184. package/lib/codec/codec.js.map +1 -1
  185. package/lib/codec/discriminatedUnions.d.ts.map +1 -1
  186. package/lib/codec/discriminatedUnions.js +1 -1
  187. package/lib/codec/discriminatedUnions.js.map +1 -1
  188. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  189. package/lib/core/schema-stored/schema.js +3 -3
  190. package/lib/core/schema-stored/schema.js.map +1 -1
  191. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  192. package/lib/core/tree/anchorSet.js +19 -14
  193. package/lib/core/tree/anchorSet.js.map +1 -1
  194. package/lib/core/tree/treeTextFormat.js +1 -1
  195. package/lib/core/tree/treeTextFormat.js.map +1 -1
  196. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  197. package/lib/feature-libraries/chunked-forest/basicChunk.js +11 -8
  198. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  199. package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -2
  200. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  201. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -3
  202. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  203. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
  204. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  205. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  206. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
  207. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  208. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
  209. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
  210. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
  211. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
  212. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
  213. package/lib/feature-libraries/chunked-forest/emptyChunk.js +14 -14
  214. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  215. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  216. package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
  217. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  218. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  219. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  220. package/lib/feature-libraries/default-schema/schemaChecker.js +1 -1
  221. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  222. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  223. package/lib/feature-libraries/flex-tree/lazyField.js +4 -3
  224. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  225. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  226. package/lib/feature-libraries/flex-tree/lazyNode.js +5 -4
  227. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  228. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  229. package/lib/feature-libraries/indexing/anchorTreeIndex.js +1 -1
  230. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  231. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  232. package/lib/feature-libraries/modular-schema/comparison.js +6 -4
  233. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  234. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  235. package/lib/feature-libraries/modular-schema/isNeverTree.js +4 -4
  236. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  237. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
  238. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  239. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  240. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +11 -12
  241. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  242. package/lib/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
  243. package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  244. package/lib/feature-libraries/object-forest/objectForest.js +1 -1
  245. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  246. package/lib/feature-libraries/schema-index/codec.js +1 -1
  247. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  248. package/lib/feature-libraries/sequence-field/compose.js +1 -1
  249. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  250. package/lib/feature-libraries/sequence-field/invert.js +1 -1
  251. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  252. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
  253. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
  254. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
  255. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  256. package/lib/feature-libraries/sequence-field/utils.js +1 -1
  257. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  258. package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
  259. package/lib/feature-libraries/treeCursorUtils.js +6 -4
  260. package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
  261. package/lib/index.d.ts +3 -1
  262. package/lib/index.d.ts.map +1 -1
  263. package/lib/index.js +2 -0
  264. package/lib/index.js.map +1 -1
  265. package/lib/jsonDomainSchema.d.ts +113 -0
  266. package/lib/jsonDomainSchema.d.ts.map +1 -0
  267. package/lib/jsonDomainSchema.js +98 -0
  268. package/lib/jsonDomainSchema.js.map +1 -0
  269. package/lib/packageVersion.d.ts +1 -1
  270. package/lib/packageVersion.js +1 -1
  271. package/lib/packageVersion.js.map +1 -1
  272. package/lib/serializableDomainSchema.d.ts +108 -0
  273. package/lib/serializableDomainSchema.d.ts.map +1 -0
  274. package/lib/serializableDomainSchema.js +87 -0
  275. package/lib/serializableDomainSchema.js.map +1 -0
  276. package/lib/shared-tree/index.d.ts +1 -1
  277. package/lib/shared-tree/index.d.ts.map +1 -1
  278. package/lib/shared-tree/index.js.map +1 -1
  279. package/lib/shared-tree/schematizeTree.js +1 -1
  280. package/lib/shared-tree/schematizeTree.js.map +1 -1
  281. package/lib/shared-tree/sharedTree.d.ts +37 -20
  282. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  283. package/lib/shared-tree/sharedTree.js +18 -18
  284. package/lib/shared-tree/sharedTree.js.map +1 -1
  285. package/lib/shared-tree/sharedTreeChangeFamily.js +1 -1
  286. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  287. package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
  288. package/lib/shared-tree/treeApiAlpha.js +4 -4
  289. package/lib/shared-tree/treeApiAlpha.js.map +1 -1
  290. package/lib/shared-tree/treeCheckout.js +1 -1
  291. package/lib/shared-tree/treeCheckout.js.map +1 -1
  292. package/lib/shared-tree-core/editManager.d.ts +11 -2
  293. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  294. package/lib/shared-tree-core/editManager.js +70 -34
  295. package/lib/shared-tree-core/editManager.js.map +1 -1
  296. package/lib/shared-tree-core/resubmitMachine.d.ts +2 -0
  297. package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  298. package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
  299. package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -3
  300. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  301. package/lib/shared-tree-core/sharedTreeCore.js +42 -7
  302. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  303. package/lib/simple-tree/api/customTree.js +3 -3
  304. package/lib/simple-tree/api/customTree.js.map +1 -1
  305. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  306. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  307. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  308. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  309. package/lib/simple-tree/api/simpleTreeIndex.js +3 -3
  310. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  311. package/lib/simple-tree/api/tree.js +1 -1
  312. package/lib/simple-tree/api/tree.js.map +1 -1
  313. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  314. package/lib/simple-tree/api/treeNodeApi.js +9 -5
  315. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  316. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  317. package/lib/simple-tree/api/verboseTree.js +5 -4
  318. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  319. package/lib/simple-tree/api/view.js +1 -1
  320. package/lib/simple-tree/api/view.js.map +1 -1
  321. package/lib/simple-tree/arrayNode.js +2 -2
  322. package/lib/simple-tree/arrayNode.js.map +1 -1
  323. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  324. package/lib/simple-tree/core/getOrCreateNode.js +1 -1
  325. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  326. package/lib/simple-tree/core/schemaCaching.js +1 -1
  327. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  328. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  329. package/lib/simple-tree/core/treeNodeKernel.js +6 -6
  330. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  331. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  332. package/lib/simple-tree/core/unhydratedFlexTree.js +5 -5
  333. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  334. package/lib/simple-tree/objectNode.js +2 -2
  335. package/lib/simple-tree/objectNode.js.map +1 -1
  336. package/lib/simple-tree/proxies.js +1 -1
  337. package/lib/simple-tree/proxies.js.map +1 -1
  338. package/lib/simple-tree/toMapTree.js +3 -3
  339. package/lib/simple-tree/toMapTree.js.map +1 -1
  340. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  341. package/lib/simple-tree/toStoredSchema.js +2 -1
  342. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  343. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  344. package/lib/simple-tree/treeNodeValid.js +5 -2
  345. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  346. package/lib/util/idAllocator.js +1 -1
  347. package/lib/util/idAllocator.js.map +1 -1
  348. package/lib/util/index.d.ts +2 -2
  349. package/lib/util/index.d.ts.map +1 -1
  350. package/lib/util/index.js +2 -2
  351. package/lib/util/index.js.map +1 -1
  352. package/lib/util/nestedMap.d.ts +2 -10
  353. package/lib/util/nestedMap.d.ts.map +1 -1
  354. package/lib/util/nestedMap.js +5 -23
  355. package/lib/util/nestedMap.js.map +1 -1
  356. package/lib/util/utils.d.ts +23 -6
  357. package/lib/util/utils.d.ts.map +1 -1
  358. package/lib/util/utils.js +42 -11
  359. package/lib/util/utils.js.map +1 -1
  360. package/package.json +22 -22
  361. package/src/codec/codec.ts +3 -3
  362. package/src/codec/discriminatedUnions.ts +2 -1
  363. package/src/core/schema-stored/schema.ts +5 -3
  364. package/src/core/tree/anchorSet.ts +37 -26
  365. package/src/core/tree/treeTextFormat.ts +1 -1
  366. package/src/feature-libraries/chunked-forest/basicChunk.ts +11 -8
  367. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
  368. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -3
  369. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -2
  370. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
  371. package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
  372. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +4 -3
  373. package/src/feature-libraries/chunked-forest/emptyChunk.ts +14 -14
  374. package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
  375. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
  376. package/src/feature-libraries/default-schema/schemaChecker.ts +1 -1
  377. package/src/feature-libraries/flex-tree/lazyField.ts +6 -8
  378. package/src/feature-libraries/flex-tree/lazyNode.ts +6 -4
  379. package/src/feature-libraries/indexing/anchorTreeIndex.ts +2 -1
  380. package/src/feature-libraries/modular-schema/comparison.ts +7 -5
  381. package/src/feature-libraries/modular-schema/isNeverTree.ts +6 -4
  382. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -4
  383. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +16 -12
  384. package/src/feature-libraries/node-key/mockNodeKeyManager.ts +1 -1
  385. package/src/feature-libraries/object-forest/objectForest.ts +1 -1
  386. package/src/feature-libraries/schema-index/codec.ts +1 -1
  387. package/src/feature-libraries/sequence-field/compose.ts +1 -1
  388. package/src/feature-libraries/sequence-field/invert.ts +1 -1
  389. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +1 -1
  390. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +1 -1
  391. package/src/feature-libraries/sequence-field/utils.ts +1 -1
  392. package/src/feature-libraries/treeCursorUtils.ts +6 -4
  393. package/src/index.ts +3 -1
  394. package/src/jsonDomainSchema.ts +129 -0
  395. package/src/packageVersion.ts +1 -1
  396. package/src/serializableDomainSchema.ts +121 -0
  397. package/src/shared-tree/index.ts +0 -1
  398. package/src/shared-tree/schematizeTree.ts +1 -1
  399. package/src/shared-tree/sharedTree.ts +31 -41
  400. package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
  401. package/src/shared-tree/treeApiAlpha.ts +12 -4
  402. package/src/shared-tree/treeCheckout.ts +1 -1
  403. package/src/shared-tree-core/editManager.ts +85 -47
  404. package/src/shared-tree-core/resubmitMachine.ts +2 -0
  405. package/src/shared-tree-core/sharedTreeCore.ts +62 -14
  406. package/src/simple-tree/api/customTree.ts +3 -3
  407. package/src/simple-tree/api/schemaCreationUtilities.ts +1 -1
  408. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  409. package/src/simple-tree/api/simpleTreeIndex.ts +3 -3
  410. package/src/simple-tree/api/tree.ts +1 -1
  411. package/src/simple-tree/api/treeNodeApi.ts +11 -6
  412. package/src/simple-tree/api/verboseTree.ts +8 -4
  413. package/src/simple-tree/api/view.ts +1 -1
  414. package/src/simple-tree/arrayNode.ts +2 -2
  415. package/src/simple-tree/core/getOrCreateNode.ts +2 -1
  416. package/src/simple-tree/core/schemaCaching.ts +1 -1
  417. package/src/simple-tree/core/treeNodeKernel.ts +9 -6
  418. package/src/simple-tree/core/unhydratedFlexTree.ts +7 -5
  419. package/src/simple-tree/objectNode.ts +2 -2
  420. package/src/simple-tree/proxies.ts +1 -1
  421. package/src/simple-tree/toMapTree.ts +3 -3
  422. package/src/simple-tree/toStoredSchema.ts +2 -1
  423. package/src/simple-tree/treeNodeValid.ts +5 -2
  424. package/src/util/idAllocator.ts +1 -1
  425. package/src/util/index.ts +3 -2
  426. package/src/util/nestedMap.ts +9 -33
  427. package/src/util/utils.ts +52 -12
@@ -0,0 +1,108 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
+ import { type FixRecursiveArraySchema, type TreeNodeFromImplicitAllowedTypes } from "./simple-tree/index.js";
7
+ import type { JsonCompatible } from "./util/index.js";
8
+ /**
9
+ * Utilities for storing {@link FluidSerializableAsTree.Data|Fluid Serializable data} in {@link TreeNode}s.
10
+ *
11
+ * Same as {@link JsonAsTree} except allows {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}s.
12
+ * @remarks
13
+ * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
14
+ *
15
+ * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link TreeAlpha.importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
16
+ * @internal
17
+ */
18
+ export declare namespace FluidSerializableAsTree {
19
+ /**
20
+ * Data which can be serialized by Fluid.
21
+ * @remarks
22
+ * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link TreeAlpha.importConcise}.
23
+ * @internal
24
+ */
25
+ type Data = JsonCompatible<IFluidHandle>;
26
+ /**
27
+ * {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.
28
+ * @example
29
+ * ```typescript
30
+ * const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
31
+ * ```
32
+ * @internal
33
+ */
34
+ const Tree: readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", import("./simple-tree/index.js").NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>];
35
+ /**
36
+ * @internal
37
+ */
38
+ type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
39
+ /**
40
+ * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
41
+ * @system @internal
42
+ */
43
+ const _APIExtractorWorkaroundObjectBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.serializable.object", import("./simple-tree/index.js").NodeKind.Map, import("./simple-tree/index.js").TreeMapNodeUnsafe<readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", import("./simple-tree/index.js").NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>]> & import("./simple-tree/index.js").WithType<"com.fluidframework.serializable.object", import("./simple-tree/index.js").NodeKind.Map, unknown>, {
44
+ [Symbol.iterator](): Iterator<[string, string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
45
+ create(data: boolean): boolean;
46
+ }> | FluidSerializableObject | Array | null], any, undefined>;
47
+ } | {
48
+ readonly [x: string]: string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
49
+ create(data: boolean): boolean;
50
+ }> | FluidSerializableObject | Array | null;
51
+ }, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", import("./simple-tree/index.js").NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>], undefined>;
52
+ /**
53
+ * Arbitrary Fluid Serializable object as a {@link TreeNode}.
54
+ * @remarks
55
+ * API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.
56
+ * @example
57
+ * ```typescript
58
+ * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
59
+ * const fromArray = new JsonAsTreeObject([["a", 0]]);
60
+ * // Using `importConcise` can work better for Fluid Serializable data:
61
+ * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Object, { a: 0 });
62
+ * // Node API is like a Map:
63
+ * const value = imported.get("a");
64
+ * ```
65
+ * @privateRemarks
66
+ * Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.
67
+ * @sealed @internal
68
+ */
69
+ class FluidSerializableObject extends _APIExtractorWorkaroundObjectBase {
70
+ }
71
+ /**
72
+ * D.ts bug workaround, see {@link FixRecursiveArraySchema}.
73
+ * @privateRemarks
74
+ * In the past this this had to reference the base type (_APIExtractorWorkaroundArrayBase).
75
+ * Testing for this in examples/utils/import-testing now shows it has to reference FluidSerializableAsTree.Array instead.
76
+ * @system @internal
77
+ */
78
+ type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<typeof Array>;
79
+ /**
80
+ * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
81
+ * @system @internal
82
+ */
83
+ const _APIExtractorWorkaroundArrayBase: import("./simple-tree/index.js").TreeNodeSchemaClass<"com.fluidframework.serializable.array", import("./simple-tree/index.js").NodeKind.Array, import("./simple-tree/index.js").TreeArrayNodeUnsafe<readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", import("./simple-tree/index.js").NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>]> & import("./simple-tree/index.js").WithType<"com.fluidframework.serializable.array", import("./simple-tree/index.js").NodeKind.Array, unknown>, {
84
+ [Symbol.iterator](): Iterator<string | number | IFluidHandle<unknown> | import("./simple-tree/index.js").InsertableTypedNodeUnsafe<import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaCore<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, true, unknown, boolean, unknown> & {
85
+ create(data: boolean): boolean;
86
+ }> | FluidSerializableObject | Array | null, any, undefined>;
87
+ }, false, readonly [() => typeof FluidSerializableObject, () => typeof Array, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.string", import("./simple-tree/index.js").NodeKind.Leaf, string, string, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.number", import("./simple-tree/index.js").NodeKind.Leaf, number, number, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.boolean", import("./simple-tree/index.js").NodeKind.Leaf, boolean, boolean, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.null", import("./simple-tree/index.js").NodeKind.Leaf, null, null, true, unknown, never, unknown>, import("./simple-tree/index.js").TreeNodeSchemaNonClass<"com.fluidframework.leaf.handle", import("./simple-tree/index.js").NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>, true, unknown, never, unknown>], undefined>;
88
+ /**
89
+ * Arbitrary Fluid Serializable array as a {@link TreeNode}.
90
+ * @remarks
91
+ * This can be imported using {@link TreeAlpha.importConcise}.
92
+ * @example
93
+ * ```typescript
94
+ * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
95
+ * const usingConstructor = new FluidSerializableAsTree.Array(["a", 0, new FluidSerializableAsTree.Array([1])]);
96
+ * // Using `importConcise` can work better for Fluid Serializable data:
97
+ * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Array, ["a", 0, [1]]);
98
+ * // Node API is like an Array:
99
+ * const inner: FluidSerializableAsTree.Tree = imported[2];
100
+ * assert(Tree.is(inner, FluidSerializableAsTree.Array));
101
+ * const leaf = inner[0];
102
+ * ```
103
+ * @sealed @internal
104
+ */
105
+ class Array extends _APIExtractorWorkaroundArrayBase {
106
+ }
107
+ }
108
+ //# sourceMappingURL=serializableDomainSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializableDomainSchema.d.ts","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD;;;;;;;;;GASG;AACH,yBAAiB,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,KAAY,IAAI,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;IAEhD;;;;;;;OAOG;IACI,MAAM,IAAI,kgCAIP,CAAC;IAEX;;OAEG;IACH,KAAY,IAAI,GAAG,gCAAgC,CAAC,OAAO,IAAI,CAAC,CAAC;IAEjE;;;OAGG;IACI,MAAM,iCAAiC;;;;;;;;0hCAAkC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,uBAAwB,SAAQ,iCAAiC;KAAG;IAKjF;;;;;;OAMG;IACH,KAAoB,kCAAkC,GAAG,uBAAuB,CAC/E,OAAO,KAAK,CACZ,CAAC;IAEF;;;OAGG;IACI,MAAM,gCAAgC;;;;0hCAAmC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,gCAAgC;KAAG;CAI9D"}
@@ -0,0 +1,87 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { SchemaFactory, } from "./simple-tree/index.js";
6
+ const sf = new SchemaFactory("com.fluidframework.serializable");
7
+ /**
8
+ * Utilities for storing {@link FluidSerializableAsTree.Data|Fluid Serializable data} in {@link TreeNode}s.
9
+ *
10
+ * Same as {@link JsonAsTree} except allows {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}s.
11
+ * @remarks
12
+ * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
13
+ *
14
+ * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link TreeAlpha.importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
15
+ * @internal
16
+ */
17
+ export var FluidSerializableAsTree;
18
+ (function (FluidSerializableAsTree) {
19
+ /**
20
+ * {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.
21
+ * @example
22
+ * ```typescript
23
+ * const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
24
+ * ```
25
+ * @internal
26
+ */
27
+ FluidSerializableAsTree.Tree = [
28
+ () => FluidSerializableObject,
29
+ () => Array,
30
+ ...SchemaFactory.leaves,
31
+ ];
32
+ /**
33
+ * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
34
+ * @system @internal
35
+ */
36
+ FluidSerializableAsTree._APIExtractorWorkaroundObjectBase = sf.mapRecursive("object", FluidSerializableAsTree.Tree);
37
+ /**
38
+ * Arbitrary Fluid Serializable object as a {@link TreeNode}.
39
+ * @remarks
40
+ * API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.
41
+ * @example
42
+ * ```typescript
43
+ * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
44
+ * const fromArray = new JsonAsTreeObject([["a", 0]]);
45
+ * // Using `importConcise` can work better for Fluid Serializable data:
46
+ * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Object, { a: 0 });
47
+ * // Node API is like a Map:
48
+ * const value = imported.get("a");
49
+ * ```
50
+ * @privateRemarks
51
+ * Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.
52
+ * @sealed @internal
53
+ */
54
+ class FluidSerializableObject extends FluidSerializableAsTree._APIExtractorWorkaroundObjectBase {
55
+ }
56
+ FluidSerializableAsTree.FluidSerializableObject = FluidSerializableObject;
57
+ {
58
+ }
59
+ /**
60
+ * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
61
+ * @system @internal
62
+ */
63
+ FluidSerializableAsTree._APIExtractorWorkaroundArrayBase = sf.arrayRecursive("array", FluidSerializableAsTree.Tree);
64
+ /**
65
+ * Arbitrary Fluid Serializable array as a {@link TreeNode}.
66
+ * @remarks
67
+ * This can be imported using {@link TreeAlpha.importConcise}.
68
+ * @example
69
+ * ```typescript
70
+ * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
71
+ * const usingConstructor = new FluidSerializableAsTree.Array(["a", 0, new FluidSerializableAsTree.Array([1])]);
72
+ * // Using `importConcise` can work better for Fluid Serializable data:
73
+ * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Array, ["a", 0, [1]]);
74
+ * // Node API is like an Array:
75
+ * const inner: FluidSerializableAsTree.Tree = imported[2];
76
+ * assert(Tree.is(inner, FluidSerializableAsTree.Array));
77
+ * const leaf = inner[0];
78
+ * ```
79
+ * @sealed @internal
80
+ */
81
+ class Array extends FluidSerializableAsTree._APIExtractorWorkaroundArrayBase {
82
+ }
83
+ FluidSerializableAsTree.Array = Array;
84
+ {
85
+ }
86
+ })(FluidSerializableAsTree || (FluidSerializableAsTree = {}));
87
+ //# sourceMappingURL=serializableDomainSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializableDomainSchema.js","sourceRoot":"","sources":["../src/serializableDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,aAAa,GAIb,MAAM,wBAAwB,CAAC;AAGhC,MAAM,EAAE,GAAG,IAAI,aAAa,CAAC,iCAAiC,CAAC,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,KAAW,uBAAuB,CA8FvC;AA9FD,WAAiB,uBAAuB;IASvC;;;;;;;OAOG;IACU,4BAAI,GAAG;QACnB,GAAG,EAAE,CAAC,uBAAuB;QAC7B,GAAG,EAAE,CAAC,KAAK;QACX,GAAG,aAAa,CAAC,MAAM;KACd,CAAC;IAOX;;;OAGG;IACU,yDAAiC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,wBAAA,IAAI,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,uBAAwB,SAAQ,wBAAA,iCAAiC;KAAG;IAApE,+CAAuB,0BAA6C,CAAA;IACjF,CAAC;IAED,CAAC;IAaD;;;OAGG;IACU,wDAAgC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAA,IAAI,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,wBAAA,gCAAgC;KAAG;IAAjD,6BAAK,QAA4C,CAAA;IAC9D,CAAC;IAED,CAAC;AACF,CAAC,EA9FgB,uBAAuB,KAAvB,uBAAuB,QA8FvC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tSchemaFactory,\n\ttype FixRecursiveArraySchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype ValidateRecursiveSchema,\n} from \"./simple-tree/index.js\";\nimport type { JsonCompatible } from \"./util/index.js\";\n\nconst sf = new SchemaFactory(\"com.fluidframework.serializable\");\n\n/**\n * Utilities for storing {@link FluidSerializableAsTree.Data|Fluid Serializable data} in {@link TreeNode}s.\n *\n * Same as {@link JsonAsTree} except allows {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}s.\n * @remarks\n * Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.\n *\n * Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link TreeAlpha.importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.\n * @internal\n */\nexport namespace FluidSerializableAsTree {\n\t/**\n\t * Data which can be serialized by Fluid.\n\t * @remarks\n\t * Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link TreeAlpha.importConcise}.\n\t * @internal\n\t */\n\texport type Data = JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.\n\t * @example\n\t * ```typescript\n\t * const tree = TreeAlpha.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });\n\t * ```\n\t * @internal\n\t */\n\texport const Tree = [\n\t\t() => FluidSerializableObject,\n\t\t() => Array,\n\t\t...SchemaFactory.leaves,\n\t] as const;\n\n\t/**\n\t * @internal\n\t */\n\texport type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;\n\n\t/**\n\t * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.\n\t * @system @internal\n\t */\n\texport const _APIExtractorWorkaroundObjectBase = sf.mapRecursive(\"object\", Tree);\n\n\t/**\n\t * Arbitrary Fluid Serializable object as a {@link TreeNode}.\n\t * @remarks\n\t * API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.\n\t * @example\n\t * ```typescript\n\t * // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.\n\t * const fromArray = new JsonAsTreeObject([[\"a\", 0]]);\n\t * // Using `importConcise` can work better for Fluid Serializable data:\n\t * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Object, { a: 0 });\n\t * // Node API is like a Map:\n\t * const value = imported.get(\"a\");\n\t * ```\n\t * @privateRemarks\n\t * Due to https://github.com/microsoft/TypeScript/issues/61270 this can't be named `Object`.\n\t * @sealed @internal\n\t */\n\texport class FluidSerializableObject extends _APIExtractorWorkaroundObjectBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof FluidSerializableObject>;\n\t}\n\n\t/**\n\t * D.ts bug workaround, see {@link FixRecursiveArraySchema}.\n\t * @privateRemarks\n\t * In the past this this had to reference the base type (_APIExtractorWorkaroundArrayBase).\n\t * Testing for this in examples/utils/import-testing now shows it has to reference FluidSerializableAsTree.Array instead.\n\t * @system @internal\n\t */\n\texport declare type _RecursiveArrayWorkaroundJsonArray = FixRecursiveArraySchema<\n\t\ttypeof Array\n\t>;\n\n\t/**\n\t * Do not use. Exists only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.\n\t * @system @internal\n\t */\n\texport const _APIExtractorWorkaroundArrayBase = sf.arrayRecursive(\"array\", Tree);\n\n\t/**\n\t * Arbitrary Fluid Serializable array as a {@link TreeNode}.\n\t * @remarks\n\t * This can be imported using {@link TreeAlpha.importConcise}.\n\t * @example\n\t * ```typescript\n\t * // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.\n\t * const usingConstructor = new FluidSerializableAsTree.Array([\"a\", 0, new FluidSerializableAsTree.Array([1])]);\n\t * // Using `importConcise` can work better for Fluid Serializable data:\n\t * const imported = TreeAlpha.importConcise(FluidSerializableAsTree.Array, [\"a\", 0, [1]]);\n\t * // Node API is like an Array:\n\t * const inner: FluidSerializableAsTree.Tree = imported[2];\n\t * assert(Tree.is(inner, FluidSerializableAsTree.Array));\n\t * const leaf = inner[0];\n\t * ```\n\t * @sealed @internal\n\t */\n\texport class Array extends _APIExtractorWorkaroundArrayBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof Array>;\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ISharedTree, type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, SharedTree, getBranch, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, type IChannelView, } from "./sharedTree.js";
5
+ export { type ISharedTree, type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, SharedTree, getBranch, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, SharedTreeFormatVersion, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./sharedTree.js";
6
6
  export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, type ITreeCheckoutFork, type BranchableTree, type TreeBranchFork, } from "./treeCheckout.js";
7
7
  export { type TreeStoredContent } from "./schematizeTree.js";
8
8
  export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,UAAU,EACV,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,YAAY,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EACN,OAAO,IAAI,IAAI,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,GACf,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,UAAU,EACV,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EACN,OAAO,IAAI,IAAI,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,GACf,MAAM,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,UAAU,EACV,SAAS,EAIT,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAGxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GAEnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,GAMZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EACN,OAAO,IAAI,IAAI,GAGf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAE1B,eAAe,GACf,MAAM,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ISharedTree,\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\tSharedTree,\n\tgetBranch,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n\ttype IChannelView,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { type TreeStoredContent } from \"./schematizeTree.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { CheckoutFlexTreeView } from \"./checkoutFlexTreeView.js\";\n\nexport type { ISharedTreeEditor, ISchemaEditor } from \"./sharedTreeEditBuilder.js\";\n\nexport {\n\ttreeApi as Tree,\n\ttype TreeApi,\n\ttype RunTransaction,\n} from \"./treeApi.js\";\n\nexport { TreeAlpha } from \"./treeApiAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,UAAU,EACV,SAAS,EAIT,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAGxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,GAMZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EACN,OAAO,IAAI,IAAI,GAGf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACN,0BAA0B,EAE1B,eAAe,GACf,MAAM,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ISharedTree,\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\tSharedTree,\n\tgetBranch,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { type TreeStoredContent } from \"./schematizeTree.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { CheckoutFlexTreeView } from \"./checkoutFlexTreeView.js\";\n\nexport type { ISharedTreeEditor, ISchemaEditor } from \"./sharedTreeEditBuilder.js\";\n\nexport {\n\ttreeApi as Tree,\n\ttype TreeApi,\n\ttype RunTransaction,\n} from \"./treeApi.js\";\n\nexport { TreeAlpha } from \"./treeApiAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n} from \"./independentView.js\";\n"]}
@@ -140,7 +140,7 @@ export function initialize(checkout, treeContent) {
140
140
  break;
141
141
  }
142
142
  default: {
143
- fail("unexpected root field kind during initialize");
143
+ fail(0xac7 /* unexpected root field kind during initialize */);
144
144
  }
145
145
  }
146
146
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schematizeTree.js","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EACN,iBAAiB,EAIjB,YAAY,EACZ,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAmB,MAAM,yBAAyB,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAChC,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AC;QACD,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;YAC5B,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC;YACd,CAAC;YACD,QAAQ;YACR,sFAAsF;YACtF,iGAAiG;YACjG,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tAllowedUpdateType,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype TreeStoredSchema,\n\trootFieldKey,\n\tschemaDataIsEmpty,\n} from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\tallowsRepoSuperset,\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tmapTreeFromCursor,\n} from \"../feature-libraries/index.js\";\nimport { fail, isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\nimport { toStoredSchema, type ViewSchema } from \"../simple-tree/index.js\";\n\n/**\n * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.\n *\n * Requires `storedSchema` to be in its default/empty state.\n *\n * This is done in such a way that if the content (implicitly assumed to start empty)\n * is never out of schema.\n * This means that if the root field of the new schema requires content (like a value field),\n * a temporary intermediate schema is used so the initial empty state is not out of schema.\n *\n * Since this makes multiple changes, callers may want to wrap it in a transaction.\n */\nexport function initializeContent(\n\tschemaRepository: {\n\t\tstoredSchema: ITreeCheckout[\"storedSchema\"];\n\t\tupdateSchema: ITreeCheckout[\"updateSchema\"];\n\t},\n\tnewSchema: TreeStoredSchema,\n\tsetInitialTree: () => void,\n): void {\n\tassert(\n\t\tschemaDataIsEmpty(schemaRepository.storedSchema),\n\t\t0x743 /* cannot initialize after a schema is set */,\n\t);\n\n\tconst rootSchema = newSchema.rootFieldSchema;\n\tconst rootKind = rootSchema.kind;\n\n\t// To keep the data in schema during the update, first define a schema that tolerates the current (empty) tree as well as the final (initial) tree.\n\tlet incrementalSchemaUpdate: TreeStoredSchema;\n\tif (\n\t\trootKind === FieldKinds.sequence.identifier ||\n\t\trootKind === FieldKinds.optional.identifier\n\t) {\n\t\t// These kinds are known to tolerate empty, so use the schema as is:\n\t\tincrementalSchemaUpdate = newSchema;\n\t} else {\n\t\tassert(rootKind === FieldKinds.required.identifier, 0x5c8 /* Unexpected kind */);\n\t\t// Replace value kind with optional kind in root field schema:\n\t\tincrementalSchemaUpdate = {\n\t\t\tnodeSchema: newSchema.nodeSchema,\n\t\t\trootFieldSchema: {\n\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\ttypes: rootSchema.types,\n\t\t\t},\n\t\t};\n\t}\n\n\t// TODO: fix issues with schema comparison and enable this.\n\t// assert(\n\t// \tallowsRepoSuperset(defaultSchemaPolicy, tree.storedSchema, incrementalSchemaUpdate),\n\t// \t\"Incremental Schema update should support the existing empty tree\",\n\t// );\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should be a allow a superset of the final schema */,\n\t);\n\t// Update to intermediate schema\n\tschemaRepository.updateSchema(incrementalSchemaUpdate);\n\t// Insert initial tree\n\tsetInitialTree();\n\n\t// If intermediate schema is not final desired schema, update to the final schema:\n\tif (incrementalSchemaUpdate !== newSchema) {\n\t\tschemaRepository.updateSchema(newSchema);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\n\t/**\n\t * Empty: needs initializing.\n\t */\n\tInitialize,\n\t/**\n\t * Schema can be upgraded leaving tree as is.\n\t */\n\tSchemaCompatible,\n\t/**\n\t * No update currently supported.\n\t */\n\tIncompatible,\n}\n\nexport function evaluateUpdate(\n\tviewSchema: ViewSchema,\n\tallowedSchemaModifications: AllowedUpdateType,\n\tcheckout: ITreeCheckout,\n): UpdateType {\n\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\n\tif (compatibility.canUpgrade && compatibility.canView) {\n\t\t// Compatible as is\n\t\treturn UpdateType.None;\n\t}\n\n\t// eslint-disable-next-line no-bitwise\n\tif (allowedSchemaModifications & AllowedUpdateType.Initialize && canInitialize(checkout)) {\n\t\treturn UpdateType.Initialize;\n\t}\n\n\tif (!compatibility.canUpgrade) {\n\t\t// Existing stored schema permits trees which are incompatible with the view schema, so schema can not be updated\n\t\treturn UpdateType.Incompatible;\n\t}\n\n\tassert(!compatibility.canView, 0x8bd /* unexpected case */);\n\tassert(compatibility.canUpgrade, 0x8be /* unexpected case */);\n\n\t// eslint-disable-next-line no-bitwise\n\treturn allowedSchemaModifications & AllowedUpdateType.SchemaCompatible\n\t\t? UpdateType.SchemaCompatible\n\t\t: UpdateType.Incompatible;\n}\n\nexport function canInitialize(checkout: ITreeCheckout): boolean {\n\t// Check for empty.\n\treturn checkout.forest.isEmpty && schemaDataIsEmpty(checkout.storedSchema);\n}\n\nfunction normalizeNewFieldContent(\n\tcontent: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined,\n): ITreeCursorSynchronous {\n\tif (content === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\n\tif (isReadonlyArray(content)) {\n\t\treturn cursorForMapTreeField(content.map((c) => mapTreeFromCursor(c)));\n\t}\n\n\tif (content.mode === CursorLocationType.Fields) {\n\t\treturn content;\n\t}\n\n\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n}\n\n/**\n * Initialize a checkout with a schema and tree content.\n * This function should only be called when the tree is uninitialized (no schema or content).\n * @remarks\n *\n * If the proposed schema (from `treeContent`) is not compatible with the emptry tree, this function handles using an intermediate schema\n * which supports the empty tree as well as the final tree content.\n */\nexport function initialize(checkout: ITreeCheckout, treeContent: TreeStoredContent): void {\n\tcheckout.transaction.start();\n\ttry {\n\t\tinitializeContent(checkout, treeContent.schema, () => {\n\t\t\tconst field = { field: rootFieldKey, parent: undefined };\n\t\t\tconst content = normalizeNewFieldContent(treeContent.initialTree);\n\n\t\t\tswitch (checkout.storedSchema.rootFieldSchema.kind) {\n\t\t\t\tcase FieldKinds.optional.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.optionalField(field);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontent.getFieldLength() <= 1,\n\t\t\t\t\t\t0x7f4 /* optional field content should normalize at most one item */,\n\t\t\t\t\t);\n\t\t\t\t\tfieldEditor.set(content.getFieldLength() === 0 ? undefined : content, true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase FieldKinds.sequence.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.sequenceField(field);\n\t\t\t\t\t// TODO: should do an idempotent edit here.\n\t\t\t\t\tfieldEditor.insert(0, content);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tfail(\"unexpected root field kind during initialize\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} finally {\n\t\tcheckout.transaction.commit();\n\t}\n}\n\n/**\n * Ensure a {@link ITreeCheckout} can be used with a given {@link ViewSchema}.\n *\n * @remarks\n * It is up to the caller to ensure that compatibility is reevaluated if the checkout's stored schema is edited in the future.\n *\n * @param viewSchema - View schema that `checkout` should be made compatible with.\n * @param allowedSchemaModifications - Flags enum describing the ways this is allowed to modify `checkout`.\n * @param checkout - To be modified as needed to be compatible with `viewSchema`.\n * @param treeContent - Content to be used to initialize `checkout`'s the tree if needed and allowed.\n * @returns true iff checkout now is compatible with `viewSchema`.\n */\nexport function ensureSchema(\n\tviewSchema: ViewSchema,\n\tallowedSchemaModifications: AllowedUpdateType,\n\tcheckout: ITreeCheckout,\n\ttreeContent: TreeStoredContent | undefined,\n): boolean {\n\tlet possibleModifications = allowedSchemaModifications;\n\tif (treeContent === undefined) {\n\t\t// Clear bit for Initialize if initial tree is not provided.\n\t\t// eslint-disable-next-line no-bitwise\n\t\tpossibleModifications &= ~AllowedUpdateType.Initialize;\n\t}\n\tconst updatedNeeded = evaluateUpdate(viewSchema, possibleModifications, checkout);\n\tswitch (updatedNeeded) {\n\t\tcase UpdateType.None: {\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Incompatible: {\n\t\t\treturn false;\n\t\t}\n\t\tcase UpdateType.SchemaCompatible: {\n\t\t\tcheckout.updateSchema(toStoredSchema(viewSchema.schema));\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Initialize: {\n\t\t\tif (treeContent === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// TODO:\n\t\t\t// When this becomes a more proper out of schema adapter, editing should be made lazy.\n\t\t\t// This will improve support for readonly documents, cross version collaboration and attribution.\n\t\t\tinitialize(checkout, treeContent);\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(updatedNeeded);\n\t\t}\n\t}\n}\n\n/**\n * Content that can populate a `SharedTree`.\n */\nexport interface TreeStoredContent {\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * Default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t */\n\treadonly initialTree: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined;\n}\n"]}
1
+ {"version":3,"file":"schematizeTree.js","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EACN,iBAAiB,EAIjB,YAAY,EACZ,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,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AAY,CAAC,CAAC,CAAC;YAC9B,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAClC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;YAC5B,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC;YACd,CAAC;YACD,QAAQ;YACR,sFAAsF;YACtF,iGAAiG;YACjG,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tAllowedUpdateType,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype TreeStoredSchema,\n\trootFieldKey,\n\tschemaDataIsEmpty,\n} from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\tallowsRepoSuperset,\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tmapTreeFromCursor,\n} from \"../feature-libraries/index.js\";\nimport { fail, isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.js\";\nimport { toStoredSchema, type ViewSchema } from \"../simple-tree/index.js\";\n\n/**\n * Modify `storedSchema` and invoke `setInitialTree` when it's time to set the tree content.\n *\n * Requires `storedSchema` to be in its default/empty state.\n *\n * This is done in such a way that if the content (implicitly assumed to start empty)\n * is never out of schema.\n * This means that if the root field of the new schema requires content (like a value field),\n * a temporary intermediate schema is used so the initial empty state is not out of schema.\n *\n * Since this makes multiple changes, callers may want to wrap it in a transaction.\n */\nexport function initializeContent(\n\tschemaRepository: {\n\t\tstoredSchema: ITreeCheckout[\"storedSchema\"];\n\t\tupdateSchema: ITreeCheckout[\"updateSchema\"];\n\t},\n\tnewSchema: TreeStoredSchema,\n\tsetInitialTree: () => void,\n): void {\n\tassert(\n\t\tschemaDataIsEmpty(schemaRepository.storedSchema),\n\t\t0x743 /* cannot initialize after a schema is set */,\n\t);\n\n\tconst rootSchema = newSchema.rootFieldSchema;\n\tconst rootKind = rootSchema.kind;\n\n\t// To keep the data in schema during the update, first define a schema that tolerates the current (empty) tree as well as the final (initial) tree.\n\tlet incrementalSchemaUpdate: TreeStoredSchema;\n\tif (\n\t\trootKind === FieldKinds.sequence.identifier ||\n\t\trootKind === FieldKinds.optional.identifier\n\t) {\n\t\t// These kinds are known to tolerate empty, so use the schema as is:\n\t\tincrementalSchemaUpdate = newSchema;\n\t} else {\n\t\tassert(rootKind === FieldKinds.required.identifier, 0x5c8 /* Unexpected kind */);\n\t\t// Replace value kind with optional kind in root field schema:\n\t\tincrementalSchemaUpdate = {\n\t\t\tnodeSchema: newSchema.nodeSchema,\n\t\t\trootFieldSchema: {\n\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\ttypes: rootSchema.types,\n\t\t\t},\n\t\t};\n\t}\n\n\t// TODO: fix issues with schema comparison and enable this.\n\t// assert(\n\t// \tallowsRepoSuperset(defaultSchemaPolicy, tree.storedSchema, incrementalSchemaUpdate),\n\t// \t\"Incremental Schema update should support the existing empty tree\",\n\t// );\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should be a allow a superset of the final schema */,\n\t);\n\t// Update to intermediate schema\n\tschemaRepository.updateSchema(incrementalSchemaUpdate);\n\t// Insert initial tree\n\tsetInitialTree();\n\n\t// If intermediate schema is not final desired schema, update to the final schema:\n\tif (incrementalSchemaUpdate !== newSchema) {\n\t\tschemaRepository.updateSchema(newSchema);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\n\t/**\n\t * Empty: needs initializing.\n\t */\n\tInitialize,\n\t/**\n\t * Schema can be upgraded leaving tree as is.\n\t */\n\tSchemaCompatible,\n\t/**\n\t * No update currently supported.\n\t */\n\tIncompatible,\n}\n\nexport function evaluateUpdate(\n\tviewSchema: ViewSchema,\n\tallowedSchemaModifications: AllowedUpdateType,\n\tcheckout: ITreeCheckout,\n): UpdateType {\n\tconst compatibility = viewSchema.checkCompatibility(checkout.storedSchema);\n\n\tif (compatibility.canUpgrade && compatibility.canView) {\n\t\t// Compatible as is\n\t\treturn UpdateType.None;\n\t}\n\n\t// eslint-disable-next-line no-bitwise\n\tif (allowedSchemaModifications & AllowedUpdateType.Initialize && canInitialize(checkout)) {\n\t\treturn UpdateType.Initialize;\n\t}\n\n\tif (!compatibility.canUpgrade) {\n\t\t// Existing stored schema permits trees which are incompatible with the view schema, so schema can not be updated\n\t\treturn UpdateType.Incompatible;\n\t}\n\n\tassert(!compatibility.canView, 0x8bd /* unexpected case */);\n\tassert(compatibility.canUpgrade, 0x8be /* unexpected case */);\n\n\t// eslint-disable-next-line no-bitwise\n\treturn allowedSchemaModifications & AllowedUpdateType.SchemaCompatible\n\t\t? UpdateType.SchemaCompatible\n\t\t: UpdateType.Incompatible;\n}\n\nexport function canInitialize(checkout: ITreeCheckout): boolean {\n\t// Check for empty.\n\treturn checkout.forest.isEmpty && schemaDataIsEmpty(checkout.storedSchema);\n}\n\nfunction normalizeNewFieldContent(\n\tcontent: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined,\n): ITreeCursorSynchronous {\n\tif (content === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\n\tif (isReadonlyArray(content)) {\n\t\treturn cursorForMapTreeField(content.map((c) => mapTreeFromCursor(c)));\n\t}\n\n\tif (content.mode === CursorLocationType.Fields) {\n\t\treturn content;\n\t}\n\n\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n}\n\n/**\n * Initialize a checkout with a schema and tree content.\n * This function should only be called when the tree is uninitialized (no schema or content).\n * @remarks\n *\n * If the proposed schema (from `treeContent`) is not compatible with the emptry tree, this function handles using an intermediate schema\n * which supports the empty tree as well as the final tree content.\n */\nexport function initialize(checkout: ITreeCheckout, treeContent: TreeStoredContent): void {\n\tcheckout.transaction.start();\n\ttry {\n\t\tinitializeContent(checkout, treeContent.schema, () => {\n\t\t\tconst field = { field: rootFieldKey, parent: undefined };\n\t\t\tconst content = normalizeNewFieldContent(treeContent.initialTree);\n\n\t\t\tswitch (checkout.storedSchema.rootFieldSchema.kind) {\n\t\t\t\tcase FieldKinds.optional.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.optionalField(field);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontent.getFieldLength() <= 1,\n\t\t\t\t\t\t0x7f4 /* optional field content should normalize at most one item */,\n\t\t\t\t\t);\n\t\t\t\t\tfieldEditor.set(content.getFieldLength() === 0 ? undefined : content, true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase FieldKinds.sequence.identifier: {\n\t\t\t\t\tconst fieldEditor = checkout.editor.sequenceField(field);\n\t\t\t\t\t// TODO: should do an idempotent edit here.\n\t\t\t\t\tfieldEditor.insert(0, content);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tfail(0xac7 /* unexpected root field kind during initialize */);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} finally {\n\t\tcheckout.transaction.commit();\n\t}\n}\n\n/**\n * Ensure a {@link ITreeCheckout} can be used with a given {@link ViewSchema}.\n *\n * @remarks\n * It is up to the caller to ensure that compatibility is reevaluated if the checkout's stored schema is edited in the future.\n *\n * @param viewSchema - View schema that `checkout` should be made compatible with.\n * @param allowedSchemaModifications - Flags enum describing the ways this is allowed to modify `checkout`.\n * @param checkout - To be modified as needed to be compatible with `viewSchema`.\n * @param treeContent - Content to be used to initialize `checkout`'s the tree if needed and allowed.\n * @returns true iff checkout now is compatible with `viewSchema`.\n */\nexport function ensureSchema(\n\tviewSchema: ViewSchema,\n\tallowedSchemaModifications: AllowedUpdateType,\n\tcheckout: ITreeCheckout,\n\ttreeContent: TreeStoredContent | undefined,\n): boolean {\n\tlet possibleModifications = allowedSchemaModifications;\n\tif (treeContent === undefined) {\n\t\t// Clear bit for Initialize if initial tree is not provided.\n\t\t// eslint-disable-next-line no-bitwise\n\t\tpossibleModifications &= ~AllowedUpdateType.Initialize;\n\t}\n\tconst updatedNeeded = evaluateUpdate(viewSchema, possibleModifications, checkout);\n\tswitch (updatedNeeded) {\n\t\tcase UpdateType.None: {\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Incompatible: {\n\t\t\treturn false;\n\t\t}\n\t\tcase UpdateType.SchemaCompatible: {\n\t\t\tcheckout.updateSchema(toStoredSchema(viewSchema.schema));\n\t\t\treturn true;\n\t\t}\n\t\tcase UpdateType.Initialize: {\n\t\t\tif (treeContent === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// TODO:\n\t\t\t// When this becomes a more proper out of schema adapter, editing should be made lazy.\n\t\t\t// This will improve support for readonly documents, cross version collaboration and attribution.\n\t\t\tinitialize(checkout, treeContent);\n\t\t\treturn true;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(updatedNeeded);\n\t\t}\n\t}\n}\n\n/**\n * Content that can populate a `SharedTree`.\n */\nexport interface TreeStoredContent {\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * Default tree content to initialize the tree with iff the tree is uninitialized\n\t * (meaning it does not even have any schema set at all).\n\t */\n\treadonly initialTree: readonly ITreeCursorSynchronous[] | ITreeCursorSynchronous | undefined;\n}\n"]}
@@ -2,22 +2,23 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { ErasedType } from "@fluidframework/core-interfaces/internal";
6
- import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannel } from "@fluidframework/datastore-definitions/internal";
7
- import { SharedObject, type IFluidSerializer, type ISharedObject } from "@fluidframework/shared-object-base/internal";
5
+ import type { ErasedType, IFluidLoadable } from "@fluidframework/core-interfaces/internal";
6
+ import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
7
+ import { SharedObject, type IChannelView, type IFluidSerializer, type ISharedObject } from "@fluidframework/shared-object-base/internal";
8
+ import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
8
9
  import type { IIdCompressor } from "@fluidframework/id-compressor";
9
- import type { ITelemetryContext, IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
10
+ import type { ITelemetryContext, IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, IRuntimeMessageCollection } from "@fluidframework/runtime-definitions/internal";
10
11
  import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
11
12
  import { type ICodecOptions } from "../codec/index.js";
12
- import { type IEditableForest, type JsonableTree, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription } from "../core/index.js";
13
+ import { type GraphCommit, type IEditableForest, type JsonableTree, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription } from "../core/index.js";
13
14
  import { TreeCompressionStrategy } from "../feature-libraries/index.js";
14
- import { SharedTreeCore } from "../shared-tree-core/index.js";
15
+ import { type ClonableSchemaAndPolicy, SharedTreeCore } from "../shared-tree-core/index.js";
15
16
  import { type ITree, type ImplicitFieldSchema, type ReadSchema, type SimpleTreeSchema, type TreeView, type TreeViewAlpha, type TreeViewConfiguration, type UnsafeUnknownSchema, type VerboseTree, type ITreeAlpha } from "../simple-tree/index.js";
16
17
  import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
17
18
  import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
18
19
  import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
19
20
  import { type TreeCheckout, type BranchableTree } from "./treeCheckout.js";
20
- import { Breakable, type WithBreakable } from "../util/index.js";
21
+ import { Breakable } from "../util/index.js";
21
22
  /**
22
23
  * Copy of data from an {@link ITreePrivate} at some point in time.
23
24
  * @remarks
@@ -41,13 +42,6 @@ export interface SharedTreeContentSnapshot {
41
42
  */
42
43
  readonly removed: [string | number | undefined, number, JsonableTree][];
43
44
  }
44
- /**
45
- * Information about a Fluid channel.
46
- * @privateRemarks
47
- * This is distinct from {@link IChannel} as it omits the APIs used by the runtime to manage the channel and instead only has things which are useful (and safe) to expose to users of the channel.
48
- * @internal
49
- */
50
- export type IChannelView = Pick<IChannel, "id" | "attributes" | "isAttached">;
51
45
  /**
52
46
  * {@link ITree} extended with some non-public APIs.
53
47
  * @internal
@@ -69,6 +63,10 @@ export interface ITreePrivate extends ITreeInternal {
69
63
  * This does not include everything that is included in a tree summary, since information about how to merge future edits is omitted.
70
64
  */
71
65
  contentSnapshot(): SharedTreeContentSnapshot;
66
+ /**
67
+ * Access to internals for testing.
68
+ */
69
+ readonly kernel: SharedTreeKernel;
72
70
  }
73
71
  /**
74
72
  * {@link ITreePrivate} extended with ISharedObject.
@@ -80,15 +78,13 @@ export interface ISharedTree extends ISharedObject, ITreePrivate {
80
78
  /**
81
79
  * Shared object wrapping {@link SharedTreeKernel}.
82
80
  */
83
- export declare class SharedTree extends SharedObject implements ISharedTree, WithBreakable {
84
- readonly breaker: Breakable;
85
- get checkout(): TreeCheckout;
86
- get storedSchema(): TreeStoredSchemaRepository;
87
- private readonly kernel;
81
+ export declare class SharedTree extends SharedObject implements ISharedTree {
82
+ private readonly breaker;
83
+ readonly kernel: SharedTreeKernel;
88
84
  constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, optionsParam: SharedTreeOptionsInternal, telemetryContextPrefix?: string);
89
- get editor(): SharedTreeEditBuilder;
90
85
  summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): ISummaryTreeWithStats;
91
86
  protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
87
+ protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
92
88
  protected onDisconnect(): void;
93
89
  exportVerbose(): VerboseTree | undefined;
94
90
  exportSimpleSchema(): SimpleTreeSchema;
@@ -100,6 +96,26 @@ export declare class SharedTree extends SharedObject implements ISharedTree, Wit
100
96
  protected applyStashedOp(...args: Parameters<SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>["applyStashedOp"]>): void;
101
97
  protected reSubmitCore(...args: Parameters<SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>["reSubmitCore"]>): void;
102
98
  }
99
+ /**
100
+ * SharedTreeCore, configured with a good set of indexes and field kinds which will maintain compatibility over time.
101
+ *
102
+ * TODO: detail compatibility requirements.
103
+ */
104
+ declare class SharedTreeKernel extends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange> {
105
+ readonly checkout: TreeCheckout;
106
+ get storedSchema(): TreeStoredSchemaRepository;
107
+ constructor(breaker: Breakable, sharedObject: IChannelView & IFluidLoadable, serializer: IFluidSerializer, submitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void, lastSequenceNumber: () => number | undefined, logger: ITelemetryLoggerExt | undefined, idCompressor: IIdCompressor, optionsParam: SharedTreeOptionsInternal);
108
+ exportVerbose(): VerboseTree | undefined;
109
+ exportSimpleSchema(): SimpleTreeSchema;
110
+ contentSnapshot(): SharedTreeContentSnapshot;
111
+ viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(config: TreeViewConfiguration<ReadSchema<TRoot>>): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;
112
+ viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): SchematizingSimpleTreeView<TRoot> & TreeView<TRoot>;
113
+ loadCore(services: IChannelStorageService): Promise<void>;
114
+ didAttach(): void;
115
+ applyStashedOp(...args: Parameters<SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>["applyStashedOp"]>): void;
116
+ protected submitCommit(commit: GraphCommit<SharedTreeChange>, schemaAndPolicy: ClonableSchemaAndPolicy, isResubmit: boolean): void;
117
+ onDisconnect(): void;
118
+ }
103
119
  /**
104
120
  * Get a {@link BranchableTree} from a {@link ITree}.
105
121
  * @remarks The branch can be used for "version control"-style coordination of edits on the tree.
@@ -238,4 +254,5 @@ export declare const ForestTypeExpensiveDebug: ForestType;
238
254
  */
239
255
  export declare function buildConfiguredForest(factory: ForestType, schema: TreeStoredSchemaSubscription, idCompressor: IIdCompressor): IEditableForest;
240
256
  export declare const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal>;
257
+ export {};
241
258
  //# sourceMappingURL=sharedTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,UAAU,EAGV,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,MAAM,6CAA6C,CAAC;AAKrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EACX,iBAAiB,EACjB,sCAAsC,EACtC,qBAAqB,EACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAEN,KAAK,eAAe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,uBAAuB,CAAC,MAAM,uBAAuB,CAAC,CAAC;CACtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,UAAU,CAAC,YAAY,CAAC;CAAG;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,YAAoC,CAAC;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,YAG/B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,YAAmD,CAAC;AAWzF;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,4BAA4B,EACpC,YAAY,EAAE,aAAa,GACzB,eAAe,CAEjB;AAED,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,yBAAyB,CAMxE,CAAC"}
@@ -52,7 +52,7 @@ import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
52
52
  import { SharedTreeReadonlyChangeEnricher } from "./sharedTreeChangeEnricher.js";
53
53
  import { SharedTreeChangeFamily } from "./sharedTreeChangeFamily.js";
54
54
  import { createTreeCheckout } from "./treeCheckout.js";
55
- import { Breakable, breakingClass, fail, throwIfBroken, } from "../util/index.js";
55
+ import { Breakable, breakingClass, fail, throwIfBroken } from "../util/index.js";
56
56
  const formatVersionToTopLevelCodecVersions = new Map([
57
57
  [
58
58
  1,
@@ -80,12 +80,6 @@ function getCodecVersions(formatVersion) {
80
80
  * Shared object wrapping {@link SharedTreeKernel}.
81
81
  */
82
82
  export class SharedTree extends SharedObject {
83
- get checkout() {
84
- return this.kernel.checkout;
85
- }
86
- get storedSchema() {
87
- return this.checkout.storedSchema;
88
- }
89
83
  constructor(id, runtime, attributes, optionsParam, telemetryContextPrefix = "fluid_sharedTree_") {
90
84
  super(id, runtime, attributes, telemetryContextPrefix);
91
85
  this.breaker = new Breakable("Shared Tree");
@@ -94,16 +88,18 @@ export class SharedTree extends SharedObject {
94
88
  }
95
89
  this.kernel = new SharedTreeKernel(this.breaker, this, this.serializer, (content, localOpMetadata) => this.submitLocalMessage(content, localOpMetadata), () => this.deltaManager.lastSequenceNumber, this.logger, runtime.idCompressor, optionsParam);
96
90
  }
97
- get editor() {
98
- return this.kernel.getEditor();
99
- }
100
91
  summarizeCore(serializer, telemetryContext, incrementalSummaryContext) {
101
92
  return this.kernel.summarizeCore(serializer, telemetryContext, incrementalSummaryContext);
102
93
  }
103
94
  processCore(message, local, localOpMetadata) {
104
95
  this.kernel.processCore(message, local, localOpMetadata);
105
96
  }
106
- onDisconnect() { }
97
+ processMessagesCore(messagesCollection) {
98
+ this.kernel.processMessagesCore(messagesCollection);
99
+ }
100
+ onDisconnect() {
101
+ this.kernel.onDisconnect();
102
+ }
107
103
  exportVerbose() {
108
104
  return this.kernel.exportVerbose();
109
105
  }
@@ -242,7 +238,7 @@ let SharedTreeKernel = (() => {
242
238
  return verboseFromCursor(cursor, this.storedSchema.nodeSchema);
243
239
  }
244
240
  else {
245
- fail("Invalid document root length");
241
+ fail(0xac8 /* Invalid document root length */);
246
242
  }
247
243
  }
248
244
  finally {
@@ -300,6 +296,7 @@ let SharedTreeKernel = (() => {
300
296
  // that causes a crash (e.g. in the forest), this will at least prevent this client from sending the problematic commit to any other clients.
301
297
  this.checkout.onCommitValid(commit, () => super.submitCommit(commit, schemaAndPolicy, isResubmit));
302
298
  }
299
+ onDisconnect() { }
303
300
  };
304
301
  __setFunctionName(_classThis, "SharedTreeKernel");
305
302
  (() => {
@@ -314,10 +311,13 @@ let SharedTreeKernel = (() => {
314
311
  return SharedTreeKernel = _classThis;
315
312
  })();
316
313
  export function getBranch(treeOrView) {
317
- assert(treeOrView instanceof SharedTree || treeOrView instanceof SchematizingSimpleTreeView, 0xa48 /* Unsupported implementation */);
318
- const checkout = treeOrView.checkout;
314
+ if (treeOrView instanceof SchematizingSimpleTreeView) {
315
+ return treeOrView.checkout;
316
+ }
317
+ const kernel = treeOrView.kernel;
318
+ assert(kernel instanceof SharedTreeKernel, 0xb56 /* Invalid ITree */);
319
319
  // This cast is safe so long as TreeCheckout supports all the operations on the branch interface.
320
- return checkout;
320
+ return kernel.checkout;
321
321
  }
322
322
  /**
323
323
  * Format versions supported by SharedTree.
@@ -389,7 +389,7 @@ export const defaultSharedTreeOptions = {
389
389
  };
390
390
  function verboseFromCursor(reader, schema) {
391
391
  const fields = customFromCursorStored(reader, schema, verboseFromCursor);
392
- const nodeSchema = schema.get(reader.type) ?? fail("missing schema for type in cursor");
392
+ const nodeSchema = schema.get(reader.type) ?? fail(0xac9 /* missing schema for type in cursor */);
393
393
  if (nodeSchema instanceof LeafNodeStoredSchema) {
394
394
  return fields;
395
395
  }
@@ -415,7 +415,7 @@ function exportSimpleFieldSchemaStored(schema) {
415
415
  assert(schema.types.size === 0, 0xa94 /* invalid forbidden field */);
416
416
  break;
417
417
  default:
418
- fail("invalid field kind");
418
+ fail(0xaca /* invalid field kind */);
419
419
  }
420
420
  return { kind, allowedTypes: schema.types };
421
421
  }
@@ -438,6 +438,6 @@ function exportSimpleNodeSchemaStored(schema) {
438
438
  if (schema instanceof LeafNodeStoredSchema) {
439
439
  return { kind: NodeKind.Leaf, leafKind: schema.leafValue };
440
440
  }
441
- fail("invalid schema kind");
441
+ fail(0xacb /* invalid schema kind */);
442
442
  }
443
443
  //# sourceMappingURL=sharedTree.js.map