@fluidframework/tree 2.71.0 → 2.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (603) hide show
  1. package/CHANGELOG.md +26 -40
  2. package/api-report/tree.alpha.api.md +27 -18
  3. package/api-report/tree.beta.api.md +42 -0
  4. package/api-report/tree.legacy.beta.api.md +42 -0
  5. package/dist/alpha.d.ts +9 -7
  6. package/dist/api.js +1 -1
  7. package/dist/api.js.map +1 -1
  8. package/dist/beta.d.ts +7 -0
  9. package/dist/codec/codec.d.ts +16 -1
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +16 -3
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/core/index.d.ts +1 -1
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +2 -2
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/schema-stored/index.d.ts +1 -1
  18. package/dist/core/schema-stored/index.d.ts.map +1 -1
  19. package/dist/core/schema-stored/index.js +2 -2
  20. package/dist/core/schema-stored/index.js.map +1 -1
  21. package/dist/core/schema-stored/schema.d.ts +6 -6
  22. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  23. package/dist/core/schema-stored/schema.js +6 -7
  24. package/dist/core/schema-stored/schema.js.map +1 -1
  25. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  26. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  27. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  29. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  31. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
  34. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  36. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  37. package/dist/core/tree/detachedFieldIndexCodecs.js +29 -8
  38. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  40. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
  42. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  43. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  44. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  46. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  47. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  48. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  49. package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
  50. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  51. package/dist/core/tree/index.d.ts +2 -1
  52. package/dist/core/tree/index.d.ts.map +1 -1
  53. package/dist/core/tree/index.js.map +1 -1
  54. package/dist/external-utilities/typeboxValidator.js +1 -1
  55. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  57. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -8
  59. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
  63. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
  65. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  67. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/index.js +1 -2
  69. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  72. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  74. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  75. package/dist/feature-libraries/chunked-forest/index.js +1 -2
  76. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  77. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
  78. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  79. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
  80. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  81. package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
  82. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  83. package/dist/feature-libraries/forest-summary/codec.js +15 -4
  84. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  85. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  86. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  87. package/dist/feature-libraries/forest-summary/format.d.ts +8 -1
  88. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  89. package/dist/feature-libraries/forest-summary/format.js +8 -3
  90. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  91. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  92. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  93. package/dist/feature-libraries/forest-summary/index.js +3 -1
  94. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  95. package/dist/feature-libraries/index.d.ts +3 -3
  96. package/dist/feature-libraries/index.d.ts.map +1 -1
  97. package/dist/feature-libraries/index.js +2 -2
  98. package/dist/feature-libraries/index.js.map +1 -1
  99. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  100. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  101. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  102. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  103. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  104. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
  105. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  106. package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
  107. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  108. package/dist/feature-libraries/schema-index/codec.js +22 -18
  109. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  110. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  111. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  112. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  113. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  114. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
  115. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  116. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  117. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  118. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  119. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  120. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  121. package/dist/index.d.ts +1 -1
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +3 -1
  124. package/dist/index.js.map +1 -1
  125. package/dist/legacy.d.ts +7 -0
  126. package/dist/packageVersion.d.ts +1 -1
  127. package/dist/packageVersion.js +1 -1
  128. package/dist/packageVersion.js.map +1 -1
  129. package/dist/shared-tree/independentView.d.ts +1 -1
  130. package/dist/shared-tree/independentView.d.ts.map +1 -1
  131. package/dist/shared-tree/independentView.js +22 -15
  132. package/dist/shared-tree/independentView.js.map +1 -1
  133. package/dist/shared-tree/sharedTree.d.ts +12 -16
  134. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  135. package/dist/shared-tree/sharedTree.js +87 -127
  136. package/dist/shared-tree/sharedTree.js.map +1 -1
  137. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
  138. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  139. package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -11
  140. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  141. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  142. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  143. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  144. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  145. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  146. package/dist/shared-tree/treeAlpha.js +4 -2
  147. package/dist/shared-tree/treeAlpha.js.map +1 -1
  148. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  149. package/dist/shared-tree/treeCheckout.js +1 -3
  150. package/dist/shared-tree/treeCheckout.js.map +1 -1
  151. package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
  152. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  153. package/dist/shared-tree-core/editManagerCodecs.js +35 -17
  154. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  155. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
  156. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  157. package/dist/shared-tree-core/editManagerFormatCommons.js +43 -1
  158. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  159. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  160. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  161. package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
  162. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  163. package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  164. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  165. package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
  166. package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
  167. package/dist/shared-tree-core/index.d.ts +5 -3
  168. package/dist/shared-tree-core/index.d.ts.map +1 -1
  169. package/dist/shared-tree-core/index.js +11 -3
  170. package/dist/shared-tree-core/index.js.map +1 -1
  171. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  172. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  173. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  174. package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
  175. package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  176. package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
  177. package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
  178. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  179. package/dist/shared-tree-core/messageCodecs.js +38 -21
  180. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  181. package/dist/shared-tree-core/messageFormat.d.ts +50 -0
  182. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
  183. package/dist/shared-tree-core/messageFormat.js +51 -0
  184. package/dist/shared-tree-core/messageFormat.js.map +1 -0
  185. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
  186. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  187. package/dist/shared-tree-core/sharedTreeCore.js +3 -3
  188. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  189. package/dist/simple-tree/api/discrepancies.d.ts +2 -2
  190. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  191. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  192. package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
  193. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  194. package/dist/simple-tree/api/index.d.ts +3 -2
  195. package/dist/simple-tree/api/index.d.ts.map +1 -1
  196. package/dist/simple-tree/api/index.js +4 -1
  197. package/dist/simple-tree/api/index.js.map +1 -1
  198. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  199. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  200. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
  201. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  202. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  203. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  204. package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
  205. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  206. package/dist/simple-tree/api/schemaFromSimple.js +6 -3
  207. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  208. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  209. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  210. package/dist/simple-tree/api/simpleSchemaCodec.js +292 -0
  211. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  212. package/dist/simple-tree/api/storedSchema.d.ts +2 -2
  213. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  214. package/dist/simple-tree/api/storedSchema.js +8 -6
  215. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  216. package/dist/simple-tree/api/tree.d.ts +2 -2
  217. package/dist/simple-tree/api/tree.js.map +1 -1
  218. package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
  219. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  220. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  221. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  222. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
  223. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  224. package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
  225. package/dist/simple-tree/core/allowedTypes.js +1 -1
  226. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  227. package/dist/simple-tree/core/treeNode.js +1 -1
  228. package/dist/simple-tree/core/treeNode.js.map +1 -1
  229. package/dist/simple-tree/index.d.ts +2 -1
  230. package/dist/simple-tree/index.d.ts.map +1 -1
  231. package/dist/simple-tree/index.js +4 -0
  232. package/dist/simple-tree/index.js.map +1 -1
  233. package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
  234. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  235. package/dist/simple-tree/node-kinds/map/mapNode.js +1 -1
  236. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  237. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
  238. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  239. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
  240. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  241. package/dist/simple-tree/simpleSchema.d.ts +11 -3
  242. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  243. package/dist/simple-tree/simpleSchema.js.map +1 -1
  244. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  245. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  246. package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
  247. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  248. package/dist/tableSchema.d.ts.map +1 -1
  249. package/dist/tableSchema.js +1 -1
  250. package/dist/tableSchema.js.map +1 -1
  251. package/dist/treeFactory.d.ts +3 -1
  252. package/dist/treeFactory.d.ts.map +1 -1
  253. package/dist/treeFactory.js +26 -2
  254. package/dist/treeFactory.js.map +1 -1
  255. package/dist/util/brand.d.ts +31 -2
  256. package/dist/util/brand.d.ts.map +1 -1
  257. package/dist/util/brand.js +28 -2
  258. package/dist/util/brand.js.map +1 -1
  259. package/dist/util/brandedMap.d.ts +3 -1
  260. package/dist/util/brandedMap.d.ts.map +1 -1
  261. package/dist/util/brandedMap.js.map +1 -1
  262. package/dist/util/index.d.ts +1 -1
  263. package/dist/util/index.d.ts.map +1 -1
  264. package/dist/util/index.js +3 -2
  265. package/dist/util/index.js.map +1 -1
  266. package/lib/alpha.d.ts +9 -7
  267. package/lib/api.js +2 -2
  268. package/lib/api.js.map +1 -1
  269. package/lib/beta.d.ts +7 -0
  270. package/lib/codec/codec.d.ts +16 -1
  271. package/lib/codec/codec.d.ts.map +1 -1
  272. package/lib/codec/codec.js +16 -3
  273. package/lib/codec/codec.js.map +1 -1
  274. package/lib/core/index.d.ts +1 -1
  275. package/lib/core/index.d.ts.map +1 -1
  276. package/lib/core/index.js +1 -1
  277. package/lib/core/index.js.map +1 -1
  278. package/lib/core/schema-stored/index.d.ts +1 -1
  279. package/lib/core/schema-stored/index.d.ts.map +1 -1
  280. package/lib/core/schema-stored/index.js +1 -1
  281. package/lib/core/schema-stored/index.js.map +1 -1
  282. package/lib/core/schema-stored/schema.d.ts +6 -6
  283. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  284. package/lib/core/schema-stored/schema.js +6 -7
  285. package/lib/core/schema-stored/schema.js.map +1 -1
  286. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  287. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  288. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  289. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  290. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  291. package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
  292. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  293. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  294. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
  295. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  296. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  297. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  298. package/lib/core/tree/detachedFieldIndexCodecs.js +29 -8
  299. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  300. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  301. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  302. package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
  303. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  304. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  305. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  306. package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
  307. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  308. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  309. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  310. package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
  311. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  312. package/lib/core/tree/index.d.ts +2 -1
  313. package/lib/core/tree/index.d.ts.map +1 -1
  314. package/lib/core/tree/index.js +1 -1
  315. package/lib/core/tree/index.js.map +1 -1
  316. package/lib/external-utilities/typeboxValidator.js +1 -1
  317. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  318. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  319. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  320. package/lib/feature-libraries/chunked-forest/codec/codecs.js +13 -8
  321. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  322. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
  323. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  324. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
  325. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  326. package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
  327. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  328. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  329. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  331. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  333. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  334. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  335. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  336. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  337. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  338. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  339. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
  340. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  341. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
  342. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  343. package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
  344. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  345. package/lib/feature-libraries/forest-summary/codec.js +16 -5
  346. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  347. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  348. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  349. package/lib/feature-libraries/forest-summary/format.d.ts +8 -1
  350. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  351. package/lib/feature-libraries/forest-summary/format.js +7 -2
  352. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  353. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  354. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  355. package/lib/feature-libraries/forest-summary/index.js +1 -0
  356. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  357. package/lib/feature-libraries/index.d.ts +3 -3
  358. package/lib/feature-libraries/index.d.ts.map +1 -1
  359. package/lib/feature-libraries/index.js +2 -2
  360. package/lib/feature-libraries/index.js.map +1 -1
  361. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  362. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  363. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  364. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  365. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  366. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
  367. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  368. package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
  369. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  370. package/lib/feature-libraries/schema-index/codec.js +24 -20
  371. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  372. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  373. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  374. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  375. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  376. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
  377. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  378. package/lib/feature-libraries/schema-index/formatV2.js +2 -2
  379. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  380. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  381. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  382. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  383. package/lib/index.d.ts +1 -1
  384. package/lib/index.d.ts.map +1 -1
  385. package/lib/index.js +1 -1
  386. package/lib/index.js.map +1 -1
  387. package/lib/legacy.d.ts +7 -0
  388. package/lib/packageVersion.d.ts +1 -1
  389. package/lib/packageVersion.js +1 -1
  390. package/lib/packageVersion.js.map +1 -1
  391. package/lib/shared-tree/independentView.d.ts +1 -1
  392. package/lib/shared-tree/independentView.d.ts.map +1 -1
  393. package/lib/shared-tree/independentView.js +11 -4
  394. package/lib/shared-tree/independentView.js.map +1 -1
  395. package/lib/shared-tree/sharedTree.d.ts +12 -16
  396. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  397. package/lib/shared-tree/sharedTree.js +90 -130
  398. package/lib/shared-tree/sharedTree.js.map +1 -1
  399. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
  400. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  401. package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -6
  402. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  403. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  404. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  405. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  406. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  407. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  408. package/lib/shared-tree/treeAlpha.js +5 -3
  409. package/lib/shared-tree/treeAlpha.js.map +1 -1
  410. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  411. package/lib/shared-tree/treeCheckout.js +1 -3
  412. package/lib/shared-tree/treeCheckout.js.map +1 -1
  413. package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
  414. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  415. package/lib/shared-tree-core/editManagerCodecs.js +32 -16
  416. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  417. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
  418. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  419. package/lib/shared-tree-core/editManagerFormatCommons.js +42 -0
  420. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  421. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  422. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  423. package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
  424. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  425. package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  426. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  427. package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
  428. package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
  429. package/lib/shared-tree-core/index.d.ts +5 -3
  430. package/lib/shared-tree-core/index.d.ts.map +1 -1
  431. package/lib/shared-tree-core/index.js +4 -2
  432. package/lib/shared-tree-core/index.js.map +1 -1
  433. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  434. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  435. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  436. package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
  437. package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  438. package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
  439. package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
  440. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  441. package/lib/shared-tree-core/messageCodecs.js +35 -20
  442. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  443. package/lib/shared-tree-core/messageFormat.d.ts +50 -0
  444. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
  445. package/lib/shared-tree-core/messageFormat.js +48 -0
  446. package/lib/shared-tree-core/messageFormat.js.map +1 -0
  447. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
  448. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  449. package/lib/shared-tree-core/sharedTreeCore.js +3 -3
  450. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  451. package/lib/simple-tree/api/discrepancies.d.ts +2 -2
  452. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  453. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  454. package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
  455. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  456. package/lib/simple-tree/api/index.d.ts +3 -2
  457. package/lib/simple-tree/api/index.d.ts.map +1 -1
  458. package/lib/simple-tree/api/index.js +1 -0
  459. package/lib/simple-tree/api/index.js.map +1 -1
  460. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  461. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  462. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
  463. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  464. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  465. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  466. package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
  467. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  468. package/lib/simple-tree/api/schemaFromSimple.js +6 -3
  469. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  470. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  471. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  472. package/lib/simple-tree/api/simpleSchemaCodec.js +264 -0
  473. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  474. package/lib/simple-tree/api/storedSchema.d.ts +2 -2
  475. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  476. package/lib/simple-tree/api/storedSchema.js +5 -3
  477. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  478. package/lib/simple-tree/api/tree.d.ts +2 -2
  479. package/lib/simple-tree/api/tree.js.map +1 -1
  480. package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
  481. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  482. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  483. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  484. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
  485. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  486. package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
  487. package/lib/simple-tree/core/allowedTypes.js +1 -1
  488. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  489. package/lib/simple-tree/core/treeNode.js +1 -1
  490. package/lib/simple-tree/core/treeNode.js.map +1 -1
  491. package/lib/simple-tree/index.d.ts +2 -1
  492. package/lib/simple-tree/index.d.ts.map +1 -1
  493. package/lib/simple-tree/index.js +1 -0
  494. package/lib/simple-tree/index.js.map +1 -1
  495. package/lib/simple-tree/node-kinds/array/arrayNode.js +2 -2
  496. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  497. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  498. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  499. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  500. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  501. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
  502. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  503. package/lib/simple-tree/simpleSchema.d.ts +11 -3
  504. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  505. package/lib/simple-tree/simpleSchema.js.map +1 -1
  506. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  507. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  508. package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
  509. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  510. package/lib/tableSchema.d.ts.map +1 -1
  511. package/lib/tableSchema.js +1 -1
  512. package/lib/tableSchema.js.map +1 -1
  513. package/lib/treeFactory.d.ts +3 -1
  514. package/lib/treeFactory.d.ts.map +1 -1
  515. package/lib/treeFactory.js +23 -1
  516. package/lib/treeFactory.js.map +1 -1
  517. package/lib/util/brand.d.ts +31 -2
  518. package/lib/util/brand.d.ts.map +1 -1
  519. package/lib/util/brand.js +26 -1
  520. package/lib/util/brand.js.map +1 -1
  521. package/lib/util/brandedMap.d.ts +3 -1
  522. package/lib/util/brandedMap.d.ts.map +1 -1
  523. package/lib/util/brandedMap.js.map +1 -1
  524. package/lib/util/index.d.ts +1 -1
  525. package/lib/util/index.d.ts.map +1 -1
  526. package/lib/util/index.js +1 -1
  527. package/lib/util/index.js.map +1 -1
  528. package/package.json +24 -24
  529. package/src/api.ts +2 -2
  530. package/src/codec/codec.ts +17 -3
  531. package/src/core/index.ts +1 -2
  532. package/src/core/schema-stored/index.ts +1 -2
  533. package/src/core/schema-stored/schema.ts +10 -7
  534. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  535. package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
  536. package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
  537. package/src/core/tree/detachedFieldIndexCodecs.ts +33 -11
  538. package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
  539. package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
  540. package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
  541. package/src/core/tree/index.ts +2 -4
  542. package/src/external-utilities/typeboxValidator.ts +1 -1
  543. package/src/feature-libraries/chunked-forest/codec/codecs.ts +18 -13
  544. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
  545. package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
  546. package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
  547. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
  548. package/src/feature-libraries/chunked-forest/index.ts +0 -1
  549. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
  550. package/src/feature-libraries/forest-summary/codec.ts +24 -9
  551. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  552. package/src/feature-libraries/forest-summary/format.ts +12 -2
  553. package/src/feature-libraries/forest-summary/index.ts +2 -1
  554. package/src/feature-libraries/index.ts +1 -2
  555. package/src/feature-libraries/schema-edits/index.ts +0 -1
  556. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
  557. package/src/feature-libraries/schema-index/codec.ts +34 -22
  558. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  559. package/src/feature-libraries/schema-index/formatV2.ts +2 -2
  560. package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
  561. package/src/index.ts +3 -1
  562. package/src/packageVersion.ts +1 -1
  563. package/src/shared-tree/independentView.ts +16 -5
  564. package/src/shared-tree/sharedTree.ts +112 -172
  565. package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
  566. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
  567. package/src/shared-tree/treeAlpha.ts +6 -5
  568. package/src/shared-tree/treeCheckout.ts +1 -3
  569. package/src/shared-tree-core/editManagerCodecs.ts +56 -19
  570. package/src/shared-tree-core/editManagerFormatCommons.ts +47 -0
  571. package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
  572. package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
  573. package/src/shared-tree-core/index.ts +11 -5
  574. package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
  575. package/src/shared-tree-core/messageCodecV5.ts +2 -1
  576. package/src/shared-tree-core/messageCodecs.ts +60 -26
  577. package/src/shared-tree-core/messageFormat.ts +56 -0
  578. package/src/shared-tree-core/sharedTreeCore.ts +11 -13
  579. package/src/simple-tree/api/discrepancies.ts +2 -2
  580. package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
  581. package/src/simple-tree/api/index.ts +6 -2
  582. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
  583. package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
  584. package/src/simple-tree/api/schemaFromSimple.ts +6 -3
  585. package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
  586. package/src/simple-tree/api/storedSchema.ts +8 -5
  587. package/src/simple-tree/api/tree.ts +2 -2
  588. package/src/simple-tree/api/typesUnsafe.ts +6 -6
  589. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
  590. package/src/simple-tree/core/allowedTypes.ts +3 -3
  591. package/src/simple-tree/core/treeNode.ts +2 -2
  592. package/src/simple-tree/index.ts +5 -1
  593. package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -2
  594. package/src/simple-tree/node-kinds/map/mapNode.ts +2 -2
  595. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
  596. package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
  597. package/src/simple-tree/simpleSchema.ts +12 -3
  598. package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
  599. package/src/tableSchema.ts +5 -2
  600. package/src/treeFactory.ts +33 -1
  601. package/src/util/brand.ts +40 -2
  602. package/src/util/brandedMap.ts +3 -1
  603. package/src/util/index.ts +1 -0
@@ -8,7 +8,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
8
 
9
9
  import { tryGetTreeNodeSchema } from "./treeNodeKernel.js";
10
10
  import { NodeKind, type TreeNodeSchemaClass } from "./treeNodeSchema.js";
11
- // eslint-disable-next-line import/no-deprecated
11
+ // eslint-disable-next-line import-x/no-deprecated
12
12
  import { type WithType, typeNameSymbol, type typeSchemaSymbol } from "./withType.js";
13
13
  import { markEager } from "./flexList.js";
14
14
 
@@ -80,7 +80,7 @@ export abstract class TreeNode implements WithType {
80
80
  * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.
81
81
  * @deprecated Use {@link typeSchemaSymbol} instead.
82
82
  */
83
- // eslint-disable-next-line import/no-deprecated
83
+ // eslint-disable-next-line import-x/no-deprecated
84
84
  public abstract get [typeNameSymbol](): string;
85
85
 
86
86
  /**
@@ -74,6 +74,7 @@ export {
74
74
  type ITreeConfigurationOptions,
75
75
  SchemaFactory,
76
76
  SchemaFactoryBeta,
77
+ type SchemaStaticsBeta,
77
78
  SchemaFactoryAlpha,
78
79
  type ObjectSchemaOptionsAlpha,
79
80
  type ObjectSchemaOptions,
@@ -180,7 +181,6 @@ export {
180
181
  type TreeChangeEvents,
181
182
  type NodeSchemaOptions,
182
183
  type NodeSchemaOptionsAlpha,
183
- type SchemaStaticsAlpha,
184
184
  KeyEncodingOptions,
185
185
  type TreeParsingOptions,
186
186
  incrementalSummaryHint,
@@ -280,3 +280,7 @@ export {
280
280
  nullSchema,
281
281
  } from "./leafNodeSchema.js";
282
282
  export type { LeafSchema } from "./leafNodeSchema.js";
283
+ export {
284
+ encodeSimpleSchema,
285
+ decodeSimpleSchema,
286
+ } from "./api/index.js";
@@ -16,7 +16,7 @@ import { FieldKinds, isTreeValue } from "../../../feature-libraries/index.js";
16
16
  import {
17
17
  CompatibilityLevel,
18
18
  type WithType,
19
- // eslint-disable-next-line import/no-deprecated
19
+ // eslint-disable-next-line import-x/no-deprecated
20
20
  typeNameSymbol,
21
21
  NodeKind,
22
22
  type TreeNode,
@@ -1266,7 +1266,7 @@ export function arraySchema<
1266
1266
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
1267
1267
  persistedMetadata;
1268
1268
 
1269
- // eslint-disable-next-line import/no-deprecated
1269
+ // eslint-disable-next-line import-x/no-deprecated
1270
1270
  public get [typeNameSymbol](): TName {
1271
1271
  return identifier;
1272
1272
  }
@@ -22,7 +22,7 @@ import {
22
22
  type InnerNode,
23
23
  NodeKind,
24
24
  type TreeNodeSchema,
25
- // eslint-disable-next-line import/no-deprecated
25
+ // eslint-disable-next-line import-x/no-deprecated
26
26
  typeNameSymbol,
27
27
  type TreeNode,
28
28
  typeSchemaSymbol,
@@ -334,7 +334,7 @@ export function mapSchema<
334
334
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
335
335
  persistedMetadata;
336
336
 
337
- // eslint-disable-next-line import/no-deprecated
337
+ // eslint-disable-next-line import-x/no-deprecated
338
338
  public get [typeNameSymbol](): TName {
339
339
  return identifier;
340
340
  }
@@ -32,7 +32,7 @@ import {
32
32
  type TreeNodeSchema,
33
33
  NodeKind,
34
34
  type WithType,
35
- // eslint-disable-next-line import/no-deprecated
35
+ // eslint-disable-next-line import-x/no-deprecated
36
36
  typeNameSymbol,
37
37
  typeSchemaSymbol,
38
38
  type InternalTreeNode,
@@ -275,7 +275,7 @@ function createProxyHandler(
275
275
  if (propertyKey === typeSchemaSymbol) {
276
276
  return schema;
277
277
  }
278
- // eslint-disable-next-line import/no-deprecated
278
+ // eslint-disable-next-line import-x/no-deprecated
279
279
  if (propertyKey === typeNameSymbol) {
280
280
  return schema.identifier;
281
281
  }
@@ -573,7 +573,7 @@ export function objectSchema<
573
573
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
574
574
  nodeOptions.persistedMetadata;
575
575
 
576
- // eslint-disable-next-line import/no-deprecated
576
+ // eslint-disable-next-line import-x/no-deprecated
577
577
  public get [typeNameSymbol](): TName {
578
578
  return identifier;
579
579
  }
@@ -11,7 +11,7 @@ import { type JsonCompatibleReadOnlyObject, brand } from "../../../util/index.js
11
11
  import {
12
12
  type TreeNodeSchema,
13
13
  NodeKind,
14
- // eslint-disable-next-line import/no-deprecated
14
+ // eslint-disable-next-line import-x/no-deprecated
15
15
  typeNameSymbol,
16
16
  typeSchemaSymbol,
17
17
  type UnhydratedFlexTreeNode,
@@ -80,7 +80,7 @@ function createRecordNodeProxy(
80
80
  case typeSchemaSymbol: {
81
81
  return schema;
82
82
  }
83
- // eslint-disable-next-line import/no-deprecated
83
+ // eslint-disable-next-line import-x/no-deprecated
84
84
  case typeNameSymbol: {
85
85
  return schema.identifier;
86
86
  }
@@ -370,7 +370,7 @@ export function recordSchema<
370
370
  public static readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined =
371
371
  persistedMetadata;
372
372
 
373
- // eslint-disable-next-line import/no-deprecated
373
+ // eslint-disable-next-line import-x/no-deprecated
374
374
  public get [typeNameSymbol](): TName {
375
375
  return identifier;
376
376
  }
@@ -58,6 +58,15 @@ export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown>
58
58
  * especially if/when TreeNodeSchema for objects provide more maps.
59
59
  */
60
60
  readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
61
+
62
+ /**
63
+ * Whether the object node allows unknown optional fields.
64
+ *
65
+ * @see {@link ObjectSchemaOptions.allowUnknownOptionalFields} for the API where this field is set as part of authoring a schema.
66
+ *
67
+ * @remarks Only populated for view schemas, undefined otherwise. Relevant for compatibility checking scenarios.
68
+ */
69
+ readonly allowUnknownOptionalFields: boolean | undefined;
61
70
  }
62
71
 
63
72
  /**
@@ -163,14 +172,14 @@ export type SimpleNodeSchema =
163
172
  | SimpleRecordNodeSchema;
164
173
 
165
174
  /**
166
- * Information about allowed types.
175
+ * Information about allowed types under a field.
167
176
  *
168
177
  * @alpha
169
178
  * @sealed
170
179
  */
171
180
  export interface SimpleAllowedTypeAttributes {
172
181
  /**
173
- * True if this schema is included as a {@link SchemaStaticsAlpha.staged | staged} schema upgrade,
182
+ * True if this schema is included as a {@link SchemaStaticsBeta.staged | staged} schema upgrade,
174
183
  * allowing the view schema be compatible with stored schema with (post upgrade) or without it (pre-upgrade).
175
184
  * New documents and schema upgrades will omit any staged schema.
176
185
  *
@@ -238,7 +247,7 @@ export interface SimpleTreeSchema {
238
247
  * @remarks
239
248
  * The keys are the schemas' {@link TreeNodeSchemaCore.identifier | identifiers}.
240
249
  *
241
- * Information about if a schema is {@link SchemaStaticsAlpha.staged | staged} or not is not available as the "Simple Schema" layer of abstraction: they are included unconditionally.
250
+ * Information about if a schema is {@link SchemaStaticsBeta.staged | staged} or not is not available as the "Simple Schema" layer of abstraction: they are included unconditionally.
242
251
  * Options for filtering out staged schemas from view schema are available in {@link extractPersistedSchema}.
243
252
  */
244
253
  readonly definitions: ReadonlyMap<string, SimpleNodeSchema>;
@@ -0,0 +1,179 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { Type, type ObjectOptions, type Static } from "@sinclair/typebox";
7
+
8
+ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
9
+
10
+ /**
11
+ * The format version for the schema.
12
+ */
13
+ export const SimpleSchemaFormatVersion = {
14
+ v1: 1,
15
+ } as const;
16
+
17
+ /**
18
+ * The allowed types and their attributes in the simple schema format.
19
+ * @see {@link SimpleAllowedTypes}.
20
+ */
21
+ export const SimpleAllowedTypeAttributesFormat = Type.Object(
22
+ {
23
+ isStaged: Type.Optional(Type.Boolean()),
24
+ },
25
+ noAdditionalProps,
26
+ );
27
+
28
+ export type SimpleAllowedTypeAttributesFormat = Static<
29
+ typeof SimpleAllowedTypeAttributesFormat
30
+ >;
31
+
32
+ /**
33
+ * A set of allowed types in the simple schema format.
34
+ * The keys are the type identifiers, and the values are their attributes.
35
+ */
36
+ export const SimpleAllowedTypesFormat = Type.Record(
37
+ Type.String(),
38
+ SimpleAllowedTypeAttributesFormat,
39
+ );
40
+ export type SimpleAllowedTypesFormat = Static<typeof SimpleAllowedTypesFormat>;
41
+
42
+ /**
43
+ * Persisted format for a field schema in the simple schema format.
44
+ * @see {@link SimpleFieldSchema}.
45
+ */
46
+ export const SimpleFieldSchemaFormat = Type.Object(
47
+ {
48
+ kind: Type.Integer(),
49
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
50
+ },
51
+ noAdditionalProps,
52
+ );
53
+ export type SimpleFieldSchemaFormat = Static<typeof SimpleFieldSchemaFormat>;
54
+
55
+ /**
56
+ * Persisted format for an object field schema in the simple schema format.
57
+ * @see {@link SimpleObjectFieldSchema}.
58
+ */
59
+ export const SimpleObjectFieldSchemaFormat = Type.Object(
60
+ {
61
+ kind: Type.Integer(),
62
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
63
+ storedKey: Type.String(),
64
+ },
65
+ noAdditionalProps,
66
+ );
67
+ export type SimpleObjectFieldSchemaFormat = Static<typeof SimpleObjectFieldSchemaFormat>;
68
+
69
+ /**
70
+ * Persisted format for an array node schema in the simple schema format.
71
+ * @see {@link SimpleArrayNodeSchema}.
72
+ */
73
+ export const SimpleArrayNodeSchemaFormat = Type.Object(
74
+ {
75
+ kind: Type.Integer(),
76
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
77
+ },
78
+ noAdditionalProps,
79
+ );
80
+ export type SimpleArrayNodeSchemaFormat = Static<typeof SimpleArrayNodeSchemaFormat>;
81
+
82
+ /**
83
+ * Persisted format for a map node schema in the simple schema format.
84
+ * @see {@link SimpleMapNodeSchema}.
85
+ */
86
+ export const SimpleMapNodeSchemaFormat = Type.Object(
87
+ {
88
+ kind: Type.Integer(),
89
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
90
+ },
91
+ noAdditionalProps,
92
+ );
93
+ export type SimpleMapNodeSchemaFormat = Static<typeof SimpleMapNodeSchemaFormat>;
94
+
95
+ /**
96
+ * Persisted format for a record node schema in the simple schema format.
97
+ * @see {@link SimpleRecordNodeSchema}.
98
+ */
99
+ export const SimpleRecordNodeSchemaFormat = Type.Object(
100
+ {
101
+ kind: Type.Integer(),
102
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
103
+ },
104
+ noAdditionalProps,
105
+ );
106
+ export type SimpleRecordNodeSchemaFormat = Static<typeof SimpleRecordNodeSchemaFormat>;
107
+
108
+ /**
109
+ * Persisted format for a leaf node schema in the simple schema format.
110
+ * @see {@link SimpleLeafNodeSchema}.
111
+ */
112
+ export const SimpleLeafNodeSchemaFormat = Type.Object(
113
+ {
114
+ kind: Type.Integer(),
115
+ leafKind: Type.Integer(),
116
+ },
117
+ noAdditionalProps,
118
+ );
119
+ export type SimpleLeafNodeSchemaFormat = Static<typeof SimpleLeafNodeSchemaFormat>;
120
+
121
+ /**
122
+ * Persisted format for the field schemas of an object node in the simple schema format.
123
+ */
124
+ export const SimpleObjectFieldSchemasFormat = Type.Record(
125
+ Type.String(),
126
+ SimpleObjectFieldSchemaFormat,
127
+ );
128
+ export type SimpleObjectFieldSchemasFormat = Static<typeof SimpleObjectFieldSchemasFormat>;
129
+
130
+ /**
131
+ * Persisted format for an object node schema in the simple schema format.
132
+ * @see {@link SimpleObjectNodeSchema}.
133
+ */
134
+ export const SimpleObjectNodeSchemaFormat = Type.Object(
135
+ {
136
+ kind: Type.Integer(),
137
+ fields: SimpleObjectFieldSchemasFormat,
138
+ allowUnknownOptionalFields: Type.Optional(Type.Boolean()),
139
+ },
140
+ noAdditionalProps,
141
+ );
142
+ export type SimpleObjectNodeSchemaFormat = Static<typeof SimpleObjectNodeSchemaFormat>;
143
+
144
+ /**
145
+ * Discriminated union of all possible node schemas.
146
+ *
147
+ * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
148
+ */
149
+ export const SimpleNodeSchemaUnionFormat = Type.Object({
150
+ array: Type.Optional(SimpleArrayNodeSchemaFormat),
151
+ map: Type.Optional(SimpleMapNodeSchemaFormat),
152
+ record: Type.Optional(SimpleRecordNodeSchemaFormat),
153
+ leaf: Type.Optional(SimpleLeafNodeSchemaFormat),
154
+ object: Type.Optional(SimpleObjectNodeSchemaFormat),
155
+ });
156
+ export type SimpleNodeSchemaUnionFormat = Static<typeof SimpleNodeSchemaUnionFormat>;
157
+
158
+ /**
159
+ * Helper type for the schema definitions map in the persisted format.
160
+ */
161
+ export const SimpleSchemaDefinitionsFormat = Type.Record(
162
+ Type.String(),
163
+ SimpleNodeSchemaUnionFormat,
164
+ );
165
+ export type SimpleSchemaDefinitionsFormat = Static<typeof SimpleSchemaDefinitionsFormat>;
166
+
167
+ /**
168
+ * Persisted format for the entire tree schema in the simple schema format.
169
+ * @see {@link SimpleTreeSchema}.
170
+ */
171
+ export const SimpleTreeSchemaFormat = Type.Object(
172
+ {
173
+ version: Type.Literal(SimpleSchemaFormatVersion.v1),
174
+ root: SimpleFieldSchemaFormat,
175
+ definitions: SimpleSchemaDefinitionsFormat,
176
+ },
177
+ noAdditionalProps,
178
+ );
179
+ export type SimpleTreeSchemaFormat = Static<typeof SimpleTreeSchemaFormat>;
@@ -216,7 +216,10 @@ export namespace System_TableSchema {
216
216
  throw new UsageError(`Column with ID "${this.id}" is not contained in a table.`);
217
217
  }
218
218
 
219
- const result = [];
219
+ const result: {
220
+ rowId: string;
221
+ cell: CellValueType;
222
+ }[] = [];
220
223
  for (const row of tableNode.rows) {
221
224
  const cell = row.getCell(this.id);
222
225
  if (cell !== undefined) {
@@ -226,7 +229,7 @@ export namespace System_TableSchema {
226
229
  );
227
230
  }
228
231
 
229
- result.push({ rowId: row.id, cell: cell as CellValueType });
232
+ result.push({ rowId: row.id, cell });
230
233
  }
231
234
  }
232
235
  return result;
@@ -26,8 +26,12 @@ import {
26
26
  } from "./shared-tree/index.js";
27
27
  import { SharedTreeFactoryType, SharedTreeAttributes } from "./sharedTreeAttributes.js";
28
28
  import type { ITree } from "./simple-tree/index.js";
29
- import { Breakable } from "./util/index.js";
29
+ import { Breakable, copyProperty } from "./util/index.js";
30
30
  import { FluidClientVersion } from "./codec/index.js";
31
+ import {
32
+ editManagerFormatVersionSelectorForSharedBranches,
33
+ messageFormatVersionSelectorForSharedBranches,
34
+ } from "./shared-tree-core/index.js";
31
35
 
32
36
  /**
33
37
  * {@link ITreePrivate} extended with ISharedObject.
@@ -169,6 +173,13 @@ export function configuredSharedTreeBetaLegacy(
169
173
  */
170
174
  export function configuredSharedTree(
171
175
  options: SharedTreeOptions,
176
+ ): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {
177
+ const internalOptions = resolveOptions(options);
178
+ return configuredSharedTreeInternal(internalOptions);
179
+ }
180
+
181
+ export function configuredSharedTreeInternal(
182
+ options: SharedTreeOptionsInternal,
172
183
  ): ISharedObjectKind<ITree> & SharedObjectKind<ITree> {
173
184
  const sharedObjectOptions: SharedObjectOptions<ITree> = {
174
185
  type: SharedTreeFactoryType,
@@ -179,3 +190,24 @@ export function configuredSharedTree(
179
190
 
180
191
  return makeSharedObjectKind<ITree>(sharedObjectOptions);
181
192
  }
193
+
194
+ export function resolveOptions(options: SharedTreeOptions): SharedTreeOptionsInternal {
195
+ const internal: SharedTreeOptionsInternal = {
196
+ ...resolveSharedBranchesOptions(options.enableSharedBranches),
197
+ };
198
+ copyProperty(options, "forest", internal);
199
+ copyProperty(options, "jsonValidator", internal);
200
+ copyProperty(options, "minVersionForCollab", internal);
201
+ copyProperty(options, "treeEncodeType", internal);
202
+ return internal;
203
+ }
204
+
205
+ function resolveSharedBranchesOptions(
206
+ enableSharedBranches: boolean | undefined,
207
+ ): SharedTreeOptionsInternal {
208
+ return enableSharedBranches === true ? sharedBranchesOptions : {};
209
+ }
210
+ const sharedBranchesOptions: SharedTreeOptionsInternal = {
211
+ messageFormatSelector: messageFormatVersionSelectorForSharedBranches,
212
+ editManagerFormatSelector: editManagerFormatVersionSelectorForSharedBranches,
213
+ };
package/src/util/brand.ts CHANGED
@@ -9,7 +9,7 @@ import type { Covariant } from "./typeCheck.js";
9
9
 
10
10
  /**
11
11
  * Constructs a "Branded" type, adding a type-checking only field to `ValueType`.
12
- *
12
+ * @remarks
13
13
  * Two usages of `Brand` should never use the same `Name`.
14
14
  * If they do, the resulting types will be assignable which defeats the point of this type.
15
15
  *
@@ -18,11 +18,17 @@ import type { Covariant } from "./typeCheck.js";
18
18
  * `Type 'Name1' is not assignable to type 'Name2'.`
19
19
  *
20
20
  * These branded types are not opaque: A `Brand<A, B>` can still be used as a `A`.
21
+ *
22
+ * @example Simple usage:
23
+ * ```typescript
24
+ * export type StrongId = Brand<string, "tree.StrongId">;
25
+ * const x: StrongId = brand("myId");
26
+ * ```
21
27
  */
22
28
  export type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;
23
29
 
24
30
  /**
25
- * Helper for {@link Brand}.
31
+ * Implementation detail for {@link Brand}.
26
32
  *
27
33
  * See `MakeNominal` for some more details.
28
34
  *
@@ -98,6 +104,11 @@ export type NameFromBranded<T extends BrandedType<unknown, unknown>> = T extends
98
104
  * Adds a type {@link Brand} to a value.
99
105
  *
100
106
  * Only do this when specifically allowed by the requirements of the type being converted to.
107
+ * @remarks
108
+ * This infers the branded type from context so it can very easily be used to a semantically invalid conversion.
109
+ * Treat this like "as" casts: they are an indicator that the user/reader must ensure the conversion is valid.
110
+ *
111
+ * If branding a constant, and wanting to preserve the exact typing of the constant, use {@link brandConst} instead.
101
112
  * @privateRemarks
102
113
  * Leaving `T` unconstrained here allows for better type inference when branding unions.
103
114
  * For example when assigning `brand(number)` a number to an optional branded number field,
@@ -111,3 +122,30 @@ export function brand<T>(
111
122
  ): T {
112
123
  return value as T;
113
124
  }
125
+
126
+ /**
127
+ * Adds a type {@link Brand} to a value, while preserving the exact type of the value being branded.
128
+ * @remarks
129
+ * This takes in the type to brand to as a required type parameter, unlike {@link brand} which infers it from context.
130
+ * This also preserves the exact type of the value being branded.
131
+ * TypeScript has no way to take an explicit type parameter and infer another in a single generic context.
132
+ * To work around this, two generic contexts are used, first a function to infer the parameter type,
133
+ * and a second function (returned) to take the explicit type parameter.
134
+ *
135
+ * This is intended for use when branding constants.
136
+ * @example
137
+ * ```typescript
138
+ * const requiredIdentifier = brandConst("Value")<FieldKindIdentifier>();
139
+ * ```
140
+ * @privateRemarks
141
+ * The dummy parameter is used to produce a compile error in the event where the value being branded is incompatible with the branded type.
142
+ */
143
+ export function brandConst<const T>(
144
+ value: T,
145
+ ): <T2 extends BrandedType<unknown, unknown>>(
146
+ ...dummy: T extends (T2 extends BrandedType<infer ValueType, unknown> ? ValueType : never)
147
+ ? []
148
+ : [never]
149
+ ) => T2 & T {
150
+ return <T2>() => value as T2 & T;
151
+ }
@@ -11,10 +11,12 @@ import { getOrCreate } from "./utils.js";
11
11
  /**
12
12
  * Key in a {@link BrandedMapSubset}.
13
13
  * @remarks
14
+ * `TContent` is used as part of the brand to strongly associate the key type with the type of the values it looks up.
15
+ *
14
16
  * Due to the `TContent` type parameter being invariant (which it has to be since keys are used to both read and write data),
15
17
  * generic collections end up needing to constrain their key's `TContent` to `any`.
16
18
  */
17
- export type BrandedKey<TKey, TContent> = TKey & Invariant<TContent>;
19
+ export type BrandedKey<TKey, TContent> = Brand<TKey, ["BrandedKey", Invariant<TContent>]>;
18
20
 
19
21
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
22
  export type BrandedKeyContent<TKey extends BrandedKey<unknown, any>> = TKey extends BrandedKey<
package/src/util/index.ts CHANGED
@@ -9,6 +9,7 @@ export {
9
9
  BrandedType,
10
10
  type NameFromBranded,
11
11
  type ValueFromBranded,
12
+ brandConst,
12
13
  } from "./brand.js";
13
14
  export { brandedNumberType, brandedStringType } from "./typeboxBrand.js";
14
15
  export {