@fluidframework/tree 2.51.0 → 2.53.0-350190

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 (730) hide show
  1. package/.vscode/settings.json +0 -1
  2. package/CHANGELOG.md +43 -0
  3. package/api-report/tree.alpha.api.md +40 -30
  4. package/dist/alpha.d.ts +2 -1
  5. package/dist/codec/codec.d.ts +2 -1
  6. package/dist/codec/codec.d.ts.map +1 -1
  7. package/dist/codec/codec.js +4 -3
  8. package/dist/codec/codec.js.map +1 -1
  9. package/dist/core/index.d.ts +1 -1
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +3 -2
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/rebase/index.d.ts +1 -1
  14. package/dist/core/rebase/index.d.ts.map +1 -1
  15. package/dist/core/rebase/index.js +2 -1
  16. package/dist/core/rebase/index.js.map +1 -1
  17. package/dist/core/rebase/types.d.ts +3 -1
  18. package/dist/core/rebase/types.d.ts.map +1 -1
  19. package/dist/core/rebase/types.js +2 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/schema-stored/schema.d.ts +1 -23
  22. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  23. package/dist/core/schema-stored/schema.js +2 -2
  24. package/dist/core/schema-stored/schema.js.map +1 -1
  25. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  26. package/dist/core/tree/detachedFieldIndex.js +2 -3
  27. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  29. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  30. package/dist/core/tree/detachedFieldIndexCodecCommon.js +68 -0
  31. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  32. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  33. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  34. package/dist/core/tree/detachedFieldIndexCodecV1.js +55 -0
  35. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  36. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  37. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  38. package/dist/core/tree/detachedFieldIndexCodecV2.js +49 -0
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  40. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  41. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  42. package/dist/core/tree/detachedFieldIndexCodecs.js +26 -0
  43. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  44. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  45. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  46. package/dist/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +18 -13
  47. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  48. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  49. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  50. package/dist/core/tree/detachedFieldIndexFormatV1.js +12 -0
  51. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  52. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  53. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  54. package/dist/core/tree/detachedFieldIndexFormatV2.js +14 -0
  55. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  56. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  57. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +21 -21
  59. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  61. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  65. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +74 -61
  67. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  69. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/format.js +18 -12
  71. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  72. package/{lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts → dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  73. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  74. package/dist/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +23 -17
  75. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  76. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  77. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -22
  79. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  81. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  82. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  83. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
  85. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  86. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  87. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -2
  88. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  90. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  91. package/dist/feature-libraries/default-schema/index.js +2 -2
  92. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  93. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  94. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  95. package/dist/feature-libraries/default-schema/schemaChecker.js +31 -26
  96. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  97. package/dist/feature-libraries/index.d.ts +1 -2
  98. package/dist/feature-libraries/index.d.ts.map +1 -1
  99. package/dist/feature-libraries/index.js +2 -4
  100. package/dist/feature-libraries/index.js.map +1 -1
  101. package/dist/feature-libraries/modular-schema/comparison.d.ts +5 -6
  102. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  103. package/dist/feature-libraries/modular-schema/comparison.js +15 -16
  104. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  105. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
  106. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  107. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
  108. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  110. package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -0
  111. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +49 -20
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  117. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  118. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  119. package/dist/feature-libraries/object-forest/objectForest.js +2 -3
  120. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  121. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  122. package/dist/feature-libraries/optional-field/optionalField.js +3 -0
  123. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  124. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
  125. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  126. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
  127. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  128. package/dist/index.d.ts +1 -1
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +6 -2
  131. package/dist/index.js.map +1 -1
  132. package/dist/jsonDomainSchema.d.ts +5 -3
  133. package/dist/jsonDomainSchema.d.ts.map +1 -1
  134. package/dist/jsonDomainSchema.js.map +1 -1
  135. package/dist/packageVersion.d.ts +1 -1
  136. package/dist/packageVersion.d.ts.map +1 -1
  137. package/dist/packageVersion.js +1 -1
  138. package/dist/packageVersion.js.map +1 -1
  139. package/dist/shared-tree/independentView.d.ts +8 -0
  140. package/dist/shared-tree/independentView.d.ts.map +1 -1
  141. package/dist/shared-tree/independentView.js +23 -11
  142. package/dist/shared-tree/independentView.js.map +1 -1
  143. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  144. package/dist/shared-tree/schematizeTree.js +1 -1
  145. package/dist/shared-tree/schematizeTree.js.map +1 -1
  146. package/dist/shared-tree/schematizingTreeView.d.ts +0 -1
  147. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  148. package/dist/shared-tree/schematizingTreeView.js +9 -12
  149. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  150. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  151. package/dist/shared-tree/sharedTree.js +1 -29
  152. package/dist/shared-tree/sharedTree.js.map +1 -1
  153. package/dist/shared-tree/treeAlpha.d.ts +20 -6
  154. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  155. package/dist/shared-tree/treeAlpha.js +18 -7
  156. package/dist/shared-tree/treeAlpha.js.map +1 -1
  157. package/dist/shared-tree/treeCheckout.d.ts +2 -1
  158. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  159. package/dist/shared-tree/treeCheckout.js +32 -0
  160. package/dist/shared-tree/treeCheckout.js.map +1 -1
  161. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  162. package/dist/shared-tree-core/branch.js +1 -1
  163. package/dist/shared-tree-core/branch.js.map +1 -1
  164. package/dist/simple-tree/api/conciseTree.d.ts +2 -2
  165. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  166. package/dist/simple-tree/api/conciseTree.js +6 -6
  167. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  168. package/dist/simple-tree/api/configuration.d.ts +11 -2
  169. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  170. package/dist/simple-tree/api/configuration.js +5 -1
  171. package/dist/simple-tree/api/configuration.js.map +1 -1
  172. package/dist/simple-tree/api/create.d.ts +8 -7
  173. package/dist/simple-tree/api/create.d.ts.map +1 -1
  174. package/dist/simple-tree/api/create.js +33 -23
  175. package/dist/simple-tree/api/create.js.map +1 -1
  176. package/dist/simple-tree/api/customTree.d.ts +25 -4
  177. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  178. package/dist/simple-tree/api/customTree.js +42 -16
  179. package/dist/simple-tree/api/customTree.js.map +1 -1
  180. package/dist/simple-tree/api/discrepancies.d.ts +94 -0
  181. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -0
  182. package/dist/simple-tree/api/discrepancies.js +256 -0
  183. package/dist/simple-tree/api/discrepancies.js.map +1 -0
  184. package/dist/simple-tree/api/index.d.ts +3 -2
  185. package/dist/simple-tree/api/index.d.ts.map +1 -1
  186. package/dist/simple-tree/api/index.js +3 -2
  187. package/dist/simple-tree/api/index.js.map +1 -1
  188. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  189. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  190. package/dist/simple-tree/api/schemaCompatibilityTester.js +17 -117
  191. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  192. package/dist/simple-tree/api/schemaFactory.d.ts +16 -159
  193. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  194. package/dist/simple-tree/api/schemaFactory.js +4 -47
  195. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  196. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
  197. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  198. package/dist/simple-tree/api/schemaFactoryAlpha.js +33 -11
  199. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  200. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
  201. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  202. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -7
  203. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  204. package/dist/simple-tree/api/schemaStatics.d.ts +158 -0
  205. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -0
  206. package/dist/simple-tree/api/schemaStatics.js +59 -0
  207. package/dist/simple-tree/api/schemaStatics.js.map +1 -0
  208. package/dist/simple-tree/api/storedSchema.d.ts +5 -3
  209. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  210. package/dist/simple-tree/api/storedSchema.js +9 -3
  211. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  212. package/dist/simple-tree/api/treeBeta.d.ts +2 -2
  213. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  214. package/dist/simple-tree/api/treeBeta.js +16 -4
  215. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  216. package/dist/simple-tree/api/verboseTree.d.ts +2 -2
  217. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  218. package/dist/simple-tree/api/verboseTree.js +15 -15
  219. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  220. package/dist/simple-tree/core/allowedTypes.d.ts +43 -11
  221. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  222. package/dist/simple-tree/core/allowedTypes.js +51 -11
  223. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  224. package/dist/simple-tree/core/context.d.ts +13 -2
  225. package/dist/simple-tree/core/context.d.ts.map +1 -1
  226. package/dist/simple-tree/core/context.js +22 -9
  227. package/dist/simple-tree/core/context.js.map +1 -1
  228. package/dist/simple-tree/core/index.d.ts +6 -4
  229. package/dist/simple-tree/core/index.d.ts.map +1 -1
  230. package/dist/simple-tree/core/index.js +8 -1
  231. package/dist/simple-tree/core/index.js.map +1 -1
  232. package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
  233. package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
  234. package/dist/simple-tree/core/simpleNodeSchemaBase.js +7 -0
  235. package/dist/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
  236. package/dist/simple-tree/core/toStored.d.ts +32 -0
  237. package/dist/simple-tree/core/toStored.d.ts.map +1 -0
  238. package/dist/simple-tree/core/toStored.js +37 -0
  239. package/dist/simple-tree/core/toStored.js.map +1 -0
  240. package/dist/simple-tree/core/treeNodeKernel.d.ts +1 -1
  241. package/dist/simple-tree/core/treeNodeKernel.js +1 -1
  242. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  243. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -2
  244. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  246. package/dist/simple-tree/core/treeNodeValid.d.ts +7 -2
  247. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  248. package/dist/simple-tree/core/treeNodeValid.js +19 -4
  249. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  250. package/dist/simple-tree/core/walkSchema.d.ts +22 -5
  251. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  252. package/dist/simple-tree/core/walkSchema.js +6 -2
  253. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  254. package/dist/simple-tree/createContext.d.ts +2 -0
  255. package/dist/simple-tree/createContext.d.ts.map +1 -1
  256. package/dist/simple-tree/createContext.js +4 -2
  257. package/dist/simple-tree/createContext.js.map +1 -1
  258. package/dist/simple-tree/fieldSchema.d.ts +1 -0
  259. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  260. package/dist/simple-tree/fieldSchema.js +2 -1
  261. package/dist/simple-tree/fieldSchema.js.map +1 -1
  262. package/dist/simple-tree/index.d.ts +7 -7
  263. package/dist/simple-tree/index.d.ts.map +1 -1
  264. package/dist/simple-tree/index.js +13 -8
  265. package/dist/simple-tree/index.js.map +1 -1
  266. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  267. package/dist/simple-tree/leafNodeSchema.js +1 -0
  268. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  269. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  270. package/dist/simple-tree/node-kinds/array/arrayNode.js +18 -4
  271. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  272. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  273. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  274. package/dist/simple-tree/node-kinds/index.js +1 -2
  275. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  276. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  277. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -2
  278. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  279. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  280. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  281. package/dist/simple-tree/node-kinds/object/index.js +1 -2
  282. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  283. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
  284. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  285. package/dist/simple-tree/node-kinds/object/objectNode.js +41 -44
  286. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  287. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  288. package/dist/simple-tree/node-kinds/record/recordNode.js +9 -2
  289. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  290. package/dist/simple-tree/prepareForInsertion.d.ts +6 -6
  291. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  292. package/dist/simple-tree/prepareForInsertion.js +19 -13
  293. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  294. package/dist/simple-tree/simpleSchema.d.ts +6 -21
  295. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  296. package/dist/simple-tree/simpleSchema.js.map +1 -1
  297. package/dist/simple-tree/toStoredSchema.d.ts +38 -11
  298. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  299. package/dist/simple-tree/toStoredSchema.js +71 -33
  300. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  301. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  302. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  303. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  304. package/dist/simple-tree/walkFieldSchema.d.ts +1 -0
  305. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  306. package/dist/simple-tree/walkFieldSchema.js +1 -0
  307. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  308. package/lib/alpha.d.ts +2 -1
  309. package/lib/codec/codec.d.ts +2 -1
  310. package/lib/codec/codec.d.ts.map +1 -1
  311. package/lib/codec/codec.js +4 -3
  312. package/lib/codec/codec.js.map +1 -1
  313. package/lib/core/index.d.ts +1 -1
  314. package/lib/core/index.d.ts.map +1 -1
  315. package/lib/core/index.js +1 -1
  316. package/lib/core/index.js.map +1 -1
  317. package/lib/core/rebase/index.d.ts +1 -1
  318. package/lib/core/rebase/index.d.ts.map +1 -1
  319. package/lib/core/rebase/index.js +1 -1
  320. package/lib/core/rebase/index.js.map +1 -1
  321. package/lib/core/rebase/types.d.ts +3 -1
  322. package/lib/core/rebase/types.d.ts.map +1 -1
  323. package/lib/core/rebase/types.js +1 -0
  324. package/lib/core/rebase/types.js.map +1 -1
  325. package/lib/core/schema-stored/schema.d.ts +1 -23
  326. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  327. package/lib/core/schema-stored/schema.js +2 -2
  328. package/lib/core/schema-stored/schema.js.map +1 -1
  329. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  330. package/lib/core/tree/detachedFieldIndex.js +2 -3
  331. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  332. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  333. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  334. package/lib/core/tree/detachedFieldIndexCodecCommon.js +64 -0
  335. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  336. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  337. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  338. package/lib/core/tree/detachedFieldIndexCodecV1.js +51 -0
  339. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  340. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  341. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  342. package/lib/core/tree/detachedFieldIndexCodecV2.js +45 -0
  343. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  344. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  345. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  346. package/lib/core/tree/detachedFieldIndexCodecs.js +21 -0
  347. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  348. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  349. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  350. package/lib/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +13 -10
  351. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  352. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  353. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  354. package/lib/core/tree/detachedFieldIndexFormatV1.js +9 -0
  355. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  356. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  357. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  358. package/lib/core/tree/detachedFieldIndexFormatV2.js +11 -0
  359. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  360. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  361. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  362. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +19 -19
  363. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  364. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  365. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  366. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  367. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  368. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  369. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  370. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +70 -57
  371. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  372. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  373. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  374. package/lib/feature-libraries/chunked-forest/codec/format.js +17 -11
  375. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  376. package/{dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts → lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  377. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  378. package/lib/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +21 -15
  379. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  380. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  381. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  382. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +19 -19
  383. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  384. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  385. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  386. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  387. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  388. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
  389. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  390. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  391. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -2
  392. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  393. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  394. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  395. package/lib/feature-libraries/default-schema/index.js +1 -1
  396. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  397. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  398. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  399. package/lib/feature-libraries/default-schema/schemaChecker.js +29 -24
  400. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  401. package/lib/feature-libraries/index.d.ts +1 -2
  402. package/lib/feature-libraries/index.d.ts.map +1 -1
  403. package/lib/feature-libraries/index.js +1 -2
  404. package/lib/feature-libraries/index.js.map +1 -1
  405. package/lib/feature-libraries/modular-schema/comparison.d.ts +5 -6
  406. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  407. package/lib/feature-libraries/modular-schema/comparison.js +14 -14
  408. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  409. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
  410. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  411. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
  412. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  413. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  414. package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -0
  415. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  416. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
  417. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  418. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +50 -21
  419. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  420. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  421. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  422. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  423. package/lib/feature-libraries/object-forest/objectForest.js +3 -4
  424. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  425. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  426. package/lib/feature-libraries/optional-field/optionalField.js +3 -0
  427. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  428. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
  429. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  430. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
  431. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  432. package/lib/index.d.ts +1 -1
  433. package/lib/index.d.ts.map +1 -1
  434. package/lib/index.js +2 -2
  435. package/lib/index.js.map +1 -1
  436. package/lib/jsonDomainSchema.d.ts +5 -3
  437. package/lib/jsonDomainSchema.d.ts.map +1 -1
  438. package/lib/jsonDomainSchema.js.map +1 -1
  439. package/lib/packageVersion.d.ts +1 -1
  440. package/lib/packageVersion.d.ts.map +1 -1
  441. package/lib/packageVersion.js +1 -1
  442. package/lib/packageVersion.js.map +1 -1
  443. package/lib/shared-tree/independentView.d.ts +8 -0
  444. package/lib/shared-tree/independentView.d.ts.map +1 -1
  445. package/lib/shared-tree/independentView.js +21 -10
  446. package/lib/shared-tree/independentView.js.map +1 -1
  447. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  448. package/lib/shared-tree/schematizeTree.js +2 -2
  449. package/lib/shared-tree/schematizeTree.js.map +1 -1
  450. package/lib/shared-tree/schematizingTreeView.d.ts +0 -1
  451. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  452. package/lib/shared-tree/schematizingTreeView.js +10 -13
  453. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  454. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  455. package/lib/shared-tree/sharedTree.js +2 -30
  456. package/lib/shared-tree/sharedTree.js.map +1 -1
  457. package/lib/shared-tree/treeAlpha.d.ts +20 -6
  458. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  459. package/lib/shared-tree/treeAlpha.js +19 -8
  460. package/lib/shared-tree/treeAlpha.js.map +1 -1
  461. package/lib/shared-tree/treeCheckout.d.ts +2 -1
  462. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  463. package/lib/shared-tree/treeCheckout.js +33 -1
  464. package/lib/shared-tree/treeCheckout.js.map +1 -1
  465. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  466. package/lib/shared-tree-core/branch.js +1 -1
  467. package/lib/shared-tree-core/branch.js.map +1 -1
  468. package/lib/simple-tree/api/conciseTree.d.ts +2 -2
  469. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  470. package/lib/simple-tree/api/conciseTree.js +6 -6
  471. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  472. package/lib/simple-tree/api/configuration.d.ts +11 -2
  473. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  474. package/lib/simple-tree/api/configuration.js +6 -2
  475. package/lib/simple-tree/api/configuration.js.map +1 -1
  476. package/lib/simple-tree/api/create.d.ts +8 -7
  477. package/lib/simple-tree/api/create.d.ts.map +1 -1
  478. package/lib/simple-tree/api/create.js +35 -25
  479. package/lib/simple-tree/api/create.js.map +1 -1
  480. package/lib/simple-tree/api/customTree.d.ts +25 -4
  481. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  482. package/lib/simple-tree/api/customTree.js +43 -17
  483. package/lib/simple-tree/api/customTree.js.map +1 -1
  484. package/lib/simple-tree/api/discrepancies.d.ts +94 -0
  485. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -0
  486. package/lib/simple-tree/api/discrepancies.js +251 -0
  487. package/lib/simple-tree/api/discrepancies.js.map +1 -0
  488. package/lib/simple-tree/api/index.d.ts +3 -2
  489. package/lib/simple-tree/api/index.d.ts.map +1 -1
  490. package/lib/simple-tree/api/index.js +2 -1
  491. package/lib/simple-tree/api/index.js.map +1 -1
  492. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  493. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  494. package/lib/simple-tree/api/schemaCompatibilityTester.js +19 -119
  495. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  496. package/lib/simple-tree/api/schemaFactory.d.ts +16 -159
  497. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  498. package/lib/simple-tree/api/schemaFactory.js +2 -45
  499. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  500. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
  501. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  502. package/lib/simple-tree/api/schemaFactoryAlpha.js +23 -1
  503. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  504. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
  505. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  506. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -5
  507. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  508. package/lib/simple-tree/api/schemaStatics.d.ts +158 -0
  509. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -0
  510. package/lib/simple-tree/api/schemaStatics.js +56 -0
  511. package/lib/simple-tree/api/schemaStatics.js.map +1 -0
  512. package/lib/simple-tree/api/storedSchema.d.ts +5 -3
  513. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  514. package/lib/simple-tree/api/storedSchema.js +12 -6
  515. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  516. package/lib/simple-tree/api/treeBeta.d.ts +2 -2
  517. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeBeta.js +14 -2
  519. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  520. package/lib/simple-tree/api/verboseTree.d.ts +2 -2
  521. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  522. package/lib/simple-tree/api/verboseTree.js +9 -9
  523. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  524. package/lib/simple-tree/core/allowedTypes.d.ts +43 -11
  525. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  526. package/lib/simple-tree/core/allowedTypes.js +52 -11
  527. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  528. package/lib/simple-tree/core/context.d.ts +13 -2
  529. package/lib/simple-tree/core/context.d.ts.map +1 -1
  530. package/lib/simple-tree/core/context.js +22 -9
  531. package/lib/simple-tree/core/context.js.map +1 -1
  532. package/lib/simple-tree/core/index.d.ts +6 -4
  533. package/lib/simple-tree/core/index.d.ts.map +1 -1
  534. package/lib/simple-tree/core/index.js +4 -3
  535. package/lib/simple-tree/core/index.js.map +1 -1
  536. package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
  537. package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
  538. package/lib/simple-tree/core/simpleNodeSchemaBase.js +6 -0
  539. package/lib/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
  540. package/lib/simple-tree/core/toStored.d.ts +32 -0
  541. package/lib/simple-tree/core/toStored.d.ts.map +1 -0
  542. package/lib/simple-tree/core/toStored.js +32 -0
  543. package/lib/simple-tree/core/toStored.js.map +1 -0
  544. package/lib/simple-tree/core/treeNodeKernel.d.ts +1 -1
  545. package/lib/simple-tree/core/treeNodeKernel.js +1 -1
  546. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  547. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -2
  548. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  549. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  550. package/lib/simple-tree/core/treeNodeValid.d.ts +7 -2
  551. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  552. package/lib/simple-tree/core/treeNodeValid.js +17 -3
  553. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  554. package/lib/simple-tree/core/walkSchema.d.ts +22 -5
  555. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  556. package/lib/simple-tree/core/walkSchema.js +6 -2
  557. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  558. package/lib/simple-tree/createContext.d.ts +2 -0
  559. package/lib/simple-tree/createContext.d.ts.map +1 -1
  560. package/lib/simple-tree/createContext.js +5 -3
  561. package/lib/simple-tree/createContext.js.map +1 -1
  562. package/lib/simple-tree/fieldSchema.d.ts +1 -0
  563. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  564. package/lib/simple-tree/fieldSchema.js +2 -1
  565. package/lib/simple-tree/fieldSchema.js.map +1 -1
  566. package/lib/simple-tree/index.d.ts +7 -7
  567. package/lib/simple-tree/index.d.ts.map +1 -1
  568. package/lib/simple-tree/index.js +5 -5
  569. package/lib/simple-tree/index.js.map +1 -1
  570. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  571. package/lib/simple-tree/leafNodeSchema.js +2 -1
  572. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  573. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  574. package/lib/simple-tree/node-kinds/array/arrayNode.js +21 -7
  575. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  576. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  577. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  578. package/lib/simple-tree/node-kinds/index.js +1 -1
  579. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  580. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  581. package/lib/simple-tree/node-kinds/map/mapNode.js +12 -5
  582. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  583. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  584. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  585. package/lib/simple-tree/node-kinds/object/index.js +1 -1
  586. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  587. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
  588. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  589. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -21
  590. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  591. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  592. package/lib/simple-tree/node-kinds/record/recordNode.js +12 -5
  593. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  594. package/lib/simple-tree/prepareForInsertion.d.ts +6 -6
  595. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  596. package/lib/simple-tree/prepareForInsertion.js +21 -15
  597. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  598. package/lib/simple-tree/simpleSchema.d.ts +6 -21
  599. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  600. package/lib/simple-tree/simpleSchema.js.map +1 -1
  601. package/lib/simple-tree/toStoredSchema.d.ts +38 -11
  602. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  603. package/lib/simple-tree/toStoredSchema.js +70 -34
  604. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  605. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  606. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  607. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
  608. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  609. package/lib/simple-tree/walkFieldSchema.d.ts +1 -0
  610. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  611. package/lib/simple-tree/walkFieldSchema.js +1 -0
  612. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  613. package/package.json +23 -23
  614. package/src/codec/codec.ts +4 -3
  615. package/src/core/index.ts +2 -0
  616. package/src/core/rebase/index.ts +2 -0
  617. package/src/core/rebase/types.ts +4 -0
  618. package/src/core/schema-stored/schema.ts +2 -26
  619. package/src/core/tree/detachedFieldIndex.ts +4 -6
  620. package/src/core/tree/detachedFieldIndexCodecCommon.ts +87 -0
  621. package/src/core/tree/{detachedFieldIndexCodec.ts → detachedFieldIndexCodecV1.ts} +22 -68
  622. package/src/core/tree/detachedFieldIndexCodecV2.ts +72 -0
  623. package/src/core/tree/detachedFieldIndexCodecs.ts +44 -0
  624. package/src/core/tree/{detachedFieldIndexFormat.ts → detachedFieldIndexFormatCommon.ts} +32 -23
  625. package/src/core/tree/detachedFieldIndexFormatV1.ts +15 -0
  626. package/src/core/tree/detachedFieldIndexFormatV2.ts +17 -0
  627. package/src/feature-libraries/chunked-forest/codec/README.md +1 -1
  628. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +25 -25
  629. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -6
  630. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +96 -73
  631. package/src/feature-libraries/chunked-forest/codec/format.ts +20 -14
  632. package/src/feature-libraries/chunked-forest/codec/{nodeShape.ts → nodeEncoder.ts} +23 -17
  633. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +34 -34
  634. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +5 -5
  635. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -0
  636. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -2
  637. package/src/feature-libraries/default-schema/index.ts +1 -1
  638. package/src/feature-libraries/default-schema/schemaChecker.ts +47 -30
  639. package/src/feature-libraries/index.ts +1 -3
  640. package/src/feature-libraries/modular-schema/comparison.ts +14 -29
  641. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +9 -0
  642. package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -0
  643. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +61 -19
  644. package/src/feature-libraries/object-forest/objectForest.ts +10 -6
  645. package/src/feature-libraries/optional-field/optionalField.ts +4 -0
  646. package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +4 -0
  647. package/src/index.ts +7 -1
  648. package/src/jsonDomainSchema.ts +4 -0
  649. package/src/packageVersion.ts +1 -1
  650. package/src/shared-tree/independentView.ts +45 -19
  651. package/src/shared-tree/schematizeTree.ts +2 -2
  652. package/src/shared-tree/schematizingTreeView.ts +24 -15
  653. package/src/shared-tree/sharedTree.ts +2 -42
  654. package/src/shared-tree/treeAlpha.ts +48 -22
  655. package/src/shared-tree/treeCheckout.ts +54 -10
  656. package/src/shared-tree-core/branch.ts +1 -6
  657. package/src/simple-tree/api/conciseTree.ts +9 -7
  658. package/src/simple-tree/api/configuration.ts +18 -4
  659. package/src/simple-tree/api/create.ts +44 -36
  660. package/src/simple-tree/api/customTree.ts +59 -20
  661. package/src/simple-tree/api/discrepancies.ts +474 -0
  662. package/src/simple-tree/api/index.ts +2 -3
  663. package/src/simple-tree/api/schemaCompatibilityTester.ts +23 -151
  664. package/src/simple-tree/api/schemaFactory.ts +13 -254
  665. package/src/simple-tree/api/schemaFactoryAlpha.ts +174 -1
  666. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -25
  667. package/src/simple-tree/api/schemaStatics.ts +291 -0
  668. package/src/simple-tree/api/storedSchema.ts +18 -14
  669. package/src/simple-tree/api/treeBeta.ts +24 -4
  670. package/src/simple-tree/api/verboseTree.ts +17 -8
  671. package/src/simple-tree/core/allowedTypes.ts +87 -34
  672. package/src/simple-tree/core/context.ts +24 -22
  673. package/src/simple-tree/core/index.ts +11 -2
  674. package/src/simple-tree/core/simpleNodeSchemaBase.ts +30 -0
  675. package/src/simple-tree/core/toStored.ts +58 -0
  676. package/src/simple-tree/core/treeNodeKernel.ts +1 -1
  677. package/src/simple-tree/core/treeNodeSchema.ts +8 -2
  678. package/src/simple-tree/core/treeNodeValid.ts +23 -4
  679. package/src/simple-tree/core/walkSchema.ts +26 -6
  680. package/src/simple-tree/createContext.ts +11 -3
  681. package/src/simple-tree/fieldSchema.ts +3 -1
  682. package/src/simple-tree/index.ts +19 -13
  683. package/src/simple-tree/leafNodeSchema.ts +2 -1
  684. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -23
  685. package/src/simple-tree/node-kinds/index.ts +0 -1
  686. package/src/simple-tree/node-kinds/map/mapNode.ts +23 -2
  687. package/src/simple-tree/node-kinds/object/index.ts +0 -1
  688. package/src/simple-tree/node-kinds/object/objectNode.ts +42 -30
  689. package/src/simple-tree/node-kinds/record/recordNode.ts +20 -2
  690. package/src/simple-tree/prepareForInsertion.ts +28 -15
  691. package/src/simple-tree/simpleSchema.ts +6 -26
  692. package/src/simple-tree/toStoredSchema.ts +110 -44
  693. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +6 -2
  694. package/src/simple-tree/walkFieldSchema.ts +1 -0
  695. package/dist/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  696. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  697. package/dist/core/tree/detachedFieldIndexCodec.js +0 -100
  698. package/dist/core/tree/detachedFieldIndexCodec.js.map +0 -1
  699. package/dist/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  700. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  701. package/dist/core/tree/detachedFieldIndexFormat.js.map +0 -1
  702. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  703. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  704. package/dist/feature-libraries/initializeForest.d.ts +0 -18
  705. package/dist/feature-libraries/initializeForest.d.ts.map +0 -1
  706. package/dist/feature-libraries/initializeForest.js +0 -35
  707. package/dist/feature-libraries/initializeForest.js.map +0 -1
  708. package/dist/simple-tree/discrepancies.d.ts +0 -167
  709. package/dist/simple-tree/discrepancies.d.ts.map +0 -1
  710. package/dist/simple-tree/discrepancies.js +0 -382
  711. package/dist/simple-tree/discrepancies.js.map +0 -1
  712. package/lib/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  713. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  714. package/lib/core/tree/detachedFieldIndexCodec.js +0 -96
  715. package/lib/core/tree/detachedFieldIndexCodec.js.map +0 -1
  716. package/lib/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  717. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  718. package/lib/core/tree/detachedFieldIndexFormat.js.map +0 -1
  719. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  720. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  721. package/lib/feature-libraries/initializeForest.d.ts +0 -18
  722. package/lib/feature-libraries/initializeForest.d.ts.map +0 -1
  723. package/lib/feature-libraries/initializeForest.js +0 -31
  724. package/lib/feature-libraries/initializeForest.js.map +0 -1
  725. package/lib/simple-tree/discrepancies.d.ts +0 -167
  726. package/lib/simple-tree/discrepancies.d.ts.map +0 -1
  727. package/lib/simple-tree/discrepancies.js +0 -376
  728. package/lib/simple-tree/discrepancies.js.map +0 -1
  729. package/src/feature-libraries/initializeForest.ts +0 -55
  730. package/src/simple-tree/discrepancies.ts +0 -648
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAA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AkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,YAAY,EAEX,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,KAAK,EACL,WAAW,EAEX,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO;AACN;;;GAGG;AACH,aAAa,GACb,CAAC;AAKF,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -27,8 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.SharedTreeFactoryType = exports.SharedTreeAttributes = exports.configuredSharedTree = exports.SharedTree = exports.RecordNodeSchema = exports.MapNodeSchema = exports.ArrayNodeSchema = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.evaluateLazySchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.asTreeViewAlpha = exports.getSimpleSchema = exports.normalizeAllowedTypes = exports.getJsonSchema = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.TreeViewConfigurationAlpha = exports.TreeBeta = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.ObjectNodeSchema = exports.NodeKind = exports.FieldSchema = exports.FieldKind = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfiguration = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.independentView = exports.TreeAlpha = exports.independentInitializedView = exports.getBranch = exports.Tree = exports.SharedTreeFormatVersion = exports.TreeCompressionStrategy = exports.TreeStatus = exports.RevertibleStatus = exports.CommitKind = exports.ValueSchema = void 0;
31
- exports.TableSchema = exports.FluidSerializableAsTree = exports.JsonAsTree = exports.InternalTypes = exports.cloneWithReplacements = exports.typeboxValidator = exports.noopValidator = exports.FluidClientVersion = exports.persistedToSimpleSchema = void 0;
30
+ exports.RecordNodeSchema = exports.MapNodeSchema = exports.ArrayNodeSchema = exports.allowUnused = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.evaluateLazySchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.asTreeViewAlpha = exports.getSimpleSchema = exports.walkAllowedTypes = exports.walkNodeSchema = exports.walkFieldSchema = exports.normalizeAllowedTypes = exports.getJsonSchema = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.TreeViewConfigurationAlpha = exports.TreeBeta = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.normalizeFieldSchema = exports.ObjectNodeSchema = exports.NodeKind = exports.FieldSchema = exports.FieldKind = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfiguration = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.independentView = exports.TreeAlpha = exports.independentInitializedView = exports.getBranch = exports.Tree = exports.SharedTreeFormatVersion = exports.TreeCompressionStrategy = exports.TreeStatus = exports.RevertibleStatus = exports.CommitKind = exports.ValueSchema = void 0;
31
+ exports.TableSchema = exports.FluidSerializableAsTree = exports.JsonAsTree = exports.InternalTypes = exports.cloneWithReplacements = exports.typeboxValidator = exports.noopValidator = exports.FluidClientVersion = exports.persistedToSimpleSchema = exports.SharedTreeFactoryType = exports.SharedTreeAttributes = exports.configuredSharedTree = exports.SharedTree = void 0;
32
32
  var index_js_1 = require("./core/index.js");
33
33
  Object.defineProperty(exports, "ValueSchema", { enumerable: true, get: function () { return index_js_1.ValueSchema; } });
34
34
  Object.defineProperty(exports, "CommitKind", { enumerable: true, get: function () { return index_js_1.CommitKind; } });
@@ -56,6 +56,7 @@ Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function ()
56
56
  Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function () { return index_js_4.FieldSchema; } });
57
57
  Object.defineProperty(exports, "NodeKind", { enumerable: true, get: function () { return index_js_4.NodeKind; } });
58
58
  Object.defineProperty(exports, "ObjectNodeSchema", { enumerable: true, get: function () { return index_js_4.ObjectNodeSchema; } });
59
+ Object.defineProperty(exports, "normalizeFieldSchema", { enumerable: true, get: function () { return index_js_4.normalizeFieldSchema; } });
59
60
  Object.defineProperty(exports, "createSimpleTreeIndex", { enumerable: true, get: function () { return index_js_4.createSimpleTreeIndex; } });
60
61
  Object.defineProperty(exports, "createIdentifierIndex", { enumerable: true, get: function () { return index_js_4.createIdentifierIndex; } });
61
62
  // experimental @alpha APIs:
@@ -69,6 +70,9 @@ Object.defineProperty(exports, "extractPersistedSchema", { enumerable: true, get
69
70
  Object.defineProperty(exports, "comparePersistedSchema", { enumerable: true, get: function () { return index_js_4.comparePersistedSchema; } });
70
71
  Object.defineProperty(exports, "getJsonSchema", { enumerable: true, get: function () { return index_js_4.getJsonSchema; } });
71
72
  Object.defineProperty(exports, "normalizeAllowedTypes", { enumerable: true, get: function () { return index_js_4.normalizeAllowedTypes; } });
73
+ Object.defineProperty(exports, "walkFieldSchema", { enumerable: true, get: function () { return index_js_4.walkFieldSchema; } });
74
+ Object.defineProperty(exports, "walkNodeSchema", { enumerable: true, get: function () { return index_js_4.walkNodeSchema; } });
75
+ Object.defineProperty(exports, "walkAllowedTypes", { enumerable: true, get: function () { return index_js_4.walkAllowedTypes; } });
72
76
  Object.defineProperty(exports, "getSimpleSchema", { enumerable: true, get: function () { return index_js_4.getSimpleSchema; } });
73
77
  Object.defineProperty(exports, "asTreeViewAlpha", { enumerable: true, get: function () { return index_js_4.asTreeViewAlpha; } });
74
78
  Object.defineProperty(exports, "rollback", { enumerable: true, get: function () { return index_js_4.rollback; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CASyB;AARxB,uGAAA,WAAW,OAAA;AAEX,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AAuCjB,yDAMsC;AALrC,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AAMxB,mDAoBgC;AAf/B,mHAAA,uBAAuB,OAAA;AACvB,gGAAA,IAAI,OAAA;AAGJ,qGAAA,SAAS,OAAA;AAGT,sHAAA,0BAA0B,OAAA;AAE1B,qGAAA,SAAS,OAAA;AAET,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AAGpB,mDAsLgC;AArL/B,yGAAA,aAAa,OAAA;AAEb,oHAAA,wBAAwB,OAAA;AAKxB,iHAAA,qBAAqB,OAAA;AAKrB,yGAAA,aAAa,OAAA;AACb,8GAAA,kBAAkB,OAAA;AASlB,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AAMX,oGAAA,QAAQ,OAAA;AAER,4GAAA,gBAAgB,OAAA;AAgChB,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AACrB,4BAA4B;AAC5B,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAyBf,YAAY;AACZ,oGAAA,QAAQ,OAAA;AAOR,sHAAA,0BAA0B,OAAA;AAE1B,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AAkBtB,yGAAA,aAAa,OAAA;AAcb,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AAMf,2GAAA,eAAe,OAAA;AAef,oGAAA,QAAQ,OAAA;AACR,0HAAA,8BAA8B,OAAA;AAC9B,8GAAA,kBAAkB,OAAA;AAClB,qHAAA,yBAAyB,OAAA;AACzB,0GAAA,cAAc,OAAA;AACd,qHAAA,yBAAyB,OAAA;AAEzB,uGAAA,WAAW,OAAA;AAIX,2GAAA,eAAe,OAAA;AAGf,yGAAA,aAAa,OAAA;AAIb,4GAAA,gBAAgB,OAAA;AAMjB,mDAG0B;AAFzB,4GAAA,UAAU,OAAA;AACV,sHAAA,oBAAoB,OAAA;AAErB,qEAAwF;AAA/E,+HAAA,oBAAoB,OAAA;AAAE,gIAAA,qBAAqB,OAAA;AACpD,mDAAiE;AAAxD,mHAAA,uBAAuB,OAAA;AAEhC,6CAM0B;AADzB,8GAAA,kBAAkB,OAAA;AAEnB,6CAAiD;AAAxC,yGAAA,aAAa,OAAA;AACtB,0DAAiE;AAAxD,4GAAA,gBAAgB,OAAA;AAwBzB,4CAAwD;AAA/C,iHAAA,qBAAqB,OAAA;AAE9B,kEAAoD;AAMnD,sCAAa;AAQd,6DAAmD;AAA1C,iHAAA,UAAU,OAAA;AACnB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype NormalizedAnnotatedAllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateAllowedTypeOrLazyItem,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CASyB;AARxB,uGAAA,WAAW,OAAA;AAEX,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AAuCjB,yDAMsC;AALrC,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AAMxB,mDAoBgC;AAf/B,mHAAA,uBAAuB,OAAA;AACvB,gGAAA,IAAI,OAAA;AAGJ,qGAAA,SAAS,OAAA;AAGT,sHAAA,0BAA0B,OAAA;AAE1B,qGAAA,SAAS,OAAA;AAET,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AAGpB,mDA4LgC;AA3L/B,yGAAA,aAAa,OAAA;AAEb,oHAAA,wBAAwB,OAAA;AAKxB,iHAAA,qBAAqB,OAAA;AAKrB,yGAAA,aAAa,OAAA;AACb,8GAAA,kBAAkB,OAAA;AASlB,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AAMX,oGAAA,QAAQ,OAAA;AAER,4GAAA,gBAAgB,OAAA;AAMhB,gHAAA,oBAAoB,OAAA;AA4BpB,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AACrB,4BAA4B;AAC5B,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAyBf,YAAY;AACZ,oGAAA,QAAQ,OAAA;AAOR,sHAAA,0BAA0B,OAAA;AAE1B,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AAkBtB,yGAAA,aAAa,OAAA;AAcb,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AACf,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAEhB,2GAAA,eAAe,OAAA;AAMf,2GAAA,eAAe,OAAA;AAef,oGAAA,QAAQ,OAAA;AACR,0HAAA,8BAA8B,OAAA;AAC9B,8GAAA,kBAAkB,OAAA;AAClB,qHAAA,yBAAyB,OAAA;AACzB,0GAAA,cAAc,OAAA;AACd,qHAAA,yBAAyB,OAAA;AAEzB,uGAAA,WAAW,OAAA;AAIX,2GAAA,eAAe,OAAA;AAGf,yGAAA,aAAa,OAAA;AAIb,4GAAA,gBAAgB,OAAA;AAMjB,mDAG0B;AAFzB,4GAAA,UAAU,OAAA;AACV,sHAAA,oBAAoB,OAAA;AAErB,qEAAwF;AAA/E,+HAAA,oBAAoB,OAAA;AAAE,gIAAA,qBAAqB,OAAA;AACpD,mDAAiE;AAAxD,mHAAA,uBAAuB,OAAA;AAEhC,6CAM0B;AADzB,8GAAA,kBAAkB,OAAA;AAEnB,6CAAiD;AAAxC,yGAAA,aAAa,OAAA;AACtB,0DAAiE;AAAxD,4GAAA,gBAAgB,OAAA;AAwBzB,4CAAwD;AAA/C,iHAAA,qBAAqB,OAAA;AAE9B,kEAAoD;AAMnD,sCAAa;AAQd,6DAAmD;AAA1C,iHAAA,UAAU,OAAA;AACnB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tSharedTreeFormatVersion,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype ImplicitAnnotatedFieldSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype NormalizedAnnotatedAllowedTypes,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype InsertableObjectFromAnnotatedSchemaRecord,\n\ttype UnannotateImplicitAllowedTypes,\n\ttype UnannotateAllowedTypes,\n\ttype UnannotateAllowedType,\n\ttype UnannotateAllowedTypesList,\n\ttype UnannotateImplicitFieldSchema,\n\ttype UnannotateSchemaRecord,\n\ttype SchemaStaticsAlpha,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype JsonValidator,\n\ttype SchemaValidationFunction,\n\tFluidClientVersion,\n} from \"./codec/index.js\";\nexport { noopValidator } from \"./codec/index.js\";\nexport { typeboxValidator } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\nexport {\n\t/**\n\t * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n\t * They are used internally to implement API aspects, but are not intended for use by external consumers.\n\t */\n\tInternalTypes,\n};\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\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
- import type { FixRecursiveArraySchema, TreeNodeFromImplicitAllowedTypes, System_Unsafe, TreeNodeSchemaClass, NodeKind, WithType, LeafSchema } from "./simple-tree/index.js";
5
+ import type { FixRecursiveArraySchema, TreeNodeFromImplicitAllowedTypes, ArrayNodeCustomizableSchemaUnsafe, System_Unsafe, TreeNodeSchemaClass, TreeRecordNodeUnsafe, NodeKind, WithType, LeafSchema } from "./simple-tree/index.js";
6
6
  /**
7
7
  * Utilities for storing JSON data in {@link TreeNode}s.
8
8
  * @remarks
@@ -25,6 +25,7 @@ export declare namespace JsonAsTree {
25
25
  */
26
26
  const Primitive: readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>];
27
27
  /**
28
+ * {@inheritDoc JsonAsTree.(Primitive:variable)}
28
29
  * @alpha
29
30
  */
30
31
  type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;
@@ -43,6 +44,7 @@ export declare namespace JsonAsTree {
43
44
  */
44
45
  const Tree: readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array];
45
46
  /**
47
+ * {@inheritDoc JsonAsTree.(Tree:variable)}
46
48
  * @alpha
47
49
  */
48
50
  type Tree = TreeNodeFromImplicitAllowedTypes<typeof Tree>;
@@ -50,7 +52,7 @@ export declare namespace JsonAsTree {
50
52
  * 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}.
51
53
  * @system @alpha
52
54
  */
53
- const _APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Record, import("./simple-tree/index.js").TreeRecordNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Record, unknown>, {
55
+ const _APIExtractorWorkaroundObjectBase: TreeNodeSchemaClass<"com.fluidframework.json.object", NodeKind.Record, TreeRecordNodeUnsafe<readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array]> & WithType<"com.fluidframework.json.object", NodeKind.Record, unknown>, {
54
56
  readonly [x: string]: string | number | JsonObject | Array | System_Unsafe.InsertableTypedNodeUnsafe<LeafSchema<"boolean", boolean>, LeafSchema<"boolean", boolean>> | null;
55
57
  }, false, readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], undefined>;
56
58
  /**
@@ -84,7 +86,7 @@ export declare namespace JsonAsTree {
84
86
  * 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}.
85
87
  * @system @alpha
86
88
  */
87
- const _APIExtractorWorkaroundArrayBase: import("./simple-tree/index.js").ArrayNodeCustomizableSchemaUnsafe<"com.fluidframework.json.array", readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], unknown>;
89
+ const _APIExtractorWorkaroundArrayBase: ArrayNodeCustomizableSchemaUnsafe<"com.fluidframework.json.array", readonly [LeafSchema<"null", null>, LeafSchema<"number", number>, LeafSchema<"string", string>, LeafSchema<"boolean", boolean>, () => typeof JsonObject, () => typeof Array], unknown>;
88
90
  /**
89
91
  * Arbitrary JSON array as a {@link TreeNode}.
90
92
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"jsonDomainSchema.d.ts","sourceRoot":"","sources":["../src/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAEX,uBAAuB,EACvB,gCAAgC,EAIhC,aAAa,EAEb,mBAAmB,EACnB,QAAQ,EAER,QAAQ,EACR,UAAU,EAGV,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;;;;;;;;GAcG;AACH,yBAAiB,UAAU,CAAC;IAC3B;;;OAGG;IACI,MAAM,SAAS,iIAKW,CAAC;IAElC;;OAEG;IACH,KAAY,SAAS,GAAG,gCAAgC,CAAC,OAAO,SAAS,CAAC,CAAC;IAE3E;;;;;;;;;;;;OAYG;IACI,MAAM,IAAI,8KAAyD,CAAC;IAE3E;;OAEG;IACH,KAAY,IAAI,GAAG,gCAAgC,CAAC,OAAO,IAAI,CAAC,CAAC;IAEjE;;;OAGG;IACI,MAAM,iCAAiC;;sMAAqC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,UAAW,SAAQ,iCAAiC;KAAG;IAKpE;;;;;;OAMG;IACH,KAAoB,kCAAkC,GAAG,uBAAuB,CAC/E,OAAO,KAAK,CACZ,CAAC;IAEF;;;OAGG;IACI,MAAM,gCAAgC,4RAAmC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,gCAAgC;KAAG;CAI9D"}
1
+ {"version":3,"file":"jsonDomainSchema.d.ts","sourceRoot":"","sources":["../src/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAEX,uBAAuB,EACvB,gCAAgC,EAIhC,iCAAiC,EACjC,aAAa,EAEb,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EAER,QAAQ,EACR,UAAU,EAGV,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;;;;;;;;GAcG;AACH,yBAAiB,UAAU,C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I,CAAC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,UAAW,SAAQ,WAAA,iCAAiC;KAAG;IAAvD,qBAAU,aAA6C,CAAA;IACpE,CAAC;IAED,CAAC;IAaD;;;OAGG;IACU,2CAAgC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,WAAA,IAAI,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,WAAA,gCAAgC;KAAG;IAAjD,gBAAK,QAA4C,CAAA;IAC9D,CAAC;IAED,CAAC;AACF,CAAC,EAvGgB,UAAU,0BAAV,UAAU,QAuG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SchemaFactory, SchemaFactoryAlpha } from \"./simple-tree/index.js\";\nimport type {\n\tAllowedTypes,\n\tFixRecursiveArraySchema,\n\tTreeNodeFromImplicitAllowedTypes,\n\tValidateRecursiveSchema,\n\t// #region Unused imports to make d.ts cleaner\n\t/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */\n\tSystem_Unsafe,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaClass,\n\tNodeKind,\n\tTreeNodeSchemaCore,\n\tWithType,\n\tLeafSchema,\n\t/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */\n\t// #endregion\n} from \"./simple-tree/index.js\";\n\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.json\");\n\n/**\n * Utilities for storing JSON data in {@link TreeNode}s.\n * @remarks\n * Schema which replicate the JSON data model with {@link TreeNode}s.\n *\n * This allows JSON to be losslessly round-tripped through a tree with the following limitations:\n *\n * 1. Only information that would be preserved by JSON.parse is preserved. This means (among other things) that numbers are limited to JavasScript's numeric precision.\n *\n * 2. The order of fields on an object is not preserved. The resulting order is arbitrary.\n *\n * JSON data can be imported from JSON into this format using `JSON.parse` then {@link (TreeAlpha:interface).importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.\n *\n * @alpha\n */\nexport namespace JsonAsTree {\n\t/**\n\t * {@link AllowedTypes} for primitives types allowed in JSON.\n\t * @alpha\n\t */\n\texport const Primitive = [\n\t\tSchemaFactory.null,\n\t\tSchemaFactory.number,\n\t\tSchemaFactory.string,\n\t\tSchemaFactory.boolean,\n\t] as const satisfies AllowedTypes;\n\n\t/**\n\t * @alpha\n\t */\n\texport type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;\n\n\t/**\n\t * {@link AllowedTypes} for any content allowed in the {@link JsonAsTree} domain.\n\t * @example\n\t * ```typescript\n\t * const tree = TreeAlpha.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });\n\t * ```\n\t * @privateRemarks\n\t * The order here should not matter for any functionality related reasons.\n\t * In an attempt to improve readability of derived types (in errors, api-reports, IntelliSense etc.)\n\t * and possibly reduce incremental build related order dependence issues,\n\t * the simpler non-recursive types are listed first, followed by the recursive types.\n\t * @alpha\n\t */\n\texport const Tree = [...Primitive, () => JsonObject, () => Array] as const;\n\n\t/**\n\t * @alpha\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 @alpha\n\t */\n\texport const _APIExtractorWorkaroundObjectBase = sf.recordRecursive(\"object\", Tree);\n\n\t/**\n\t * Arbitrary JSON 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 JSON data:\n\t * const imported = TreeAlpha.importConcise(JsonAsTree.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 @alpha\n\t */\n\texport class JsonObject extends _APIExtractorWorkaroundObjectBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof JsonObject>;\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 JsonAsTree.Array instead.\n\t * @system @alpha\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 @alpha\n\t */\n\texport const _APIExtractorWorkaroundArrayBase = sf.arrayRecursive(\"array\", Tree);\n\n\t/**\n\t * Arbitrary JSON array as a {@link TreeNode}.\n\t * @remarks\n\t * This can be imported using {@link (TreeAlpha:interface).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 JsonAsTree.Array([\"a\", 0, new JsonAsTree.Array([1])]);\n\t * // Using `importConcise` can work better for JSON data:\n\t * const imported = TreeAlpha.importConcise(JsonAsTree.Array, [\"a\", 0, [1]]);\n\t * // Node API is like an Array:\n\t * const inner: JsonAsTree.Tree = imported[2];\n\t * assert(Tree.is(inner, JsonAsTree.Array));\n\t * const leaf = inner[0];\n\t * ```\n\t * @sealed @alpha\n\t */\n\texport class Array extends _APIExtractorWorkaroundArrayBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof Array>;\n\t}\n}\n"]}
1
+ {"version":3,"file":"jsonDomainSchema.js","sourceRoot":"","sources":["../src/jsonDomainSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA2E;AAqB3E,MAAM,EAAE,GAAG,IAAI,6BAAkB,CAAC,yBAAyB,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,IAAiB,UAAU,CAyG1B;AAzGD,WAAiB,UAAU;IAC1B;;;OAGG;IACU,oBAAS,GAAG;QACxB,wBAAa,CAAC,IAAI;QAClB,wBAAa,CAAC,MAAM;QACpB,wBAAa,CAAC,MAAM;QACpB,wBAAa,CAAC,OAAO;KACW,CAAC;IAQlC;;;;;;;;;;;;OAYG;IACU,eAAI,GAAG,CAAC,GAAG,WAAA,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAU,CAAC;IAQ3E;;;OAGG;IACU,4CAAiC,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,WAAA,IAAI,CAAC,CAAC;IAEpF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,UAAW,SAAQ,WAAA,iCAAiC;KAAG;IAAvD,qBAAU,aAA6C,CAAA;IACpE,CAAC;IAED,CAAC;IAaD;;;OAGG;IACU,2CAAgC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,WAAA,IAAI,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;OAgBG;IACH,MAAa,KAAM,SAAQ,WAAA,gCAAgC;KAAG;IAAjD,gBAAK,QAA4C,CAAA;IAC9D,CAAC;IAED,CAAC;AACF,CAAC,EAzGgB,UAAU,0BAAV,UAAU,QAyG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SchemaFactory, SchemaFactoryAlpha } from \"./simple-tree/index.js\";\nimport type {\n\tAllowedTypes,\n\tFixRecursiveArraySchema,\n\tTreeNodeFromImplicitAllowedTypes,\n\tValidateRecursiveSchema,\n\t// #region Unused imports to make d.ts cleaner\n\t/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */\n\tArrayNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaClass,\n\tTreeRecordNodeUnsafe,\n\tNodeKind,\n\tTreeNodeSchemaCore,\n\tWithType,\n\tLeafSchema,\n\t/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */\n\t// #endregion\n} from \"./simple-tree/index.js\";\n\nconst sf = new SchemaFactoryAlpha(\"com.fluidframework.json\");\n\n/**\n * Utilities for storing JSON data in {@link TreeNode}s.\n * @remarks\n * Schema which replicate the JSON data model with {@link TreeNode}s.\n *\n * This allows JSON to be losslessly round-tripped through a tree with the following limitations:\n *\n * 1. Only information that would be preserved by JSON.parse is preserved. This means (among other things) that numbers are limited to JavasScript's numeric precision.\n *\n * 2. The order of fields on an object is not preserved. The resulting order is arbitrary.\n *\n * JSON data can be imported from JSON into this format using `JSON.parse` then {@link (TreeAlpha:interface).importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.\n *\n * @alpha\n */\nexport namespace JsonAsTree {\n\t/**\n\t * {@link AllowedTypes} for primitives types allowed in JSON.\n\t * @alpha\n\t */\n\texport const Primitive = [\n\t\tSchemaFactory.null,\n\t\tSchemaFactory.number,\n\t\tSchemaFactory.string,\n\t\tSchemaFactory.boolean,\n\t] as const satisfies AllowedTypes;\n\n\t/**\n\t * {@inheritDoc JsonAsTree.(Primitive:variable)}\n\t * @alpha\n\t */\n\texport type Primitive = TreeNodeFromImplicitAllowedTypes<typeof Primitive>;\n\n\t/**\n\t * {@link AllowedTypes} for any content allowed in the {@link JsonAsTree} domain.\n\t * @example\n\t * ```typescript\n\t * const tree = TreeAlpha.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });\n\t * ```\n\t * @privateRemarks\n\t * The order here should not matter for any functionality related reasons.\n\t * In an attempt to improve readability of derived types (in errors, api-reports, IntelliSense etc.)\n\t * and possibly reduce incremental build related order dependence issues,\n\t * the simpler non-recursive types are listed first, followed by the recursive types.\n\t * @alpha\n\t */\n\texport const Tree = [...Primitive, () => JsonObject, () => Array] as const;\n\n\t/**\n\t * {@inheritDoc JsonAsTree.(Tree:variable)}\n\t * @alpha\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 @alpha\n\t */\n\texport const _APIExtractorWorkaroundObjectBase = sf.recordRecursive(\"object\", Tree);\n\n\t/**\n\t * Arbitrary JSON 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 JSON data:\n\t * const imported = TreeAlpha.importConcise(JsonAsTree.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 @alpha\n\t */\n\texport class JsonObject extends _APIExtractorWorkaroundObjectBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof JsonObject>;\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 JsonAsTree.Array instead.\n\t * @system @alpha\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 @alpha\n\t */\n\texport const _APIExtractorWorkaroundArrayBase = sf.arrayRecursive(\"array\", Tree);\n\n\t/**\n\t * Arbitrary JSON array as a {@link TreeNode}.\n\t * @remarks\n\t * This can be imported using {@link (TreeAlpha:interface).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 JsonAsTree.Array([\"a\", 0, new JsonAsTree.Array([1])]);\n\t * // Using `importConcise` can work better for JSON data:\n\t * const imported = TreeAlpha.importConcise(JsonAsTree.Array, [\"a\", 0, [1]]);\n\t * // Node API is like an Array:\n\t * const inner: JsonAsTree.Tree = imported[2];\n\t * assert(Tree.is(inner, JsonAsTree.Array));\n\t * const leaf = inner[0];\n\t * ```\n\t * @sealed @alpha\n\t */\n\texport class Array extends _APIExtractorWorkaroundArrayBase {}\n\t{\n\t\ttype _check = ValidateRecursiveSchema<typeof Array>;\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tree";
8
- export declare const pkgVersion = "2.51.0";
8
+ export declare const pkgVersion = "2.53.0-350190";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,WAAW,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAC9C,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/tree";
11
- exports.pkgVersion = "2.51.0";
11
+ exports.pkgVersion = "2.53.0-350190";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.51.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.53.0-350190\";\n"]}
@@ -5,9 +5,11 @@
5
5
  import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import { type IIdCompressor } from "@fluidframework/id-compressor/internal";
7
7
  import type { ICodecOptions } from "../codec/index.js";
8
+ import { type ITreeCursorSynchronous, type TreeStoredSchema } from "../core/index.js";
8
9
  import type { TreeViewConfiguration, ImplicitFieldSchema, TreeViewAlpha } from "../simple-tree/index.js";
9
10
  import { type JsonCompatible } from "../util/index.js";
10
11
  import { type ForestOptions } from "./sharedTree.js";
12
+ import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
11
13
  /**
12
14
  * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.
13
15
  *
@@ -27,9 +29,15 @@ export declare function independentView<const TSchema extends ImplicitFieldSchem
27
29
  * Such a view can never experience collaboration or be persisted to to a Fluid Container.
28
30
  *
29
31
  * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.
32
+ * @privateRemarks
33
+ * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.
30
34
  * @alpha
31
35
  */
32
36
  export declare function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, content: ViewContent): TreeViewAlpha<TSchema>;
37
+ /**
38
+ * {@link independentInitializedView} but using internal types instead of persisted data formats.
39
+ */
40
+ export declare function independentInitializedViewInternal<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, schema: TreeStoredSchema, rootFieldCursor: ITreeCursorSynchronous, idCompressor: IIdCompressor): SchematizingSimpleTreeView<TSchema>;
33
41
  /**
34
42
  * The portion of SharedTree data typically persisted by the container.
35
43
  * Usable with {@link independentInitializedView} to create a {@link TreeView}
@@ -1 +1 @@
1
- {"version":3,"file":"independentView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACN,KAAK,aAAa,EAElB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAkBvD,OAAO,KAAK,EACX,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA+B,KAAK,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;GAQG;A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B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGvE;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,OAAO,SAAS,mBAAmB,EACxE,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,EACtC,OAAO,EAAE,aAAa,GAAG;IAAE,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,GACnE,aAAa,CAAC,OAAO,CAAC,CAuBxB;AACD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,CAAC,OAAO,SAAS,mBAAmB,EACnF,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,EACtC,OAAO,EAAE,aAAa,GAAG,aAAa,EACtC,OAAO,EAAE,WAAW,GAClB,aAAa,CAAC,OAAO,CAAC,CAyBxB;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,CAAC,OAAO,SAAS,mBAAmB,EAC3F,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,EACtC,OAAO,EAAE,aAAa,GAAG,aAAa,EACtC,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,sBAAsB,EACvC,YAAY,EAAE,aAAa,GACzB,0BAA0B,CAAC,OAAO,CAAC,CA2BrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;CACrC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.independentInitializedView = exports.independentView = void 0;
7
+ exports.independentInitializedViewInternal = exports.independentInitializedView = exports.independentView = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/id-compressor/internal");
10
10
  const index_js_1 = require("../core/index.js");
@@ -13,6 +13,7 @@ const index_js_3 = require("../util/index.js");
13
13
  const sharedTree_js_1 = require("./sharedTree.js");
14
14
  const treeCheckout_js_1 = require("./treeCheckout.js");
15
15
  const schematizingTreeView_js_1 = require("./schematizingTreeView.js");
16
+ const schematizeTree_js_1 = require("./schematizeTree.js");
16
17
  /**
17
18
  * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.
18
19
  *
@@ -45,17 +46,15 @@ exports.independentView = independentView;
45
46
  * Such a view can never experience collaboration or be persisted to to a Fluid Container.
46
47
  *
47
48
  * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.
49
+ * @privateRemarks
50
+ * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.
48
51
  * @alpha
49
52
  */
50
53
  function independentInitializedView(config, options, content) {
51
- const breaker = new index_js_3.Breakable("independentInitializedView");
52
54
  const idCompressor = content.idCompressor;
53
- const mintRevisionTag = () => idCompressor.generateCompressedId();
54
- const revisionTagCodec = new index_js_1.RevisionTagCodec(idCompressor);
55
55
  const fieldBatchCodec = (0, index_js_2.makeFieldBatchCodec)(options, 1);
56
56
  const schemaCodec = (0, index_js_2.makeSchemaCodec)(options, index_js_1.SchemaVersion.v1);
57
- const schema = new index_js_1.TreeStoredSchemaRepository(schemaCodec.decode(content.schema));
58
- const forest = (0, sharedTree_js_1.buildConfiguredForest)(breaker, options.forest ?? sharedTree_js_1.defaultSharedTreeOptions.forest, schema, idCompressor);
57
+ const schema = schemaCodec.decode(content.schema);
59
58
  const context = {
60
59
  encodeType: index_js_2.TreeCompressionStrategy.Compressed,
61
60
  idCompressor,
@@ -64,16 +63,29 @@ function independentInitializedView(config, options, content) {
64
63
  };
65
64
  const fieldCursors = fieldBatchCodec.decode(content.tree, context);
66
65
  (0, internal_1.assert)(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);
66
+ return independentInitializedViewInternal(config, options, schema,
67
67
  // Checked above.
68
68
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
69
- (0, index_js_2.initializeForest)(forest, fieldCursors[0], revisionTagCodec, idCompressor, false);
69
+ fieldCursors[0], idCompressor);
70
+ }
71
+ exports.independentInitializedView = independentInitializedView;
72
+ /**
73
+ * {@link independentInitializedView} but using internal types instead of persisted data formats.
74
+ */
75
+ function independentInitializedViewInternal(config, options, schema, rootFieldCursor, idCompressor) {
76
+ const breaker = new index_js_3.Breakable("independentInitializedView");
77
+ const revisionTagCodec = new index_js_1.RevisionTagCodec(idCompressor);
78
+ const mintRevisionTag = () => idCompressor.generateCompressedId();
79
+ // To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.
80
+ const schemaRepository = new index_js_1.TreeStoredSchemaRepository();
81
+ const forest = (0, sharedTree_js_1.buildConfiguredForest)(breaker, options.forest ?? sharedTree_js_1.defaultSharedTreeOptions.forest, schemaRepository, idCompressor);
70
82
  const checkout = (0, treeCheckout_js_1.createTreeCheckout)(idCompressor, mintRevisionTag, revisionTagCodec, {
71
83
  forest,
72
- schema,
84
+ schema: schemaRepository,
73
85
  breaker,
74
86
  });
75
- const out = new schematizingTreeView_js_1.SchematizingSimpleTreeView(checkout, config, (0, index_js_2.createNodeIdentifierManager)(idCompressor));
76
- return out;
87
+ (0, schematizeTree_js_1.initialize)(checkout, { schema, initialTree: rootFieldCursor });
88
+ return new schematizingTreeView_js_1.SchematizingSimpleTreeView(checkout, config, (0, index_js_2.createNodeIdentifierManager)(idCompressor));
77
89
  }
78
- exports.independentInitializedView = independentInitializedView;
90
+ exports.independentInitializedViewInternal = independentInitializedViewInternal;
79
91
  //# sourceMappingURL=independentView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,k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AC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AA7CD,gEA6CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IIdCompressor,\n\tcreateIdCompressor,\n} from \"@fluidframework/id-compressor/internal\";\n\nimport type { ICodecOptions } from \"../codec/index.js\";\nimport {\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\tSchemaVersion,\n\tTreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\tcreateNodeIdentifierManager,\n\tmakeFieldBatchCodec,\n\tmakeSchemaCodec,\n\ttype FieldBatchEncodingContext,\n\tdefaultSchemaPolicy,\n\tTreeCompressionStrategy,\n\tinitializeForest,\n} from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport type { Format } from \"../feature-libraries/schema-index/formatV1.js\";\nimport type {\n\tTreeViewConfiguration,\n\tImplicitFieldSchema,\n\tTreeViewAlpha,\n} from \"../simple-tree/index.js\";\nimport { type JsonCompatibleReadOnly, type JsonCompatible, Breakable } from \"../util/index.js\";\nimport {\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\nimport { createTreeCheckout } from \"./treeCheckout.js\";\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\n/**\n * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & { idCompressor?: IIdCompressor | undefined },\n): TreeViewAlpha<TSchema> {\n\tconst breaker = new Breakable(\"independentView\");\n\tconst idCompressor: IIdCompressor = options.idCompressor ?? createIdCompressor();\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\tconst schema = new TreeStoredSchemaRepository();\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschema,\n\t\tidCompressor,\n\t);\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema,\n\t\tbreaker,\n\t});\n\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n\treturn out;\n}\n/**\n * Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentInitializedView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tcontent: ViewContent,\n): TreeViewAlpha<TSchema> {\n\tconst breaker = new Breakable(\"independentInitializedView\");\n\tconst idCompressor: IIdCompressor = content.idCompressor;\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\n\tconst fieldBatchCodec = makeFieldBatchCodec(options, 1);\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\n\tconst schema = new TreeStoredSchemaRepository(schemaCodec.decode(content.schema as Format));\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschema,\n\t\tidCompressor,\n\t);\n\n\tconst context: FieldBatchEncodingContext = {\n\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\tidCompressor,\n\t\toriginatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?\n\t\tschema: { schema, policy: defaultSchemaPolicy },\n\t};\n\n\tconst fieldCursors = fieldBatchCodec.decode(content.tree as JsonCompatibleReadOnly, context);\n\tassert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);\n\t// Checked above.\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\tinitializeForest(forest, fieldCursors[0]!, revisionTagCodec, idCompressor, false);\n\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema,\n\t\tbreaker,\n\t});\n\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n\treturn out;\n}\n\n/**\n * The portion of SharedTree data typically persisted by the container.\n * Usable with {@link independentInitializedView} to create a {@link TreeView}\n * without loading a container.\n * @alpha\n */\nexport interface ViewContent {\n\t/**\n\t * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.\n\t * @remarks\n\t * This is an owning reference:\n\t * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.\n\t */\n\treadonly tree: JsonCompatible<IFluidHandle>;\n\t/**\n\t * Persisted schema from {@link extractPersistedSchema}.\n\t */\n\treadonly schema: JsonCompatible;\n\t/**\n\t * IIdCompressor which will be used to decompress any compressed identifiers in `tree`\n\t * as well as for any other identifiers added to the view.\n\t */\n\treadonly idCompressor: IIdCompressor;\n}\n"]}
1
+ {"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,qEAGgD;AAGhD,+CAO0B;AAC1B,4DAOuC;AAQvC,+CAA+F;AAC/F,mDAIyB;AACzB,uDAAuD;AACvD,uEAAuE;AACvE,2DAAiD;AAEjD;;;;;;;;GAQG;AACH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AAE,eAAe,EAAE,CAAC,CAAC;IAC/D,OAAO,IAAI,oDAA0B,CACpC,QAAQ,EACR,MAAM,EACN,IAAA,sCAA2B,EAAC,YAAY,CAAC,CACzC,CAAC;AACH,CAAC;AAjCD,gFAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IIdCompressor,\n\tcreateIdCompressor,\n} from \"@fluidframework/id-compressor/internal\";\n\nimport type { ICodecOptions } from \"../codec/index.js\";\nimport {\n\ttype ITreeCursorSynchronous,\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\tSchemaVersion,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\tcreateNodeIdentifierManager,\n\tmakeFieldBatchCodec,\n\tmakeSchemaCodec,\n\ttype FieldBatchEncodingContext,\n\tdefaultSchemaPolicy,\n\tTreeCompressionStrategy,\n} from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport type { Format } from \"../feature-libraries/schema-index/formatV1.js\";\nimport type {\n\tTreeViewConfiguration,\n\tImplicitFieldSchema,\n\tTreeViewAlpha,\n} from \"../simple-tree/index.js\";\nimport { type JsonCompatibleReadOnly, type JsonCompatible, Breakable } from \"../util/index.js\";\nimport {\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\nimport { createTreeCheckout } from \"./treeCheckout.js\";\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport { initialize } from \"./schematizeTree.js\";\n\n/**\n * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & { idCompressor?: IIdCompressor | undefined },\n): TreeViewAlpha<TSchema> {\n\tconst breaker = new Breakable(\"independentView\");\n\tconst idCompressor: IIdCompressor = options.idCompressor ?? createIdCompressor();\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\tconst schema = new TreeStoredSchemaRepository();\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschema,\n\t\tidCompressor,\n\t);\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema,\n\t\tbreaker,\n\t});\n\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n\treturn out;\n}\n/**\n * Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @privateRemarks\n * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.\n * @alpha\n */\nexport function independentInitializedView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tcontent: ViewContent,\n): TreeViewAlpha<TSchema> {\n\tconst idCompressor: IIdCompressor = content.idCompressor;\n\tconst fieldBatchCodec = makeFieldBatchCodec(options, 1);\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\n\tconst schema = schemaCodec.decode(content.schema as Format);\n\tconst context: FieldBatchEncodingContext = {\n\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\tidCompressor,\n\t\toriginatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?\n\t\tschema: { schema, policy: defaultSchemaPolicy },\n\t};\n\n\tconst fieldCursors = fieldBatchCodec.decode(content.tree as JsonCompatibleReadOnly, context);\n\tassert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);\n\n\treturn independentInitializedViewInternal(\n\t\tconfig,\n\t\toptions,\n\t\tschema,\n\t\t// Checked above.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tfieldCursors[0]!,\n\t\tidCompressor,\n\t);\n}\n\n/**\n * {@link independentInitializedView} but using internal types instead of persisted data formats.\n */\nexport function independentInitializedViewInternal<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tschema: TreeStoredSchema,\n\trootFieldCursor: ITreeCursorSynchronous,\n\tidCompressor: IIdCompressor,\n): SchematizingSimpleTreeView<TSchema> {\n\tconst breaker = new Breakable(\"independentInitializedView\");\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\n\t// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.\n\tconst schemaRepository = new TreeStoredSchemaRepository();\n\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions.forest ?? defaultSharedTreeOptions.forest,\n\t\tschemaRepository,\n\t\tidCompressor,\n\t);\n\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema: schemaRepository,\n\t\tbreaker,\n\t});\n\n\tinitialize(checkout, { schema, initialTree: rootFieldCursor });\n\treturn new SchematizingSimpleTreeView<TSchema>(\n\t\tcheckout,\n\t\tconfig,\n\t\tcreateNodeIdentifierManager(idCompressor),\n\t);\n}\n\n/**\n * The portion of SharedTree data typically persisted by the container.\n * Usable with {@link independentInitializedView} to create a {@link TreeView}\n * without loading a container.\n * @alpha\n */\nexport interface ViewContent {\n\t/**\n\t * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.\n\t * @remarks\n\t * This is an owning reference:\n\t * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.\n\t */\n\treadonly tree: JsonCompatible<IFluidHandle>;\n\t/**\n\t * Persisted schema from {@link extractPersistedSchema}.\n\t */\n\treadonly schema: JsonCompatible;\n\t/**\n\t * IIdCompressor which will be used to decompress any compressed identifiers in `tree`\n\t * as well as for any other identifiers added to the view.\n\t */\n\treadonly idCompressor: IIdCompressor;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schematizeTree.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAGrB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,gBAAgB,EAAE;IACjB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CAC5C,EACD,SAAS,EAAE,gBAAgB,EAC3B,cAAc,EAAE,MAAM,IAAI,GACxB,IAAI,CA4CN;AAED,oBAAY,UAAU;IACrB;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,YAAY,IAAA;CACZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,UAAU,EAAE,yBAAyB,EACrC,QAAQ,EAAE,aAAa,GACrB,UAAU,CAiBZ;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,GA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AQ,EAAE,aAAa,GAAG,OAAO,CAG9D;AAoBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAgCxF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC3B,UAAU,EAAE,yBAAyB,EACrC,QAAQ,EAAE,aAAa,GACrB,OAAO,CAiBT;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,GAAG,SAAS,CAAC;CAC7F"}
@@ -168,7 +168,7 @@ function ensureSchema(viewSchema, checkout) {
168
168
  return false;
169
169
  }
170
170
  case UpdateType.SchemaCompatible: {
171
- checkout.updateSchema((0, index_js_3.toStoredSchema)(viewSchema.viewSchemaRoot));
171
+ checkout.updateSchema((0, index_js_3.toUpgradeSchema)(viewSchema.viewSchema.root));
172
172
  return true;
173
173
  }
174
174
  default: {
@@ -1 +1 @@
1
- {"version":3,"file":"schematizeTree.js","sourceRoot":"","sources":["../../src/shared-tree/schematizeTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAEpF,+CAM0B;AAC1B,4DAMuC;AACvC,sDAAyF;AACzF,+CAAmD;AAInD;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAChC,gBAGC,EACD,SAA2B,EAC3B,cAA0B;IAE1B,IAAA,iBAAM,EACL,IAAA,4BAAiB,EAAC,gBAAgB,CAAC,YAAY,CAAC,EAChD,KAAK,CAAC,6CAA6C,CACnD,CAAC;IAEF,MAAM,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC;IAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;IAEjC,mJAAmJ;IACnJ,IAAI,uBAAyC,CAAC;IAC9C,IACC,QAAQ,K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QACF,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;AACF,CAAC;AAhCD,gCAgCC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,YAAY,CAC3B,UAAqC,EACrC,QAAuB;IAEvB,MAAM,aAAa,GAAG,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3D,QAAQ,aAAa,EAAE,CAAC;QACvB,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9B,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAClC,QAAQ,CAAC,YAAY,CAAC,IAAA,yBAAc,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC;AApBD,oCAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\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 { toStoredSchema, type SchemaCompatibilityTester } from \"../simple-tree/index.js\";\nimport { isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.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\tpersistedMetadata: rootSchema.persistedMetadata,\n\t\t\t},\n\t\t};\n\t}\n\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should 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\t// This makes the root more strict, so set allowNonSupersetSchema to true.\n\t\tschemaRepository.updateSchema(newSchema, true);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\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\n/**\n * Returns how compatible updating checkout's schema is with the viewSchema.\n */\nexport function evaluateUpdate(\n\tviewSchema: SchemaCompatibilityTester,\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\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\treturn UpdateType.SchemaCompatible;\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 empty 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\t\t\tconst contentChunk = checkout.forest.chunkField(content);\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(contentChunk.topLevelLength === 0 ? undefined : contentChunk, 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, contentChunk);\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 SchemaCompatibilityTester}.\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: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): boolean {\n\tconst updatedNeeded = evaluateUpdate(viewSchema, 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.viewSchemaRoot));\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,kEAAoF;AAEpF,+CAM0B;AAC1B,4DAMuC;AACvC,sDAA0F;AAC1F,+CAAmD;AAInD;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAChC,gBAGC,EACD,SAA2B,EAC3B,cAA0B;IAE1B,IAAA,iBAAM,EACL,IAAA,4BAAiB,EAAC,gBAAgB,CAAC,YAAY,CAAC,EAChD,KAAK,CAAC,6CAA6C,CACnD,CAAC;IAEF,MAAM,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC;IAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;IAEjC,mJAAmJ;IACnJ,IAAI,uBAAyC,CAAC;IAC9C,IACC,QAAQ,KAAK,qBAAU,CAAC,QAAQ,CAAC,U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C;YAAS,CAAC;QACV,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;AACF,CAAC;AAhCD,gCAgCC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,YAAY,CAC3B,UAAqC,EACrC,QAAuB;IAEvB,MAAM,aAAa,GAAG,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3D,QAAQ,aAAa,EAAE,CAAC;QACvB,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9B,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAClC,QAAQ,CAAC,YAAY,CAAC,IAAA,0BAAe,EAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,aAAa,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;AACF,CAAC;AApBD,oCAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\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 { toUpgradeSchema, type SchemaCompatibilityTester } from \"../simple-tree/index.js\";\nimport { isReadonlyArray } from \"../util/index.js\";\n\nimport type { ITreeCheckout } from \"./treeCheckout.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\tpersistedMetadata: rootSchema.persistedMetadata,\n\t\t\t},\n\t\t};\n\t}\n\n\tassert(\n\t\tallowsRepoSuperset(defaultSchemaPolicy, newSchema, incrementalSchemaUpdate),\n\t\t0x5c9 /* Incremental Schema during update should 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\t// This makes the root more strict, so set allowNonSupersetSchema to true.\n\t\tschemaRepository.updateSchema(newSchema, true);\n\t}\n}\n\nexport enum UpdateType {\n\t/**\n\t * Already compatible, no update needed.\n\t */\n\tNone,\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\n/**\n * Returns how compatible updating checkout's schema is with the viewSchema.\n */\nexport function evaluateUpdate(\n\tviewSchema: SchemaCompatibilityTester,\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\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\treturn UpdateType.SchemaCompatible;\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 empty 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\t\t\tconst contentChunk = checkout.forest.chunkField(content);\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(contentChunk.topLevelLength === 0 ? undefined : contentChunk, 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, contentChunk);\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 SchemaCompatibilityTester}.\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: SchemaCompatibilityTester,\n\tcheckout: ITreeCheckout,\n): boolean {\n\tconst updatedNeeded = evaluateUpdate(viewSchema, 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(toUpgradeSchema(viewSchema.viewSchema.root));\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"]}
@@ -30,7 +30,6 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
30
30
  * Undefined iff uninitialized or disposed.
31
31
  */
32
32
  private currentCompatibility;
33
- private readonly schemaPolicy;
34
33
  readonly events: Listenable<TreeViewEvents & TreeBranchEvents> & IEmitter<TreeViewEvents & TreeBranchEvents> & HasListeners<TreeViewEvents & TreeBranchEvents>;
35
34
  private readonly viewSchema;
36
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EACN,KAAK,qBAAqB,EAI1B,OAAO,EACP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,yBAAyB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AAI,IAAI,aAAa,CAAC,WAAW,CAAC,CAS5C;IAED,IAAW,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,EASpD;IAIM,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,0BAA0B,CAAC,WAAW,CAAC;IAIhF,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,UAAO,GAAG,IAAI;IAItD,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;CAK5C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CAK7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAC1C,QAAQ,EAAE,aAAa,EACvB,mBAAmB,EAAE,OAAO,EAC5B,WAAW,GAAE,SAAS,qBAAqB,EAAO,GAChD,IAAI,CAwBN"}
1
+ {"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EACN,KAAK,qBAAqB,EAI1B,OAAO,EACP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,cAAc,EAMnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGrB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAU1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,KAAK,SAAS,E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G;AACH,wBAAgB,2BAA2B,CAC1C,QAAQ,EAAE,aAAa,EACvB,mBAAmB,EAAE,OAAO,EAC5B,WAAW,GAAE,SAAS,qBAAqB,EAAO,GAChD,IAAI,CAwBN"}
@@ -93,12 +93,8 @@ let SchematizingSimpleTreeView = (() => {
93
93
  }
94
94
  checkout.forest.anchors.slots.set(exports.ViewSlot, this);
95
95
  this.rootFieldSchema = (0, index_js_3.normalizeFieldSchema)(config.schema);
96
- this.schemaPolicy = {
97
- ...index_js_2.defaultSchemaPolicy,
98
- validateSchema: config.enableSchemaValidation,
99
- allowUnknownOptionalFields: (0, index_js_3.createUnknownOptionalFieldPolicy)(this.rootFieldSchema),
100
- };
101
- this.viewSchema = new index_js_3.SchemaCompatibilityTester(this.schemaPolicy, this.rootFieldSchema);
96
+ const configAlpha = new index_js_3.TreeViewConfigurationAlpha({ schema: config.schema });
97
+ this.viewSchema = new index_js_3.SchemaCompatibilityTester(configAlpha);
102
98
  // This must be initialized before `update` can be called.
103
99
  this.currentCompatibility = {
104
100
  canView: false,
@@ -125,11 +121,11 @@ let SchematizingSimpleTreeView = (() => {
125
121
  throw new internal_2.UsageError("Tree cannot be initialized more than once.");
126
122
  }
127
123
  this.runSchemaEdit(() => {
128
- const schema = (0, index_js_3.toStoredSchema)(this.viewSchema.viewSchemaRoot);
124
+ const schema = (0, index_js_3.toInitialSchema)(this.config.schema);
129
125
  const mapTree = (0, index_js_3.prepareForInsertionContextless)(content, this.rootFieldSchema, {
130
126
  schema,
131
- policy: this.schemaPolicy,
132
- }, this);
127
+ policy: index_js_2.defaultSchemaPolicy,
128
+ }, this, schema.rootFieldSchema);
133
129
  (0, schematizeTree_js_1.initialize)(this.checkout, {
134
130
  schema,
135
131
  initialTree: mapTree === undefined ? undefined : (0, index_js_2.cursorForMapTreeNode)(mapTree),
@@ -211,9 +207,10 @@ let SchematizingSimpleTreeView = (() => {
211
207
  const anchors = this.checkout.forest.anchors;
212
208
  const slots = anchors.slots;
213
209
  if (compatibility.canView) {
214
- this.flexTreeContext = new index_js_2.Context(this.schemaPolicy, this.checkout, this.nodeKeyManager);
210
+ this.flexTreeContext = new index_js_2.Context(index_js_2.defaultSchemaPolicy, this.checkout, this.nodeKeyManager);
215
211
  (0, internal_1.assert)(!slots.has(index_js_3.SimpleContextSlot), 0xa47 /* extra simple tree context */);
216
- slots.set(index_js_3.SimpleContextSlot, new index_js_3.HydratedContext((0, index_js_3.normalizeFieldSchema)(this.rootFieldSchema).annotatedAllowedTypesNormalized, this.flexTreeContext));
212
+ (0, internal_1.assert)(this.rootFieldSchema instanceof index_js_3.FieldSchemaAlpha, 0xbfa /* all field schema should be FieldSchemaAlpha */);
213
+ slots.set(index_js_3.SimpleContextSlot, new index_js_3.HydratedContext(this.flexTreeContext, index_js_3.HydratedContext.schemaMapFromRootSchema(this.rootFieldSchema.annotatedAllowedTypesNormalized)));
217
214
  // Trigger "rootChanged" events if the root changes in the future.
218
215
  {
219
216
  // Currently there is no good way to do this as FlexTreeField has no events for changes.
@@ -301,7 +298,7 @@ let SchematizingSimpleTreeView = (() => {
301
298
  throw new internal_2.UsageError("Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.");
302
299
  }
303
300
  const view = this.getFlexTreeContext();
304
- (0, index_js_3.setField)(view.root, this.rootFieldSchema, newRoot);
301
+ (0, index_js_3.setField)(view.root, this.rootFieldSchema, newRoot, this.checkout.storedSchema.rootFieldSchema);
305
302
  }
306
303
  // #region Branching
307
304
  fork() {