@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,E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,kCAAkC,EAClC,KAAK,0BAA0B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,8BAA8B,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAy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d,eAAe,EACf,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,8BAA8B,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
@@ -13,11 +13,12 @@ export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFrom
13
13
  // Split this up into separate import and export for compatibility with API-Extractor.
14
14
  import * as SequenceField from "./sequence-field/index.js";
15
15
  export { SequenceField };
16
- export { isNeverField, ModularEditBuilder, makeModularChangeCodecFamily, CrossFieldTarget, FlexFieldKind, allowsRepoSuperset, genericFieldKind, FieldKindWithEditor, ModularChangeFamily, EncodedModularChangeset, updateRefreshers, isNeverTree, } from "./modular-schema/index.js";
16
+ export { isNeverField, ModularEditBuilder, makeModularChangeCodecFamily, CrossFieldTarget, FlexFieldKind, allowsRepoSuperset, genericFieldKind, ModularChangeFamily, EncodedModularChangeset, updateRefreshers, isNeverTree, } from "./modular-schema/index.js";
17
17
  export { mapRootChanges } from "./deltaUtils.js";
18
- export { chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, emptyChunk, combineChunks, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
18
+ export { chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, emptyChunk, combineChunks, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
19
19
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, MockNodeIdentifierManager, nodeKeyTreeIdentifier, } from "./node-identifier/index.js";
20
- export { FieldKinds, DefaultChangeFamily, DefaultEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
20
+ export { FieldKinds, DefaultChangeFamily, DefaultEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
21
+ export { SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
21
22
  export { TreeStatus, Context, isFlexTreeNode, ContextSlot,
22
23
  // Internal
23
24
  flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, getOrCreateHydratedFlexTreeNode, currentObserver, withObservation, } from "./flex-tree/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EAEnB,UAAU,EACV,eAAe,EAEf,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,sFAAsF;AACtF,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,OAAO,EACN,YAAY,EACZ,kBAAkB,EAUlB,4BAA4B,EAM5B,gBAAgB,EAChB,aAAa,EAEb,kBAAkB,EAElB,gBAAgB,EAGhB,mBAAmB,EACnB,mBAAmB,EAEnB,uBAAuB,EACvB,gBAAgB,EAKhB,WAAW,G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Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\ttype ForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n\tclientVersionToSchemaVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\ttype FieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport {\n\tTreeCompressionStrategy,\n\tTreeCompressionStrategyExtended,\n\ttype TreeCompressionStrategyPrivate,\n} from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EAEnB,UAAU,EACV,eAAe,EAEf,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,sFAAsF;AACtF,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,OAAO,EACN,YAAY,EACZ,kBAAkB,EAUlB,4BAA4B,EAM5B,gBAAgB,EAChB,aAAa,EAEb,kBAAkB,EAElB,gBAAgB,EAGhB,mBAAmB,EAEnB,uBAAuB,EACvB,gBAAgB,EAKhB,WAAW,GACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAEN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAGlB,uBAAuB,EACvB,+BAA+B,EAC/B,eAAe,EACf,mBAAmB,EAEnB,UAAU,EACV,aAAa,EAEb,gCAAgC,GAChC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EAEtB,yBAAyB,EAEzB,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACN,UAAU,EAOV,mBAAmB,EACnB,kBAAkB,EAKlB,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,oBAAoB,EACpB,kCAAkC,GAElC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAUN,UAAU,EACV,OAAO,EAGP,cAAc,EACd,WAAW;AACX,WAAW;AACX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAKlB,+BAA+B,EAC/B,eAAe,EACf,eAAe,GAEf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,GAE/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEN,eAAe,EACf,UAAU,GAIV,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\ttype ForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n\tclientVersionToSchemaVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport {\n\tTreeCompressionStrategy,\n\tTreeCompressionStrategyExtended,\n\ttype TreeCompressionStrategyPrivate,\n} from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CA0ET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAwBT"}
1
+ {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CA0ET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAwBT"}
@@ -5,7 +5,6 @@
5
5
  import { assert, fail } from "@fluidframework/core-utils/internal";
6
6
  import { LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, storedEmptyFieldSchema, } from "../../core/index.js";
7
7
  import { compareSets } from "../../util/index.js";
8
- import { withEditor } from "./fieldKindWithEditor.js";
9
8
  import { isNeverTree } from "./isNeverTree.js";
10
9
  /**
11
10
  * Returns true iff `superset` is a superset of `original`.
@@ -74,7 +73,7 @@ export function allowsValueSuperset(original, superset) {
74
73
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
75
74
  */
76
75
  export function allowsFieldSuperset(policy, originalData, original, superset) {
77
- return withEditor(policy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)).allowsFieldSuperset(policy, originalData, original.types, superset);
76
+ return (policy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)).allowsFieldSuperset(policy, originalData, original.types, superset);
78
77
  }
79
78
  /**
80
79
  * Returns true iff `superset` is a superset of `original`.
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAMtB,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAI,QAAQ,Y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,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kCAAkC,CACjD,QAAqB,EACrB,QAAqB;IAErB,KAAK,MAAM,YAAY,IAAI,QAAQ,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAwB,EACxB,QAA0B,EAC1B,QAA0B;IAE1B,CAAC;QACA,IACC,CAAC,mBAAmB,CACnB,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,eAAe,CACxB,EACA,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,uGAAuG;IACvG,wHAAwH;IACxH,2FAA2F;IAC3F,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,mIAAmI;IACnI,2CAA2C;IAC3C,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 { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n"]}
1
+ {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EACN,oBAAoB,E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;IACxH,2FAA2F;IAC3F,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,mIAAmI;IACnI,2CAA2C;IAC3C,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 { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn (\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n"]}
@@ -2,7 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy } from "../../core/index.js";
5
+ import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy, TreeFieldStoredSchema, TreeStoredSchema, TreeTypeSet } from "../../core/index.js";
6
+ import type { MakeNominal } from "../../util/index.js";
7
+ import type { FieldChangeHandler, FieldEditor } from "./fieldChangeHandler.js";
6
8
  /**
7
9
  * Functionality for FieldKinds that is stable,
8
10
  * meaning that it can not change in any measurable way without providing a new identifier.
@@ -15,21 +17,45 @@ import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy } f
15
17
  *
16
18
  * These policies include the data encoding, change encoding, change rebase and change application.
17
19
  *
18
- * @sealed * @privateRemarks
19
- * This being @sealed is for users of this package.
20
- * This package itself may provide implementations.
21
- * This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,
22
- * and using a class also gets stronger (nominal) typing for objects which will be down cast.
20
+ * @privateRemarks
21
+ * Using a class gets stronger (nominal) typing for objects which will be down cast.
23
22
  */
24
- export declare abstract class FlexFieldKind<TName extends string = string, TMultiplicity extends Multiplicity = Multiplicity> implements FieldKindData {
25
- readonly identifier: TName & FieldKindIdentifier;
23
+ export declare class FlexFieldKind<TEditor extends FieldEditor<any> = FieldEditor<any>, TName extends FieldKindIdentifier = FieldKindIdentifier, TMultiplicity extends Multiplicity = Multiplicity> implements FieldKindData {
24
+ readonly identifier: TName;
26
25
  readonly multiplicity: TMultiplicity;
26
+ private readonly options;
27
+ protected _typeCheck: MakeNominal;
27
28
  /**
28
- * @param identifier - Globally scoped identifier.
29
- * @param multiplicity - bound on the number of children that fields of this kind may have.
30
- * TODO: consider replacing with numeric upper and lower bounds.
29
+ * Change handling policy.
31
30
  */
32
- protected constructor(identifier: TName & FieldKindIdentifier, multiplicity: TMultiplicity);
31
+ readonly changeHandler: FieldChangeHandler<any, TEditor>;
32
+ constructor(identifier: TName, multiplicity: TMultiplicity, options: FieldKindOptions<FieldChangeHandler<any, TEditor>>);
33
+ /**
34
+ * Returns true if and only if `superset` permits a (non-strict) superset of the subtrees
35
+ * allowed by field made from `this` and `originalTypes`.
36
+ *
37
+ * TODO: clarify the relationship between this and FieldKindData, and issues with cyclic schema upgrades.
38
+ */
39
+ allowsFieldSuperset(policy: SchemaPolicy, originalData: TreeStoredSchema, originalTypes: TreeTypeSet, superset: TreeFieldStoredSchema): boolean;
40
+ }
41
+ /**
42
+ * Additional options for {@link FlexFieldKind}.
43
+ *
44
+ * @remarks
45
+ * Puts the more confusing parameters into this object so they get explicit names to help with clarity.
46
+ */
47
+ export interface FieldKindOptions<TFieldChangeHandler> {
48
+ /**
49
+ * Change handling policy.
50
+ */
51
+ readonly changeHandler: TFieldChangeHandler;
52
+ /**
53
+ * Returns true if and only if `superset` permits a (non-strict) superset of the subtrees
54
+ * allowed by field made from `this` and `originalTypes`.
55
+ * @remarks
56
+ * Used by {@link FlexFieldKind.allowsFieldSuperset}, which handles the `never` cases before calling this.
57
+ */
58
+ readonly allowsTreeSupersetOf: (originalTypes: TreeTypeSet, superset: TreeFieldStoredSchema) => boolean;
33
59
  }
34
60
  /**
35
61
  * Policy from the app for interpreting the stored schema.
@@ -1 +1 @@
1
- {"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,aAAa,CAClC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,aAAa,SAAS,YAAY,GAAG,YAAY,CAChD,YAAW,aAAa;aAQR,UAAU,EAAE,KAAK,GAAG,mBAAmB;aACvC,YAAY,EAAE,aAAa;IAP5C;;;;OAIG;IACH,SAAS,aACQ,UAAU,EAAE,KAAK,GAAG,mBAAmB,EACvC,YAAY,EAAE,aAAa;CAE5C;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;CACrE"}
1
+ {"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG/E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAa,CAGzB,OAAO,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EACnD,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,EACvD,aAAa,SAAS,YAAY,GAAG,YAAY,CAChD,YAAW,aAAa;aAYR,UAAU,EAAE,KAAK;aACjB,YAAY,EAAE,aAAa;IAG3C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAdzB,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAEnC;;OAEG;IAGH,SAAgB,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAG/C,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,aAAa,EAG1B,OAAO,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAK7E;;;;;OAKG;IACI,mBAAmB,CACzB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO;CAgBV;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,mBAAmB;IACpD;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,EAAE,CAC9B,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,qBAAqB,KAC3B,OAAO,CAAC;CAUb;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;CACrE"}
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import { isNeverField } from "./isNeverTree.js";
5
6
  /**
6
7
  * Functionality for FieldKinds that is stable,
7
8
  * meaning that it can not change in any measurable way without providing a new identifier.
@@ -14,21 +15,38 @@
14
15
  *
15
16
  * These policies include the data encoding, change encoding, change rebase and change application.
16
17
  *
17
- * @sealed * @privateRemarks
18
- * This being @sealed is for users of this package.
19
- * This package itself may provide implementations.
20
- * This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,
21
- * and using a class also gets stronger (nominal) typing for objects which will be down cast.
18
+ * @privateRemarks
19
+ * Using a class gets stronger (nominal) typing for objects which will be down cast.
22
20
  */
23
21
  export class FlexFieldKind {
24
- /**
25
- * @param identifier - Globally scoped identifier.
26
- * @param multiplicity - bound on the number of children that fields of this kind may have.
27
- * TODO: consider replacing with numeric upper and lower bounds.
28
- */
29
- constructor(identifier, multiplicity) {
22
+ constructor(identifier, multiplicity,
23
+ // TODO: stronger typing
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ options) {
30
26
  this.identifier = identifier;
31
27
  this.multiplicity = multiplicity;
28
+ this.options = options;
29
+ this.changeHandler = options.changeHandler;
30
+ }
31
+ /**
32
+ * Returns true if and only if `superset` permits a (non-strict) superset of the subtrees
33
+ * allowed by field made from `this` and `originalTypes`.
34
+ *
35
+ * TODO: clarify the relationship between this and FieldKindData, and issues with cyclic schema upgrades.
36
+ */
37
+ allowsFieldSuperset(policy, originalData, originalTypes, superset) {
38
+ if (isNeverField(policy, originalData, {
39
+ kind: this.identifier,
40
+ types: originalTypes,
41
+ // Metadata is not used for this check.
42
+ persistedMetadata: undefined,
43
+ })) {
44
+ return true;
45
+ }
46
+ if (isNeverField(policy, originalData, superset)) {
47
+ return false;
48
+ }
49
+ return this.options.allowsTreeSupersetOf(originalTypes, superset);
32
50
  }
33
51
  }
34
52
  //# sourceMappingURL=fieldKind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAgB,aAAa;IAKlC;;;;OAIG;IACH,YACiB,UAAuC,EACvC,YAA2B;QAD3B,eAAU,GAAV,UAAU,CAA6B;QACvC,iBAAY,GAAZ,YAAY,CAAe;IACzC,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFieldKindIdentifier,\n\tFieldKindData,\n\tMultiplicity,\n\tSchemaPolicy,\n} from \"../../core/index.js\";\n\n/**\n * Functionality for FieldKinds that is stable,\n * meaning that it can not change in any measurable way without providing a new identifier.\n *\n * It is assumed that this information and policy is available on all clients interacting with a document\n * using the identifier.\n *\n * This must contain enough information to process remote edits to this FieldKind consistently with all clients.\n * All behavior must be deterministic, and not change across versions of the app/library.\n *\n * These policies include the data encoding, change encoding, change rebase and change application.\n *\n * @sealed * @privateRemarks\n * This being @sealed is for users of this package.\n * This package itself may provide implementations.\n * This pattern was picked instead of an interface since we do not have a convention for how to mark interfaces as only allowed to be implemented by the package declaring them,\n * and using a class also gets stronger (nominal) typing for objects which will be down cast.\n */\nexport abstract class FlexFieldKind<\n\tTName extends string = string,\n\tTMultiplicity extends Multiplicity = Multiplicity,\n> implements FieldKindData\n{\n\t/**\n\t * @param identifier - Globally scoped identifier.\n\t * @param multiplicity - bound on the number of children that fields of this kind may have.\n\t * TODO: consider replacing with numeric upper and lower bounds.\n\t */\n\tprotected constructor(\n\t\tpublic readonly identifier: TName & FieldKindIdentifier,\n\t\tpublic readonly multiplicity: TMultiplicity,\n\t) {}\n}\n\n/**\n * Policy from the app for interpreting the stored schema.\n * The app must ensure consistency for all users of the document.\n */\nexport interface FullSchemaPolicy extends SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handles fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;\n}\n"]}
1
+ {"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,aAAa;IAiBzB,YACiB,UAAiB,EACjB,YAA2B;IAC3C,wBAAwB;IACxB,8DAA8D;IAC7C,OAA2D;QAJ5D,eAAU,GAAV,UAAU,CAAO;QACjB,iBAAY,GAAZ,YAAY,CAAe;QAG1B,YAAO,GAAP,OAAO,CAAoD;QAE5E,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACI,mBAAmB,CACzB,MAAoB,EACpB,YAA8B,EAC9B,aAA0B,EAC1B,QAA+B;QAE/B,IACC,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE;YAClC,IAAI,EAAE,IAAI,CAAC,UAAU;YACrB,KAAK,EAAE,aAAa;YACpB,uCAAuC;YACvC,iBAAiB,EAAE,SAAS;SAC5B,CAAC,EACD,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;YAClD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFieldKindIdentifier,\n\tFieldKindData,\n\tMultiplicity,\n\tSchemaPolicy,\n\tTreeFieldStoredSchema,\n\tTreeStoredSchema,\n\tTreeTypeSet,\n} from \"../../core/index.js\";\nimport type { MakeNominal } from \"../../util/index.js\";\n\nimport type { FieldChangeHandler, FieldEditor } from \"./fieldChangeHandler.js\";\nimport { isNeverField } from \"./isNeverTree.js\";\n\n/**\n * Functionality for FieldKinds that is stable,\n * meaning that it can not change in any measurable way without providing a new identifier.\n *\n * It is assumed that this information and policy is available on all clients interacting with a document\n * using the identifier.\n *\n * This must contain enough information to process remote edits to this FieldKind consistently with all clients.\n * All behavior must be deterministic, and not change across versions of the app/library.\n *\n * These policies include the data encoding, change encoding, change rebase and change application.\n *\n * @privateRemarks\n * Using a class gets stronger (nominal) typing for objects which will be down cast.\n */\nexport class FlexFieldKind<\n\t// TODO: stronger typing\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTEditor extends FieldEditor<any> = FieldEditor<any>,\n\tTName extends FieldKindIdentifier = FieldKindIdentifier,\n\tTMultiplicity extends Multiplicity = Multiplicity,\n> implements FieldKindData\n{\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Change handling policy.\n\t */\n\t// TODO: stronger typing\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic readonly changeHandler: FieldChangeHandler<any, TEditor>;\n\n\tpublic constructor(\n\t\tpublic readonly identifier: TName,\n\t\tpublic readonly multiplicity: TMultiplicity,\n\t\t// TODO: stronger typing\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tprivate readonly options: FieldKindOptions<FieldChangeHandler<any, TEditor>>,\n\t) {\n\t\tthis.changeHandler = options.changeHandler;\n\t}\n\n\t/**\n\t * Returns true if and only if `superset` permits a (non-strict) superset of the subtrees\n\t * allowed by field made from `this` and `originalTypes`.\n\t *\n\t * TODO: clarify the relationship between this and FieldKindData, and issues with cyclic schema upgrades.\n\t */\n\tpublic allowsFieldSuperset(\n\t\tpolicy: SchemaPolicy,\n\t\toriginalData: TreeStoredSchema,\n\t\toriginalTypes: TreeTypeSet,\n\t\tsuperset: TreeFieldStoredSchema,\n\t): boolean {\n\t\tif (\n\t\t\tisNeverField(policy, originalData, {\n\t\t\t\tkind: this.identifier,\n\t\t\t\ttypes: originalTypes,\n\t\t\t\t// Metadata is not used for this check.\n\t\t\t\tpersistedMetadata: undefined,\n\t\t\t})\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\tif (isNeverField(policy, originalData, superset)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.options.allowsTreeSupersetOf(originalTypes, superset);\n\t}\n}\n\n/**\n * Additional options for {@link FlexFieldKind}.\n *\n * @remarks\n * Puts the more confusing parameters into this object so they get explicit names to help with clarity.\n */\nexport interface FieldKindOptions<TFieldChangeHandler> {\n\t/**\n\t * Change handling policy.\n\t */\n\treadonly changeHandler: TFieldChangeHandler;\n\n\t/**\n\t * Returns true if and only if `superset` permits a (non-strict) superset of the subtrees\n\t * allowed by field made from `this` and `originalTypes`.\n\t * @remarks\n\t * Used by {@link FlexFieldKind.allowsFieldSuperset}, which handles the `never` cases before calling this.\n\t */\n\treadonly allowsTreeSupersetOf: (\n\t\toriginalTypes: TreeTypeSet,\n\t\tsuperset: TreeFieldStoredSchema,\n\t) => boolean;\n\n\t/**\n\t * Kinds (in addition to this) whose edits can be processed by changeHandler.\n\t * If the kind of a field changes, and edits are rebased across that kind change,\n\t * listing the other old kind here can prevent those edits from being conflicted and\n\t * provide a chance to handle them.\n\t */\n\t// TODO: provide this and use it for improved support for rebasing changes across schema upgrades.\n\t// readonly handlesEditsFrom: ReadonlySet<FieldKindIdentifier>;\n}\n\n/**\n * Policy from the app for interpreting the stored schema.\n * The app must ensure consistency for all users of the document.\n */\nexport interface FullSchemaPolicy extends SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handles fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;\n}\n"]}
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { FieldKindIdentifier } from "../../core/index.js";
6
- import type { FieldKindWithEditor } from "./fieldKindWithEditor.js";
6
+ import type { FlexFieldKind } from "./fieldKind.js";
7
7
  /**
8
8
  * Configuration for a single field kind.
9
9
  */
10
10
  export interface FieldKindConfigurationEntry {
11
- readonly kind: FieldKindWithEditor;
11
+ readonly kind: FlexFieldKind;
12
12
  /**
13
13
  * The format to be used for encoding changesets for this field kind.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fieldKindConfiguration.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKindConfiguration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC/C,mBAAmB,EACnB,2BAA2B,CAC3B,CAAC"}
1
+ {"version":3,"file":"fieldKindConfiguration.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKindConfiguration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC/C,mBAAmB,EACnB,2BAA2B,CAC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldKindConfiguration.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKindConfiguration.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKindIdentifier } from \"../../core/index.js\";\n\nimport type { FieldKindWithEditor } from \"./fieldKindWithEditor.js\";\n\n/**\n * Configuration for a single field kind.\n */\nexport interface FieldKindConfigurationEntry {\n\treadonly kind: FieldKindWithEditor;\n\t/**\n\t * The format to be used for encoding changesets for this field kind.\n\t */\n\treadonly formatVersion: number;\n}\n\n/**\n * Configuration for a set of field kinds.\n */\nexport type FieldKindConfiguration = ReadonlyMap<\n\tFieldKindIdentifier,\n\tFieldKindConfigurationEntry\n>;\n"]}
1
+ {"version":3,"file":"fieldKindConfiguration.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKindConfiguration.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FieldKindIdentifier } from \"../../core/index.js\";\nimport type { FlexFieldKind } from \"./fieldKind.js\";\n\n/**\n * Configuration for a single field kind.\n */\nexport interface FieldKindConfigurationEntry {\n\treadonly kind: FlexFieldKind;\n\t/**\n\t * The format to be used for encoding changesets for this field kind.\n\t */\n\treadonly formatVersion: number;\n}\n\n/**\n * Configuration for a set of field kinds.\n */\nexport type FieldKindConfiguration = ReadonlyMap<\n\tFieldKindIdentifier,\n\tFieldKindConfigurationEntry\n>;\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { FieldChangeHandler } from "./fieldChangeHandler.js";
6
- import { FieldKindWithEditor } from "./fieldKindWithEditor.js";
7
6
  import { type GenericChangeset } from "./genericFieldKindTypes.js";
7
+ import { FlexFieldKind } from "./fieldKind.js";
8
8
  /**
9
9
  * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.
10
10
  */
@@ -12,7 +12,7 @@ export declare const genericChangeHandler: FieldChangeHandler<GenericChangeset>;
12
12
  /**
13
13
  * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.
14
14
  */
15
- export declare const genericFieldKind: FieldKindWithEditor;
15
+ export declare const genericFieldKind: FlexFieldKind;
16
16
  /**
17
17
  * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.
18
18
  * @param changeset - The generic changeset to convert.
@@ -1 +1 @@
1
- {"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,KAAK,EAEX,kBAAkB,EAOlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGxF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,gBAAgB,CAkCrE,CAAC;AA+FF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,mBAM9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACjC,OAAO,CAET"}
1
+ {"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,KAAK,EAEX,kBAAkB,EAOlB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,gBAAgB,CAkCrE,CAAC;AA+FF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAI9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACjC,OAAO,CAET"}
@@ -5,9 +5,10 @@
5
5
  import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { BTree } from "@tylerbu/sorted-btree-es6";
7
7
  import { Multiplicity, replaceAtomRevisions, } from "../../core/index.js";
8
- import { FieldKindWithEditor } from "./fieldKindWithEditor.js";
9
8
  import { makeGenericChangeCodec } from "./genericFieldKindCodecs.js";
10
9
  import { newGenericChangeset } from "./genericFieldKindTypes.js";
10
+ import { FlexFieldKind } from "./fieldKind.js";
11
+ import { brandConst } from "../../util/index.js";
11
12
  /**
12
13
  * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.
13
14
  */
@@ -114,7 +115,7 @@ function replaceRevisions(changeset, oldRevisions, newRevision) {
114
115
  /**
115
116
  * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.
116
117
  */
117
- export const genericFieldKind = new FieldKindWithEditor("ModularEditBuilder.Generic", Multiplicity.Sequence, genericChangeHandler, (types, other) => false, new Set());
118
+ export const genericFieldKind = new FlexFieldKind(brandConst("ModularEditBuilder.Generic")(), Multiplicity.Sequence, { changeHandler: genericChangeHandler, allowsTreeSupersetOf: (types, other) => false });
118
119
  /**
119
120
  * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.
120
121
  * @param changeset - The generic changeset to convert.
@@ -1 +1 @@
1
- {"version":3,"file":"genericFieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,E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MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport {\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\tMultiplicity,\n\ttype RevisionTag,\n\treplaceAtomRevisions,\n} from \"../../core/index.js\";\n\nimport type {\n\tFieldChangeDelta,\n\tFieldChangeHandler,\n\tNestedChangesIndices,\n\tNodeChangeComposer,\n\tNodeChangePruner,\n\tNodeChangeRebaser,\n\tRelevantRemovedRootsFromChild,\n\tToDelta,\n} from \"./fieldChangeHandler.js\";\nimport { FieldKindWithEditor } from \"./fieldKindWithEditor.js\";\nimport { makeGenericChangeCodec } from \"./genericFieldKindCodecs.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport type { NodeId } from \"./modularChangeTypes.js\";\n\n/**\n * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.\n */\nexport const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {\n\trebaser: {\n\t\tcompose,\n\t\tinvert: (change: GenericChangeset): GenericChangeset => change,\n\t\trebase: rebaseGenericChange,\n\t\tprune: pruneGenericChange,\n\t\treplaceRevisions,\n\t\tmute: (change: GenericChangeset): GenericChangeset => change,\n\t},\n\tcodecsFactory: makeGenericChangeCodec,\n\teditor: {\n\t\tbuildChildChanges(changes: Iterable<[number, NodeId]>): GenericChangeset {\n\t\t\treturn newGenericChangeset(Array.from(changes));\n\t\t},\n\t},\n\tintoDelta: (change: GenericChangeset, deltaFromChild: ToDelta): FieldChangeDelta => {\n\t\tlet nodeIndex = 0;\n\t\tconst markList: DeltaMark[] = [];\n\t\tfor (const [index, nodeChange] of change.entries()) {\n\t\t\tif (nodeIndex < index) {\n\t\t\t\tconst offset = index - nodeIndex;\n\t\t\t\tmarkList.push({ count: offset });\n\t\t\t\tnodeIndex = index;\n\t\t\t}\n\t\t\tmarkList.push({ count: 1, fields: deltaFromChild(nodeChange) });\n\t\t\tnodeIndex += 1;\n\t\t}\n\t\treturn { local: markList };\n\t},\n\trelevantRemovedRoots,\n\tisEmpty: (change: GenericChangeset): boolean => change.length === 0,\n\tgetNestedChanges,\n\tcreateEmpty: newGenericChangeset,\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction compose(\n\tchange1: GenericChangeset,\n\tchange2: GenericChangeset,\n\tcomposeChildren: NodeChangeComposer,\n): GenericChangeset {\n\tconst composed = change1.clone();\n\tfor (const [index, id2] of change2.entries()) {\n\t\tconst id1 = composed.get(index);\n\t\tconst idComposed = id1 !== undefined ? composeChildren(id1, id2) : id2;\n\t\tcomposed.set(index, idComposed);\n\t}\n\n\treturn composed;\n}\n\nfunction getNestedChanges(change: GenericChangeset): NestedChangesIndices {\n\t// For generic changeset, the indices in the input and output contexts are the same.\n\treturn change.toArray().map(([index, nodeChange]) => [nodeChange, index, index]);\n}\n\nfunction rebaseGenericChange(\n\tchange: GenericChangeset,\n\tover: GenericChangeset,\n\trebaseChild: NodeChangeRebaser,\n): GenericChangeset {\n\tconst rebased: GenericChangeset = new BTree();\n\tlet nextIndex = 0;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst newEntry = change.getPairOrNextHigher(nextIndex);\n\t\tconst baseEntry = over.getPairOrNextHigher(nextIndex);\n\n\t\tif (baseEntry === undefined && newEntry === undefined) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst newIndex = newEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tconst baseIndex = baseEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tlet newNodeChange: NodeId | undefined;\n\t\tlet baseNodeChange: NodeId | undefined;\n\t\tlet index: number;\n\t\tif (newIndex === baseIndex) {\n\t\t\tassert(\n\t\t\t\tnewEntry !== undefined && baseEntry !== undefined,\n\t\t\t\t0xa0d /* Entries should be defined */,\n\t\t\t);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t} else if (newIndex < baseIndex) {\n\t\t\tassert(newEntry !== undefined, 0xa0e /* Entry should be defined */);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t} else {\n\t\t\tassert(baseEntry !== undefined, 0xa0f /* Entry should be defined */);\n\t\t\tindex = baseIndex;\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t}\n\n\t\tconst nodeChange = rebaseChild(newNodeChange, baseNodeChange);\n\t\tif (nodeChange !== undefined) {\n\t\t\trebased.set(index, nodeChange);\n\t\t}\n\n\t\tnextIndex = index + 1;\n\t}\n\n\treturn rebased;\n}\n\nfunction pruneGenericChange(\n\tchangeset: GenericChangeset,\n\tpruneChild: NodeChangePruner,\n): GenericChangeset {\n\tconst pruned: GenericChangeset = new BTree();\n\tfor (const [index, node] of changeset.entries()) {\n\t\tconst prunedNode = pruneChild(node);\n\t\tif (prunedNode !== undefined) {\n\t\t\tpruned.set(index, node);\n\t\t}\n\t}\n\treturn pruned;\n}\n\nfunction replaceRevisions(\n\tchangeset: GenericChangeset,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): GenericChangeset {\n\treturn changeset.mapValues((node) => replaceAtomRevisions(node, oldRevisions, newRevision));\n}\n\n/**\n * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.\n */\nexport const genericFieldKind: FieldKindWithEditor = new FieldKindWithEditor(\n\t\"ModularEditBuilder.Generic\",\n\tMultiplicity.Sequence,\n\tgenericChangeHandler,\n\t(types, other) => false,\n\tnew Set(),\n);\n\n/**\n * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.\n * @param changeset - The generic changeset to convert.\n * @param target - The {@link FieldChangeHandler} for the `FieldKind` that the returned change should target.\n * @param composeChild - A delegate to compose {@link NodeChangeset}s.\n * @returns An equivalent changeset as represented by the `target` field-kind.\n */\nexport function convertGenericChange<TChange>(\n\tchangeset: GenericChangeset,\n\ttarget: FieldChangeHandler<TChange>,\n): TChange {\n\treturn target.editor.buildChildChanges(changeset.entries());\n}\n\nfunction* relevantRemovedRoots(\n\tchange: GenericChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const nodeChange of change.values()) {\n\t\tyield* relevantRemovedRootsFromChild(nodeChange);\n\t}\n}\n"]}
1
+ {"version":3,"file":"genericFieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAIN,YAAY,EAEZ,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyC;IACzE,OAAO,EAAE;QACR,OAAO;QACP,MAAM,EAAE,CAAC,MAAwB,EAAoB,EAAE,CAAC,MAAM;QAC9D,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE,kBAAkB;QACzB,gBAAgB;QAChB,IAAI,EAAE,CAAC,MAAwB,EAAoB,EAAE,CAAC,MAAM;KAC5D;IACD,aAAa,EAAE,sBAAsB;IACrC,MAAM,EAAE;QACP,iBAAiB,CAAC,OAAmC;YAC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AAS,gBAAgB,CACxB,SAA2B,EAC3B,YAA0C,EAC1C,WAAoC;IAEpC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAkB,IAAI,aAAa,CAC/D,UAAU,CAAC,4BAA4B,CAAC,EAAuB,EAC/D,YAAY,CAAC,QAAQ,EACrB,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CACtF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAA2B,EAC3B,MAAmC;IAEnC,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED,QAAQ,CAAC,CAAC,oBAAoB,CAC7B,MAAwB,EACxB,6BAA4D;IAE5D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport {\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\ttype FieldKindIdentifier,\n\tMultiplicity,\n\ttype RevisionTag,\n\treplaceAtomRevisions,\n} from \"../../core/index.js\";\n\nimport type {\n\tFieldChangeDelta,\n\tFieldChangeHandler,\n\tNestedChangesIndices,\n\tNodeChangeComposer,\n\tNodeChangePruner,\n\tNodeChangeRebaser,\n\tRelevantRemovedRootsFromChild,\n\tToDelta,\n} from \"./fieldChangeHandler.js\";\nimport { makeGenericChangeCodec } from \"./genericFieldKindCodecs.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport type { NodeId } from \"./modularChangeTypes.js\";\nimport { FlexFieldKind } from \"./fieldKind.js\";\nimport { brandConst } from \"../../util/index.js\";\n\n/**\n * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.\n */\nexport const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {\n\trebaser: {\n\t\tcompose,\n\t\tinvert: (change: GenericChangeset): GenericChangeset => change,\n\t\trebase: rebaseGenericChange,\n\t\tprune: pruneGenericChange,\n\t\treplaceRevisions,\n\t\tmute: (change: GenericChangeset): GenericChangeset => change,\n\t},\n\tcodecsFactory: makeGenericChangeCodec,\n\teditor: {\n\t\tbuildChildChanges(changes: Iterable<[number, NodeId]>): GenericChangeset {\n\t\t\treturn newGenericChangeset(Array.from(changes));\n\t\t},\n\t},\n\tintoDelta: (change: GenericChangeset, deltaFromChild: ToDelta): FieldChangeDelta => {\n\t\tlet nodeIndex = 0;\n\t\tconst markList: DeltaMark[] = [];\n\t\tfor (const [index, nodeChange] of change.entries()) {\n\t\t\tif (nodeIndex < index) {\n\t\t\t\tconst offset = index - nodeIndex;\n\t\t\t\tmarkList.push({ count: offset });\n\t\t\t\tnodeIndex = index;\n\t\t\t}\n\t\t\tmarkList.push({ count: 1, fields: deltaFromChild(nodeChange) });\n\t\t\tnodeIndex += 1;\n\t\t}\n\t\treturn { local: markList };\n\t},\n\trelevantRemovedRoots,\n\tisEmpty: (change: GenericChangeset): boolean => change.length === 0,\n\tgetNestedChanges,\n\tcreateEmpty: newGenericChangeset,\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction compose(\n\tchange1: GenericChangeset,\n\tchange2: GenericChangeset,\n\tcomposeChildren: NodeChangeComposer,\n): GenericChangeset {\n\tconst composed = change1.clone();\n\tfor (const [index, id2] of change2.entries()) {\n\t\tconst id1 = composed.get(index);\n\t\tconst idComposed = id1 !== undefined ? composeChildren(id1, id2) : id2;\n\t\tcomposed.set(index, idComposed);\n\t}\n\n\treturn composed;\n}\n\nfunction getNestedChanges(change: GenericChangeset): NestedChangesIndices {\n\t// For generic changeset, the indices in the input and output contexts are the same.\n\treturn change.toArray().map(([index, nodeChange]) => [nodeChange, index, index]);\n}\n\nfunction rebaseGenericChange(\n\tchange: GenericChangeset,\n\tover: GenericChangeset,\n\trebaseChild: NodeChangeRebaser,\n): GenericChangeset {\n\tconst rebased: GenericChangeset = new BTree();\n\tlet nextIndex = 0;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst newEntry = change.getPairOrNextHigher(nextIndex);\n\t\tconst baseEntry = over.getPairOrNextHigher(nextIndex);\n\n\t\tif (baseEntry === undefined && newEntry === undefined) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst newIndex = newEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tconst baseIndex = baseEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tlet newNodeChange: NodeId | undefined;\n\t\tlet baseNodeChange: NodeId | undefined;\n\t\tlet index: number;\n\t\tif (newIndex === baseIndex) {\n\t\t\tassert(\n\t\t\t\tnewEntry !== undefined && baseEntry !== undefined,\n\t\t\t\t0xa0d /* Entries should be defined */,\n\t\t\t);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t} else if (newIndex < baseIndex) {\n\t\t\tassert(newEntry !== undefined, 0xa0e /* Entry should be defined */);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t} else {\n\t\t\tassert(baseEntry !== undefined, 0xa0f /* Entry should be defined */);\n\t\t\tindex = baseIndex;\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t}\n\n\t\tconst nodeChange = rebaseChild(newNodeChange, baseNodeChange);\n\t\tif (nodeChange !== undefined) {\n\t\t\trebased.set(index, nodeChange);\n\t\t}\n\n\t\tnextIndex = index + 1;\n\t}\n\n\treturn rebased;\n}\n\nfunction pruneGenericChange(\n\tchangeset: GenericChangeset,\n\tpruneChild: NodeChangePruner,\n): GenericChangeset {\n\tconst pruned: GenericChangeset = new BTree();\n\tfor (const [index, node] of changeset.entries()) {\n\t\tconst prunedNode = pruneChild(node);\n\t\tif (prunedNode !== undefined) {\n\t\t\tpruned.set(index, node);\n\t\t}\n\t}\n\treturn pruned;\n}\n\nfunction replaceRevisions(\n\tchangeset: GenericChangeset,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): GenericChangeset {\n\treturn changeset.mapValues((node) => replaceAtomRevisions(node, oldRevisions, newRevision));\n}\n\n/**\n * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.\n */\nexport const genericFieldKind: FlexFieldKind = new FlexFieldKind(\n\tbrandConst(\"ModularEditBuilder.Generic\")<FieldKindIdentifier>(),\n\tMultiplicity.Sequence,\n\t{ changeHandler: genericChangeHandler, allowsTreeSupersetOf: (types, other) => false },\n);\n\n/**\n * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.\n * @param changeset - The generic changeset to convert.\n * @param target - The {@link FieldChangeHandler} for the `FieldKind` that the returned change should target.\n * @param composeChild - A delegate to compose {@link NodeChangeset}s.\n * @returns An equivalent changeset as represented by the `target` field-kind.\n */\nexport function convertGenericChange<TChange>(\n\tchangeset: GenericChangeset,\n\ttarget: FieldChangeHandler<TChange>,\n): TChange {\n\treturn target.editor.buildChildChanges(changeset.entries());\n}\n\nfunction* relevantRemovedRoots(\n\tchange: GenericChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const nodeChange of change.values()) {\n\t\tyield* relevantRemovedRootsFromChild(nodeChange);\n\t}\n}\n"]}
@@ -7,7 +7,6 @@ export { isNeverField, isNeverTree } from "./isNeverTree.js";
7
7
  export { addCrossFieldQuery, type CrossFieldManager, type CrossFieldMap, type CrossFieldQuerySet, CrossFieldTarget, setInCrossFieldMap, } from "./crossFieldQueries.js";
8
8
  export { ChangesetLocalIdSchema, EncodedChangeAtomId, EncodedRevisionInfo, EncodedModularChangeset, EncodedNodeChangeset, } from "./modularChangeFormat.js";
9
9
  export { FlexFieldKind, type FullSchemaPolicy } from "./fieldKind.js";
10
- export { FieldKindWithEditor } from "./fieldKindWithEditor.js";
11
10
  export { type FieldChangeHandler, type FieldChangeDelta, type FieldChangeRebaser, type FieldEditor, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, referenceFreeFieldChangeRebaser, type RebaseRevisionMetadata, type RelevantRemovedRootsFromChild, type ToDelta, NodeAttachState, type FieldChangeEncodingContext, type NestedChangesIndices, } from "./fieldChangeHandler.js";
12
11
  export type { CrossFieldKey, CrossFieldKeyRange, FieldChange, FieldChangeMap, FieldChangeset, HasFieldChanges, ModularChangeset, NodeExistsConstraint, NodeId, } from "./modularChangeTypes.js";
13
12
  export { convertGenericChange, genericChangeHandler, genericFieldKind, } from "./genericFieldKind.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,+BAA+B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,OAAO,EACZ,eAAe,EACf,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,GACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EACX,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB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,EACX,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC"}
@@ -7,7 +7,6 @@ export { isNeverField, isNeverTree } from "./isNeverTree.js";
7
7
  export { addCrossFieldQuery, CrossFieldTarget, setInCrossFieldMap, } from "./crossFieldQueries.js";
8
8
  export { ChangesetLocalIdSchema, EncodedChangeAtomId, EncodedRevisionInfo, EncodedModularChangeset, EncodedNodeChangeset, } from "./modularChangeFormat.js";
9
9
  export { FlexFieldKind } from "./fieldKind.js";
10
- export { FieldKindWithEditor } from "./fieldKindWithEditor.js";
11
10
  export { referenceFreeFieldChangeRebaser, NodeAttachState, } from "./fieldChangeHandler.js";
12
11
  export { convertGenericChange, genericChangeHandler, genericFieldKind, } from "./genericFieldKind.js";
13
12
  export { ModularChangeFamily, ModularEditBuilder, rebaseRevisionMetadataFromInfo, intoDelta, relevantRemovedRoots, updateRefreshers, } from "./modularChangeFamily.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAIlB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EASN,+BAA+B,EAI/B,eAAe,GAGf,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangeset,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormat.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport { FieldKindWithEditor } from \"./fieldKindWithEditor.js\";\nexport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n\ttype FieldChangeEncodingContext,\n\ttype NestedChangesIndices,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport { makeModularChangeCodecFamily } from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAIlB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EASN,+BAA+B,EAI/B,eAAe,GAGf,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangeset,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormat.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n\ttype FieldChangeEncodingContext,\n\ttype NestedChangesIndices,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport { makeModularChangeCodecFamily } from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\n"]}
@@ -2,22 +2,21 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema } from "../../core/index.js";
6
- import type { FullSchemaPolicy } from "./fieldKind.js";
7
- export declare function isNeverField(policy: FullSchemaPolicy, originalData: TreeStoredSchema, field: TreeFieldStoredSchema): boolean;
8
- export declare function isNeverFieldRecursive(policy: FullSchemaPolicy, originalData: TreeStoredSchema, field: TreeFieldStoredSchema, parentTypeStack: Set<TreeNodeStoredSchema>): boolean;
5
+ import { type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type SchemaPolicy } from "../../core/index.js";
6
+ export declare function isNeverField(policy: SchemaPolicy, originalData: TreeStoredSchema, field: TreeFieldStoredSchema): boolean;
7
+ export declare function isNeverFieldRecursive(policy: SchemaPolicy, originalData: TreeStoredSchema, field: TreeFieldStoredSchema, parentTypeStack: Set<TreeNodeStoredSchema>): boolean;
9
8
  /**
10
9
  * Returns true iff there are no possible trees that could meet this schema.
11
10
  * Trees which are infinite (like endless linked lists) are considered impossible.
12
11
  *
13
12
  * `undefined` means the schema is not present and thus a NeverTree.
14
13
  */
15
- export declare function isNeverTree(policy: FullSchemaPolicy, originalData: TreeStoredSchema, treeNode: TreeNodeStoredSchema | undefined): boolean;
14
+ export declare function isNeverTree(policy: SchemaPolicy, originalData: TreeStoredSchema, treeNode: TreeNodeStoredSchema | undefined): boolean;
16
15
  /**
17
16
  * Returns true iff there are no possible trees that could meet this schema.
18
17
  * Trees which are infinite (like endless linked lists) are considered impossible.
19
18
  *
20
19
  * `undefined` means the schema is not present and thus a NeverTree.
21
20
  */
22
- export declare function isNeverTreeRecursive(policy: FullSchemaPolicy, originalData: TreeStoredSchema, treeNode: TreeNodeStoredSchema | undefined, parentTypeStack: Set<TreeNodeStoredSchema>): boolean;
21
+ export declare function isNeverTreeRecursive(policy: SchemaPolicy, originalData: TreeStoredSchema, treeNode: TreeNodeStoredSchema | undefined, parentTypeStack: Set<TreeNodeStoredSchema>): boolean;
23
22
  //# sourceMappingURL=isNeverTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isNeverTree.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,wBAAgB,YAAY,CAC3B,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,GAC1B,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAuBT;AACD;;;;;GAKG;AAEH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CAET;AACD;;;;;GAKG;AAEH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAkCT"}
1
+ {"version":3,"file":"isNeverTree.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAC3B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,GAC1B,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAuBT;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,eAAe,EAAE,GAAG,CAAC,oBAAoB,CAAC,GACxC,OAAO,CAkCT"}
@@ -1 +1 @@
1
- {"version":3,"file":"isNeverTree.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAItB,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAI7B,MAAM,UAAU,YAAY,CAC3B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,IAAI,CAAC;QACJ,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,IAAI,QAAQ,YAAY,mBAAmB,EAAE,CAAC;YAC7C,OAAO,CACN,CACC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9C,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CACpC,CAAC,YAAY,KAAK,YAAY,CAAC,MAAM,CACtC,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,YAAY,sBAAsB,EAAE,CAAC;YACvD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxD,yFAAyF;gBACzF,qDAAqD;gBACrD,4GAA4G;gBAC5G,6EAA6E;gBAC7E,IAAI,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;oBACzE,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,QAAQ,YAAY,oBAAoB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;YAAS,CAAC;QACV,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tMultiplicity,\n} from \"../../core/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\n\nexport function isNeverField(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n): boolean {\n\treturn isNeverFieldRecursive(policy, originalData, field, new Set());\n}\n\nexport function isNeverFieldRecursive(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (\n\t\t(policy.fieldKinds.get(field.kind) ?? fail(0xb1c /* missing field kind */))\n\t\t\t.multiplicity === Multiplicity.Single &&\n\t\tfield.types !== undefined\n\t) {\n\t\tfor (const type of field.types) {\n\t\t\tif (\n\t\t\t\t!isNeverTreeRecursive(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\toriginalData.nodeSchema.get(type),\n\t\t\t\t\tparentTypeStack,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// This field requires at least one child, and there are no types permitted in it that can exist,\n\t\t// so this is a never field (field which no sequence of children content could ever be in schema for)\n\t\treturn true;\n\t}\n\treturn false;\n}\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\n\nexport function isNeverTree(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n): boolean {\n\treturn isNeverTreeRecursive(policy, originalData, treeNode, new Set());\n}\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\n\nexport function isNeverTreeRecursive(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (treeNode === undefined) {\n\t\treturn true;\n\t}\n\tif (parentTypeStack.has(treeNode)) {\n\t\treturn true;\n\t}\n\ttry {\n\t\tparentTypeStack.add(treeNode);\n\t\tif (treeNode instanceof MapNodeStoredSchema) {\n\t\t\treturn (\n\t\t\t\t(\n\t\t\t\t\tpolicy.fieldKinds.get(treeNode.mapFields.kind) ??\n\t\t\t\t\tfail(0xb1d /* missing field kind */)\n\t\t\t\t).multiplicity === Multiplicity.Single\n\t\t\t);\n\t\t} else if (treeNode instanceof ObjectNodeStoredSchema) {\n\t\t\tfor (const field of treeNode.objectNodeFields.values()) {\n\t\t\t\t// TODO: this can recurse infinitely for schema that include themselves in a value field.\n\t\t\t\t// This breaks even if there are other allowed types.\n\t\t\t\t// Such schema should either be rejected (as an error here) or considered never (and thus detected by this).\n\t\t\t\t// This can be done by passing a set/stack of current types recursively here.\n\t\t\t\tif (isNeverFieldRecursive(policy, originalData, field, parentTypeStack)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tassert(treeNode instanceof LeafNodeStoredSchema, 0x897 /* unsupported node kind */);\n\t\t\treturn false;\n\t\t}\n\t} finally {\n\t\tparentTypeStack.delete(treeNode);\n\t}\n}\n"]}
1
+ {"version":3,"file":"isNeverTree.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/isNeverTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAItB,YAAY,GAEZ,MAAM,qBAAqB,CAAC;AAE7B,MAAM,UAAU,YAAY,CAC3B,MAAoB,EACpB,YAA8B,EAC9B,KAA4B;IAE5B,OAAO,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qBAAqB,CACpC,MAA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C,SAAS,CAAC,IAAI,CAAC;gBAC9C,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CACpC,CAAC,YAAY,KAAK,YAAY,CAAC,MAAM,CACtC,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,YAAY,sBAAsB,EAAE,CAAC;YACvD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxD,yFAAyF;gBACzF,qDAAqD;gBACrD,4GAA4G;gBAC5G,6EAA6E;gBAC7E,IAAI,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;oBACzE,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,QAAQ,YAAY,oBAAoB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;YAAS,CAAC;QACV,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"../../core/index.js\";\n\nexport function isNeverField(\n\tpolicy: SchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n): boolean {\n\treturn isNeverFieldRecursive(policy, originalData, field, new Set());\n}\n\nexport function isNeverFieldRecursive(\n\tpolicy: SchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\tfield: TreeFieldStoredSchema,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (\n\t\t(policy.fieldKinds.get(field.kind) ?? fail(0xb1c /* missing field kind */))\n\t\t\t.multiplicity === Multiplicity.Single &&\n\t\tfield.types !== undefined\n\t) {\n\t\tfor (const type of field.types) {\n\t\t\tif (\n\t\t\t\t!isNeverTreeRecursive(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\toriginalData.nodeSchema.get(type),\n\t\t\t\t\tparentTypeStack,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// This field requires at least one child, and there are no types permitted in it that can exist,\n\t\t// so this is a never field (field which no sequence of children content could ever be in schema for)\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\nexport function isNeverTree(\n\tpolicy: SchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n): boolean {\n\treturn isNeverTreeRecursive(policy, originalData, treeNode, new Set());\n}\n\n/**\n * Returns true iff there are no possible trees that could meet this schema.\n * Trees which are infinite (like endless linked lists) are considered impossible.\n *\n * `undefined` means the schema is not present and thus a NeverTree.\n */\nexport function isNeverTreeRecursive(\n\tpolicy: SchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\ttreeNode: TreeNodeStoredSchema | undefined,\n\tparentTypeStack: Set<TreeNodeStoredSchema>,\n): boolean {\n\tif (treeNode === undefined) {\n\t\treturn true;\n\t}\n\tif (parentTypeStack.has(treeNode)) {\n\t\treturn true;\n\t}\n\ttry {\n\t\tparentTypeStack.add(treeNode);\n\t\tif (treeNode instanceof MapNodeStoredSchema) {\n\t\t\treturn (\n\t\t\t\t(\n\t\t\t\t\tpolicy.fieldKinds.get(treeNode.mapFields.kind) ??\n\t\t\t\t\tfail(0xb1d /* missing field kind */)\n\t\t\t\t).multiplicity === Multiplicity.Single\n\t\t\t);\n\t\t} else if (treeNode instanceof ObjectNodeStoredSchema) {\n\t\t\tfor (const field of treeNode.objectNodeFields.values()) {\n\t\t\t\t// TODO: this can recurse infinitely for schema that include themselves in a value field.\n\t\t\t\t// This breaks even if there are other allowed types.\n\t\t\t\t// Such schema should either be rejected (as an error here) or considered never (and thus detected by this).\n\t\t\t\t// This can be done by passing a set/stack of current types recursively here.\n\t\t\t\tif (isNeverFieldRecursive(policy, originalData, field, parentTypeStack)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tassert(treeNode instanceof LeafNodeStoredSchema, 0x897 /* unsupported node kind */);\n\t\t\treturn false;\n\t\t}\n\t} finally {\n\t\tparentTypeStack.delete(treeNode);\n\t}\n}\n"]}