@fluidframework/tree 2.72.0 → 2.73.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 (609) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/api-report/tree.alpha.api.md +17 -30
  3. package/dist/alpha.d.ts +3 -1
  4. package/dist/api.d.ts +6 -2
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +2 -11
  7. package/dist/api.js.map +1 -1
  8. package/dist/codec/codec.d.ts +9 -2
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +9 -2
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/index.d.ts +1 -1
  13. package/dist/codec/index.d.ts.map +1 -1
  14. package/dist/codec/index.js +2 -1
  15. package/dist/codec/index.js.map +1 -1
  16. package/dist/codec/versioned/codec.d.ts +7 -2
  17. package/dist/codec/versioned/codec.d.ts.map +1 -1
  18. package/dist/codec/versioned/codec.js +24 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/codec/versioned/index.d.ts +1 -1
  21. package/dist/codec/versioned/index.d.ts.map +1 -1
  22. package/dist/codec/versioned/index.js +2 -1
  23. package/dist/codec/versioned/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +12 -1
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js.map +1 -1
  27. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
  29. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  31. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
  35. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  37. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  40. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/codecs.js +31 -17
  42. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  44. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  46. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  48. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
  50. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  52. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  53. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  54. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  56. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  58. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  60. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
  62. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  64. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
  66. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  68. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  70. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  71. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  72. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  73. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
  74. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  75. package/dist/feature-libraries/default-schema/index.d.ts +1 -3
  76. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  77. package/dist/feature-libraries/default-schema/index.js +2 -8
  78. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  79. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  80. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/forest-summary/format.js +4 -2
  82. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  83. package/dist/feature-libraries/index.d.ts +4 -3
  84. package/dist/feature-libraries/index.d.ts.map +1 -1
  85. package/dist/feature-libraries/index.js +8 -7
  86. package/dist/feature-libraries/index.js.map +1 -1
  87. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  88. package/dist/feature-libraries/modular-schema/comparison.js +1 -2
  89. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  90. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  91. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  92. package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
  93. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  95. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  96. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  97. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  98. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  99. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  100. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  101. package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
  102. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  103. package/dist/feature-libraries/modular-schema/index.js +1 -3
  104. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  105. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  106. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  107. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  108. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  109. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  110. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  111. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  113. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  114. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  115. package/dist/feature-libraries/object-forest/objectForest.js +3 -2
  116. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  117. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  118. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  119. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  120. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  121. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  122. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  123. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  124. package/dist/feature-libraries/schema-index/codec.js +5 -3
  125. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  126. package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  127. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
  128. package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  129. package/dist/feature-libraries/schemaChecker.js.map +1 -0
  130. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  131. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  132. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  133. package/dist/index.d.ts +2 -2
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +5 -3
  136. package/dist/index.js.map +1 -1
  137. package/dist/packageVersion.d.ts +1 -1
  138. package/dist/packageVersion.js +1 -1
  139. package/dist/packageVersion.js.map +1 -1
  140. package/dist/shared-tree/index.d.ts +1 -1
  141. package/dist/shared-tree/index.d.ts.map +1 -1
  142. package/dist/shared-tree/index.js +1 -2
  143. package/dist/shared-tree/index.js.map +1 -1
  144. package/dist/shared-tree/sharedTree.d.ts +0 -44
  145. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  146. package/dist/shared-tree/sharedTree.js +1 -52
  147. package/dist/shared-tree/sharedTree.js.map +1 -1
  148. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  149. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  150. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
  151. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  152. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  153. package/dist/shared-tree-core/editManagerCodecs.js +12 -6
  154. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  155. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  156. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  157. package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
  158. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  159. package/dist/shared-tree-core/index.d.ts +2 -2
  160. package/dist/shared-tree-core/index.d.ts.map +1 -1
  161. package/dist/shared-tree-core/index.js +3 -2
  162. package/dist/shared-tree-core/index.js.map +1 -1
  163. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  164. package/dist/shared-tree-core/messageCodecs.js +20 -9
  165. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  166. package/dist/shared-tree-core/messageFormat.d.ts +4 -6
  167. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  168. package/dist/shared-tree-core/messageFormat.js +9 -7
  169. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  170. package/dist/simple-tree/api/configuration.d.ts +2 -0
  171. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  172. package/dist/simple-tree/api/configuration.js +10 -0
  173. package/dist/simple-tree/api/configuration.js.map +1 -1
  174. package/dist/simple-tree/api/index.d.ts +1 -0
  175. package/dist/simple-tree/api/index.d.ts.map +1 -1
  176. package/dist/simple-tree/api/index.js +5 -1
  177. package/dist/simple-tree/api/index.js.map +1 -1
  178. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  179. package/dist/simple-tree/api/schemaFromSimple.js +7 -1
  180. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  181. package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
  182. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  183. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  184. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  185. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
  186. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  187. package/dist/simple-tree/api/tree.d.ts +1 -1
  188. package/dist/simple-tree/api/tree.js +1 -1
  189. package/dist/simple-tree/api/tree.js.map +1 -1
  190. package/dist/simple-tree/core/allowedTypes.js +1 -1
  191. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  192. package/dist/simple-tree/core/index.d.ts +3 -3
  193. package/dist/simple-tree/core/index.d.ts.map +1 -1
  194. package/dist/simple-tree/core/index.js +3 -1
  195. package/dist/simple-tree/core/index.js.map +1 -1
  196. package/dist/simple-tree/core/toStored.d.ts +12 -5
  197. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  198. package/dist/simple-tree/core/toStored.js +26 -10
  199. package/dist/simple-tree/core/toStored.js.map +1 -1
  200. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
  201. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  202. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  203. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  204. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  205. package/dist/simple-tree/core/treeNodeValid.js +1 -2
  206. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  207. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  208. package/dist/simple-tree/fieldSchema.js +1 -8
  209. package/dist/simple-tree/fieldSchema.js.map +1 -1
  210. package/dist/simple-tree/index.d.ts +2 -2
  211. package/dist/simple-tree/index.d.ts.map +1 -1
  212. package/dist/simple-tree/index.js +9 -3
  213. package/dist/simple-tree/index.js.map +1 -1
  214. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  215. package/dist/simple-tree/leafNodeSchema.js +0 -1
  216. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  217. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  218. package/dist/simple-tree/node-kinds/array/arrayNode.js +13 -49
  219. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  220. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  221. package/dist/simple-tree/node-kinds/map/mapNode.js +1 -5
  222. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  223. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  224. package/dist/simple-tree/node-kinds/object/objectNode.js +2 -10
  225. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  226. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  227. package/dist/simple-tree/node-kinds/record/recordNode.js +1 -5
  228. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  229. package/dist/simple-tree/simpleSchema.d.ts +15 -3
  230. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  231. package/dist/simple-tree/simpleSchema.js.map +1 -1
  232. package/dist/simple-tree/toStoredSchema.d.ts +20 -8
  233. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  234. package/dist/simple-tree/toStoredSchema.js +27 -22
  235. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  236. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  237. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
  238. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  239. package/dist/tableSchema.d.ts +22 -52
  240. package/dist/tableSchema.d.ts.map +1 -1
  241. package/dist/tableSchema.js +141 -277
  242. package/dist/tableSchema.js.map +1 -1
  243. package/dist/util/arrayUtilities.d.ts +45 -0
  244. package/dist/util/arrayUtilities.d.ts.map +1 -0
  245. package/dist/util/arrayUtilities.js +76 -0
  246. package/dist/util/arrayUtilities.js.map +1 -0
  247. package/dist/util/index.d.ts +1 -0
  248. package/dist/util/index.d.ts.map +1 -1
  249. package/dist/util/index.js +7 -2
  250. package/dist/util/index.js.map +1 -1
  251. package/lib/alpha.d.ts +3 -1
  252. package/lib/api.d.ts +6 -2
  253. package/lib/api.d.ts.map +1 -1
  254. package/lib/api.js +2 -13
  255. package/lib/api.js.map +1 -1
  256. package/lib/codec/codec.d.ts +9 -2
  257. package/lib/codec/codec.d.ts.map +1 -1
  258. package/lib/codec/codec.js +9 -2
  259. package/lib/codec/codec.js.map +1 -1
  260. package/lib/codec/index.d.ts +1 -1
  261. package/lib/codec/index.d.ts.map +1 -1
  262. package/lib/codec/index.js +1 -1
  263. package/lib/codec/index.js.map +1 -1
  264. package/lib/codec/versioned/codec.d.ts +7 -2
  265. package/lib/codec/versioned/codec.d.ts.map +1 -1
  266. package/lib/codec/versioned/codec.js +22 -0
  267. package/lib/codec/versioned/codec.js.map +1 -1
  268. package/lib/codec/versioned/index.d.ts +1 -1
  269. package/lib/codec/versioned/index.d.ts.map +1 -1
  270. package/lib/codec/versioned/index.js +1 -1
  271. package/lib/codec/versioned/index.js.map +1 -1
  272. package/lib/core/schema-stored/schema.d.ts +12 -1
  273. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  274. package/lib/core/schema-stored/schema.js.map +1 -1
  275. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  276. package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
  277. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  278. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  279. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  280. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  281. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  282. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
  283. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  284. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  285. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  286. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  287. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  288. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  289. package/lib/feature-libraries/chunked-forest/codec/codecs.js +34 -20
  290. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  291. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  292. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  293. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  294. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  295. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  296. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  297. package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
  298. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  299. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  300. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  301. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  302. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  303. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  304. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  305. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  306. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  307. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  308. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  309. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
  310. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  311. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  312. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  313. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
  314. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  315. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  316. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  317. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  318. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  319. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  320. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  321. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
  322. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  323. package/lib/feature-libraries/default-schema/index.d.ts +1 -3
  324. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  325. package/lib/feature-libraries/default-schema/index.js +1 -3
  326. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  327. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  328. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  329. package/lib/feature-libraries/forest-summary/format.js +4 -2
  330. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  331. package/lib/feature-libraries/index.d.ts +4 -3
  332. package/lib/feature-libraries/index.d.ts.map +1 -1
  333. package/lib/feature-libraries/index.js +4 -3
  334. package/lib/feature-libraries/index.js.map +1 -1
  335. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  336. package/lib/feature-libraries/modular-schema/comparison.js +1 -2
  337. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  338. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  339. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  340. package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
  341. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  342. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  343. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  344. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  345. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  346. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  347. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  348. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  349. package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
  350. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  351. package/lib/feature-libraries/modular-schema/index.js +0 -1
  352. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  353. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  354. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  355. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  356. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  357. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  358. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  359. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  360. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  361. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  362. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  363. package/lib/feature-libraries/object-forest/objectForest.js +2 -1
  364. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  365. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  366. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  367. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  368. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  369. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  370. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  371. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  372. package/lib/feature-libraries/schema-index/codec.js +5 -3
  373. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  374. package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  375. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
  376. package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  377. package/lib/feature-libraries/schemaChecker.js.map +1 -0
  378. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  379. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  380. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  381. package/lib/index.d.ts +2 -2
  382. package/lib/index.d.ts.map +1 -1
  383. package/lib/index.js +2 -2
  384. package/lib/index.js.map +1 -1
  385. package/lib/packageVersion.d.ts +1 -1
  386. package/lib/packageVersion.js +1 -1
  387. package/lib/packageVersion.js.map +1 -1
  388. package/lib/shared-tree/index.d.ts +1 -1
  389. package/lib/shared-tree/index.d.ts.map +1 -1
  390. package/lib/shared-tree/index.js +1 -1
  391. package/lib/shared-tree/index.js.map +1 -1
  392. package/lib/shared-tree/sharedTree.d.ts +0 -44
  393. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  394. package/lib/shared-tree/sharedTree.js +0 -51
  395. package/lib/shared-tree/sharedTree.js.map +1 -1
  396. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  397. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  398. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
  399. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  400. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  401. package/lib/shared-tree-core/editManagerCodecs.js +13 -7
  402. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  403. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  404. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  405. package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
  406. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  407. package/lib/shared-tree-core/index.d.ts +2 -2
  408. package/lib/shared-tree-core/index.d.ts.map +1 -1
  409. package/lib/shared-tree-core/index.js +2 -2
  410. package/lib/shared-tree-core/index.js.map +1 -1
  411. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  412. package/lib/shared-tree-core/messageCodecs.js +21 -10
  413. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  414. package/lib/shared-tree-core/messageFormat.d.ts +4 -6
  415. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  416. package/lib/shared-tree-core/messageFormat.js +8 -6
  417. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  418. package/lib/simple-tree/api/configuration.d.ts +2 -0
  419. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  420. package/lib/simple-tree/api/configuration.js +10 -0
  421. package/lib/simple-tree/api/configuration.js.map +1 -1
  422. package/lib/simple-tree/api/index.d.ts +1 -0
  423. package/lib/simple-tree/api/index.d.ts.map +1 -1
  424. package/lib/simple-tree/api/index.js +1 -0
  425. package/lib/simple-tree/api/index.js.map +1 -1
  426. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  427. package/lib/simple-tree/api/schemaFromSimple.js +8 -2
  428. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  429. package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
  430. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  431. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  432. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  433. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
  434. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  435. package/lib/simple-tree/api/tree.d.ts +1 -1
  436. package/lib/simple-tree/api/tree.js +1 -1
  437. package/lib/simple-tree/api/tree.js.map +1 -1
  438. package/lib/simple-tree/core/allowedTypes.js +1 -1
  439. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  440. package/lib/simple-tree/core/index.d.ts +3 -3
  441. package/lib/simple-tree/core/index.d.ts.map +1 -1
  442. package/lib/simple-tree/core/index.js +2 -2
  443. package/lib/simple-tree/core/index.js.map +1 -1
  444. package/lib/simple-tree/core/toStored.d.ts +12 -5
  445. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  446. package/lib/simple-tree/core/toStored.js +25 -9
  447. package/lib/simple-tree/core/toStored.js.map +1 -1
  448. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
  449. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  450. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  451. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  452. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  453. package/lib/simple-tree/core/treeNodeValid.js +1 -2
  454. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  455. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  456. package/lib/simple-tree/fieldSchema.js +2 -9
  457. package/lib/simple-tree/fieldSchema.js.map +1 -1
  458. package/lib/simple-tree/index.d.ts +2 -2
  459. package/lib/simple-tree/index.d.ts.map +1 -1
  460. package/lib/simple-tree/index.js +2 -2
  461. package/lib/simple-tree/index.js.map +1 -1
  462. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  463. package/lib/simple-tree/leafNodeSchema.js +1 -2
  464. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  465. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  466. package/lib/simple-tree/node-kinds/array/arrayNode.js +15 -51
  467. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  468. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  469. package/lib/simple-tree/node-kinds/map/mapNode.js +3 -7
  470. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  471. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  472. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -11
  473. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  474. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  475. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -7
  476. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  477. package/lib/simple-tree/simpleSchema.d.ts +15 -3
  478. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  479. package/lib/simple-tree/simpleSchema.js.map +1 -1
  480. package/lib/simple-tree/toStoredSchema.d.ts +20 -8
  481. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  482. package/lib/simple-tree/toStoredSchema.js +28 -24
  483. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  484. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  485. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
  486. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  487. package/lib/tableSchema.d.ts +22 -52
  488. package/lib/tableSchema.d.ts.map +1 -1
  489. package/lib/tableSchema.js +143 -279
  490. package/lib/tableSchema.js.map +1 -1
  491. package/lib/util/arrayUtilities.d.ts +45 -0
  492. package/lib/util/arrayUtilities.d.ts.map +1 -0
  493. package/lib/util/arrayUtilities.js +69 -0
  494. package/lib/util/arrayUtilities.js.map +1 -0
  495. package/lib/util/index.d.ts +1 -0
  496. package/lib/util/index.d.ts.map +1 -1
  497. package/lib/util/index.js +1 -0
  498. package/lib/util/index.js.map +1 -1
  499. package/package.json +21 -21
  500. package/src/api.ts +22 -11
  501. package/src/codec/codec.ts +10 -2
  502. package/src/codec/index.ts +1 -0
  503. package/src/codec/versioned/codec.ts +40 -2
  504. package/src/codec/versioned/index.ts +1 -0
  505. package/src/core/schema-stored/schema.ts +12 -1
  506. package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
  507. package/src/feature-libraries/README.md +1 -1
  508. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
  509. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
  510. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  511. package/src/feature-libraries/chunked-forest/codec/codecs.ts +52 -19
  512. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
  513. package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
  514. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
  515. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
  516. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
  517. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
  518. package/src/feature-libraries/chunked-forest/index.ts +1 -1
  519. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
  520. package/src/feature-libraries/default-schema/index.ts +1 -9
  521. package/src/feature-libraries/forest-summary/format.ts +15 -9
  522. package/src/feature-libraries/index.ts +7 -5
  523. package/src/feature-libraries/modular-schema/comparison.ts +2 -3
  524. package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
  525. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
  526. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
  527. package/src/feature-libraries/modular-schema/index.ts +0 -1
  528. package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
  529. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
  530. package/src/feature-libraries/object-forest/objectForest.ts +2 -6
  531. package/src/feature-libraries/optional-field/index.ts +1 -0
  532. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  533. package/src/feature-libraries/schema-index/codec.ts +10 -3
  534. package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
  535. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
  536. package/src/index.ts +3 -1
  537. package/src/packageVersion.ts +1 -1
  538. package/src/shared-tree/index.ts +0 -1
  539. package/src/shared-tree/sharedTree.ts +0 -70
  540. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
  541. package/src/shared-tree-core/editManagerCodecs.ts +19 -7
  542. package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
  543. package/src/shared-tree-core/index.ts +6 -2
  544. package/src/shared-tree-core/messageCodecs.ts +32 -17
  545. package/src/shared-tree-core/messageFormat.ts +8 -6
  546. package/src/simple-tree/api/configuration.ts +17 -4
  547. package/src/simple-tree/api/index.ts +5 -0
  548. package/src/simple-tree/api/schemaFromSimple.ts +14 -6
  549. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
  550. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
  551. package/src/simple-tree/api/tree.ts +1 -1
  552. package/src/simple-tree/core/allowedTypes.ts +1 -1
  553. package/src/simple-tree/core/index.ts +3 -1
  554. package/src/simple-tree/core/toStored.ts +42 -18
  555. package/src/simple-tree/core/treeNodeSchema.ts +1 -7
  556. package/src/simple-tree/core/treeNodeValid.ts +0 -2
  557. package/src/simple-tree/fieldSchema.ts +2 -11
  558. package/src/simple-tree/index.ts +6 -1
  559. package/src/simple-tree/leafNodeSchema.ts +1 -2
  560. package/src/simple-tree/node-kinds/array/arrayNode.ts +26 -75
  561. package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
  562. package/src/simple-tree/node-kinds/object/objectNode.ts +2 -17
  563. package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
  564. package/src/simple-tree/simpleSchema.ts +16 -3
  565. package/src/simple-tree/toStoredSchema.ts +54 -38
  566. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
  567. package/src/tableSchema.ts +110 -334
  568. package/src/util/arrayUtilities.ts +88 -0
  569. package/src/util/index.ts +6 -0
  570. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  571. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  572. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
  573. package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  574. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  575. package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  576. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  577. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  578. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
  579. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  580. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  581. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  582. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
  583. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  584. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  585. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  586. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
  587. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  588. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  589. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  590. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
  591. package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  592. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  593. package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  594. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  595. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  596. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
  597. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  598. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  599. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  600. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
  601. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  602. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  603. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  604. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
  605. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  606. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
  607. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
  608. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
  609. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getNodeEncoder = exports.getFieldEncoder = exports.buildContext = exports.schemaCompressedEncode = void 0;
7
+ exports.getNodeEncoder = exports.getFieldEncoder = exports.buildContext = exports.schemaCompressedEncodeV2 = exports.schemaCompressedEncodeV1 = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../../core/index.js");
10
10
  const compressedEncode_js_1 = require("./compressedEncode.js");
@@ -12,6 +12,24 @@ const format_js_1 = require("./format.js");
12
12
  const nodeEncoder_js_1 = require("./nodeEncoder.js");
13
13
  const incrementalEncodingPolicy_js_1 = require("./incrementalEncodingPolicy.js");
14
14
  const index_js_2 = require("../../../util/index.js");
15
+ /**
16
+ * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
17
+ * @remarks See {@link schemaCompressedEncode} for more details.
18
+ * This version does not support incremental encoding.
19
+ */
20
+ function schemaCompressedEncodeV1(schema, policy, fieldBatch, idCompressor) {
21
+ return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, undefined /* incrementalEncoder */, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
22
+ }
23
+ exports.schemaCompressedEncodeV1 = schemaCompressedEncodeV1;
24
+ /**
25
+ * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.
26
+ * @remarks See {@link schemaCompressedEncode} for more details.
27
+ * Incremental encoding is supported from this version onwards.
28
+ */
29
+ function schemaCompressedEncodeV2(schema, policy, fieldBatch, idCompressor, incrementalEncoder) {
30
+ return schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
31
+ }
32
+ exports.schemaCompressedEncodeV2 = schemaCompressedEncodeV2;
15
33
  /**
16
34
  * Encode data from `fieldBatch` in into an `EncodedChunk`.
17
35
  * @remarks
@@ -22,12 +40,11 @@ const index_js_2 = require("../../../util/index.js");
22
40
  * Optimized for encoded size and encoding performance.
23
41
  * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.
24
42
  */
25
- function schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder) {
26
- return (0, compressedEncode_js_1.compressedEncode)(fieldBatch, buildContext(schema, policy, idCompressor, incrementalEncoder));
43
+ function schemaCompressedEncode(schema, policy, fieldBatch, idCompressor, incrementalEncoder, version) {
44
+ return (0, compressedEncode_js_1.compressedEncode)(fieldBatch, buildContext(schema, policy, idCompressor, incrementalEncoder, version));
27
45
  }
28
- exports.schemaCompressedEncode = schemaCompressedEncode;
29
- function buildContext(storedSchema, policy, idCompressor, incrementalEncoder) {
30
- const context = new compressedEncode_js_1.EncoderContext((fieldBuilder, schemaName) => getNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder), (nodeBuilder, fieldSchema) => getFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema), policy.fieldKinds, idCompressor, incrementalEncoder);
46
+ function buildContext(storedSchema, policy, idCompressor, incrementalEncoder, version) {
47
+ const context = new compressedEncode_js_1.EncoderContext((fieldBuilder, schemaName) => getNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder), (nodeBuilder, fieldSchema) => getFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema), policy.fieldKinds, idCompressor, incrementalEncoder, version);
31
48
  return context;
32
49
  }
33
50
  exports.buildContext = buildContext;
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAUgC;AAGhC,+DAU+B;AAE/B,2CAA2F;AAE3F,qDAAyD;AACzD,iFAAkF;AAClF,qDAAyD;AAEzD;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CACrC,MAA8B,EAC9B,MAAwB,EACxB,UAAsB,EACtB,YAA2B,EAC3B,kBAAuC;IAEvC,OAAO,IAAA,sCAAgB,EACtB,UAAU,EACV,YAAY,CAAC,MAAM,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Content":["/*!\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\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n} from \"../../../core/index.js\";\nimport type { FullSchemaPolicy } from \"../../modular-schema/index.js\";\n\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport { type EncodedFieldBatch, type EncodedValueShape, SpecialField } from \"./format.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { oneFromIterable } from \"../../../util/index.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nexport function schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: FullSchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder?: IncrementalEncoder,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: FullSchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder?: IncrementalEncoder,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype !== undefined ? nodeBuilder.nodeEncoderFromSchema(type) : anyNodeEncoder;\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\n\t\tconst shouldEncodeIncrementally =\n\t\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tfalse,\n\t\t\t[],\n\t\t\tfieldBuilder.fieldEncoderFromSchema(schema.mapFields),\n\t\t);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle:\n\t\t\treturn true;\n\t\tcase ValueSchema.Null:\n\t\t\treturn [null];\n\t\tdefault:\n\t\t\tunreachableCase(schema);\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAEhC,+DAU+B;AAE/B,2CAOqB;AAErB,qDAAyD;AACzD,iFAAkF;AAClF,qDAAgE;AAEhE;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAdD,4DAcC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B,EAC3B,kBAAkD;IAElD,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;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AW,CAAC,OAAO,CAAC;QACzB,KAAK,sBAAW,CAAC,WAAW;YAC3B,OAAO,IAAI,CAAC;QACb,KAAK,sBAAW,CAAC,IAAI;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf;YACC,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\n\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype !== undefined ? nodeBuilder.nodeEncoderFromSchema(type) : anyNodeEncoder;\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\n\t\tconst shouldEncodeIncrementally =\n\t\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tfalse,\n\t\t\t[],\n\t\t\tfieldBuilder.fieldEncoderFromSchema(schema.mapFields),\n\t\t);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle:\n\t\t\treturn true;\n\t\tcase ValueSchema.Null:\n\t\t\treturn [null];\n\t\tdefault:\n\t\t\tunreachableCase(schema);\n\t}\n}\n"]}
@@ -3,14 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { FieldBatch } from "./fieldBatch.js";
6
- import { type EncodedFieldBatch } from "./format.js";
6
+ import { type EncodedFieldBatchV1, type EncodedFieldBatchV2 } from "./format.js";
7
7
  /**
8
- * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.
9
- *
10
- * No polymorphism, identifier deduplication or schema based compression.
11
- * Just uses two hard coded shapes and inline identifiers.
12
- *
13
- * This is intended as a simple reference implementation with minimal code and dependencies.
8
+ * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
9
+ * @remarks See {@link uncompressedEncode} for more details.
14
10
  */
15
- export declare function uncompressedEncode(batch: FieldBatch): EncodedFieldBatch;
11
+ export declare function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1;
12
+ /**
13
+ * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.
14
+ * @remarks See {@link uncompressedEncode} for more details.
15
+ */
16
+ export declare function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2;
16
17
  //# sourceMappingURL=uncompressedEncode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEN,KAAK,iBAAiB,EAGtB,MAAM,aAAa,CAAC;AAGrB;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,iBAAiB,CAUvE"}
1
+ {"version":3,"file":"uncompressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE3E"}
@@ -4,9 +4,26 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.uncompressedEncode = void 0;
7
+ exports.uncompressedEncodeV2 = exports.uncompressedEncodeV1 = void 0;
8
8
  const index_js_1 = require("../../../core/index.js");
9
+ const index_js_2 = require("../../../util/index.js");
9
10
  const format_js_1 = require("./format.js");
11
+ /**
12
+ * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
13
+ * @remarks See {@link uncompressedEncode} for more details.
14
+ */
15
+ function uncompressedEncodeV1(batch) {
16
+ return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v1));
17
+ }
18
+ exports.uncompressedEncodeV1 = uncompressedEncodeV1;
19
+ /**
20
+ * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.
21
+ * @remarks See {@link uncompressedEncode} for more details.
22
+ */
23
+ function uncompressedEncodeV2(batch) {
24
+ return uncompressedEncode(batch, (0, index_js_2.brand)(format_js_1.FieldBatchFormatVersion.v2));
25
+ }
26
+ exports.uncompressedEncodeV2 = uncompressedEncodeV2;
10
27
  /**
11
28
  * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.
12
29
  *
@@ -15,10 +32,10 @@ const format_js_1 = require("./format.js");
15
32
  *
16
33
  * This is intended as a simple reference implementation with minimal code and dependencies.
17
34
  */
18
- function uncompressedEncode(batch) {
35
+ function uncompressedEncode(batch, version) {
19
36
  const rootFields = batch.map(encodeSequence);
20
37
  return {
21
- version: format_js_1.FieldBatchFormatVersion.v1,
38
+ version,
22
39
  identifiers: [],
23
40
  // A single shape used to encode all fields.
24
41
  shapes: [{ c: anyNodeShape }, { a: anyArray }],
@@ -26,7 +43,6 @@ function uncompressedEncode(batch) {
26
43
  data: rootFields.map((data) => [arrayIndex, data]),
27
44
  };
28
45
  }
29
- exports.uncompressedEncode = uncompressedEncode;
30
46
  const treeIndex = 0;
31
47
  const arrayIndex = 1;
32
48
  const anyNodeShape = {
@@ -1 +1 @@
1
- {"version":3,"file":"uncompressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAIgC;AAIhC,2CAKqB;AAGrB;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,KAAiB;IACnD,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO;QACN,OAAO,EAAE,mCAAuB,CAAC,EAAE;QACnC,WAAW,EAAE,EAAE;QACf,4CAA4C;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC9C,mFAAmF;QACnF,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAClD,CAAC;AACH,CAAC;AAVD,gDAUC;AAED,MAAM,SAAS,GAAe,CAAC,CAAC;AAChC,MAAM,UAAU,GAAe,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAqB;IACtC,WAAW,EAAE,UAAU;CACvB,CAAC;AAEF,MAAM,QAAQ,GAA4B,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAA8B;IACrD,MAAM,IAAI,GAAgC,EAAE,CAAC;IAC7C,IAAA,sBAAW,EAAC,MAAM,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\tFieldBatchFormatVersion,\n\ttype EncodedFieldBatch,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedNodeShape,\n} from \"./format.js\";\nimport type { ShapeIndex } from \"./formatGeneric.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nexport function uncompressedEncode(batch: FieldBatch): EncodedFieldBatch {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion: FieldBatchFormatVersion.v1,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
1
+ {"version":3,"file":"uncompressed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IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAgC,EAAE,CAAC;QAC9C,IAAA,uBAAY,EAAC,MAAM,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ITreeCursorSynchronous,\n\tforEachField,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { brand } from \"../../../util/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\tFieldBatchFormatVersion,\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedNodeShape,\n} from \"./format.js\";\nimport type { ShapeIndex } from \"./formatGeneric.js\";\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV1(batch: FieldBatch): EncodedFieldBatchV1 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v1));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link uncompressedEncode} for more details.\n */\nexport function uncompressedEncodeV2(batch: FieldBatch): EncodedFieldBatchV2 {\n\treturn uncompressedEncode(batch, brand(FieldBatchFormatVersion.v2));\n}\n\n/**\n * Encode data from `cursor` in the simplest way supported by `EncodedChunk`.\n *\n * No polymorphism, identifier deduplication or schema based compression.\n * Just uses two hard coded shapes and inline identifiers.\n *\n * This is intended as a simple reference implementation with minimal code and dependencies.\n */\nfunction uncompressedEncode(\n\tbatch: FieldBatch,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\tconst rootFields = batch.map(encodeSequence);\n\treturn {\n\t\tversion,\n\t\tidentifiers: [],\n\t\t// A single shape used to encode all fields.\n\t\tshapes: [{ c: anyNodeShape }, { a: anyArray }],\n\t\t// Wrap up each field as an indicator to use the above shape, and its encoded data.\n\t\tdata: rootFields.map((data) => [arrayIndex, data]),\n\t};\n}\n\nconst treeIndex: ShapeIndex = 0;\nconst arrayIndex: ShapeIndex = 1;\n\nconst anyNodeShape: EncodedNodeShape = {\n\textraFields: arrayIndex,\n};\n\nconst anyArray: EncodedNestedArrayShape = treeIndex;\n\n/**\n * Encode a field using the hard coded shape above.\n * @remarks\n * Since this shape contains no information about the actual schema, all schema/shape information is inline in the data:\n * that is why this encoding is called \"uncompressed\".\n */\nfunction encodeSequence(cursor: ITreeCursorSynchronous): FluidSerializableReadOnly[] {\n\tconst data: FluidSerializableReadOnly[] = [];\n\tforEachNode(cursor, () => {\n\t\tdata.push(cursor.type);\n\t\tconst value = cursor.value;\n\t\tdata.push(value !== undefined);\n\t\tif (value !== undefined) {\n\t\t\tdata.push(value);\n\t\t}\n\t\tconst local: FluidSerializableReadOnly[] = [];\n\t\tforEachField(cursor, () => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tlocal.push(key, encodeSequence(cursor));\n\t\t});\n\t\tdata.push(local);\n\t});\n\treturn data;\n}\n"]}
@@ -6,6 +6,6 @@ export { uniformChunk, ChunkShape } from "./uniformChunk.js";
6
6
  export { type TreeChunk, dummyRoot } from "../../core/index.js";
7
7
  export { chunkTree, defaultChunkPolicy, makeTreeChunker, type IChunker, chunkFieldSingle, chunkField, combineChunks, } from "./chunkTree.js";
8
8
  export { buildChunkedForest } from "./chunkedForest.js";
9
- export { EncodedFieldBatch, type FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, type FieldBatch, type FieldBatchCodec, makeFieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
9
+ export { EncodedFieldBatch, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, type FieldBatch, type FieldBatchCodec, makeFieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
10
10
  export { emptyChunk } from "./emptyChunk.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,+BAA+B,EAC/B,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.emptyChunk = exports.defaultIncrementalEncodingPolicy = exports.makeFieldBatchCodec = exports.getCodecTreeForFieldBatchFormat = exports.EncodedFieldBatch = exports.buildChunkedForest = exports.combineChunks = exports.chunkField = exports.chunkFieldSingle = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.chunkTree = exports.dummyRoot = exports.ChunkShape = exports.uniformChunk = void 0;
7
+ exports.emptyChunk = exports.defaultIncrementalEncodingPolicy = exports.makeFieldBatchCodec = exports.getCodecTreeForFieldBatchFormat = exports.FieldBatchFormatVersion = exports.EncodedFieldBatch = exports.buildChunkedForest = exports.combineChunks = exports.chunkField = exports.chunkFieldSingle = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.chunkTree = exports.dummyRoot = exports.ChunkShape = exports.uniformChunk = void 0;
8
8
  var uniformChunk_js_1 = require("./uniformChunk.js");
9
9
  Object.defineProperty(exports, "uniformChunk", { enumerable: true, get: function () { return uniformChunk_js_1.uniformChunk; } });
10
10
  Object.defineProperty(exports, "ChunkShape", { enumerable: true, get: function () { return uniformChunk_js_1.ChunkShape; } });
@@ -21,6 +21,7 @@ var chunkedForest_js_1 = require("./chunkedForest.js");
21
21
  Object.defineProperty(exports, "buildChunkedForest", { enumerable: true, get: function () { return chunkedForest_js_1.buildChunkedForest; } });
22
22
  var index_js_2 = require("./codec/index.js");
23
23
  Object.defineProperty(exports, "EncodedFieldBatch", { enumerable: true, get: function () { return index_js_2.EncodedFieldBatch; } });
24
+ Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return index_js_2.FieldBatchFormatVersion; } });
24
25
  Object.defineProperty(exports, "getCodecTreeForFieldBatchFormat", { enumerable: true, get: function () { return index_js_2.getCodecTreeForFieldBatchFormat; } });
25
26
  Object.defineProperty(exports, "makeFieldBatchCodec", { enumerable: true, get: function () { return index_js_2.makeFieldBatchCodec; } });
26
27
  Object.defineProperty(exports, "defaultIncrementalEncodingPolicy", { enumerable: true, get: function () { return index_js_2.defaultIncrementalEncodingPolicy; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAY0B;AAXzB,6GAAA,iBAAiB,OAAA;AAEjB,2HAAA,+BAA+B,OAAA;AAG/B,+GAAA,mBAAmB,OAAA;AAKnB,4HAAA,gCAAgC,OAAA;AAEjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\tEncodedFieldBatch,\n\ttype FieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA6D;AAApD,+GAAA,YAAY,OAAA;AAAE,6GAAA,UAAU,OAAA;AACjC,gDAAgE;AAAvC,qGAAA,SAAS,OAAA;AAClC,+CAQwB;AAPvB,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AAEf,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AAEd,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAC3B,6CAY0B;AAXzB,6GAAA,iBAAiB,OAAA;AACjB,mHAAA,uBAAuB,OAAA;AACvB,2HAAA,+BAA+B,OAAA;AAG/B,+GAAA,mBAAmB,OAAA;AAKnB,4HAAA,gCAAgC,OAAA;AAEjC,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\tEncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
@@ -3,15 +3,24 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type ChangeAtomId, type FieldKindIdentifier, forbiddenFieldKindIdentifier, Multiplicity } from "../../core/index.js";
6
- import { type FieldChangeHandler, type FieldEditor, type FieldKindConfiguration, FieldKindWithEditor, type FlexFieldKind } from "../modular-schema/index.js";
7
- import { type OptionalChangeset } from "../optional-field/index.js";
6
+ import { type FieldChangeHandler, type FieldEditor, type FieldKindConfiguration, FlexFieldKind, type FullSchemaPolicy } from "../modular-schema/index.js";
7
+ import { type OptionalChangeset, type OptionalFieldEditor } from "../optional-field/index.js";
8
+ import { type SequenceFieldEditor } from "../sequence-field/index.js";
8
9
  import type { CodecTree } from "../../codec/index.js";
9
10
  import { type Brand } from "../../util/index.js";
10
11
  /**
11
12
  * ChangeHandler that only handles no-op / identity changes.
12
13
  */
13
14
  export declare const noChangeHandler: FieldChangeHandler<0>;
14
- export interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {
15
+ /**
16
+ * {@link FieldEditor} for required fields (always contain exactly 1 child).
17
+ * @remarks
18
+ * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,
19
+ * and the content is always assumed to not be empty.
20
+ * This means the actual edits implemented for optional fields are sufficient to support required fields
21
+ * which is why this is defined and implemented in terms of optional fields.
22
+ */
23
+ export interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {
15
24
  /**
16
25
  * Creates a change which replaces the current value of the field with `newValue`.
17
26
  * @param ids - The ids for the fill and detach fields.
@@ -21,24 +30,28 @@ export interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {
21
30
  detach: ChangeAtomId;
22
31
  }): OptionalChangeset;
23
32
  }
33
+ declare const optionalIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional";
24
34
  /**
25
35
  * 0 or 1 items.
26
36
  */
27
- export declare const optional: FieldKindWithEditor<import("../optional-field/optionalField.js").OptionalFieldEditor, Multiplicity.Optional, "Optional">;
28
- export declare const valueFieldEditor: ValueFieldEditor;
29
- export declare const valueChangeHandler: FieldChangeHandler<OptionalChangeset, ValueFieldEditor>;
37
+ export declare const optional: FlexFieldKind<OptionalFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional", Multiplicity.Optional>;
38
+ export declare const requiredFieldEditor: RequiredFieldEditor;
39
+ export declare const requiredFieldChangeHandler: FieldChangeHandler<OptionalChangeset, RequiredFieldEditor>;
40
+ declare const requiredIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value";
30
41
  /**
31
42
  * Exactly one item.
32
43
  */
33
- export declare const required: FieldKindWithEditor<ValueFieldEditor, Multiplicity.Single, "Value">;
44
+ export declare const required: FlexFieldKind<RequiredFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value", Multiplicity.Single>;
45
+ declare const sequenceIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence";
34
46
  /**
35
47
  * 0 or more items.
36
48
  */
37
- export declare const sequence: FieldKindWithEditor<import("../sequence-field/sequenceFieldEditor.js").SequenceFieldEditor, Multiplicity.Sequence, "Sequence">;
49
+ export declare const sequence: FlexFieldKind<SequenceFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence", Multiplicity.Sequence>;
50
+ declare const identifierFieldIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier";
38
51
  /**
39
52
  * Exactly one identifier.
40
53
  */
41
- export declare const identifier: FieldKindWithEditor<FieldEditor<0>, Multiplicity.Single, "Identifier">;
54
+ export declare const identifier: FlexFieldKind<FieldEditor<0>, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier", Multiplicity.Single>;
42
55
  /**
43
56
  * Exactly 0 items.
44
57
  *
@@ -67,9 +80,9 @@ export declare const identifier: FieldKindWithEditor<FieldEditor<0>, Multiplicit
67
80
  *
68
81
  * See {@link emptyField} for a constant, reusable field using Forbidden.
69
82
  */
70
- export declare const forbidden: FieldKindWithEditor<FieldEditor<0>, Multiplicity.Forbidden, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Forbidden">;
83
+ export declare const forbidden: FlexFieldKind<FieldEditor<0>, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Forbidden", Multiplicity.Forbidden>;
71
84
  export declare const fieldKindConfigurations: ReadonlyMap<ModularChangeFormatVersion, FieldKindConfiguration>;
72
- export type ModularChangeFormatVersion = Brand<1 | 2 | 3 | 4, "ModularChangeFormatVersion">;
85
+ export type ModularChangeFormatVersion = Brand<3 | 4, "ModularChangeFormatVersion">;
73
86
  export declare function getCodecTreeForModularChangeFormat(version: ModularChangeFormatVersion): CodecTree;
74
87
  /**
75
88
  * All supported field kinds.
@@ -78,16 +91,16 @@ export declare function getCodecTreeForModularChangeFormat(version: ModularChang
78
91
  * Before making a SharedTree format change which impacts which set of field kinds are allowed,
79
92
  * code which uses this should be audited for compatibility considerations.
80
93
  */
81
- export declare const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor>;
82
- export interface Required extends FlexFieldKind<"Value", Multiplicity.Single> {
94
+ export declare const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;
95
+ export interface Required extends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {
83
96
  }
84
- export interface Optional extends FlexFieldKind<"Optional", Multiplicity.Optional> {
97
+ export interface Optional extends FlexFieldKind<OptionalFieldEditor, typeof optionalIdentifier, Multiplicity.Optional> {
85
98
  }
86
- export interface Sequence extends FlexFieldKind<"Sequence", Multiplicity.Sequence> {
99
+ export interface Sequence extends FlexFieldKind<SequenceFieldEditor, typeof sequenceIdentifier, Multiplicity.Sequence> {
87
100
  }
88
- export interface Identifier extends FlexFieldKind<"Identifier", Multiplicity.Single> {
101
+ export interface Identifier extends FlexFieldKind<FieldEditor<0>, typeof identifierFieldIdentifier, Multiplicity.Single> {
89
102
  }
90
- export interface Forbidden extends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {
103
+ export interface Forbidden extends FlexFieldKind<FieldEditor<0>, typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {
91
104
  }
92
105
  /**
93
106
  * Default FieldKinds with their editor types erased.
@@ -99,4 +112,9 @@ export declare const FieldKinds: {
99
112
  readonly identifier: Identifier;
100
113
  readonly forbidden: Forbidden;
101
114
  };
115
+ /**
116
+ * FullSchemaPolicy with the default field kinds.
117
+ */
118
+ export declare const defaultSchemaPolicy: FullSchemaPolicy;
119
+ export {};
102
120
  //# sourceMappingURL=defaultFieldKinds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE3B,mBAAmB,EACnB,KAAK,aAAa,EAIlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,iBAAiB,EAGtB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAejD,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IACvE;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,GAAG,iBAAiB,CAAC;CAC1E;AAGD;;GAEG;AACH,eAAO,MAAM,QAAQ,0HAQpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAM9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,gBAAgB,CAGtF,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,QAAQ,qEAepB,CAAC;AA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Q,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC4B,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAEjC,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.FieldKinds = exports.fieldKinds = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.forbidden = exports.identifier = exports.sequence = exports.required = exports.valueChangeHandler = exports.valueFieldEditor = exports.optional = exports.noChangeHandler = void 0;
7
+ exports.defaultSchemaPolicy = exports.FieldKinds = exports.fieldKinds = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.forbidden = exports.identifier = exports.sequence = exports.required = exports.requiredFieldChangeHandler = exports.requiredFieldEditor = exports.optional = exports.noChangeHandler = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../core/index.js");
10
10
  const index_js_2 = require("../modular-schema/index.js");
@@ -31,53 +31,63 @@ exports.noChangeHandler = {
31
31
  createEmpty: () => 0,
32
32
  getCrossFieldKeys: () => [],
33
33
  };
34
- const optionalIdentifier = "Optional";
34
+ const optionalIdentifier = (0, index_js_5.brandConst)("Optional")();
35
35
  /**
36
36
  * 0 or 1 items.
37
37
  */
38
- exports.optional = new index_js_2.FieldKindWithEditor(optionalIdentifier, index_js_1.Multiplicity.Optional, index_js_3.optionalChangeHandler, (types, other) => (other.kind === exports.sequence.identifier || other.kind === optionalIdentifier) &&
39
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set([]));
40
- exports.valueFieldEditor = {
38
+ exports.optional = new index_js_2.FlexFieldKind(optionalIdentifier, index_js_1.Multiplicity.Optional, {
39
+ changeHandler: index_js_3.optionalChangeHandler,
40
+ allowsTreeSupersetOf: (types, other) => (other.kind === exports.sequence.identifier || other.kind === optionalIdentifier) &&
41
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
42
+ });
43
+ exports.requiredFieldEditor = {
41
44
  ...index_js_3.optionalFieldEditor,
42
45
  set: (ids) => index_js_3.optionalFieldEditor.set(false, ids),
43
46
  };
44
- exports.valueChangeHandler = {
45
- ...exports.optional.changeHandler,
46
- editor: exports.valueFieldEditor,
47
+ exports.requiredFieldChangeHandler = {
48
+ ...index_js_3.optionalChangeHandler,
49
+ editor: exports.requiredFieldEditor,
47
50
  };
48
- const requiredIdentifier = "Value";
51
+ const requiredIdentifier = (0, index_js_5.brandConst)("Value")();
49
52
  /**
50
53
  * Exactly one item.
51
54
  */
52
- exports.required = new index_js_2.FieldKindWithEditor(requiredIdentifier, index_js_1.Multiplicity.Single, exports.valueChangeHandler, (types, other) =>
53
- // By omitting Identifier here,
54
- // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
55
- // Since an identifier can be upgraded into a required field,
56
- // preventing the inverse helps ensure that schema upgrades are monotonic.
57
- // Which direction is allowed is a subjective policy choice.
58
- (other.kind === exports.sequence.identifier ||
59
- other.kind === requiredIdentifier ||
60
- other.kind === exports.optional.identifier) &&
61
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set());
62
- const sequenceIdentifier = "Sequence";
55
+ exports.required = new index_js_2.FlexFieldKind(requiredIdentifier, index_js_1.Multiplicity.Single, {
56
+ changeHandler: exports.requiredFieldChangeHandler,
57
+ allowsTreeSupersetOf: (types, other) =>
58
+ // By omitting Identifier here,
59
+ // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
60
+ // Since an identifier can be upgraded into a required field,
61
+ // preventing the inverse helps ensure that schema upgrades are monotonic.
62
+ // Which direction is allowed is a subjective policy choice.
63
+ (other.kind === exports.sequence.identifier ||
64
+ other.kind === requiredIdentifier ||
65
+ other.kind === exports.optional.identifier) &&
66
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
67
+ });
68
+ const sequenceIdentifier = (0, index_js_5.brandConst)("Sequence")();
63
69
  /**
64
70
  * 0 or more items.
65
71
  */
66
- exports.sequence = new index_js_2.FieldKindWithEditor(sequenceIdentifier, index_js_1.Multiplicity.Sequence, index_js_4.sequenceFieldChangeHandler, (types, other) => other.kind === sequenceIdentifier &&
67
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
68
- // TODO: add normalizer/importers for handling ops from other kinds.
69
- new Set([]));
70
- const identifierFieldIdentifier = "Identifier";
72
+ exports.sequence = new index_js_2.FlexFieldKind(sequenceIdentifier, index_js_1.Multiplicity.Sequence, {
73
+ changeHandler: index_js_4.sequenceFieldChangeHandler,
74
+ allowsTreeSupersetOf: (types, other) => other.kind === sequenceIdentifier &&
75
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
76
+ });
77
+ const identifierFieldIdentifier = (0, index_js_5.brandConst)("Identifier")();
71
78
  /**
72
79
  * Exactly one identifier.
73
80
  */
74
- exports.identifier = new index_js_2.FieldKindWithEditor(identifierFieldIdentifier, index_js_1.Multiplicity.Single, exports.noChangeHandler, (types, other) =>
75
- // Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
76
- (other.kind === exports.sequence.identifier ||
77
- other.kind === requiredIdentifier ||
78
- other.kind === exports.optional.identifier ||
79
- other.kind === identifierFieldIdentifier) &&
80
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set());
81
+ exports.identifier = new index_js_2.FlexFieldKind(identifierFieldIdentifier, index_js_1.Multiplicity.Single, {
82
+ changeHandler: exports.noChangeHandler,
83
+ allowsTreeSupersetOf: (types, other) =>
84
+ // Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
85
+ (other.kind === exports.sequence.identifier ||
86
+ other.kind === requiredIdentifier ||
87
+ other.kind === exports.optional.identifier ||
88
+ other.kind === identifierFieldIdentifier) &&
89
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
90
+ });
81
91
  /**
82
92
  * Exactly 0 items.
83
93
  *
@@ -106,30 +116,12 @@ exports.identifier = new index_js_2.FieldKindWithEditor(identifierFieldIdentifie
106
116
  *
107
117
  * See {@link emptyField} for a constant, reusable field using Forbidden.
108
118
  */
109
- exports.forbidden = new index_js_2.FieldKindWithEditor(index_js_1.forbiddenFieldKindIdentifier, index_js_1.Multiplicity.Forbidden, exports.noChangeHandler,
110
- // All multiplicities other than Value support empty.
111
- (types, other) => exports.fieldKinds.get(other.kind)?.multiplicity !== index_js_1.Multiplicity.Single, new Set());
119
+ exports.forbidden = new index_js_2.FlexFieldKind(index_js_1.forbiddenFieldKindIdentifier, index_js_1.Multiplicity.Forbidden, {
120
+ changeHandler: exports.noChangeHandler,
121
+ // All multiplicities other than Value support empty.
122
+ allowsTreeSupersetOf: (types, other) => exports.fieldKinds.get(other.kind)?.multiplicity !== index_js_1.Multiplicity.Single,
123
+ });
112
124
  exports.fieldKindConfigurations = new Map([
113
- [
114
- (0, index_js_5.brand)(1),
115
- new Map([
116
- [exports.required.identifier, { kind: exports.required, formatVersion: 1 }],
117
- [exports.optional.identifier, { kind: exports.optional, formatVersion: 1 }],
118
- [exports.sequence.identifier, { kind: exports.sequence, formatVersion: 1 }],
119
- [exports.forbidden.identifier, { kind: exports.forbidden, formatVersion: 1 }],
120
- [exports.identifier.identifier, { kind: exports.identifier, formatVersion: 1 }],
121
- ]),
122
- ],
123
- [
124
- (0, index_js_5.brand)(2),
125
- new Map([
126
- [exports.required.identifier, { kind: exports.required, formatVersion: 2 }],
127
- [exports.optional.identifier, { kind: exports.optional, formatVersion: 2 }],
128
- [exports.sequence.identifier, { kind: exports.sequence, formatVersion: 1 }],
129
- [exports.forbidden.identifier, { kind: exports.forbidden, formatVersion: 1 }],
130
- [exports.identifier.identifier, { kind: exports.identifier, formatVersion: 1 }],
131
- ]),
132
- ],
133
125
  [
134
126
  (0, index_js_5.brand)(3),
135
127
  new Map([
@@ -176,4 +168,10 @@ exports.fieldKinds = new Map([exports.required, exports.optional, exports.sequen
176
168
  * Default FieldKinds with their editor types erased.
177
169
  */
178
170
  exports.FieldKinds = { required: exports.required, optional: exports.optional, sequence: exports.sequence, identifier: exports.identifier, forbidden: exports.forbidden };
171
+ /**
172
+ * FullSchemaPolicy with the default field kinds.
173
+ */
174
+ exports.defaultSchemaPolicy = {
175
+ fieldKinds: exports.fieldKinds,
176
+ };
179
177
  //# sourceMappingURL=defaultFieldKinds.js.map