@fluidframework/tree 2.71.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 (941) hide show
  1. package/CHANGELOG.md +125 -40
  2. package/api-report/tree.alpha.api.md +44 -48
  3. package/api-report/tree.beta.api.md +42 -0
  4. package/api-report/tree.legacy.beta.api.md +42 -0
  5. package/dist/alpha.d.ts +12 -8
  6. package/dist/api.d.ts +6 -2
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js +2 -11
  9. package/dist/api.js.map +1 -1
  10. package/dist/beta.d.ts +7 -0
  11. package/dist/codec/codec.d.ts +23 -1
  12. package/dist/codec/codec.d.ts.map +1 -1
  13. package/dist/codec/codec.js +23 -3
  14. package/dist/codec/codec.js.map +1 -1
  15. package/dist/codec/index.d.ts +1 -1
  16. package/dist/codec/index.d.ts.map +1 -1
  17. package/dist/codec/index.js +2 -1
  18. package/dist/codec/index.js.map +1 -1
  19. package/dist/codec/versioned/codec.d.ts +7 -2
  20. package/dist/codec/versioned/codec.d.ts.map +1 -1
  21. package/dist/codec/versioned/codec.js +24 -1
  22. package/dist/codec/versioned/codec.js.map +1 -1
  23. package/dist/codec/versioned/index.d.ts +1 -1
  24. package/dist/codec/versioned/index.d.ts.map +1 -1
  25. package/dist/codec/versioned/index.js +2 -1
  26. package/dist/codec/versioned/index.js.map +1 -1
  27. package/dist/core/index.d.ts +1 -1
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.js +2 -2
  30. package/dist/core/index.js.map +1 -1
  31. package/dist/core/schema-stored/index.d.ts +1 -1
  32. package/dist/core/schema-stored/index.d.ts.map +1 -1
  33. package/dist/core/schema-stored/index.js +2 -2
  34. package/dist/core/schema-stored/index.js.map +1 -1
  35. package/dist/core/schema-stored/schema.d.ts +18 -7
  36. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  37. package/dist/core/schema-stored/schema.js +6 -7
  38. package/dist/core/schema-stored/schema.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  40. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  43. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  45. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  46. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  47. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
  48. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  50. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndexCodecs.js +31 -8
  52. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  53. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  54. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  55. package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
  56. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  57. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  58. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  59. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  60. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  61. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  62. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  63. package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
  64. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  65. package/dist/core/tree/index.d.ts +2 -1
  66. package/dist/core/tree/index.d.ts.map +1 -1
  67. package/dist/core/tree/index.js.map +1 -1
  68. package/dist/external-utilities/typeboxValidator.js +1 -1
  69. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  71. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
  75. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  77. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  80. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/codecs.js +39 -21
  82. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  84. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  86. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
  88. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  89. package/dist/feature-libraries/chunked-forest/codec/format.js +13 -4
  90. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  91. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  92. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  93. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  94. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  95. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  96. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  97. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  98. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  99. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  100. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
  102. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  104. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
  106. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  108. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/index.js +2 -2
  110. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  111. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
  112. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  113. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +54 -74
  114. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  115. package/dist/feature-libraries/default-schema/index.d.ts +1 -3
  116. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  117. package/dist/feature-libraries/default-schema/index.js +2 -8
  118. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
  120. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/codec.js +15 -4
  122. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  124. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/format.d.ts +9 -2
  126. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  127. package/dist/feature-libraries/forest-summary/format.js +11 -4
  128. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  129. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  130. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/forest-summary/index.js +3 -1
  132. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  133. package/dist/feature-libraries/index.d.ts +6 -5
  134. package/dist/feature-libraries/index.d.ts.map +1 -1
  135. package/dist/feature-libraries/index.js +9 -8
  136. package/dist/feature-libraries/index.js.map +1 -1
  137. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/comparison.js +1 -2
  139. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  141. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  142. package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
  143. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  144. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  145. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  146. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  148. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  150. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  151. package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
  152. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  153. package/dist/feature-libraries/modular-schema/index.js +1 -3
  154. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  155. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  156. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  157. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  158. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  159. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  160. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  161. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  162. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  163. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  164. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  165. package/dist/feature-libraries/object-forest/objectForest.js +3 -2
  166. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  167. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  168. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  169. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  170. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  171. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  172. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  173. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  174. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  175. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  176. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  177. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  178. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
  179. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  180. package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
  181. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  182. package/dist/feature-libraries/schema-index/codec.js +24 -18
  183. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  184. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  185. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  186. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  187. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  188. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
  189. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  190. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  191. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  192. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  193. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  194. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  195. package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  196. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
  197. package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  198. package/dist/feature-libraries/schemaChecker.js.map +1 -0
  199. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  200. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  201. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  202. package/dist/index.d.ts +2 -2
  203. package/dist/index.d.ts.map +1 -1
  204. package/dist/index.js +7 -3
  205. package/dist/index.js.map +1 -1
  206. package/dist/legacy.d.ts +7 -0
  207. package/dist/packageVersion.d.ts +1 -1
  208. package/dist/packageVersion.js +1 -1
  209. package/dist/packageVersion.js.map +1 -1
  210. package/dist/shared-tree/independentView.d.ts +1 -1
  211. package/dist/shared-tree/independentView.d.ts.map +1 -1
  212. package/dist/shared-tree/independentView.js +22 -15
  213. package/dist/shared-tree/independentView.js.map +1 -1
  214. package/dist/shared-tree/index.d.ts +1 -1
  215. package/dist/shared-tree/index.d.ts.map +1 -1
  216. package/dist/shared-tree/index.js +1 -2
  217. package/dist/shared-tree/index.js.map +1 -1
  218. package/dist/shared-tree/sharedTree.d.ts +12 -60
  219. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  220. package/dist/shared-tree/sharedTree.js +68 -159
  221. package/dist/shared-tree/sharedTree.js.map +1 -1
  222. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
  223. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  224. package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -11
  225. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  226. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  227. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  228. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  229. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  230. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  231. package/dist/shared-tree/treeAlpha.js +4 -2
  232. package/dist/shared-tree/treeAlpha.js.map +1 -1
  233. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  234. package/dist/shared-tree/treeCheckout.js +1 -3
  235. package/dist/shared-tree/treeCheckout.js.map +1 -1
  236. package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
  237. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  238. package/dist/shared-tree-core/editManagerCodecs.js +42 -18
  239. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  240. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
  241. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  242. package/dist/shared-tree-core/editManagerFormatCommons.js +40 -1
  243. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  244. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  245. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  246. package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
  247. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  248. package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  249. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  250. package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
  251. package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
  252. package/dist/shared-tree-core/index.d.ts +5 -3
  253. package/dist/shared-tree-core/index.d.ts.map +1 -1
  254. package/dist/shared-tree-core/index.js +12 -3
  255. package/dist/shared-tree-core/index.js.map +1 -1
  256. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  257. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  258. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  259. package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
  260. package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  261. package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
  262. package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
  263. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  264. package/dist/shared-tree-core/messageCodecs.js +49 -21
  265. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  266. package/dist/shared-tree-core/messageFormat.d.ts +48 -0
  267. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
  268. package/dist/shared-tree-core/messageFormat.js +53 -0
  269. package/dist/shared-tree-core/messageFormat.js.map +1 -0
  270. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
  271. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  272. package/dist/shared-tree-core/sharedTreeCore.js +3 -3
  273. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  274. package/dist/simple-tree/api/configuration.d.ts +2 -0
  275. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  276. package/dist/simple-tree/api/configuration.js +10 -0
  277. package/dist/simple-tree/api/configuration.js.map +1 -1
  278. package/dist/simple-tree/api/discrepancies.d.ts +2 -2
  279. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  280. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  281. package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
  282. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  283. package/dist/simple-tree/api/index.d.ts +4 -2
  284. package/dist/simple-tree/api/index.d.ts.map +1 -1
  285. package/dist/simple-tree/api/index.js +8 -1
  286. package/dist/simple-tree/api/index.js.map +1 -1
  287. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  288. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  289. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
  290. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  291. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  292. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  293. package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
  294. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  295. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  296. package/dist/simple-tree/api/schemaFromSimple.js +13 -4
  297. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  298. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  299. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  300. package/dist/simple-tree/api/simpleSchemaCodec.js +290 -0
  301. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  302. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  303. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  304. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
  305. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  306. package/dist/simple-tree/api/storedSchema.d.ts +2 -2
  307. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/storedSchema.js +8 -6
  309. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  310. package/dist/simple-tree/api/tree.d.ts +3 -3
  311. package/dist/simple-tree/api/tree.js +1 -1
  312. package/dist/simple-tree/api/tree.js.map +1 -1
  313. package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
  314. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  315. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  316. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  317. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
  318. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  319. package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
  320. package/dist/simple-tree/core/allowedTypes.js +2 -2
  321. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  322. package/dist/simple-tree/core/index.d.ts +3 -3
  323. package/dist/simple-tree/core/index.d.ts.map +1 -1
  324. package/dist/simple-tree/core/index.js +3 -1
  325. package/dist/simple-tree/core/index.js.map +1 -1
  326. package/dist/simple-tree/core/toStored.d.ts +12 -5
  327. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  328. package/dist/simple-tree/core/toStored.js +26 -10
  329. package/dist/simple-tree/core/toStored.js.map +1 -1
  330. package/dist/simple-tree/core/treeNode.js +1 -1
  331. package/dist/simple-tree/core/treeNode.js.map +1 -1
  332. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
  333. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  334. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  335. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  336. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  337. package/dist/simple-tree/core/treeNodeValid.js +1 -2
  338. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  339. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  340. package/dist/simple-tree/fieldSchema.js +1 -8
  341. package/dist/simple-tree/fieldSchema.js.map +1 -1
  342. package/dist/simple-tree/index.d.ts +3 -2
  343. package/dist/simple-tree/index.d.ts.map +1 -1
  344. package/dist/simple-tree/index.js +12 -2
  345. package/dist/simple-tree/index.js.map +1 -1
  346. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  347. package/dist/simple-tree/leafNodeSchema.js +0 -1
  348. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  349. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  350. package/dist/simple-tree/node-kinds/array/arrayNode.js +14 -50
  351. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  352. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  353. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -6
  354. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  355. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  356. package/dist/simple-tree/node-kinds/object/objectNode.js +4 -12
  357. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  358. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  359. package/dist/simple-tree/node-kinds/record/recordNode.js +3 -7
  360. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  361. package/dist/simple-tree/simpleSchema.d.ts +25 -5
  362. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  363. package/dist/simple-tree/simpleSchema.js.map +1 -1
  364. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  365. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  366. package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
  367. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  368. package/dist/simple-tree/toStoredSchema.d.ts +20 -8
  369. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  370. package/dist/simple-tree/toStoredSchema.js +27 -22
  371. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  372. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  373. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
  374. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  375. package/dist/tableSchema.d.ts +22 -52
  376. package/dist/tableSchema.d.ts.map +1 -1
  377. package/dist/tableSchema.js +141 -277
  378. package/dist/tableSchema.js.map +1 -1
  379. package/dist/treeFactory.d.ts +3 -1
  380. package/dist/treeFactory.d.ts.map +1 -1
  381. package/dist/treeFactory.js +26 -2
  382. package/dist/treeFactory.js.map +1 -1
  383. package/dist/util/arrayUtilities.d.ts +45 -0
  384. package/dist/util/arrayUtilities.d.ts.map +1 -0
  385. package/dist/util/arrayUtilities.js +76 -0
  386. package/dist/util/arrayUtilities.js.map +1 -0
  387. package/dist/util/brand.d.ts +31 -2
  388. package/dist/util/brand.d.ts.map +1 -1
  389. package/dist/util/brand.js +28 -2
  390. package/dist/util/brand.js.map +1 -1
  391. package/dist/util/brandedMap.d.ts +3 -1
  392. package/dist/util/brandedMap.d.ts.map +1 -1
  393. package/dist/util/brandedMap.js.map +1 -1
  394. package/dist/util/index.d.ts +2 -1
  395. package/dist/util/index.d.ts.map +1 -1
  396. package/dist/util/index.js +8 -2
  397. package/dist/util/index.js.map +1 -1
  398. package/lib/alpha.d.ts +12 -8
  399. package/lib/api.d.ts +6 -2
  400. package/lib/api.d.ts.map +1 -1
  401. package/lib/api.js +2 -13
  402. package/lib/api.js.map +1 -1
  403. package/lib/beta.d.ts +7 -0
  404. package/lib/codec/codec.d.ts +23 -1
  405. package/lib/codec/codec.d.ts.map +1 -1
  406. package/lib/codec/codec.js +23 -3
  407. package/lib/codec/codec.js.map +1 -1
  408. package/lib/codec/index.d.ts +1 -1
  409. package/lib/codec/index.d.ts.map +1 -1
  410. package/lib/codec/index.js +1 -1
  411. package/lib/codec/index.js.map +1 -1
  412. package/lib/codec/versioned/codec.d.ts +7 -2
  413. package/lib/codec/versioned/codec.d.ts.map +1 -1
  414. package/lib/codec/versioned/codec.js +22 -0
  415. package/lib/codec/versioned/codec.js.map +1 -1
  416. package/lib/codec/versioned/index.d.ts +1 -1
  417. package/lib/codec/versioned/index.d.ts.map +1 -1
  418. package/lib/codec/versioned/index.js +1 -1
  419. package/lib/codec/versioned/index.js.map +1 -1
  420. package/lib/core/index.d.ts +1 -1
  421. package/lib/core/index.d.ts.map +1 -1
  422. package/lib/core/index.js +1 -1
  423. package/lib/core/index.js.map +1 -1
  424. package/lib/core/schema-stored/index.d.ts +1 -1
  425. package/lib/core/schema-stored/index.d.ts.map +1 -1
  426. package/lib/core/schema-stored/index.js +1 -1
  427. package/lib/core/schema-stored/index.js.map +1 -1
  428. package/lib/core/schema-stored/schema.d.ts +18 -7
  429. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  430. package/lib/core/schema-stored/schema.js +6 -7
  431. package/lib/core/schema-stored/schema.js.map +1 -1
  432. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  433. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  434. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  435. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  436. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  437. package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
  438. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  439. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  440. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
  441. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  442. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  443. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  444. package/lib/core/tree/detachedFieldIndexCodecs.js +31 -8
  445. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  446. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  447. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  448. package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
  449. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  450. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  451. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  452. package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
  453. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  454. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  455. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  456. package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
  457. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  458. package/lib/core/tree/index.d.ts +2 -1
  459. package/lib/core/tree/index.d.ts.map +1 -1
  460. package/lib/core/tree/index.js +1 -1
  461. package/lib/core/tree/index.js.map +1 -1
  462. package/lib/external-utilities/typeboxValidator.js +1 -1
  463. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  464. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  465. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  466. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  467. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  468. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
  469. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  470. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  471. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  472. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  473. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  474. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  475. package/lib/feature-libraries/chunked-forest/codec/codecs.js +42 -23
  476. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  477. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  478. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  479. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +5 -3
  480. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  481. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
  482. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  483. package/lib/feature-libraries/chunked-forest/codec/format.js +12 -3
  484. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  485. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  486. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  487. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  488. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  489. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  490. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  491. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  492. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  493. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  494. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  495. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
  496. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  497. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  498. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  499. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
  500. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  501. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  502. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  503. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  504. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  505. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
  506. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  507. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +56 -76
  508. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  509. package/lib/feature-libraries/default-schema/index.d.ts +1 -3
  510. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  511. package/lib/feature-libraries/default-schema/index.js +1 -3
  512. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  513. package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
  514. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  515. package/lib/feature-libraries/forest-summary/codec.js +16 -5
  516. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  517. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  518. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  519. package/lib/feature-libraries/forest-summary/format.d.ts +9 -2
  520. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  521. package/lib/feature-libraries/forest-summary/format.js +9 -2
  522. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  523. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  524. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  525. package/lib/feature-libraries/forest-summary/index.js +1 -0
  526. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  527. package/lib/feature-libraries/index.d.ts +6 -5
  528. package/lib/feature-libraries/index.d.ts.map +1 -1
  529. package/lib/feature-libraries/index.js +5 -4
  530. package/lib/feature-libraries/index.js.map +1 -1
  531. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  532. package/lib/feature-libraries/modular-schema/comparison.js +1 -2
  533. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  534. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  535. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  536. package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
  537. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  538. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  539. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  540. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  541. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  542. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  543. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  544. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  545. package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
  546. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  547. package/lib/feature-libraries/modular-schema/index.js +0 -1
  548. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  549. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  550. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  551. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  552. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  553. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  554. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  555. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  556. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  557. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  558. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  559. package/lib/feature-libraries/object-forest/objectForest.js +2 -1
  560. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  561. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  562. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  563. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  564. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  565. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  566. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  567. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  568. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  569. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  570. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  571. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  572. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
  573. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  574. package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
  575. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  576. package/lib/feature-libraries/schema-index/codec.js +26 -20
  577. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  578. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  579. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  580. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  581. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  582. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
  583. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  584. package/lib/feature-libraries/schema-index/formatV2.js +2 -2
  585. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  586. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  587. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  588. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  589. package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  590. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
  591. package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  592. package/lib/feature-libraries/schemaChecker.js.map +1 -0
  593. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  594. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  595. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  596. package/lib/index.d.ts +2 -2
  597. package/lib/index.d.ts.map +1 -1
  598. package/lib/index.js +2 -2
  599. package/lib/index.js.map +1 -1
  600. package/lib/legacy.d.ts +7 -0
  601. package/lib/packageVersion.d.ts +1 -1
  602. package/lib/packageVersion.js +1 -1
  603. package/lib/packageVersion.js.map +1 -1
  604. package/lib/shared-tree/independentView.d.ts +1 -1
  605. package/lib/shared-tree/independentView.d.ts.map +1 -1
  606. package/lib/shared-tree/independentView.js +11 -4
  607. package/lib/shared-tree/independentView.js.map +1 -1
  608. package/lib/shared-tree/index.d.ts +1 -1
  609. package/lib/shared-tree/index.d.ts.map +1 -1
  610. package/lib/shared-tree/index.js +1 -1
  611. package/lib/shared-tree/index.js.map +1 -1
  612. package/lib/shared-tree/sharedTree.d.ts +12 -60
  613. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  614. package/lib/shared-tree/sharedTree.js +70 -161
  615. package/lib/shared-tree/sharedTree.js.map +1 -1
  616. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
  617. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  618. package/lib/shared-tree/sharedTreeChangeCodecs.js +5 -6
  619. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  620. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  621. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  622. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  623. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  624. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  625. package/lib/shared-tree/treeAlpha.js +5 -3
  626. package/lib/shared-tree/treeAlpha.js.map +1 -1
  627. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  628. package/lib/shared-tree/treeCheckout.js +1 -3
  629. package/lib/shared-tree/treeCheckout.js.map +1 -1
  630. package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
  631. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  632. package/lib/shared-tree-core/editManagerCodecs.js +39 -17
  633. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  634. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
  635. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  636. package/lib/shared-tree-core/editManagerFormatCommons.js +39 -0
  637. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  638. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  639. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  640. package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
  641. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  642. package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  643. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  644. package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
  645. package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
  646. package/lib/shared-tree-core/index.d.ts +5 -3
  647. package/lib/shared-tree-core/index.d.ts.map +1 -1
  648. package/lib/shared-tree-core/index.js +4 -2
  649. package/lib/shared-tree-core/index.js.map +1 -1
  650. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  651. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  652. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  653. package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
  654. package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  655. package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
  656. package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
  657. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  658. package/lib/shared-tree-core/messageCodecs.js +46 -20
  659. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  660. package/lib/shared-tree-core/messageFormat.d.ts +48 -0
  661. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
  662. package/lib/shared-tree-core/messageFormat.js +50 -0
  663. package/lib/shared-tree-core/messageFormat.js.map +1 -0
  664. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
  665. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  666. package/lib/shared-tree-core/sharedTreeCore.js +3 -3
  667. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  668. package/lib/simple-tree/api/configuration.d.ts +2 -0
  669. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  670. package/lib/simple-tree/api/configuration.js +10 -0
  671. package/lib/simple-tree/api/configuration.js.map +1 -1
  672. package/lib/simple-tree/api/discrepancies.d.ts +2 -2
  673. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  674. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  675. package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
  676. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  677. package/lib/simple-tree/api/index.d.ts +4 -2
  678. package/lib/simple-tree/api/index.d.ts.map +1 -1
  679. package/lib/simple-tree/api/index.js +2 -0
  680. package/lib/simple-tree/api/index.js.map +1 -1
  681. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  682. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  683. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
  684. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  685. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  686. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  687. package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
  688. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  689. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  690. package/lib/simple-tree/api/schemaFromSimple.js +14 -5
  691. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  692. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  693. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  694. package/lib/simple-tree/api/simpleSchemaCodec.js +262 -0
  695. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  696. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  697. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  698. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
  699. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  700. package/lib/simple-tree/api/storedSchema.d.ts +2 -2
  701. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  702. package/lib/simple-tree/api/storedSchema.js +5 -3
  703. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  704. package/lib/simple-tree/api/tree.d.ts +3 -3
  705. package/lib/simple-tree/api/tree.js +1 -1
  706. package/lib/simple-tree/api/tree.js.map +1 -1
  707. package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
  708. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  709. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  710. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  711. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
  712. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  713. package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
  714. package/lib/simple-tree/core/allowedTypes.js +2 -2
  715. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  716. package/lib/simple-tree/core/index.d.ts +3 -3
  717. package/lib/simple-tree/core/index.d.ts.map +1 -1
  718. package/lib/simple-tree/core/index.js +2 -2
  719. package/lib/simple-tree/core/index.js.map +1 -1
  720. package/lib/simple-tree/core/toStored.d.ts +12 -5
  721. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  722. package/lib/simple-tree/core/toStored.js +25 -9
  723. package/lib/simple-tree/core/toStored.js.map +1 -1
  724. package/lib/simple-tree/core/treeNode.js +1 -1
  725. package/lib/simple-tree/core/treeNode.js.map +1 -1
  726. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
  727. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  728. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  729. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  730. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  731. package/lib/simple-tree/core/treeNodeValid.js +1 -2
  732. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  733. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  734. package/lib/simple-tree/fieldSchema.js +2 -9
  735. package/lib/simple-tree/fieldSchema.js.map +1 -1
  736. package/lib/simple-tree/index.d.ts +3 -2
  737. package/lib/simple-tree/index.d.ts.map +1 -1
  738. package/lib/simple-tree/index.js +2 -1
  739. package/lib/simple-tree/index.js.map +1 -1
  740. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  741. package/lib/simple-tree/leafNodeSchema.js +1 -2
  742. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  743. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  744. package/lib/simple-tree/node-kinds/array/arrayNode.js +17 -53
  745. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  746. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  747. package/lib/simple-tree/node-kinds/map/mapNode.js +5 -9
  748. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  749. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  750. package/lib/simple-tree/node-kinds/object/objectNode.js +6 -14
  751. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  752. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  753. package/lib/simple-tree/node-kinds/record/recordNode.js +6 -10
  754. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  755. package/lib/simple-tree/simpleSchema.d.ts +25 -5
  756. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  757. package/lib/simple-tree/simpleSchema.js.map +1 -1
  758. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  759. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  760. package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
  761. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  762. package/lib/simple-tree/toStoredSchema.d.ts +20 -8
  763. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  764. package/lib/simple-tree/toStoredSchema.js +28 -24
  765. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  766. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  767. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
  768. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  769. package/lib/tableSchema.d.ts +22 -52
  770. package/lib/tableSchema.d.ts.map +1 -1
  771. package/lib/tableSchema.js +143 -279
  772. package/lib/tableSchema.js.map +1 -1
  773. package/lib/treeFactory.d.ts +3 -1
  774. package/lib/treeFactory.d.ts.map +1 -1
  775. package/lib/treeFactory.js +23 -1
  776. package/lib/treeFactory.js.map +1 -1
  777. package/lib/util/arrayUtilities.d.ts +45 -0
  778. package/lib/util/arrayUtilities.d.ts.map +1 -0
  779. package/lib/util/arrayUtilities.js +69 -0
  780. package/lib/util/arrayUtilities.js.map +1 -0
  781. package/lib/util/brand.d.ts +31 -2
  782. package/lib/util/brand.d.ts.map +1 -1
  783. package/lib/util/brand.js +26 -1
  784. package/lib/util/brand.js.map +1 -1
  785. package/lib/util/brandedMap.d.ts +3 -1
  786. package/lib/util/brandedMap.d.ts.map +1 -1
  787. package/lib/util/brandedMap.js.map +1 -1
  788. package/lib/util/index.d.ts +2 -1
  789. package/lib/util/index.d.ts.map +1 -1
  790. package/lib/util/index.js +2 -1
  791. package/lib/util/index.js.map +1 -1
  792. package/package.json +24 -24
  793. package/src/api.ts +22 -11
  794. package/src/codec/codec.ts +25 -3
  795. package/src/codec/index.ts +1 -0
  796. package/src/codec/versioned/codec.ts +40 -2
  797. package/src/codec/versioned/index.ts +1 -0
  798. package/src/core/index.ts +1 -2
  799. package/src/core/schema-stored/index.ts +1 -2
  800. package/src/core/schema-stored/schema.ts +22 -8
  801. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  802. package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
  803. package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
  804. package/src/core/tree/detachedFieldIndexCodecs.ts +40 -11
  805. package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
  806. package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
  807. package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
  808. package/src/core/tree/index.ts +2 -4
  809. package/src/external-utilities/typeboxValidator.ts +1 -1
  810. package/src/feature-libraries/README.md +1 -1
  811. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
  812. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
  813. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  814. package/src/feature-libraries/chunked-forest/codec/codecs.ts +65 -27
  815. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +9 -4
  816. package/src/feature-libraries/chunked-forest/codec/format.ts +26 -5
  817. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
  818. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -2
  819. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
  820. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
  821. package/src/feature-libraries/chunked-forest/index.ts +1 -2
  822. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +88 -103
  823. package/src/feature-libraries/default-schema/index.ts +1 -9
  824. package/src/feature-libraries/forest-summary/codec.ts +24 -9
  825. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  826. package/src/feature-libraries/forest-summary/format.ts +25 -9
  827. package/src/feature-libraries/forest-summary/index.ts +2 -1
  828. package/src/feature-libraries/index.ts +8 -7
  829. package/src/feature-libraries/modular-schema/comparison.ts +2 -3
  830. package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
  831. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
  832. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
  833. package/src/feature-libraries/modular-schema/index.ts +0 -1
  834. package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
  835. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
  836. package/src/feature-libraries/object-forest/objectForest.ts +2 -6
  837. package/src/feature-libraries/optional-field/index.ts +1 -0
  838. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  839. package/src/feature-libraries/schema-edits/index.ts +0 -1
  840. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
  841. package/src/feature-libraries/schema-index/codec.ts +41 -22
  842. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  843. package/src/feature-libraries/schema-index/formatV2.ts +2 -2
  844. package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
  845. package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
  846. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
  847. package/src/index.ts +6 -2
  848. package/src/packageVersion.ts +1 -1
  849. package/src/shared-tree/independentView.ts +16 -5
  850. package/src/shared-tree/index.ts +0 -1
  851. package/src/shared-tree/sharedTree.ts +92 -222
  852. package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -13
  853. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
  854. package/src/shared-tree/treeAlpha.ts +6 -5
  855. package/src/shared-tree/treeCheckout.ts +1 -3
  856. package/src/shared-tree-core/editManagerCodecs.ts +69 -20
  857. package/src/shared-tree-core/editManagerFormatCommons.ts +46 -0
  858. package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
  859. package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
  860. package/src/shared-tree-core/index.ts +15 -5
  861. package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
  862. package/src/shared-tree-core/messageCodecV5.ts +2 -1
  863. package/src/shared-tree-core/messageCodecs.ts +77 -28
  864. package/src/shared-tree-core/messageFormat.ts +58 -0
  865. package/src/shared-tree-core/sharedTreeCore.ts +11 -13
  866. package/src/simple-tree/api/configuration.ts +17 -4
  867. package/src/simple-tree/api/discrepancies.ts +2 -2
  868. package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
  869. package/src/simple-tree/api/index.ts +11 -2
  870. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
  871. package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
  872. package/src/simple-tree/api/schemaFromSimple.ts +20 -9
  873. package/src/simple-tree/api/simpleSchemaCodec.ts +361 -0
  874. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
  875. package/src/simple-tree/api/storedSchema.ts +8 -5
  876. package/src/simple-tree/api/tree.ts +3 -3
  877. package/src/simple-tree/api/typesUnsafe.ts +6 -6
  878. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
  879. package/src/simple-tree/core/allowedTypes.ts +4 -4
  880. package/src/simple-tree/core/index.ts +3 -1
  881. package/src/simple-tree/core/toStored.ts +42 -18
  882. package/src/simple-tree/core/treeNode.ts +2 -2
  883. package/src/simple-tree/core/treeNodeSchema.ts +1 -7
  884. package/src/simple-tree/core/treeNodeValid.ts +0 -2
  885. package/src/simple-tree/fieldSchema.ts +2 -11
  886. package/src/simple-tree/index.ts +11 -2
  887. package/src/simple-tree/leafNodeSchema.ts +1 -2
  888. package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -77
  889. package/src/simple-tree/node-kinds/map/mapNode.ts +3 -17
  890. package/src/simple-tree/node-kinds/object/objectNode.ts +5 -20
  891. package/src/simple-tree/node-kinds/record/recordNode.ts +4 -18
  892. package/src/simple-tree/simpleSchema.ts +27 -5
  893. package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
  894. package/src/simple-tree/toStoredSchema.ts +54 -38
  895. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
  896. package/src/tableSchema.ts +110 -331
  897. package/src/treeFactory.ts +33 -1
  898. package/src/util/arrayUtilities.ts +88 -0
  899. package/src/util/brand.ts +40 -2
  900. package/src/util/brandedMap.ts +3 -1
  901. package/src/util/index.ts +7 -0
  902. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  903. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  904. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
  905. package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  906. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  907. package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  908. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  909. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  910. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
  911. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  912. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  913. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  914. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
  915. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  916. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  917. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  918. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
  919. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  920. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  921. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  922. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
  923. package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  924. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  925. package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  926. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  927. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  928. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
  929. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  930. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  931. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  932. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
  933. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  934. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  935. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  936. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
  937. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  938. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
  939. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
  940. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
  941. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,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AAA;IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,KAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC3C,MAAqD;IAErD,MAAM,CACL,iBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,QAuBX;AAvBD,WAAY,QAAQ;IACnB;;OAEG;IACH,qCAAO,CAAA;IACP;;OAEG;IACH,yCAAS,CAAA;IACT;;;;OAIG;IACH,2CAAU,CAAA;IACV;;OAEG;IACH,uCAAQ,CAAA;IACR;;OAEG;IACH,2CAAU,CAAA;AACX,CAAC,EAvBW,QAAQ,KAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,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 type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { InternalTreeNode, Unhydrated } from \"./types.js\";\nimport type { UnionToIntersection } from \"../../util/index.js\";\nimport type { AllowedTypesFullEvaluated, AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { Context } from \"./context.js\";\nimport type { FieldKey, NodeData, TreeNodeStoredSchema } from \"../../core/index.js\";\nimport type { UnhydratedFlexTreeField } from \"./unhydratedFlexTree.js\";\nimport type { FactoryContent } from \"../unhydratedFlexTreeFromInsertable.js\";\nimport type { StoredSchemaGenerationOptions } from \"./toStored.js\";\n\n/**\n * Schema for a {@link TreeNode} or {@link TreeLeafValue}.\n *\n * @typeParam Name - The full (including scope) name/identifier for the schema.\n * @typeParam Kind - Which kind of node this schema is for.\n * @typeParam TNode - API for nodes that use this schema.\n * @typeParam TBuild - Data which can be used to construct an {@link Unhydrated} node of this type.\n * @typeParam Info - Data used when defining this schema.\n * @remarks\n * Captures the schema both as runtime data and compile time type information.\n * Use {@link SchemaFactory} to define schema.\n * Use `Tree.schema(value)` to lookup the schema for a {@link TreeNode} or {@link TreeLeafValue}.\n * @privateRemarks\n * TODO:\n * The long lists of type parameters here are awkward to deal with.\n * Switching to (or adding an option to use)\n * an interface based pattern with unordered named parameters for types like this would be a good idea.\n * The related `@system` types should be simple to port to the new pattern, but stable public one like this will need to support both:\n * the new one could either be added as a system type, or be recommended to replace this one (deprecating it).\n * @sealed @public\n */\nexport type TreeNodeSchema<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTBuild = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> =\n\t| (TNode extends TreeNode\n\t\t\t? TreeNodeSchemaClass<\n\t\t\t\t\tName,\n\t\t\t\t\tKind,\n\t\t\t\t\tTNode,\n\t\t\t\t\tTBuild,\n\t\t\t\t\tImplicitlyConstructable,\n\t\t\t\t\tInfo,\n\t\t\t\t\tnever,\n\t\t\t\t\tTCustomMetadata\n\t\t\t\t>\n\t\t\t: never)\n\t| TreeNodeSchemaNonClass<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tTNode,\n\t\t\tTBuild,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t >;\n\n/**\n * Schema which is not a class.\n * @remarks\n * This is used for schema which cannot have their instances constructed using constructors, like leaf schema.\n * @privateRemarks\n * Non-class based schema can have issues with recursive types due to https://github.com/microsoft/TypeScript/issues/55832.\n * @system @sealed @public\n */\nexport type TreeNodeSchemaNonClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data?: TInsertable | TConstructorExtra): TNode;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data: TInsertable | TConstructorExtra): TNode;\n\t\t\t});\n\n/**\n * Tree node schema which is implemented using a class.\n * @remarks\n * Instances of this class are nodes in the tree.\n * This is also a constructor so that it can be subclassed.\n *\n * Using classes in this way allows introducing a named type and a named value at the same time, helping keep the runtime and compile time information together and easy to refer to un a uniform way.\n * Additionally, this works around https://github.com/microsoft/TypeScript/issues/55832 which causes similar patterns with less explicit types to infer \"any\" in the d.ts file.\n *\n * When sub-classing a a `TreeNodeSchemaClass`, some extra rules must be followed:\n *\n * - Only ever use a single class from the schema's class hierarchy within a document and its schema.\n * For example, if using {@link SchemaFactory.object} you can do:\n * ```typescript\n * // Recommended \"customizable\" object schema pattern.\n * class Good extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \tpublic exampleCustomMethod(): void {\n * \t\tthis.exampleField++;\n * \t}\n * }\n * ```\n * But should avoid:\n * ```typescript\n * // This by itself is ok, and opts into \"POJO mode\".\n * const base = schemaFactory.object(\"A\", {});\n * // This is a bad pattern since it leaves two classes in scope which derive from the same SchemaFactory defined class.\n * // If both get used, its an error!\n * class Invalid extends base {}\n * ```\n *\n * - Do not modify the constructor input parameter types or values:\n * ```typescript\n * class Invalid extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \t// This Modifies the type of the constructor input.\n * \t// This is unsupported due to programmatic access to the constructor being used internally.\n * \tpublic constructor(a: number) {\n * \t\tsuper({ exampleField: a });\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport type TreeNodeSchemaClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t});\n\n/**\n * Internal helper for utilities that return schema which can be used in class and non class formats depending on the API exposing it.\n */\nexport type TreeNodeSchemaBoth<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode,\n\tTInsertable,\n\tImplicitlyConstructable,\n\tInfo,\n\tTConstructorExtra,\n\tTCustomMetadata\n> &\n\tTreeNodeSchemaNonClass<\n\t\tName,\n\t\tKind,\n\t\tTNode,\n\t\tTInsertable,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTConstructorExtra,\n\t\tTCustomMetadata\n\t>;\n\n/**\n * Data common to all tree node schema.\n *\n * @remarks\n * Implementation detail of {@link TreeNodeSchema} which should be accessed instead of referring to this type directly.\n *\n * @privateRemarks\n * All implementations must implement {@link TreeNodeSchemaCorePrivate} as well.\n *\n * @sealed @public\n */\nexport interface TreeNodeSchemaCore<\n\tout Name extends string,\n\tout Kind extends NodeKind,\n\tout ImplicitlyConstructable extends boolean,\n\tout Info = unknown,\n\tout TInsertable = never,\n\tout TCustomMetadata = unknown,\n> extends SimpleNodeSchemaBase<Kind, TCustomMetadata> {\n\t/**\n\t * Unique (within a document's schema) identifier used to associate nodes with their schema.\n\t * @remarks\n\t * This is used when encoding nodes, and when decoding nodes to re-associate them with the schema.\n\t * Since this decoding may happen in a different version of the application (or even a different application altogether),\n\t * this identifier should generally correspond to some specific semantics for the data (how to interpret the node with this identifier).\n\t * Any time the semantics change such that data would be misinterpreted if the old semantics were applied\n\t * (for example the units of a value are changed),\n\t * it is best practice to pick a new identifier.\n\t */\n\treadonly identifier: Name;\n\n\t/**\n\t * Data used to define this schema.\n\t *\n\t * @remarks\n\t * The format depends on the kind of node it is for.\n\t * For example, the \"object\" node kind could store the field schema here.\n\t */\n\treadonly info: Info;\n\n\t/**\n\t * When constructing insertable content,\n\t * data that could be passed to the node's constructor can be used instead of an {@link Unhydrated} node\n\t * iff implicitlyConstructable is true.\n\t * @privateRemarks\n\t * Currently the logic for traversing insertable content,\n\t * both to build trees and to hydrate them does not defer to the schema classes to handle the policy,\n\t * so if their constructors differ from what is supported, some cases will not work.\n\t * Setting this to false adjusts the insertable types to disallow cases which could be impacted by these inconsistencies.\n\t */\n\treadonly implicitlyConstructable: ImplicitlyConstructable;\n\n\t/**\n\t * All possible schema that a direct child of a node with this schema could have.\n\t *\n\t * Equivalently, this is also all schema directly referenced when defining this schema's allowed child types,\n\t * which is also the same as the set of schema referenced directly by the `Info` type parameter and the `info` property.\n\t * This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.\n\t * @remarks\n\t * Some kinds of nodes may have additional restrictions on children:\n\t * this set simply enumerates all directly referenced schema, and can be use to walk over all referenced schema types.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this set.\n\t * @privateRemarks\n\t * Currently there isn't much use for this in the public API,\n\t * and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.\n\t * To keep options option, this is marked `@system` for now.\n\t * @system\n\t */\n\treadonly childTypes: ReadonlySet<TreeNodeSchema>;\n\n\t/**\n\t * Constructs an instance of this node type.\n\t * @remarks\n\t * Due to TypeScript limitations, the return type of this method can not be very specific.\n\t * For {@link TreeNodeSchemaClass} prefer using the constructor directly for better typing.\n\t * For {@link TreeNodeSchemaNonClass} use `create`.\n\t *\n\t * @privateRemarks\n\t * This method signature provides a way to infer `TInsertable` without relying on the constructor, and to construct nodes from schema of unknown kind.\n\t * This makes customizations of the constructor not impact the typing of insertable content, allowing customization of the constructor,\n\t * as long as doing so only adds additional supported cases.\n\t *\n\t * This cannot be required to return `TNode`:\n\t * doing so breaks sub-classing of schema since they don't overload this method with a more specific return type.\n\t * @sealed @system\n\t */\n\tcreateFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;\n}\n\n/**\n * Symbol for use by {@link TreeNodeSchemaCorePrivate}.\n */\nexport const privateDataSymbol = Symbol(\"PrivateData\");\n\n/**\n * {@link TreeNodeSchemaCore} extended with some non-exported APIs.\n */\nexport interface TreeNodeSchemaCorePrivate<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> extends TreeNodeSchemaCore<\n\t\tName,\n\t\tKind,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTInsertable,\n\t\tTCustomMetadata\n\t> {\n\t/**\n\t * Package private data provided by all {@link TreeNodeSchema}.\n\t * @remarks\n\t * Users can add custom statics to schema classes.\n\t * To reduce the risk of such statics colliding with properties used to implement the schema,\n\t * some of the private APIs are grouped together under this symbol.\n\t *\n\t * Note that there are still some properties which are not under a symbol and thus expose some risk of name collisions.\n\t * See {@link TreeNodeValid} for some such properties.\n\t */\n\treadonly [privateDataSymbol]: TreeNodeSchemaPrivateData;\n}\n\n/**\n * Package private data provided by all {@link TreeNodeSchema}.\n * @remarks\n * This data needs to be available before lazy schema references are resolved.\n * For data which is only available after lazy schema references are resolved,\n * see {@link TreeNodeSchemaInitializedData}, which can be accessed via {@link TreeNodeSchemaPrivateData.idempotentInitialize}.\n */\nexport interface TreeNodeSchemaPrivateData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAllowedTypes: readonly AllowedTypesFull[];\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tidempotentInitialize(): TreeNodeSchemaInitializedData;\n\n\t/**\n\t * Converts a the schema into a {@link TreeNodeStoredSchema}.\n\t */\n\ttoStored(options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;\n}\n\n/**\n * Additional data about a given schema which is private to this package.\n * @remarks\n * Created by {@link TreeNodeValid.oneTimeSetup} and can involve dereferencing lazy schema references.\n */\nexport interface TreeNodeSchemaInitializedData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAllowedTypes: readonly AllowedTypesFullEvaluated[];\n\n\t/**\n\t * A {@link Context} which can be used for unhydrated nodes of this schema.\n\t */\n\treadonly context: Context;\n\n\t/**\n\t * Checks if data might be schema-compatible.\n\t *\n\t * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n\t *\n\t * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n\t */\n\tshallowCompatibilityTest(data: FactoryContent): CompatibilityLevel;\n\n\t/**\n\t * Convert data to a {@link FlexContent} representation.\n\t * @remarks\n\t * Data must be compatible with the schema according to {@link shallowCompatibilityTest}.\n\t *\n\t * TODO: use of `allowedTypes` is for fallbacks (for example NaN -\\> null).\n\t * This behavior should be moved to shallowCompatibilityTest instead.\n\t */\n\ttoFlexContent(data: FactoryContent, allowedTypes: ReadonlySet<TreeNodeSchema>): FlexContent;\n}\n\nexport type FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Each schema allowed at a location in the tree has its compatibility level checked against the data being inserted.\n * The compatibility is considered unambiguous if there is a single schema with a higher compatibility than all others.\n *\n * This approach allows adding new compatible formats as a non breaking change.\n * If the new format was already compatible with some other schema, it can still be added as non-breaking as long as a lower compatibility level is used.\n * For example, support for constructing maps from record like objects was added in Fluid Framework 2.2.\n * This format (an object with fields) was already compatible with Object nodes at compatibility level Normal so the new format support for maps was added at compatibility level Low.\n * This ensures that existing code that was using object literals as insertable content where both objects and maps were allowed will continue to work,\n * assuming the objects are intended as ObjectNodes.\n * However new code can now be written using record like objects to construct maps, as long as the schema does not also allow Object nodes which are compatible with the data in that location.\n *\n * @see {@link ITreeConfigurationOptions.preventAmbiguity} for a related setting which interacts with this in a somewhat complex way.\n */\nexport enum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Downcasts a {@link TreeNodeSchemaCore} to {@link TreeNodeSchemaCorePrivate} and get its {@link TreeNodeSchemaPrivateData}.\n */\nexport function getTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): TreeNodeSchemaPrivateData {\n\tassert(\n\t\tprivateDataSymbol in schema,\n\t\t0xbc9 /* All implementations of TreeNodeSchemaCore must also implement TreeNodeSchemaCorePrivate */,\n\t);\n\tconst schemaValid = schema as TreeNodeSchemaCorePrivate;\n\treturn schemaValid[privateDataSymbol];\n}\n\n/**\n * Kind of tree node.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * @public\n */\nexport enum NodeKind {\n\t/**\n\t * A node which serves as a map, storing children under string keys.\n\t */\n\tMap = 0,\n\t/**\n\t * A node which serves as an array, storing children in an ordered sequence.\n\t */\n\tArray = 1,\n\t/**\n\t * A node which stores a heterogenous collection of children in named fields.\n\t * @remarks\n\t * Each field gets its own schema.\n\t */\n\tObject = 2,\n\t/**\n\t * A node which stores a single leaf value.\n\t */\n\tLeaf = 3,\n\t/**\n\t * A node which serves as a record, storing children under string keys.\n\t */\n\tRecord = 4,\n}\n\n/**\n * Metadata associated with a Node Schema.\n *\n * @remarks Specified via {@link NodeSchemaOptions.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaMetadata<out TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata | undefined;\n\n\t/**\n\t * The description of the Node Schema.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the kind of node is useful.\n\t * E.g., when converting a Node Schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` property.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.\n * @internal\n */\nexport function isTreeNodeSchemaClass<\n\tName extends string,\n\tKind extends NodeKind,\n\tTNode extends TreeNode | TreeLeafValue,\n\tTBuild,\n\tImplicitlyConstructable extends boolean,\n\tInfo,\n>(\n\tschema:\n\t\t| TreeNodeSchema<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaClass<Name, Kind, TNode & TreeNode, TBuild, ImplicitlyConstructable, Info>,\n): schema is TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode & TreeNode,\n\tTBuild,\n\tImplicitlyConstructable,\n\tInfo\n> {\n\treturn schema.constructor !== undefined;\n}\n\n/**\n * Takes in `TreeNodeSchema[]` and returns a TypedNode union.\n * @privateRemarks\n * If a schema is both TreeNodeSchemaClass and TreeNodeSchemaNonClass, prefer TreeNodeSchemaClass since that includes subclasses properly.\n * @public\n */\nexport type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaClass<\n\tstring,\n\tNodeKind,\n\tinfer TNode\n>\n\t? TNode\n\t: T extends TreeNodeSchemaNonClass<string, NodeKind, infer TNode>\n\t\t? TNode\n\t\t: never;\n\n/**\n * Data which can be used as a node to be inserted.\n * Either an unhydrated node, or content to build a new node.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam T - Do not specify: default value used as implementation detail.\n * @privateRemarks\n * This can't really be fully correct, since TreeNodeSchema's TNode is generally use covariantly but this code uses it contravariantly.\n * That makes this TreeNodeSchema actually invariant with respect to TNode, but doing that would break all `extends TreeNodeSchema` clauses.\n * As is, this works correctly in most realistic use-cases.\n *\n * One special case this makes is if the result of NodeFromSchema contains TreeNode, this must be an under constrained schema, so the result is set to never.\n * Note that applying UnionToIntersection on the result of NodeFromSchema<T> does not work since it breaks booleans.\n *\n * @public\n */\nexport type InsertableTypedNode<\n\tTSchema extends TreeNodeSchema,\n\tT = UnionToIntersection<TSchema>,\n> =\n\t| (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t? NodeBuilderData<T>\n\t\t\t: never)\n\t| (T extends TreeNodeSchema\n\t\t\t? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>>\n\t\t\t: never);\n\n/**\n * Given a node's schema, return the corresponding object from which the node could be built.\n * @privateRemarks\n * This uses TreeNodeSchemaCore, and thus depends on TreeNodeSchemaCore.createFromInsertable for the typing.\n * This works almost the same as using TreeNodeSchema,\n * except that the more complex typing in TreeNodeSchema case breaks for non-class schema and leaks in `undefined` from optional crete parameters.\n * @system @public\n */\nexport type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> =\n\tT extends TreeNodeSchemaCore<string, NodeKind, boolean, unknown, infer TBuild>\n\t\t? TBuild\n\t\t: never;\n\n/**\n * Value that may be stored as a leaf node.\n * @remarks\n * Some limitations apply, see the documentation for {@link SchemaStatics.number} and {@link SchemaStatics.string} for those restrictions.\n * @public\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport type TreeLeafValue = number | string | boolean | IFluidHandle | null;\n"]}
1
+ {"version":3,"file":"treeNodeSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAqU7D;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AA6GvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAN,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC7B;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,yDAAO,CAAA;IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,KAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC3C,MAAqD;IAErD,MAAM,CACL,iBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,QAuBX;AAvBD,WAAY,QAAQ;IACnB;;OAEG;IACH,qCAAO,CAAA;IACP;;OAEG;IACH,yCAAS,CAAA;IACT;;;;OAIG;IACH,2CAAU,CAAA;IACV;;OAEG;IACH,uCAAQ,CAAA;IACR;;OAEG;IACH,2CAAU,CAAA;AACX,CAAC,EAvBW,QAAQ,KAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,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 type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { InternalTreeNode, Unhydrated } from \"./types.js\";\nimport type { UnionToIntersection } from \"../../util/index.js\";\nimport type { AllowedTypesFullEvaluated, AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { Context } from \"./context.js\";\nimport type { FieldKey, NodeData } from \"../../core/index.js\";\nimport type { UnhydratedFlexTreeField } from \"./unhydratedFlexTree.js\";\nimport type { FactoryContent } from \"../unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Schema for a {@link TreeNode} or {@link TreeLeafValue}.\n *\n * @typeParam Name - The full (including scope) name/identifier for the schema.\n * @typeParam Kind - Which kind of node this schema is for.\n * @typeParam TNode - API for nodes that use this schema.\n * @typeParam TBuild - Data which can be used to construct an {@link Unhydrated} node of this type.\n * @typeParam Info - Data used when defining this schema.\n * @remarks\n * Captures the schema both as runtime data and compile time type information.\n * Use {@link SchemaFactory} to define schema.\n * Use `Tree.schema(value)` to lookup the schema for a {@link TreeNode} or {@link TreeLeafValue}.\n * @privateRemarks\n * TODO:\n * The long lists of type parameters here are awkward to deal with.\n * Switching to (or adding an option to use)\n * an interface based pattern with unordered named parameters for types like this would be a good idea.\n * The related `@system` types should be simple to port to the new pattern, but stable public one like this will need to support both:\n * the new one could either be added as a system type, or be recommended to replace this one (deprecating it).\n * @sealed @public\n */\nexport type TreeNodeSchema<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTBuild = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> =\n\t| (TNode extends TreeNode\n\t\t\t? TreeNodeSchemaClass<\n\t\t\t\t\tName,\n\t\t\t\t\tKind,\n\t\t\t\t\tTNode,\n\t\t\t\t\tTBuild,\n\t\t\t\t\tImplicitlyConstructable,\n\t\t\t\t\tInfo,\n\t\t\t\t\tnever,\n\t\t\t\t\tTCustomMetadata\n\t\t\t\t>\n\t\t\t: never)\n\t| TreeNodeSchemaNonClass<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tTNode,\n\t\t\tTBuild,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t >;\n\n/**\n * Schema which is not a class.\n * @remarks\n * This is used for schema which cannot have their instances constructed using constructors, like leaf schema.\n * @privateRemarks\n * Non-class based schema can have issues with recursive types due to https://github.com/microsoft/TypeScript/issues/55832.\n * @system @sealed @public\n */\nexport type TreeNodeSchemaNonClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data?: TInsertable | TConstructorExtra): TNode;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data: TInsertable | TConstructorExtra): TNode;\n\t\t\t});\n\n/**\n * Tree node schema which is implemented using a class.\n * @remarks\n * Instances of this class are nodes in the tree.\n * This is also a constructor so that it can be subclassed.\n *\n * Using classes in this way allows introducing a named type and a named value at the same time, helping keep the runtime and compile time information together and easy to refer to un a uniform way.\n * Additionally, this works around https://github.com/microsoft/TypeScript/issues/55832 which causes similar patterns with less explicit types to infer \"any\" in the d.ts file.\n *\n * When sub-classing a a `TreeNodeSchemaClass`, some extra rules must be followed:\n *\n * - Only ever use a single class from the schema's class hierarchy within a document and its schema.\n * For example, if using {@link SchemaFactory.object} you can do:\n * ```typescript\n * // Recommended \"customizable\" object schema pattern.\n * class Good extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \tpublic exampleCustomMethod(): void {\n * \t\tthis.exampleField++;\n * \t}\n * }\n * ```\n * But should avoid:\n * ```typescript\n * // This by itself is ok, and opts into \"POJO mode\".\n * const base = schemaFactory.object(\"A\", {});\n * // This is a bad pattern since it leaves two classes in scope which derive from the same SchemaFactory defined class.\n * // If both get used, its an error!\n * class Invalid extends base {}\n * ```\n *\n * - Do not modify the constructor input parameter types or values:\n * ```typescript\n * class Invalid extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \t// This Modifies the type of the constructor input.\n * \t// This is unsupported due to programmatic access to the constructor being used internally.\n * \tpublic constructor(a: number) {\n * \t\tsuper({ exampleField: a });\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport type TreeNodeSchemaClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t});\n\n/**\n * Internal helper for utilities that return schema which can be used in class and non class formats depending on the API exposing it.\n */\nexport type TreeNodeSchemaBoth<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode,\n\tTInsertable,\n\tImplicitlyConstructable,\n\tInfo,\n\tTConstructorExtra,\n\tTCustomMetadata\n> &\n\tTreeNodeSchemaNonClass<\n\t\tName,\n\t\tKind,\n\t\tTNode,\n\t\tTInsertable,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTConstructorExtra,\n\t\tTCustomMetadata\n\t>;\n\n/**\n * Data common to all tree node schema.\n *\n * @remarks\n * Implementation detail of {@link TreeNodeSchema} which should be accessed instead of referring to this type directly.\n *\n * @privateRemarks\n * All implementations must implement {@link TreeNodeSchemaCorePrivate} as well.\n *\n * @sealed @public\n */\nexport interface TreeNodeSchemaCore<\n\tout Name extends string,\n\tout Kind extends NodeKind,\n\tout ImplicitlyConstructable extends boolean,\n\tout Info = unknown,\n\tout TInsertable = never,\n\tout TCustomMetadata = unknown,\n> extends SimpleNodeSchemaBase<Kind, TCustomMetadata> {\n\t/**\n\t * Unique (within a document's schema) identifier used to associate nodes with their schema.\n\t * @remarks\n\t * This is used when encoding nodes, and when decoding nodes to re-associate them with the schema.\n\t * Since this decoding may happen in a different version of the application (or even a different application altogether),\n\t * this identifier should generally correspond to some specific semantics for the data (how to interpret the node with this identifier).\n\t * Any time the semantics change such that data would be misinterpreted if the old semantics were applied\n\t * (for example the units of a value are changed),\n\t * it is best practice to pick a new identifier.\n\t */\n\treadonly identifier: Name;\n\n\t/**\n\t * Data used to define this schema.\n\t *\n\t * @remarks\n\t * The format depends on the kind of node it is for.\n\t * For example, the \"object\" node kind could store the field schema here.\n\t */\n\treadonly info: Info;\n\n\t/**\n\t * When constructing insertable content,\n\t * data that could be passed to the node's constructor can be used instead of an {@link Unhydrated} node\n\t * iff implicitlyConstructable is true.\n\t * @privateRemarks\n\t * Currently the logic for traversing insertable content,\n\t * both to build trees and to hydrate them does not defer to the schema classes to handle the policy,\n\t * so if their constructors differ from what is supported, some cases will not work.\n\t * Setting this to false adjusts the insertable types to disallow cases which could be impacted by these inconsistencies.\n\t */\n\treadonly implicitlyConstructable: ImplicitlyConstructable;\n\n\t/**\n\t * All possible schema that a direct child of a node with this schema could have.\n\t *\n\t * Equivalently, this is also all schema directly referenced when defining this schema's allowed child types,\n\t * which is also the same as the set of schema referenced directly by the `Info` type parameter and the `info` property.\n\t * This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.\n\t * @remarks\n\t * Some kinds of nodes may have additional restrictions on children:\n\t * this set simply enumerates all directly referenced schema, and can be use to walk over all referenced schema types.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this set.\n\t * @privateRemarks\n\t * Currently there isn't much use for this in the public API,\n\t * and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.\n\t * To keep options option, this is marked `@system` for now.\n\t * @system\n\t */\n\treadonly childTypes: ReadonlySet<TreeNodeSchema>;\n\n\t/**\n\t * Constructs an instance of this node type.\n\t * @remarks\n\t * Due to TypeScript limitations, the return type of this method can not be very specific.\n\t * For {@link TreeNodeSchemaClass} prefer using the constructor directly for better typing.\n\t * For {@link TreeNodeSchemaNonClass} use `create`.\n\t *\n\t * @privateRemarks\n\t * This method signature provides a way to infer `TInsertable` without relying on the constructor, and to construct nodes from schema of unknown kind.\n\t * This makes customizations of the constructor not impact the typing of insertable content, allowing customization of the constructor,\n\t * as long as doing so only adds additional supported cases.\n\t *\n\t * This cannot be required to return `TNode`:\n\t * doing so breaks sub-classing of schema since they don't overload this method with a more specific return type.\n\t * @sealed @system\n\t */\n\tcreateFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;\n}\n\n/**\n * Symbol for use by {@link TreeNodeSchemaCorePrivate}.\n */\nexport const privateDataSymbol = Symbol(\"PrivateData\");\n\n/**\n * {@link TreeNodeSchemaCore} extended with some non-exported APIs.\n */\nexport interface TreeNodeSchemaCorePrivate<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> extends TreeNodeSchemaCore<\n\t\tName,\n\t\tKind,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTInsertable,\n\t\tTCustomMetadata\n\t> {\n\t/**\n\t * Package private data provided by all {@link TreeNodeSchema}.\n\t * @remarks\n\t * Users can add custom statics to schema classes.\n\t * To reduce the risk of such statics colliding with properties used to implement the schema,\n\t * some of the private APIs are grouped together under this symbol.\n\t *\n\t * Note that there are still some properties which are not under a symbol and thus expose some risk of name collisions.\n\t * See {@link TreeNodeValid} for some such properties.\n\t */\n\treadonly [privateDataSymbol]: TreeNodeSchemaPrivateData;\n}\n\n/**\n * Package private data provided by all {@link TreeNodeSchema}.\n * @remarks\n * This data needs to be available before lazy schema references are resolved.\n * For data which is only available after lazy schema references are resolved,\n * see {@link TreeNodeSchemaInitializedData}, which can be accessed via {@link TreeNodeSchemaPrivateData.idempotentInitialize}.\n */\nexport interface TreeNodeSchemaPrivateData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAllowedTypes: readonly AllowedTypesFull[];\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tidempotentInitialize(): TreeNodeSchemaInitializedData;\n}\n\n/**\n * Additional data about a given schema which is private to this package.\n * @remarks\n * Created by {@link TreeNodeValid.oneTimeSetup} and can involve dereferencing lazy schema references.\n */\nexport interface TreeNodeSchemaInitializedData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAllowedTypes: readonly AllowedTypesFullEvaluated[];\n\n\t/**\n\t * A {@link Context} which can be used for unhydrated nodes of this schema.\n\t */\n\treadonly context: Context;\n\n\t/**\n\t * Checks if data might be schema-compatible.\n\t *\n\t * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n\t *\n\t * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n\t */\n\tshallowCompatibilityTest(data: FactoryContent): CompatibilityLevel;\n\n\t/**\n\t * Convert data to a {@link FlexContent} representation.\n\t * @remarks\n\t * Data must be compatible with the schema according to {@link shallowCompatibilityTest}.\n\t *\n\t * TODO: use of `allowedTypes` is for fallbacks (for example NaN -\\> null).\n\t * This behavior should be moved to shallowCompatibilityTest instead.\n\t */\n\ttoFlexContent(data: FactoryContent, allowedTypes: ReadonlySet<TreeNodeSchema>): FlexContent;\n}\n\nexport type FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Each schema allowed at a location in the tree has its compatibility level checked against the data being inserted.\n * The compatibility is considered unambiguous if there is a single schema with a higher compatibility than all others.\n *\n * This approach allows adding new compatible formats as a non breaking change.\n * If the new format was already compatible with some other schema, it can still be added as non-breaking as long as a lower compatibility level is used.\n * For example, support for constructing maps from record like objects was added in Fluid Framework 2.2.\n * This format (an object with fields) was already compatible with Object nodes at compatibility level Normal so the new format support for maps was added at compatibility level Low.\n * This ensures that existing code that was using object literals as insertable content where both objects and maps were allowed will continue to work,\n * assuming the objects are intended as ObjectNodes.\n * However new code can now be written using record like objects to construct maps, as long as the schema does not also allow Object nodes which are compatible with the data in that location.\n *\n * @see {@link ITreeConfigurationOptions.preventAmbiguity} for a related setting which interacts with this in a somewhat complex way.\n */\nexport enum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Downcasts a {@link TreeNodeSchemaCore} to {@link TreeNodeSchemaCorePrivate} and get its {@link TreeNodeSchemaPrivateData}.\n */\nexport function getTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): TreeNodeSchemaPrivateData {\n\tassert(\n\t\tprivateDataSymbol in schema,\n\t\t0xbc9 /* All implementations of TreeNodeSchemaCore must also implement TreeNodeSchemaCorePrivate */,\n\t);\n\tconst schemaValid = schema as TreeNodeSchemaCorePrivate;\n\treturn schemaValid[privateDataSymbol];\n}\n\n/**\n * Kind of tree node.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * @public\n */\nexport enum NodeKind {\n\t/**\n\t * A node which serves as a map, storing children under string keys.\n\t */\n\tMap = 0,\n\t/**\n\t * A node which serves as an array, storing children in an ordered sequence.\n\t */\n\tArray = 1,\n\t/**\n\t * A node which stores a heterogenous collection of children in named fields.\n\t * @remarks\n\t * Each field gets its own schema.\n\t */\n\tObject = 2,\n\t/**\n\t * A node which stores a single leaf value.\n\t */\n\tLeaf = 3,\n\t/**\n\t * A node which serves as a record, storing children under string keys.\n\t */\n\tRecord = 4,\n}\n\n/**\n * Metadata associated with a Node Schema.\n *\n * @remarks Specified via {@link NodeSchemaOptions.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaMetadata<out TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata | undefined;\n\n\t/**\n\t * The description of the Node Schema.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the kind of node is useful.\n\t * E.g., when converting a Node Schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` property.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.\n * @internal\n */\nexport function isTreeNodeSchemaClass<\n\tName extends string,\n\tKind extends NodeKind,\n\tTNode extends TreeNode | TreeLeafValue,\n\tTBuild,\n\tImplicitlyConstructable extends boolean,\n\tInfo,\n>(\n\tschema:\n\t\t| TreeNodeSchema<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaClass<Name, Kind, TNode & TreeNode, TBuild, ImplicitlyConstructable, Info>,\n): schema is TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode & TreeNode,\n\tTBuild,\n\tImplicitlyConstructable,\n\tInfo\n> {\n\treturn schema.constructor !== undefined;\n}\n\n/**\n * Takes in `TreeNodeSchema[]` and returns a TypedNode union.\n * @privateRemarks\n * If a schema is both TreeNodeSchemaClass and TreeNodeSchemaNonClass, prefer TreeNodeSchemaClass since that includes subclasses properly.\n * @public\n */\nexport type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaClass<\n\tstring,\n\tNodeKind,\n\tinfer TNode\n>\n\t? TNode\n\t: T extends TreeNodeSchemaNonClass<string, NodeKind, infer TNode>\n\t\t? TNode\n\t\t: never;\n\n/**\n * Data which can be used as a node to be inserted.\n * Either an unhydrated node, or content to build a new node.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam T - Do not specify: default value used as implementation detail.\n * @privateRemarks\n * This can't really be fully correct, since TreeNodeSchema's TNode is generally use covariantly but this code uses it contravariantly.\n * That makes this TreeNodeSchema actually invariant with respect to TNode, but doing that would break all `extends TreeNodeSchema` clauses.\n * As is, this works correctly in most realistic use-cases.\n *\n * One special case this makes is if the result of NodeFromSchema contains TreeNode, this must be an under constrained schema, so the result is set to never.\n * Note that applying UnionToIntersection on the result of NodeFromSchema<T> does not work since it breaks booleans.\n *\n * @public\n */\nexport type InsertableTypedNode<\n\tTSchema extends TreeNodeSchema,\n\tT = UnionToIntersection<TSchema>,\n> =\n\t| (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t? NodeBuilderData<T>\n\t\t\t: never)\n\t| (T extends TreeNodeSchema\n\t\t\t? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>>\n\t\t\t: never);\n\n/**\n * Given a node's schema, return the corresponding object from which the node could be built.\n * @privateRemarks\n * This uses TreeNodeSchemaCore, and thus depends on TreeNodeSchemaCore.createFromInsertable for the typing.\n * This works almost the same as using TreeNodeSchema,\n * except that the more complex typing in TreeNodeSchema case breaks for non-class schema and leaks in `undefined` from optional crete parameters.\n * @system @public\n */\nexport type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> =\n\tT extends TreeNodeSchemaCore<string, NodeKind, boolean, unknown, infer TBuild>\n\t\t? TBuild\n\t\t: never;\n\n/**\n * Value that may be stored as a leaf node.\n * @remarks\n * Some limitations apply, see the documentation for {@link SchemaStatics.number} and {@link SchemaStatics.string} for those restrictions.\n * @public\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport type TreeLeafValue = number | string | boolean | IFluidHandle | null;\n"]}
@@ -107,5 +107,5 @@ export declare function isClassBasedSchema(schema: SimpleNodeSchemaBase<NodeKind
107
107
  * @remarks
108
108
  * Such schema must extends {@link TreeNodeValid}.
109
109
  */
110
- export declare function createTreeNodeSchemaPrivateData(schema: TreeNodeSchemaCore<string, NodeKind, boolean>, childAllowedTypes: readonly AllowedTypesFull[], toStored: TreeNodeSchemaPrivateData["toStored"]): TreeNodeSchemaPrivateData;
110
+ export declare function createTreeNodeSchemaPrivateData(schema: TreeNodeSchemaCore<string, NodeKind, boolean>, childAllowedTypes: readonly AllowedTypesFull[]): TreeNodeSchemaPrivateData;
111
111
  //# sourceMappingURL=treeNodeValid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeValid.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAkC,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACN,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAAC,MAAM,CAAE,SAAQ,QAAQ;IAC3D;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EACjC,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,YAAY,GACjB,aAAa,CAAC,CAAC,CAAC;IAInB;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAC9B,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,CAAC,GACN,sBAAsB;IAIzB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAC9B,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,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AAE,QAAQ,EAAE,OAAO,CAAC,EACrD,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,GAC5C,yBAAyB,CAU3B"}
@@ -164,7 +164,7 @@ export function isClassBasedSchema(schema) {
164
164
  * @remarks
165
165
  * Such schema must extends {@link TreeNodeValid}.
166
166
  */
167
- export function createTreeNodeSchemaPrivateData(schema, childAllowedTypes, toStored) {
167
+ export function createTreeNodeSchemaPrivateData(schema, childAllowedTypes) {
168
168
  const schemaValid = schemaAsTreeNodeValid(schema);
169
169
  // Since this closes over the schema, ensure this schema is marked as most derived
170
170
  // so if some other subclass is used later, it will error instead of giving inconsistent results.
@@ -172,7 +172,6 @@ export function createTreeNodeSchemaPrivateData(schema, childAllowedTypes, toSto
172
172
  return {
173
173
  idempotentInitialize: () => schemaValid.oneTimeInitialize().oneTimeInitialized,
174
174
  childAllowedTypes,
175
- toStored,
176
175
  };
177
176
  }
178
177
  // #region NodeJS custom inspect for TreeNodes.
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeValid.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAqB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACN,QAAQ,GAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,gCAAgC,EAChC,UAAU,EACV,cAAc,GAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAsB,SAA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AAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,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\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type FlexTreeNode, isFlexTreeNode } from \"../../feature-libraries/index.js\";\n\nimport { inPrototypeChain, privateToken, TreeNode } from \"./treeNode.js\";\nimport { UnhydratedFlexTreeNode } from \"./unhydratedFlexTree.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaPrivateData,\n} from \"./treeNodeSchema.js\";\nimport {\n\tgetSimpleNodeSchemaFromInnerNode,\n\tisTreeNode,\n\tTreeNodeKernel,\n\ttype InnerNode,\n} from \"./treeNodeKernel.js\";\nimport type { InternalTreeNode } from \"./types.js\";\nimport { typeSchemaSymbol } from \"./withType.js\";\nimport type { AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\n\n/**\n * Class which all {@link TreeNode}s must extend.\n * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.\n *\n * This has static members which schema classes can override to provide schema specific functionality.\n * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.\n * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.\n */\nexport abstract class TreeNodeValid<TInput> extends TreeNode {\n\t/**\n\t * Schema classes can override this to control what happens at the end of the constructor.\n\t * The return value from this is returned from the constructor, allowing substituting a proxy if desired.\n\t *\n\t * This is not simply done in the derived constructor to enable:\n\t * - this class to access the value which is being returned before it's returned from the constructor.\n\t * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.\n\t */\n\tprotected static prepareInstance<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: FlexTreeNode,\n\t): TreeNodeValid<T> {\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Schema classes must override to provide an implementation of RawTreeNode construction.\n\t */\n\tprotected static buildRawNode<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: T,\n\t): UnhydratedFlexTreeNode {\n\t\treturn fail(0xae4 /* Schema must override buildRawNode */);\n\t}\n\n\t/**\n\t * Schema classes can override to provide a callback that is called once when the first node is constructed.\n\t * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.\n\t * @remarks\n\t * It is valid to dereference LazyItem schema references in this function (or anything that runs after it).\n\t */\n\tprotected static oneTimeSetup<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t): TreeNodeSchemaInitializedData {\n\t\tfail(0xae5 /* Missing oneTimeSetup */);\n\t}\n\n\t/**\n\t * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.\n\t * @remarks\n\t * Captured when an instance is constructed.\n\t *\n\t * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single \"most derived\" class (the constructor actually invoked the the user with `new`).\n\t *\n\t * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.\n\t *\n\t * Also used to detect if oneTimeSetup has run.\n\t *\n\t * @privateRemarks\n\t * This defaults to \"default\", which is used to trigger an error if not overridden in the derived class.\n\t *\n\t * The value of this on TreeNodeValid must only be overridden by base classes and never modified.\n\t * Ways to enforce this immutability prevent it from being overridden,\n\t * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.\n\t */\n\tprotected static constructorCached: MostDerivedData | \"default\" | undefined = \"default\";\n\n\t/**\n\t * Indicate that `this` is the most derived version of a schema, and thus the only one allowed to be used (other than by being subclassed a single time).\n\t */\n\tpublic static markMostDerived(this: typeof TreeNodeValid & TreeNodeSchema): MostDerivedData {\n\t\tassert(this.constructorCached !== \"default\", 0x95f /* invalid schema class */);\n\n\t\tif (this.constructorCached === undefined) {\n\t\t\t// Set the constructorCached on the layer of the prototype chain that declared it.\n\t\t\t// This is necessary to ensure there is only one subclass of that type used:\n\t\t\t// if constructorCached was simply set on `schema`,\n\t\t\t// then a base classes between `schema` (exclusive) and where `constructorCached` is set (inclusive) and other subclasses of them\n\t\t\t// would not see the stored `constructorCached`, and the validation above against multiple derived classes would not work.\n\n\t\t\t// This is not just an alias of `this`, but a reference to the item in the prototype chain being walked, which happens to start at `this`.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment\n\t\t\tlet schemaBase: typeof TreeNodeValid = this;\n\t\t\twhile (!Object.prototype.hasOwnProperty.call(schemaBase, \"constructorCached\")) {\n\t\t\t\tschemaBase = Reflect.getPrototypeOf(schemaBase) as typeof TreeNodeValid;\n\t\t\t}\n\t\t\tassert(schemaBase.constructorCached === undefined, 0x962 /* overwriting wrong cache */);\n\t\t\tschemaBase.constructorCached = { constructor: this, oneTimeInitialized: undefined };\n\t\t\tassert(\n\t\t\t\tthis.constructorCached === schemaBase.constructorCached,\n\t\t\t\t0x9b5 /* Inheritance should work */,\n\t\t\t);\n\t\t\treturn this.constructorCached;\n\t\t} else if (this.constructorCached.constructor === this) {\n\t\t\treturn this.constructorCached;\n\t\t}\n\n\t\t// If users trying to diagnose the cause of this error becomes a common issue, more information could be captured.\n\t\t// The call stack to when a schema is first marked most derived could be captured in debug builds and stored in the `MostDerivedData` object:\n\t\t// This could then be included in the error to aid in debugging this error.\n\t\tthrow new UsageError(\n\t\t\t`Two schema classes were used (${this.name} and ${\n\t\t\t\tthis.constructorCached.constructor.name\n\t\t\t}) which derived from the same SchemaFactory generated class (${JSON.stringify(\n\t\t\t\tthis.identifier,\n\t\t\t)}). This is invalid.`,\n\t\t);\n\t}\n\n\t/**\n\t * Node creation function for implementing the TreeNodeSchemaNonClass half of TreeNodeSchemaBoth.\n\t * @remarks\n\t * When used as TreeNodeSchemaNonClass and subclassed,\n\t * does not actually have the correct compile time type for the return value due to TypeScript limitations.\n\t * This is why this is not exposed as part of TreeNodeSchemaClass where subclassing is allowed.\n\t */\n\tpublic static create<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * See {@link TreeNodeSchemaCore.createFromInsertable}.\n\t */\n\tpublic static createFromInsertable<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tpublic static oneTimeInitialize(\n\t\tthis: typeof TreeNodeValid & TreeNodeSchema,\n\t): Required<MostDerivedData> {\n\t\tconst cache = this.markMostDerived();\n\t\tcache.oneTimeInitialized ??= this.oneTimeSetup();\n\t\t// TypeScript fails to narrow the type of `oneTimeInitialized` to `Context` here, so use a cast:\n\t\treturn cache as MostDerivedData & { oneTimeInitialized: TreeNodeSchemaInitializedData };\n\t}\n\n\tpublic constructor(input: TInput | InternalTreeNode) {\n\t\tsuper(privateToken);\n\t\tconst schema = this.constructor as typeof TreeNodeValid & TreeNodeSchema;\n\t\tconst cache = schema.oneTimeInitialize();\n\n\t\tif (isTreeNode(input)) {\n\t\t\t// TODO: update this once TreeBeta.clone is stable.\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing nodes may not be used as the constructor parameter for a new node. The existing node may be used directly instead of creating a new one, used as a child of the new node (if it has not yet been inserted into the tree). If the desired result is copying the provided node, it must be deep copied (since any child node would be parented under both the new and old nodes). `TreeBeta.clone` can be used to do this.\",\n\t\t\t);\n\t\t}\n\n\t\tconst node: InnerNode = isFlexTreeNode(input) ? input : schema.buildRawNode(this, input);\n\t\tassert(\n\t\t\tgetSimpleNodeSchemaFromInnerNode(node) === schema,\n\t\t\t0x83b /* building node with wrong schema */,\n\t\t);\n\n\t\tconst result = schema.prepareInstance(this, node);\n\t\t// For unhydrated nodes, grab the context from the `simpleContext` (which likely is from cache.oneTimeInitialized.context,\n\t\t// but might be customized for better schema evolution support like unknown optional fields like in clone)\n\t\t// For hydrated nodes, this context is unused, so using the default from cache.oneTimeInitialized.context is always fine.\n\t\tconst context =\n\t\t\tnode instanceof UnhydratedFlexTreeNode\n\t\t\t\t? node.simpleContext\n\t\t\t\t: cache.oneTimeInitialized.context;\n\t\t// The TreeNodeKernel associates itself the TreeNode (result here, not node) so it can be looked up later via getKernel.\n\t\t// If desired this could be put in a non-enumerable symbol property for lookup instead, but that gets messy going through proxies,\n\t\t// so just relying on the WeakMap seems like the cleanest approach.\n\t\tnew TreeNodeKernel(result, schema, node, context);\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Data cached about the most derived type in a schema's class hierarchy.\n * @remarks\n * The most derived type is the only one allowed to be referenced by other schema or constructed as a node.\n * It has to be discovered lazily (when a node is constructed or when a {@link TreeViewConfiguration} is made),\n * since JavaScript provides no way to find derived classes, or inject static class initialization time logic into base classes.\n * Additionally since schema can reference other schema through lazy references which might be forward or recursive references,\n * this can not be evaluated for one schema when referenced by another schema.\n *\n * See {@link TreeNodeValid.constructorCached} and {@link TreeNodeValid.markMostDerived}.\n */\nexport interface MostDerivedData {\n\treadonly constructor: typeof TreeNodeValid & TreeNodeSchema;\n\toneTimeInitialized?: TreeNodeSchemaInitializedData;\n}\n\n/**\n * Cast `schema` to a {@link TreeNodeValid}, asserting it actually extends it.\n */\nexport function schemaAsTreeNodeValid(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): typeof TreeNodeValid & TreeNodeSchema {\n\tif (!isClassBasedSchema(schema)) {\n\t\t// Use JSON.stringify to quote and escape identifier string.\n\t\tthrow new UsageError(\n\t\t\t`Schema for ${JSON.stringify(\n\t\t\t\tschema.identifier,\n\t\t\t)} does not extend a SchemaFactory generated class. This is invalid.`,\n\t\t);\n\t}\n\n\treturn schema;\n}\n\n/**\n * Check if a schema is a {@link TreeNodeValid}.\n */\nexport function isClassBasedSchema(\n\tschema: SimpleNodeSchemaBase<NodeKind>,\n): schema is typeof TreeNodeValid & TreeNodeSchema {\n\treturn inPrototypeChain(schema, TreeNodeValid);\n}\n\n/**\n * Provides the {@link TreeNodeSchemaPrivateData} for class based implementations of {@link asTreeNodeSchemaCorePrivate}.\n * @remarks\n * Such schema must extends {@link TreeNodeValid}.\n */\nexport function createTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n\tchildAllowedTypes: readonly AllowedTypesFull[],\n\ttoStored: TreeNodeSchemaPrivateData[\"toStored\"],\n): TreeNodeSchemaPrivateData {\n\tconst schemaValid = schemaAsTreeNodeValid(schema);\n\t// Since this closes over the schema, ensure this schema is marked as most derived\n\t// so if some other subclass is used later, it will error instead of giving inconsistent results.\n\tschemaValid.markMostDerived();\n\n\treturn {\n\t\tidempotentInitialize: () => schemaValid.oneTimeInitialize().oneTimeInitialized,\n\t\tchildAllowedTypes,\n\t\ttoStored,\n\t};\n}\n\n// #region NodeJS custom inspect for TreeNodes.\n\n/**\n * Used to customize \"inspect\" behavior in NodeJS.\n * See https://nodejs.org/api/util.html#utilinspectcustom for details.\n *\n * VS-Code's debugger also uses this to inspect objects,\n * see https://github.com/microsoft/vscode-js-debug/blob/64df2686c92bac402909dee5c3c389bbb7a81f6d/src/adapter/templates/getStringyProps.ts#L11 for details.\n */\nconst customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\");\n\n/**\n * Node inspecting function for use with {@link customInspectSymbol}.\n */\nfunction inspectNodeFunction(\n\tthis: TreeNodeValid<unknown>,\n\tdepth: number,\n\toptions?: unknown,\n\tinspect?: unknown,\n): unknown {\n\tconst schema = this[typeSchemaSymbol];\n\tconst title = `${schema.name}: ${NodeKind[schema.kind]} Node (${schema.identifier})`;\n\n\tif (depth < 2) {\n\t\tconst short = shortContent(this);\n\t\tif (short !== undefined) {\n\t\t\treturn `${title} ${short}`;\n\t\t}\n\t\treturn title;\n\t}\n\tconst content = `${title} ${JSON.stringify(this)}`;\n\treturn content;\n}\n\n/**\n * If the node has no items, a short JSON string for it.\n */\nfunction shortContent(node: TreeNodeValid<unknown>): string | undefined {\n\tif (Object.values(node).length === 0) {\n\t\treturn JSON.stringify(node);\n\t}\n\treturn undefined;\n}\n\n/**\n * Add inherited non-enumerable symbol for NodeJS inspection to all nodes.\n *\n * See {@link customInspectSymbol}.\n */\nObject.defineProperty(TreeNodeValid.prototype, customInspectSymbol, {\n\tvalue: inspectNodeFunction,\n\tenumerable: false,\n});\n\n// #endregion\n\n// #region Browser custom debug format for TreeNodes\n\n// This section has side-effects, so including it in this file ensures its loaded whenever TreeNodes could exist.\n// Supported in at least Chrome and FireFox, more details at https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n// For this to work the browser's dev tools generally have to \"Enable custom formatters\".\n\n// This formatter is inspired by https://github.com/andrewdavey/immutable-devtools/blob/master/src/createFormatters.js which provides a similar formatter for the immutable.js library.\n\nconst globals = typeof window === \"undefined\" ? globalThis : window;\nconst formatters = ((\n\tglobals as { devtoolsFormatters?: DevtoolsFormatter.DevtoolsFormatter[] }\n).devtoolsFormatters ??= []);\n\nconst nodeFormatter: DevtoolsFormatter.DevtoolsFormatter = {\n\theader(object, config) {\n\t\tif (isTreeNode(object)) {\n\t\t\treturn [\"span\", `${inspectNodeFunction.call(object, 1)}`];\n\t\t}\n\t\treturn null;\n\t},\n\tbody(object, config): DevtoolsFormatter.Item {\n\t\tconst children: DevtoolsFormatter.Item[] = [];\n\t\tfor (const [key, value] of Object.entries(object as TreeNode)) {\n\t\t\tchildren.push([\"li\", [\"span\", `${key}: `], formattedReference(value)]);\n\t\t}\n\n\t\t// TODO:\n\t\t// for array nodes, this isn't great since (at least in FireFox) the list items show up with a prefixed number starting from 1.\n\t\t// This looks messy when followed by the array index.\n\t\t// Find a way to hide the list index.\n\t\t// { style: 'list-style-type: none` } did not seem to work.\n\n\t\treturn [\"ol\", ...children];\n\t},\n\thasBody(object, config) {\n\t\treturn shortContent(object as TreeNodeValid<undefined>) === undefined;\n\t},\n};\n\nfunction formattedReference(\n\tobject: unknown,\n\tconfig?: DevtoolsFormatter.ObjectConfig,\n): DevtoolsFormatter.Item {\n\tif (object === undefined) {\n\t\treturn [\"span\", \"undefined\"];\n\t} else if (object === \"null\") {\n\t\treturn [\"span\", \"null\"];\n\t}\n\n\treturn [\"object\", { object, config }];\n}\n\nformatters.push(nodeFormatter);\n\n// #endregion\n\n// These types are based on https://github.com/BenjaminAster/Better-TypeScript/blob/main/types/devtools-formatters.d.ts\n// however the original package causes multiple compile errors due to some of its other types it used, so the relevant part has been extracted and adjusted to better match our conventions.\ndeclare namespace DevtoolsFormatter {\n\ttype ObjectConfig = Record<string | symbol, unknown>;\n\n\ttype ElementTagName = \"div\" | \"span\" | \"ol\" | \"li\" | \"table\" | \"tr\" | \"td\";\n\n\ttype ElementTemplate = StyledElementTemplate | UnstyledElementTemplate;\n\n\ttype StyledElementTemplate = readonly [\n\t\tElementTagName,\n\t\t{\n\t\t\tstyle?: string;\n\t\t},\n\t\t...Item[],\n\t];\n\n\ttype UnstyledElementTemplate = readonly [ElementTagName, ...Item[]];\n\n\ttype ObjectReference = readonly [\n\t\t\"object\",\n\t\t{\n\t\t\tobject: unknown;\n\t\t\tconfig?: ObjectConfig;\n\t\t},\n\t];\n\n\ttype Item = string | ElementTemplate | ObjectReference;\n\n\tinterface DevtoolsFormatter {\n\t\theader(\n\t\t\tobject?: unknown,\n\t\t\tconfig?: ObjectConfig,\n\t\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\t): Item | null;\n\t\thasBody(object?: unknown, config?: ObjectConfig): boolean;\n\t\tbody(object?: unknown, config?: ObjectConfig): Item;\n\t}\n}\n"]}
1
+ {"version":3,"file":"treeNodeValid.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAqB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACN,QAAQ,GAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,gCAAgC,EAChC,UAAU,EACV,cAAc,GAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAsB,SAAQ,QAAQ;IAC3D;;;;;;;OAOG;IACO,MAAM,CAAC,eAAe,CAE/B,QAA0B,EAC1B,KAAmB;QAEnB,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED;;OAEG;IACO,MAAM,CAAC,YAAY,CAE5B,QAA0B,EAC1B,KAAQ;QAER,OAAO,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACO,MAAM,CAAC,YAAY;QAG5B,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAAC;IAsBD;;OAEG;IACI,MAAM,CAAC,eAAe;QAC5B,MAAM,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAE/E,IAAI,IAAI,CAAC,iBAAiB,KAAK,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AAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAkB,CAAC,EAAE,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;QAED,QAAQ;QACR,+HAA+H;QAC/H,qDAAqD;QACrD,qCAAqC;QACrC,2DAA2D;QAE3D,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,MAAM,EAAE,MAAM;QACrB,OAAO,YAAY,CAAC,MAAkC,CAAC,KAAK,SAAS,CAAC;IACvE,CAAC;CACD,CAAC;AAEF,SAAS,kBAAkB,CAC1B,MAAe,EACf,MAAuC;IAEvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,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\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type FlexTreeNode, isFlexTreeNode } from \"../../feature-libraries/index.js\";\n\nimport { inPrototypeChain, privateToken, TreeNode } from \"./treeNode.js\";\nimport { UnhydratedFlexTreeNode } from \"./unhydratedFlexTree.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaPrivateData,\n} from \"./treeNodeSchema.js\";\nimport {\n\tgetSimpleNodeSchemaFromInnerNode,\n\tisTreeNode,\n\tTreeNodeKernel,\n\ttype InnerNode,\n} from \"./treeNodeKernel.js\";\nimport type { InternalTreeNode } from \"./types.js\";\nimport { typeSchemaSymbol } from \"./withType.js\";\nimport type { AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\n\n/**\n * Class which all {@link TreeNode}s must extend.\n * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.\n *\n * This has static members which schema classes can override to provide schema specific functionality.\n * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.\n * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.\n */\nexport abstract class TreeNodeValid<TInput> extends TreeNode {\n\t/**\n\t * Schema classes can override this to control what happens at the end of the constructor.\n\t * The return value from this is returned from the constructor, allowing substituting a proxy if desired.\n\t *\n\t * This is not simply done in the derived constructor to enable:\n\t * - this class to access the value which is being returned before it's returned from the constructor.\n\t * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.\n\t */\n\tprotected static prepareInstance<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: FlexTreeNode,\n\t): TreeNodeValid<T> {\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Schema classes must override to provide an implementation of RawTreeNode construction.\n\t */\n\tprotected static buildRawNode<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: T,\n\t): UnhydratedFlexTreeNode {\n\t\treturn fail(0xae4 /* Schema must override buildRawNode */);\n\t}\n\n\t/**\n\t * Schema classes can override to provide a callback that is called once when the first node is constructed.\n\t * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.\n\t * @remarks\n\t * It is valid to dereference LazyItem schema references in this function (or anything that runs after it).\n\t */\n\tprotected static oneTimeSetup<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t): TreeNodeSchemaInitializedData {\n\t\tfail(0xae5 /* Missing oneTimeSetup */);\n\t}\n\n\t/**\n\t * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.\n\t * @remarks\n\t * Captured when an instance is constructed.\n\t *\n\t * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single \"most derived\" class (the constructor actually invoked the the user with `new`).\n\t *\n\t * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.\n\t *\n\t * Also used to detect if oneTimeSetup has run.\n\t *\n\t * @privateRemarks\n\t * This defaults to \"default\", which is used to trigger an error if not overridden in the derived class.\n\t *\n\t * The value of this on TreeNodeValid must only be overridden by base classes and never modified.\n\t * Ways to enforce this immutability prevent it from being overridden,\n\t * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.\n\t */\n\tprotected static constructorCached: MostDerivedData | \"default\" | undefined = \"default\";\n\n\t/**\n\t * Indicate that `this` is the most derived version of a schema, and thus the only one allowed to be used (other than by being subclassed a single time).\n\t */\n\tpublic static markMostDerived(this: typeof TreeNodeValid & TreeNodeSchema): MostDerivedData {\n\t\tassert(this.constructorCached !== \"default\", 0x95f /* invalid schema class */);\n\n\t\tif (this.constructorCached === undefined) {\n\t\t\t// Set the constructorCached on the layer of the prototype chain that declared it.\n\t\t\t// This is necessary to ensure there is only one subclass of that type used:\n\t\t\t// if constructorCached was simply set on `schema`,\n\t\t\t// then a base classes between `schema` (exclusive) and where `constructorCached` is set (inclusive) and other subclasses of them\n\t\t\t// would not see the stored `constructorCached`, and the validation above against multiple derived classes would not work.\n\n\t\t\t// This is not just an alias of `this`, but a reference to the item in the prototype chain being walked, which happens to start at `this`.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment\n\t\t\tlet schemaBase: typeof TreeNodeValid = this;\n\t\t\twhile (!Object.prototype.hasOwnProperty.call(schemaBase, \"constructorCached\")) {\n\t\t\t\tschemaBase = Reflect.getPrototypeOf(schemaBase) as typeof TreeNodeValid;\n\t\t\t}\n\t\t\tassert(schemaBase.constructorCached === undefined, 0x962 /* overwriting wrong cache */);\n\t\t\tschemaBase.constructorCached = { constructor: this, oneTimeInitialized: undefined };\n\t\t\tassert(\n\t\t\t\tthis.constructorCached === schemaBase.constructorCached,\n\t\t\t\t0x9b5 /* Inheritance should work */,\n\t\t\t);\n\t\t\treturn this.constructorCached;\n\t\t} else if (this.constructorCached.constructor === this) {\n\t\t\treturn this.constructorCached;\n\t\t}\n\n\t\t// If users trying to diagnose the cause of this error becomes a common issue, more information could be captured.\n\t\t// The call stack to when a schema is first marked most derived could be captured in debug builds and stored in the `MostDerivedData` object:\n\t\t// This could then be included in the error to aid in debugging this error.\n\t\tthrow new UsageError(\n\t\t\t`Two schema classes were used (${this.name} and ${\n\t\t\t\tthis.constructorCached.constructor.name\n\t\t\t}) which derived from the same SchemaFactory generated class (${JSON.stringify(\n\t\t\t\tthis.identifier,\n\t\t\t)}). This is invalid.`,\n\t\t);\n\t}\n\n\t/**\n\t * Node creation function for implementing the TreeNodeSchemaNonClass half of TreeNodeSchemaBoth.\n\t * @remarks\n\t * When used as TreeNodeSchemaNonClass and subclassed,\n\t * does not actually have the correct compile time type for the return value due to TypeScript limitations.\n\t * This is why this is not exposed as part of TreeNodeSchemaClass where subclassing is allowed.\n\t */\n\tpublic static create<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * See {@link TreeNodeSchemaCore.createFromInsertable}.\n\t */\n\tpublic static createFromInsertable<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tpublic static oneTimeInitialize(\n\t\tthis: typeof TreeNodeValid & TreeNodeSchema,\n\t): Required<MostDerivedData> {\n\t\tconst cache = this.markMostDerived();\n\t\tcache.oneTimeInitialized ??= this.oneTimeSetup();\n\t\t// TypeScript fails to narrow the type of `oneTimeInitialized` to `Context` here, so use a cast:\n\t\treturn cache as MostDerivedData & { oneTimeInitialized: TreeNodeSchemaInitializedData };\n\t}\n\n\tpublic constructor(input: TInput | InternalTreeNode) {\n\t\tsuper(privateToken);\n\t\tconst schema = this.constructor as typeof TreeNodeValid & TreeNodeSchema;\n\t\tconst cache = schema.oneTimeInitialize();\n\n\t\tif (isTreeNode(input)) {\n\t\t\t// TODO: update this once TreeBeta.clone is stable.\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing nodes may not be used as the constructor parameter for a new node. The existing node may be used directly instead of creating a new one, used as a child of the new node (if it has not yet been inserted into the tree). If the desired result is copying the provided node, it must be deep copied (since any child node would be parented under both the new and old nodes). `TreeBeta.clone` can be used to do this.\",\n\t\t\t);\n\t\t}\n\n\t\tconst node: InnerNode = isFlexTreeNode(input) ? input : schema.buildRawNode(this, input);\n\t\tassert(\n\t\t\tgetSimpleNodeSchemaFromInnerNode(node) === schema,\n\t\t\t0x83b /* building node with wrong schema */,\n\t\t);\n\n\t\tconst result = schema.prepareInstance(this, node);\n\t\t// For unhydrated nodes, grab the context from the `simpleContext` (which likely is from cache.oneTimeInitialized.context,\n\t\t// but might be customized for better schema evolution support like unknown optional fields like in clone)\n\t\t// For hydrated nodes, this context is unused, so using the default from cache.oneTimeInitialized.context is always fine.\n\t\tconst context =\n\t\t\tnode instanceof UnhydratedFlexTreeNode\n\t\t\t\t? node.simpleContext\n\t\t\t\t: cache.oneTimeInitialized.context;\n\t\t// The TreeNodeKernel associates itself the TreeNode (result here, not node) so it can be looked up later via getKernel.\n\t\t// If desired this could be put in a non-enumerable symbol property for lookup instead, but that gets messy going through proxies,\n\t\t// so just relying on the WeakMap seems like the cleanest approach.\n\t\tnew TreeNodeKernel(result, schema, node, context);\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Data cached about the most derived type in a schema's class hierarchy.\n * @remarks\n * The most derived type is the only one allowed to be referenced by other schema or constructed as a node.\n * It has to be discovered lazily (when a node is constructed or when a {@link TreeViewConfiguration} is made),\n * since JavaScript provides no way to find derived classes, or inject static class initialization time logic into base classes.\n * Additionally since schema can reference other schema through lazy references which might be forward or recursive references,\n * this can not be evaluated for one schema when referenced by another schema.\n *\n * See {@link TreeNodeValid.constructorCached} and {@link TreeNodeValid.markMostDerived}.\n */\nexport interface MostDerivedData {\n\treadonly constructor: typeof TreeNodeValid & TreeNodeSchema;\n\toneTimeInitialized?: TreeNodeSchemaInitializedData;\n}\n\n/**\n * Cast `schema` to a {@link TreeNodeValid}, asserting it actually extends it.\n */\nexport function schemaAsTreeNodeValid(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): typeof TreeNodeValid & TreeNodeSchema {\n\tif (!isClassBasedSchema(schema)) {\n\t\t// Use JSON.stringify to quote and escape identifier string.\n\t\tthrow new UsageError(\n\t\t\t`Schema for ${JSON.stringify(\n\t\t\t\tschema.identifier,\n\t\t\t)} does not extend a SchemaFactory generated class. This is invalid.`,\n\t\t);\n\t}\n\n\treturn schema;\n}\n\n/**\n * Check if a schema is a {@link TreeNodeValid}.\n */\nexport function isClassBasedSchema(\n\tschema: SimpleNodeSchemaBase<NodeKind>,\n): schema is typeof TreeNodeValid & TreeNodeSchema {\n\treturn inPrototypeChain(schema, TreeNodeValid);\n}\n\n/**\n * Provides the {@link TreeNodeSchemaPrivateData} for class based implementations of {@link asTreeNodeSchemaCorePrivate}.\n * @remarks\n * Such schema must extends {@link TreeNodeValid}.\n */\nexport function createTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n\tchildAllowedTypes: readonly AllowedTypesFull[],\n): TreeNodeSchemaPrivateData {\n\tconst schemaValid = schemaAsTreeNodeValid(schema);\n\t// Since this closes over the schema, ensure this schema is marked as most derived\n\t// so if some other subclass is used later, it will error instead of giving inconsistent results.\n\tschemaValid.markMostDerived();\n\n\treturn {\n\t\tidempotentInitialize: () => schemaValid.oneTimeInitialize().oneTimeInitialized,\n\t\tchildAllowedTypes,\n\t};\n}\n\n// #region NodeJS custom inspect for TreeNodes.\n\n/**\n * Used to customize \"inspect\" behavior in NodeJS.\n * See https://nodejs.org/api/util.html#utilinspectcustom for details.\n *\n * VS-Code's debugger also uses this to inspect objects,\n * see https://github.com/microsoft/vscode-js-debug/blob/64df2686c92bac402909dee5c3c389bbb7a81f6d/src/adapter/templates/getStringyProps.ts#L11 for details.\n */\nconst customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\");\n\n/**\n * Node inspecting function for use with {@link customInspectSymbol}.\n */\nfunction inspectNodeFunction(\n\tthis: TreeNodeValid<unknown>,\n\tdepth: number,\n\toptions?: unknown,\n\tinspect?: unknown,\n): unknown {\n\tconst schema = this[typeSchemaSymbol];\n\tconst title = `${schema.name}: ${NodeKind[schema.kind]} Node (${schema.identifier})`;\n\n\tif (depth < 2) {\n\t\tconst short = shortContent(this);\n\t\tif (short !== undefined) {\n\t\t\treturn `${title} ${short}`;\n\t\t}\n\t\treturn title;\n\t}\n\tconst content = `${title} ${JSON.stringify(this)}`;\n\treturn content;\n}\n\n/**\n * If the node has no items, a short JSON string for it.\n */\nfunction shortContent(node: TreeNodeValid<unknown>): string | undefined {\n\tif (Object.values(node).length === 0) {\n\t\treturn JSON.stringify(node);\n\t}\n\treturn undefined;\n}\n\n/**\n * Add inherited non-enumerable symbol for NodeJS inspection to all nodes.\n *\n * See {@link customInspectSymbol}.\n */\nObject.defineProperty(TreeNodeValid.prototype, customInspectSymbol, {\n\tvalue: inspectNodeFunction,\n\tenumerable: false,\n});\n\n// #endregion\n\n// #region Browser custom debug format for TreeNodes\n\n// This section has side-effects, so including it in this file ensures its loaded whenever TreeNodes could exist.\n// Supported in at least Chrome and FireFox, more details at https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n// For this to work the browser's dev tools generally have to \"Enable custom formatters\".\n\n// This formatter is inspired by https://github.com/andrewdavey/immutable-devtools/blob/master/src/createFormatters.js which provides a similar formatter for the immutable.js library.\n\nconst globals = typeof window === \"undefined\" ? globalThis : window;\nconst formatters = ((\n\tglobals as { devtoolsFormatters?: DevtoolsFormatter.DevtoolsFormatter[] }\n).devtoolsFormatters ??= []);\n\nconst nodeFormatter: DevtoolsFormatter.DevtoolsFormatter = {\n\theader(object, config) {\n\t\tif (isTreeNode(object)) {\n\t\t\treturn [\"span\", `${inspectNodeFunction.call(object, 1)}`];\n\t\t}\n\t\treturn null;\n\t},\n\tbody(object, config): DevtoolsFormatter.Item {\n\t\tconst children: DevtoolsFormatter.Item[] = [];\n\t\tfor (const [key, value] of Object.entries(object as TreeNode)) {\n\t\t\tchildren.push([\"li\", [\"span\", `${key}: `], formattedReference(value)]);\n\t\t}\n\n\t\t// TODO:\n\t\t// for array nodes, this isn't great since (at least in FireFox) the list items show up with a prefixed number starting from 1.\n\t\t// This looks messy when followed by the array index.\n\t\t// Find a way to hide the list index.\n\t\t// { style: 'list-style-type: none` } did not seem to work.\n\n\t\treturn [\"ol\", ...children];\n\t},\n\thasBody(object, config) {\n\t\treturn shortContent(object as TreeNodeValid<undefined>) === undefined;\n\t},\n};\n\nfunction formattedReference(\n\tobject: unknown,\n\tconfig?: DevtoolsFormatter.ObjectConfig,\n): DevtoolsFormatter.Item {\n\tif (object === undefined) {\n\t\treturn [\"span\", \"undefined\"];\n\t} else if (object === \"null\") {\n\t\treturn [\"span\", \"null\"];\n\t}\n\n\treturn [\"object\", { object, config }];\n}\n\nformatters.push(nodeFormatter);\n\n// #endregion\n\n// These types are based on https://github.com/BenjaminAster/Better-TypeScript/blob/main/types/devtools-formatters.d.ts\n// however the original package causes multiple compile errors due to some of its other types it used, so the relevant part has been extracted and adjusted to better match our conventions.\ndeclare namespace DevtoolsFormatter {\n\ttype ObjectConfig = Record<string | symbol, unknown>;\n\n\ttype ElementTagName = \"div\" | \"span\" | \"ol\" | \"li\" | \"table\" | \"tr\" | \"td\";\n\n\ttype ElementTemplate = StyledElementTemplate | UnstyledElementTemplate;\n\n\ttype StyledElementTemplate = readonly [\n\t\tElementTagName,\n\t\t{\n\t\t\tstyle?: string;\n\t\t},\n\t\t...Item[],\n\t];\n\n\ttype UnstyledElementTemplate = readonly [ElementTagName, ...Item[]];\n\n\ttype ObjectReference = readonly [\n\t\t\"object\",\n\t\t{\n\t\t\tobject: unknown;\n\t\t\tconfig?: ObjectConfig;\n\t\t},\n\t];\n\n\ttype Item = string | ElementTemplate | ObjectReference;\n\n\tinterface DevtoolsFormatter {\n\t\theader(\n\t\t\tobject?: unknown,\n\t\t\tconfig?: ObjectConfig,\n\t\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\t): Item | null;\n\t\thasBody(object?: unknown, config?: ObjectConfig): boolean;\n\t\tbody(object?: unknown, config?: ObjectConfig): Item;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/fieldSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAIlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EACN,KAAK,WAAW,EAEhB,KAAK,mBAAmB,EAIxB,KAAK,4BAA4B,EACjC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EACX,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,oBAAoB,EACpB,gCAAgC,EAChC,aAAa,EACb,0CAA0C,EAC1C,gBAAgB,EAChB,M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,GACD,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,GAClC,CAAC,GAAG,SAAS,GACb,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,GACpC,mBAAmB,SAAS,IAAI,GAC/B,CAAC,GAAG,SAAS,GACb,CAAC,GACF,KAAK,CAAC"}
@@ -5,7 +5,7 @@
5
5
  import { Lazy } from "@fluidframework/core-utils/internal";
6
6
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
7
  import { brand, compareSets, } from "../util/index.js";
8
- import { normalizeAllowedTypes } from "./core/index.js";
8
+ import { AnnotatedAllowedTypesInternal, normalizeAllowedTypes } from "./core/index.js";
9
9
  /**
10
10
  * Kind of a field on an {@link TreeObjectNode}.
11
11
  * @remarks
@@ -152,14 +152,7 @@ export class FieldSchemaAlpha extends FieldSchema {
152
152
  return this.allowedTypesFull.evaluateIdentifiers();
153
153
  }
154
154
  get simpleAllowedTypes() {
155
- const types = this.allowedTypesFull.evaluate().types;
156
- const info = new Map();
157
- for (const type of types) {
158
- info.set(type.type.identifier, {
159
- isStaged: type.metadata.stagedSchemaUpgrade !== undefined,
160
- });
161
- }
162
- return info;
155
+ return AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(this.allowedTypesFull);
163
156
  }
164
157
  constructor(kind, types, props) {
165
158
  super(kind, types, props);
@@ -1 +1 @@
1
- {"version":3,"file":"fieldSchema.js","sourceRoot":"","sources":["../../src/simple-tree/fieldSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EAEN,KAAK,EAEL,WAAW,GAIX,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAMxD;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,SAqBX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,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,YAAY,KAAK,YAAY,CAAC;AACtC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey } from \"../core/index.js\";\nimport type { FlexTreeHydratedContextMinimal } from \"../feature-libraries/index.js\";\nimport {\n\ttype MakeNominal,\n\tbrand,\n\ttype UnionToIntersection,\n\tcompareSets,\n\ttype requireTrue,\n\ttype areOnlyKeys,\n\ttype JsonCompatibleReadOnlyObject,\n} from \"../util/index.js\";\n\nimport type {\n\tTreeNodeSchema,\n\tTreeNode,\n\tUnhydratedFlexTreeNode,\n\tImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n\tTreeLeafValue,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tAllowedTypesFull,\n} from \"./core/index.js\";\nimport { normalizeAllowedTypes } from \"./core/index.js\";\n\nimport type { SimpleAllowedTypeAttributes, SimpleFieldSchema } from \"./simpleSchema.js\";\nimport type { UnsafeUnknownSchema } from \"./unsafeUnknownSchema.js\";\nimport type { InsertableContent } from \"./unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Kind of a field on an {@link TreeObjectNode}.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * See {@link FieldSchema} for where these are used, and {@link SchemaFactory} for how to create schema which use them.\n * @public\n */\nexport enum FieldKind {\n\t/**\n\t * A field which can be empty or filled.\n\t * @remarks\n\t * Allows 0 or one child.\n\t */\n\tOptional,\n\t/**\n\t * A field which must always be filled.\n\t * @remarks\n\t * Only allows exactly one child.\n\t */\n\tRequired,\n\t/**\n\t * A special readonly field used for node identifier strings.\n\t * @remarks\n\t * Only allows exactly one child.\n\t *\n\t * See {@link SchemaFactory.identifier} for more details.\n\t */\n\tIdentifier,\n}\n\n/**\n * Maps from a property key to its corresponding {@link FieldProps.key | stored key} for the provided\n * {@link ImplicitFieldSchema | field schema}.\n *\n * @remarks\n * If an explicit stored key was specified in the schema, it will be used.\n * Otherwise, the stored key is the same as the property key.\n */\nexport function getStoredKey(propertyKey: string, fieldSchema: ImplicitFieldSchema): FieldKey {\n\treturn brand(getExplicitStoredKey(fieldSchema) ?? propertyKey);\n}\n\n/**\n * Gets the {@link FieldProps.key | stored key} specified by the schema, if one was explicitly specified.\n * Otherwise, returns undefined.\n */\nexport function getExplicitStoredKey(fieldSchema: ImplicitFieldSchema): string | undefined {\n\treturn fieldSchema instanceof FieldSchema ? fieldSchema.props?.key : undefined;\n}\n\n/**\n * Additional information to provide to a {@link FieldSchema}.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @public\n */\nexport interface FieldProps<TCustomMetadata = unknown> {\n\t/**\n\t * The unique identifier of a field, used in the persisted form of the tree.\n\t *\n\t * @remarks\n\t * If not explicitly set via the schema, this is the same as the schema's property key.\n\t *\n\t * Specifying a stored key that differs from the property key is particularly useful in refactoring scenarios.\n\t * To update the developer-facing API, while maintaining backwards compatibility with existing SharedTree data,\n\t * you can change the property key and specify the previous property key as the stored key.\n\t *\n\t * Notes:\n\t *\n\t * - Stored keys have no impact on standard JavaScript behavior, on tree nodes. For example, `Object.keys`\n\t * will always return the property keys specified in the schema, ignoring any stored keys that differ from\n\t * the property keys.\n\t *\n\t * - When specifying stored keys in an object schema, you must ensure that the final set of stored keys\n\t * (accounting for those implicitly derived from property keys) contains no duplicates.\n\t * This is validated at runtime.\n\t *\n\t * @example Refactoring code without breaking compatibility with existing data\n\t *\n\t * Consider some existing object schema:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \txPosition: schemaFactory.number,\n\t * \tyPosition: schemaFactory.number,\n\t * \tzPosition: schemaFactory.optional(schemaFactory.number),\n\t * });\n\t * ```\n\t *\n\t * Developers using nodes of this type would access the the `xPosition` property as `point.xPosition`.\n\t *\n\t * We would like to refactor the schema to omit \"Position\" from the property keys, but application data has\n\t * already been persisted using the original property keys. To maintain compatibility with existing data,\n\t * we can refactor the schema as follows:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \tx: schemaFactory.required(schemaFactory.number, { key: \"xPosition\" }),\n\t * \ty: schemaFactory.required(schemaFactory.number, { key: \"yPosition\" }),\n\t * \tz: schemaFactory.optional(schemaFactory.number, { key: \"zPosition\" }),\n\t * });\n\t * ```\n\t *\n\t * Now, developers can access the `x` property as `point.x`, while existing data can still be collaborated on.\n\t *\n\t * @defaultValue If not specified, the key that is persisted is the property key that was specified in the schema.\n\t */\n\treadonly key?: string;\n\n\t/**\n\t * A default provider used for fields which were not provided any values.\n\t * @privateRemarks\n\t * We are using an erased type here, as we want to expose this API but `InsertableContent` and `NodeKeyManager` are not public.\n\t */\n\treadonly defaultProvider?: DefaultProvider;\n\n\t/**\n\t * Optional metadata to associate with the field.\n\t *\n\t * @remarks\n\t * Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.\n\t * Different clients in the same collaborative session may see different metadata for the same field.\n\t */\n\treadonly metadata?: FieldSchemaMetadata<TCustomMetadata>;\n}\n\n/**\n * {@link FieldProps} extended with additional `alpha` options.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @alpha @input\n */\nexport interface FieldPropsAlpha<TCustomMetadata = unknown>\n\textends FieldProps<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for a field schema.\n\t * @remarks\n\t * Sets {@link SimpleFieldSchema.persistedMetadata}.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * A {@link FieldProvider} which requires additional context in order to produce its content\n */\nexport type ContextualFieldProvider = (\n\tcontext: FlexTreeHydratedContextMinimal | \"UseGlobalContext\",\n) => UnhydratedFlexTreeNode[];\n/**\n * A {@link FieldProvider} which can produce its content in a vacuum.\n */\nexport type ConstantFieldProvider = () => UnhydratedFlexTreeNode[];\n/**\n * A function which produces content for a field every time that it is called.\n */\nexport type FieldProvider = ContextualFieldProvider | ConstantFieldProvider;\n/**\n * Returns true if the given {@link FieldProvider} is a {@link ConstantFieldProvider}\n */\nexport function isConstant(\n\tfieldProvider: FieldProvider,\n): fieldProvider is ConstantFieldProvider {\n\treturn fieldProvider.length === 0;\n}\n\n/**\n * Provides a default value for a field.\n * @remarks\n * If present in a `FieldSchema`, when constructing new tree content that field can be omitted, and a default will be provided.\n * @system @sealed @public\n */\nexport interface DefaultProvider extends ErasedType<\"@fluidframework/tree.FieldProvider\"> {}\n\nexport function extractFieldProvider(input: DefaultProvider): FieldProvider {\n\treturn input as unknown as FieldProvider;\n}\n\nexport function getDefaultProvider(input: FieldProvider): DefaultProvider {\n\treturn input as unknown as DefaultProvider;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface FieldSchemaMetadata<TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata;\n\n\t/**\n\t * The description of the field.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the field is useful.\n\t * E.g., when converting a field schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` field.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}. Includes fields used by alpha features.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @alpha\n */\nexport interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown>\n\textends FieldSchemaMetadata<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Package internal construction API.\n */\nexport function createFieldSchema<\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n): FieldSchemaAlpha<Kind, Types, TCustomMetadata> {\n\treturn createFieldSchemaPrivate(kind, annotatedTypes, props);\n}\n\n/**\n * Implementation for {@link createFieldSchema}\n */\nlet createFieldSchemaPrivate: <\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n) => FieldSchemaAlpha<Kind, Types, TCustomMetadata>;\n\n/**\n * All policy for a specific field,\n * including functionality that does not have to be kept consistent across versions or deterministic.\n *\n * This can include policy for how to use this schema for \"view\" purposes, and well as how to expose editing APIs.\n * Use {@link SchemaFactory} to create the FieldSchema instances, for example {@link SchemaStatics.optional}.\n * @privateRemarks\n * Public access to the constructor is removed to prevent creating expressible but unsupported (or not stable) configurations.\n * {@link createFieldSchema} can be used internally to create instances.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @remarks\n * All implementations of this are actually {@link FieldSchemaAlpha} which exposes some additional alpha APIs.\n *\n * @sealed @public\n */\nexport class FieldSchema<\n\tout Kind extends FieldKind = FieldKind,\n\tout Types extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout TCustomMetadata = unknown,\n> {\n\t/**\n\t * This class is used with instanceof, and therefore should have nominal typing.\n\t * This field enforces that.\n\t */\n\tprotected _typeCheck!: MakeNominal;\n\n\tprivate readonly lazyTypes: Lazy<ReadonlySet<TreeNodeSchema>>;\n\n\t/**\n\t * What types of tree nodes are allowed in this field.\n\t * @remarks Counterpart to {@link FieldSchema.allowedTypes}, with any lazy definitions evaluated.\n\t */\n\tpublic get allowedTypeSet(): ReadonlySet<TreeNodeSchema> {\n\t\treturn this.lazyTypes.value;\n\t}\n\n\t/**\n\t * True if and only if, when constructing a node with this field, a value must be provided for it.\n\t */\n\tpublic readonly requiresValue: boolean;\n\n\t/**\n\t * {@inheritDoc FieldProps.metadata}\n\t */\n\tpublic get metadata(): FieldSchemaMetadata<TCustomMetadata> {\n\t\treturn this.props?.metadata ?? {};\n\t}\n\n\t/**\n\t * This class is `@sealed`: protected members like this constructor are for internal use only.\n\t * Use {@link SchemaFactory} to create the FieldSchema instances.\n\t */\n\tprotected constructor(\n\t\t/**\n\t\t * The {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind } of this field.\n\t\t * Determines the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t\t */\n\t\tpublic readonly kind: Kind,\n\t\t/**\n\t\t * What types of tree nodes are allowed in this field.\n\t\t */\n\t\tpublic readonly allowedTypes: Types,\n\t\t/**\n\t\t * Optional properties associated with the field.\n\t\t */\n\t\tpublic readonly props?: FieldProps<TCustomMetadata>,\n\t) {\n\t\tif (!(this instanceof FieldSchemaAlpha)) {\n\t\t\tthrow new UsageError(\"FieldSchema is @sealed: sub-classing is not allowed.\");\n\t\t}\n\n\t\tthis.lazyTypes = new Lazy(() => normalizeAllowedTypes(this.allowedTypes).evaluateSet());\n\t\t// TODO: optional fields should (by default) get a default provider that returns undefined, removing the need to special case them here:\n\t\tthis.requiresValue =\n\t\t\tthis.props?.defaultProvider === undefined && this.kind !== FieldKind.Optional;\n\t}\n}\n\n/**\n * {@link FieldSchema} including alpha APIs (currently {@link SimpleFieldSchema}).\n * @remarks\n * This class will go away once the alpha APIs are stable and implemented by {@link FieldSchema}.\n * @sealed @alpha\n */\nexport class FieldSchemaAlpha<\n\t\tKind extends FieldKind = FieldKind,\n\t\tTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>\n\textends FieldSchema<Kind, Types, TCustomMetadata>\n\timplements SimpleFieldSchema\n{\n\tprivate readonly propsAlpha: FieldPropsAlpha<TCustomMetadata> | undefined;\n\n\tpublic get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined {\n\t\treturn this.propsAlpha?.persistedMetadata;\n\t}\n\n\tstatic {\n\t\tcreateFieldSchemaPrivate = <\n\t\t\tKind2 extends FieldKind,\n\t\t\tTypes2 extends ImplicitAllowedTypes,\n\t\t\tTCustomMetadata2,\n\t\t>(\n\t\t\tkind: Kind2,\n\t\t\tannotatedAllowedTypes: Types2,\n\t\t\tprops?: FieldPropsAlpha<TCustomMetadata2>,\n\t\t) => new FieldSchemaAlpha(kind, annotatedAllowedTypes, props);\n\t}\n\n\t/**\n\t * {@link normalizeAllowedTypes|Normalized} version of {@link FieldSchema.allowedTypes}.\n\t */\n\tpublic readonly allowedTypesFull: AllowedTypesFull;\n\n\tpublic get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\treturn this.allowedTypesFull.evaluateIdentifiers();\n\t}\n\n\tpublic get simpleAllowedTypes(): ReadonlyMap<string, SimpleAllowedTypeAttributes> {\n\t\tconst types = this.allowedTypesFull.evaluate().types;\n\t\tconst info = new Map<string, SimpleAllowedTypeAttributes>();\n\n\t\tfor (const type of types) {\n\t\t\tinfo.set(type.type.identifier, {\n\t\t\t\tisStaged: type.metadata.stagedSchemaUpgrade !== undefined,\n\t\t\t});\n\t\t}\n\n\t\treturn info;\n\t}\n\n\tprotected constructor(\n\t\tkind: Kind,\n\t\ttypes: Types,\n\n\t\tprops?: FieldPropsAlpha<TCustomMetadata>,\n\t) {\n\t\tsuper(kind, types, props);\n\n\t\tconst normalizedTypes = normalizeAllowedTypes(types);\n\t\tthis.allowedTypesFull = normalizedTypes;\n\t\tthis.propsAlpha = props;\n\t}\n}\n\n/**\n * Normalizes a {@link ImplicitFieldSchema} or {@link ImplicitFieldSchema} to a {@link FieldSchema}.\n * @internal\n */\nexport function normalizeFieldSchema(\n\tschema: ImplicitFieldSchema | ImplicitFieldSchema,\n): FieldSchemaAlpha {\n\treturn schema instanceof FieldSchema\n\t\t? (schema as FieldSchemaAlpha)\n\t\t: createFieldSchema(FieldKind.Required, schema);\n}\n\n/**\n * Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.\n * @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be (respectively) reference equal.\n *\n * For example, comparing an ImplicitFieldSchema that is a {@link TreeNodeSchema} to an ImplicitFieldSchema that is a {@link FieldSchema}\n * will return true if they are the same kind, the FieldSchema has exactly one allowed type (the TreeNodeSchema), and they have equivalent FieldProps.\n */\nexport function areImplicitFieldSchemaEqual(\n\ta: ImplicitFieldSchema,\n\tb: ImplicitFieldSchema,\n): boolean {\n\treturn areFieldSchemaEqual(normalizeFieldSchema(a), normalizeFieldSchema(b));\n}\n\n/**\n * Returns true if the given {@link FieldSchema} are equivalent, otherwise false.\n * @remarks Two FieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be reference equal.\n */\nexport function areFieldSchemaEqual(a: FieldSchema, b: FieldSchema): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a.kind !== b.kind) {\n\t\treturn false;\n\t}\n\n\tif (!areFieldPropsEqual(a.props, b.props)) {\n\t\treturn false;\n\t}\n\n\treturn compareSets({ a: a.allowedTypeSet, b: b.allowedTypeSet });\n}\n\n/**\n * Returns true if the given {@link FieldProps} are equivalent, otherwise false.\n * @remarks FieldProps are considered equivalent if their keys and default providers are reference equal, and their metadata are {@link areMetadataEqual | equivalent}.\n */\nfunction areFieldPropsEqual(a: FieldProps | undefined, b: FieldProps | undefined): boolean {\n\t// If any new fields are added to FieldProps, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<areOnlyKeys<FieldProps, \"key\" | \"defaultProvider\" | \"metadata\">>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a?.key !== b?.key || a?.defaultProvider !== b?.defaultProvider) {\n\t\treturn false;\n\t}\n\n\tif (!areMetadataEqual(a?.metadata, b?.metadata)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns true if the given {@link FieldSchemaMetadata} are equivalent, otherwise false.\n * @remarks FieldSchemaMetadata are considered equivalent if their custom data and descriptions are (respectively) reference equal.\n */\nfunction areMetadataEqual(\n\ta: FieldSchemaMetadataAlpha | undefined,\n\tb: FieldSchemaMetadataAlpha | undefined,\n): boolean {\n\t// If any new fields are added to FieldSchemaMetadata, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<\n\t\tareOnlyKeys<FieldSchemaMetadataAlpha, \"custom\" | \"description\" | \"persistedMetadata\">\n\t>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\treturn (\n\t\tObject.is(a?.custom, b?.custom) &&\n\t\ta?.description === b?.description &&\n\t\tarePersistedMetadataEqual(a?.persistedMetadata, b?.persistedMetadata)\n\t);\n}\n\n/**\n * Returns true if the given persisted metadata fields are equivalent, otherwise false.\n * @remarks\n * Currently only handles shallow equality in the case where the keys are in the same order. This is acceptable for current use cases.\n */\nfunction arePersistedMetadataEqual(\n\ta: JsonCompatibleReadOnlyObject | undefined,\n\tb: JsonCompatibleReadOnlyObject | undefined,\n): boolean {\n\tif (Object.is(a, b)) {\n\t\treturn true;\n\t}\n\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\n\t// Note that the key order matters. If `a` and `b` have the same content but the keys are in a different order,\n\t// this method will return false.\n\tconst aStringified = JSON.stringify(a);\n\tconst bStringified = JSON.stringify(b);\n\n\treturn aStringified === bStringified;\n}\n\n/**\n * Schema for a field of a tree node.\n * @remarks\n * Implicitly treats {@link ImplicitAllowedTypes} as a Required field of that type.\n * @public\n */\nexport type ImplicitFieldSchema = FieldSchema | ImplicitAllowedTypes;\n\n/**\n * Converts an `ImplicitFieldSchema` to a property type suitable for reading a field with this that schema.\n *\n * @typeparam TSchema - When non-exact schema are provided this errors on the side of returning too general of a type (a conservative union of all possibilities).\n * This is ideal for \"output APIs\" - i.e. it converts the schema type to the runtime type that a user will _read_ from the tree.\n * Examples of such \"non-exact\" schema include `ImplicitFieldSchema`, `ImplicitAllowedTypes`, and TypeScript unions of schema types.\n * @public\n */\nexport type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> =\n\tTSchema extends FieldSchema<infer Kind, infer Types>\n\t\t? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind>\n\t\t: TSchema extends ImplicitAllowedTypes\n\t\t\t? TreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined;\n\n/**\n * Type of content that can be inserted into the tree for a field of the given schema.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam TSchema - Do not specify: default value used as implementation detail.\n * @public\n */\nexport type InsertableTreeFieldFromImplicitField<\n\tTSchemaInput extends ImplicitFieldSchema,\n\tTSchema = UnionToIntersection<TSchemaInput>,\n> = [TSchema] extends [FieldSchema<infer Kind, infer Types>]\n\t? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true>\n\t: [TSchema] extends [ImplicitAllowedTypes]\n\t\t? InsertableTreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t: never;\n\n/**\n * Content which could be inserted into a field within a tree.\n *\n * @see {@link Input}\n * @remarks\n * Extended version of {@link InsertableTreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * @alpha\n */\nexport type InsertableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? InsertableTreeFieldFromImplicitField<TSchema>\n\t: [TSchema] extends [UnsafeUnknownSchema]\n\t\t? InsertableContent | undefined\n\t\t: never;\n\n/**\n * Content which could be read from a field within a tree.\n *\n * @remarks\n * Extended version of {@link TreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * Since reading from fields with non-exact schema is still safe, this is only useful (compared to {@link TreeFieldFromImplicitField}) when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}\n * for use\n * @system @alpha\n */\nexport type ReadableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> =\n\tTreeFieldFromImplicitField<ReadSchema<TSchema>>;\n\n/**\n * Adapter to remove {@link (UnsafeUnknownSchema:type)} from a schema type so it can be used with types for generating APIs for reading data.\n *\n * @remarks\n * Since reading with non-exact schema is still safe, this is mainly useful when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}.\n * @system @alpha\n */\nexport type ReadSchema<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? TSchema\n\t: ImplicitFieldSchema;\n\n/**\n * Suitable for output.\n * For input must error on side of excluding undefined instead.\n * @system @public\n */\nexport type ApplyKind<T, Kind extends FieldKind> = {\n\t[FieldKind.Required]: T;\n\t[FieldKind.Optional]: T | undefined;\n\t[FieldKind.Identifier]: T;\n}[Kind];\n\n/**\n * Suitable for input.\n *\n * @see {@link Input}\n * @system @public\n */\nexport type ApplyKindInput<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = [\n\tKind,\n] extends [FieldKind.Required]\n\t? T\n\t: [Kind] extends [FieldKind.Optional]\n\t\t? T | undefined\n\t\t: [Kind] extends [FieldKind.Identifier]\n\t\t\t? DefaultsAreOptional extends true\n\t\t\t\t? T | undefined\n\t\t\t\t: T\n\t\t\t: never;\n"]}
1
+ {"version":3,"file":"fieldSchema.js","sourceRoot":"","sources":["../../src/simple-tree/fieldSchema.ts"],"names":[],"mappings":"AA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CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,YAAY,KAAK,YAAY,CAAC;AACtC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey } from \"../core/index.js\";\nimport type { FlexTreeHydratedContextMinimal } from \"../feature-libraries/index.js\";\nimport {\n\ttype MakeNominal,\n\tbrand,\n\ttype UnionToIntersection,\n\tcompareSets,\n\ttype requireTrue,\n\ttype areOnlyKeys,\n\ttype JsonCompatibleReadOnlyObject,\n} from \"../util/index.js\";\n\nimport type {\n\tTreeNodeSchema,\n\tTreeNode,\n\tUnhydratedFlexTreeNode,\n\tImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n\tTreeLeafValue,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tAllowedTypesFull,\n} from \"./core/index.js\";\nimport { AnnotatedAllowedTypesInternal, normalizeAllowedTypes } from \"./core/index.js\";\n\nimport type { SimpleAllowedTypeAttributes, SimpleFieldSchema } from \"./simpleSchema.js\";\nimport type { UnsafeUnknownSchema } from \"./unsafeUnknownSchema.js\";\nimport type { InsertableContent } from \"./unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Kind of a field on an {@link TreeObjectNode}.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * See {@link FieldSchema} for where these are used, and {@link SchemaFactory} for how to create schema which use them.\n * @public\n */\nexport enum FieldKind {\n\t/**\n\t * A field which can be empty or filled.\n\t * @remarks\n\t * Allows 0 or one child.\n\t */\n\tOptional,\n\t/**\n\t * A field which must always be filled.\n\t * @remarks\n\t * Only allows exactly one child.\n\t */\n\tRequired,\n\t/**\n\t * A special readonly field used for node identifier strings.\n\t * @remarks\n\t * Only allows exactly one child.\n\t *\n\t * See {@link SchemaFactory.identifier} for more details.\n\t */\n\tIdentifier,\n}\n\n/**\n * Maps from a property key to its corresponding {@link FieldProps.key | stored key} for the provided\n * {@link ImplicitFieldSchema | field schema}.\n *\n * @remarks\n * If an explicit stored key was specified in the schema, it will be used.\n * Otherwise, the stored key is the same as the property key.\n */\nexport function getStoredKey(propertyKey: string, fieldSchema: ImplicitFieldSchema): FieldKey {\n\treturn brand(getExplicitStoredKey(fieldSchema) ?? propertyKey);\n}\n\n/**\n * Gets the {@link FieldProps.key | stored key} specified by the schema, if one was explicitly specified.\n * Otherwise, returns undefined.\n */\nexport function getExplicitStoredKey(fieldSchema: ImplicitFieldSchema): string | undefined {\n\treturn fieldSchema instanceof FieldSchema ? fieldSchema.props?.key : undefined;\n}\n\n/**\n * Additional information to provide to a {@link FieldSchema}.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @public\n */\nexport interface FieldProps<TCustomMetadata = unknown> {\n\t/**\n\t * The unique identifier of a field, used in the persisted form of the tree.\n\t *\n\t * @remarks\n\t * If not explicitly set via the schema, this is the same as the schema's property key.\n\t *\n\t * Specifying a stored key that differs from the property key is particularly useful in refactoring scenarios.\n\t * To update the developer-facing API, while maintaining backwards compatibility with existing SharedTree data,\n\t * you can change the property key and specify the previous property key as the stored key.\n\t *\n\t * Notes:\n\t *\n\t * - Stored keys have no impact on standard JavaScript behavior, on tree nodes. For example, `Object.keys`\n\t * will always return the property keys specified in the schema, ignoring any stored keys that differ from\n\t * the property keys.\n\t *\n\t * - When specifying stored keys in an object schema, you must ensure that the final set of stored keys\n\t * (accounting for those implicitly derived from property keys) contains no duplicates.\n\t * This is validated at runtime.\n\t *\n\t * @example Refactoring code without breaking compatibility with existing data\n\t *\n\t * Consider some existing object schema:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \txPosition: schemaFactory.number,\n\t * \tyPosition: schemaFactory.number,\n\t * \tzPosition: schemaFactory.optional(schemaFactory.number),\n\t * });\n\t * ```\n\t *\n\t * Developers using nodes of this type would access the the `xPosition` property as `point.xPosition`.\n\t *\n\t * We would like to refactor the schema to omit \"Position\" from the property keys, but application data has\n\t * already been persisted using the original property keys. To maintain compatibility with existing data,\n\t * we can refactor the schema as follows:\n\t *\n\t * ```TypeScript\n\t * class Point extends schemaFactory.object(\"Point\", {\n\t * \tx: schemaFactory.required(schemaFactory.number, { key: \"xPosition\" }),\n\t * \ty: schemaFactory.required(schemaFactory.number, { key: \"yPosition\" }),\n\t * \tz: schemaFactory.optional(schemaFactory.number, { key: \"zPosition\" }),\n\t * });\n\t * ```\n\t *\n\t * Now, developers can access the `x` property as `point.x`, while existing data can still be collaborated on.\n\t *\n\t * @defaultValue If not specified, the key that is persisted is the property key that was specified in the schema.\n\t */\n\treadonly key?: string;\n\n\t/**\n\t * A default provider used for fields which were not provided any values.\n\t * @privateRemarks\n\t * We are using an erased type here, as we want to expose this API but `InsertableContent` and `NodeKeyManager` are not public.\n\t */\n\treadonly defaultProvider?: DefaultProvider;\n\n\t/**\n\t * Optional metadata to associate with the field.\n\t *\n\t * @remarks\n\t * Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.\n\t * Different clients in the same collaborative session may see different metadata for the same field.\n\t */\n\treadonly metadata?: FieldSchemaMetadata<TCustomMetadata>;\n}\n\n/**\n * {@link FieldProps} extended with additional `alpha` options.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @alpha @input\n */\nexport interface FieldPropsAlpha<TCustomMetadata = unknown>\n\textends FieldProps<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for a field schema.\n\t * @remarks\n\t * Sets {@link SimpleFieldSchema.persistedMetadata}.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * A {@link FieldProvider} which requires additional context in order to produce its content\n */\nexport type ContextualFieldProvider = (\n\tcontext: FlexTreeHydratedContextMinimal | \"UseGlobalContext\",\n) => UnhydratedFlexTreeNode[];\n/**\n * A {@link FieldProvider} which can produce its content in a vacuum.\n */\nexport type ConstantFieldProvider = () => UnhydratedFlexTreeNode[];\n/**\n * A function which produces content for a field every time that it is called.\n */\nexport type FieldProvider = ContextualFieldProvider | ConstantFieldProvider;\n/**\n * Returns true if the given {@link FieldProvider} is a {@link ConstantFieldProvider}\n */\nexport function isConstant(\n\tfieldProvider: FieldProvider,\n): fieldProvider is ConstantFieldProvider {\n\treturn fieldProvider.length === 0;\n}\n\n/**\n * Provides a default value for a field.\n * @remarks\n * If present in a `FieldSchema`, when constructing new tree content that field can be omitted, and a default will be provided.\n * @system @sealed @public\n */\nexport interface DefaultProvider extends ErasedType<\"@fluidframework/tree.FieldProvider\"> {}\n\nexport function extractFieldProvider(input: DefaultProvider): FieldProvider {\n\treturn input as unknown as FieldProvider;\n}\n\nexport function getDefaultProvider(input: FieldProvider): DefaultProvider {\n\treturn input as unknown as DefaultProvider;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface FieldSchemaMetadata<TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata;\n\n\t/**\n\t * The description of the field.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the field is useful.\n\t * E.g., when converting a field schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` field.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Metadata associated with a {@link FieldSchema}. Includes fields used by alpha features.\n *\n * @remarks Specified via {@link FieldProps.metadata}.\n *\n * @sealed\n * @alpha\n */\nexport interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown>\n\textends FieldSchemaMetadata<TCustomMetadata> {\n\t/**\n\t * The persisted metadata for this schema element.\n\t */\n\treadonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;\n}\n\n/**\n * Package internal construction API.\n */\nexport function createFieldSchema<\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata = unknown,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n): FieldSchemaAlpha<Kind, Types, TCustomMetadata> {\n\treturn createFieldSchemaPrivate(kind, annotatedTypes, props);\n}\n\n/**\n * Implementation for {@link createFieldSchema}\n */\nlet createFieldSchemaPrivate: <\n\tKind extends FieldKind,\n\tTypes extends ImplicitAllowedTypes,\n\tTCustomMetadata,\n>(\n\tkind: Kind,\n\tannotatedTypes: Types,\n\tprops?: FieldProps<TCustomMetadata>,\n) => FieldSchemaAlpha<Kind, Types, TCustomMetadata>;\n\n/**\n * All policy for a specific field,\n * including functionality that does not have to be kept consistent across versions or deterministic.\n *\n * This can include policy for how to use this schema for \"view\" purposes, and well as how to expose editing APIs.\n * Use {@link SchemaFactory} to create the FieldSchema instances, for example {@link SchemaStatics.optional}.\n * @privateRemarks\n * Public access to the constructor is removed to prevent creating expressible but unsupported (or not stable) configurations.\n * {@link createFieldSchema} can be used internally to create instances.\n *\n * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.\n * See {@link FieldSchemaMetadata.custom}.\n *\n * @remarks\n * All implementations of this are actually {@link FieldSchemaAlpha} which exposes some additional alpha APIs.\n *\n * @sealed @public\n */\nexport class FieldSchema<\n\tout Kind extends FieldKind = FieldKind,\n\tout Types extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout TCustomMetadata = unknown,\n> {\n\t/**\n\t * This class is used with instanceof, and therefore should have nominal typing.\n\t * This field enforces that.\n\t */\n\tprotected _typeCheck!: MakeNominal;\n\n\tprivate readonly lazyTypes: Lazy<ReadonlySet<TreeNodeSchema>>;\n\n\t/**\n\t * What types of tree nodes are allowed in this field.\n\t * @remarks Counterpart to {@link FieldSchema.allowedTypes}, with any lazy definitions evaluated.\n\t */\n\tpublic get allowedTypeSet(): ReadonlySet<TreeNodeSchema> {\n\t\treturn this.lazyTypes.value;\n\t}\n\n\t/**\n\t * True if and only if, when constructing a node with this field, a value must be provided for it.\n\t */\n\tpublic readonly requiresValue: boolean;\n\n\t/**\n\t * {@inheritDoc FieldProps.metadata}\n\t */\n\tpublic get metadata(): FieldSchemaMetadata<TCustomMetadata> {\n\t\treturn this.props?.metadata ?? {};\n\t}\n\n\t/**\n\t * This class is `@sealed`: protected members like this constructor are for internal use only.\n\t * Use {@link SchemaFactory} to create the FieldSchema instances.\n\t */\n\tprotected constructor(\n\t\t/**\n\t\t * The {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind } of this field.\n\t\t * Determines the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t\t */\n\t\tpublic readonly kind: Kind,\n\t\t/**\n\t\t * What types of tree nodes are allowed in this field.\n\t\t */\n\t\tpublic readonly allowedTypes: Types,\n\t\t/**\n\t\t * Optional properties associated with the field.\n\t\t */\n\t\tpublic readonly props?: FieldProps<TCustomMetadata>,\n\t) {\n\t\tif (!(this instanceof FieldSchemaAlpha)) {\n\t\t\tthrow new UsageError(\"FieldSchema is @sealed: sub-classing is not allowed.\");\n\t\t}\n\n\t\tthis.lazyTypes = new Lazy(() => normalizeAllowedTypes(this.allowedTypes).evaluateSet());\n\t\t// TODO: optional fields should (by default) get a default provider that returns undefined, removing the need to special case them here:\n\t\tthis.requiresValue =\n\t\t\tthis.props?.defaultProvider === undefined && this.kind !== FieldKind.Optional;\n\t}\n}\n\n/**\n * {@link FieldSchema} including alpha APIs (currently {@link SimpleFieldSchema}).\n * @remarks\n * This class will go away once the alpha APIs are stable and implemented by {@link FieldSchema}.\n * @sealed @alpha\n */\nexport class FieldSchemaAlpha<\n\t\tKind extends FieldKind = FieldKind,\n\t\tTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\t\tTCustomMetadata = unknown,\n\t>\n\textends FieldSchema<Kind, Types, TCustomMetadata>\n\timplements SimpleFieldSchema\n{\n\tprivate readonly propsAlpha: FieldPropsAlpha<TCustomMetadata> | undefined;\n\n\tpublic get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined {\n\t\treturn this.propsAlpha?.persistedMetadata;\n\t}\n\n\tstatic {\n\t\tcreateFieldSchemaPrivate = <\n\t\t\tKind2 extends FieldKind,\n\t\t\tTypes2 extends ImplicitAllowedTypes,\n\t\t\tTCustomMetadata2,\n\t\t>(\n\t\t\tkind: Kind2,\n\t\t\tannotatedAllowedTypes: Types2,\n\t\t\tprops?: FieldPropsAlpha<TCustomMetadata2>,\n\t\t) => new FieldSchemaAlpha(kind, annotatedAllowedTypes, props);\n\t}\n\n\t/**\n\t * {@link normalizeAllowedTypes|Normalized} version of {@link FieldSchema.allowedTypes}.\n\t */\n\tpublic readonly allowedTypesFull: AllowedTypesFull;\n\n\tpublic get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\treturn this.allowedTypesFull.evaluateIdentifiers();\n\t}\n\n\tpublic get simpleAllowedTypes(): ReadonlyMap<string, SimpleAllowedTypeAttributes> {\n\t\treturn AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(this.allowedTypesFull);\n\t}\n\n\tprotected constructor(\n\t\tkind: Kind,\n\t\ttypes: Types,\n\n\t\tprops?: FieldPropsAlpha<TCustomMetadata>,\n\t) {\n\t\tsuper(kind, types, props);\n\n\t\tconst normalizedTypes = normalizeAllowedTypes(types);\n\t\tthis.allowedTypesFull = normalizedTypes;\n\t\tthis.propsAlpha = props;\n\t}\n}\n\n/**\n * Normalizes a {@link ImplicitFieldSchema} or {@link ImplicitFieldSchema} to a {@link FieldSchema}.\n * @internal\n */\nexport function normalizeFieldSchema(\n\tschema: ImplicitFieldSchema | ImplicitFieldSchema,\n): FieldSchemaAlpha {\n\treturn schema instanceof FieldSchema\n\t\t? (schema as FieldSchemaAlpha)\n\t\t: createFieldSchema(FieldKind.Required, schema);\n}\n\n/**\n * Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.\n * @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be (respectively) reference equal.\n *\n * For example, comparing an ImplicitFieldSchema that is a {@link TreeNodeSchema} to an ImplicitFieldSchema that is a {@link FieldSchema}\n * will return true if they are the same kind, the FieldSchema has exactly one allowed type (the TreeNodeSchema), and they have equivalent FieldProps.\n */\nexport function areImplicitFieldSchemaEqual(\n\ta: ImplicitFieldSchema,\n\tb: ImplicitFieldSchema,\n): boolean {\n\treturn areFieldSchemaEqual(normalizeFieldSchema(a), normalizeFieldSchema(b));\n}\n\n/**\n * Returns true if the given {@link FieldSchema} are equivalent, otherwise false.\n * @remarks Two FieldSchema are considered equivalent if all of the following are true:\n * 1. They have the same {@link FieldKind | kinds}.\n * 2. They have {@link areFieldPropsEqual | equivalent FieldProps}.\n * 3. They have the same exact set of allowed types. The allowed types must be reference equal.\n */\nexport function areFieldSchemaEqual(a: FieldSchema, b: FieldSchema): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a.kind !== b.kind) {\n\t\treturn false;\n\t}\n\n\tif (!areFieldPropsEqual(a.props, b.props)) {\n\t\treturn false;\n\t}\n\n\treturn compareSets({ a: a.allowedTypeSet, b: b.allowedTypeSet });\n}\n\n/**\n * Returns true if the given {@link FieldProps} are equivalent, otherwise false.\n * @remarks FieldProps are considered equivalent if their keys and default providers are reference equal, and their metadata are {@link areMetadataEqual | equivalent}.\n */\nfunction areFieldPropsEqual(a: FieldProps | undefined, b: FieldProps | undefined): boolean {\n\t// If any new fields are added to FieldProps, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<areOnlyKeys<FieldProps, \"key\" | \"defaultProvider\" | \"metadata\">>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (a?.key !== b?.key || a?.defaultProvider !== b?.defaultProvider) {\n\t\treturn false;\n\t}\n\n\tif (!areMetadataEqual(a?.metadata, b?.metadata)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns true if the given {@link FieldSchemaMetadata} are equivalent, otherwise false.\n * @remarks FieldSchemaMetadata are considered equivalent if their custom data and descriptions are (respectively) reference equal.\n */\nfunction areMetadataEqual(\n\ta: FieldSchemaMetadataAlpha | undefined,\n\tb: FieldSchemaMetadataAlpha | undefined,\n): boolean {\n\t// If any new fields are added to FieldSchemaMetadata, this check will stop compiling as a reminder that this function needs to be updated.\n\ttype _keys = requireTrue<\n\t\tareOnlyKeys<FieldSchemaMetadataAlpha, \"custom\" | \"description\" | \"persistedMetadata\">\n\t>;\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\treturn (\n\t\tObject.is(a?.custom, b?.custom) &&\n\t\ta?.description === b?.description &&\n\t\tarePersistedMetadataEqual(a?.persistedMetadata, b?.persistedMetadata)\n\t);\n}\n\n/**\n * Returns true if the given persisted metadata fields are equivalent, otherwise false.\n * @remarks\n * Currently only handles shallow equality in the case where the keys are in the same order. This is acceptable for current use cases.\n */\nfunction arePersistedMetadataEqual(\n\ta: JsonCompatibleReadOnlyObject | undefined,\n\tb: JsonCompatibleReadOnlyObject | undefined,\n): boolean {\n\tif (Object.is(a, b)) {\n\t\treturn true;\n\t}\n\n\tif (a === undefined || b === undefined) {\n\t\treturn false;\n\t}\n\n\t// Note that the key order matters. If `a` and `b` have the same content but the keys are in a different order,\n\t// this method will return false.\n\tconst aStringified = JSON.stringify(a);\n\tconst bStringified = JSON.stringify(b);\n\n\treturn aStringified === bStringified;\n}\n\n/**\n * Schema for a field of a tree node.\n * @remarks\n * Implicitly treats {@link ImplicitAllowedTypes} as a Required field of that type.\n * @public\n */\nexport type ImplicitFieldSchema = FieldSchema | ImplicitAllowedTypes;\n\n/**\n * Converts an `ImplicitFieldSchema` to a property type suitable for reading a field with this that schema.\n *\n * @typeparam TSchema - When non-exact schema are provided this errors on the side of returning too general of a type (a conservative union of all possibilities).\n * This is ideal for \"output APIs\" - i.e. it converts the schema type to the runtime type that a user will _read_ from the tree.\n * Examples of such \"non-exact\" schema include `ImplicitFieldSchema`, `ImplicitAllowedTypes`, and TypeScript unions of schema types.\n * @public\n */\nexport type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> =\n\tTSchema extends FieldSchema<infer Kind, infer Types>\n\t\t? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind>\n\t\t: TSchema extends ImplicitAllowedTypes\n\t\t\t? TreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined;\n\n/**\n * Type of content that can be inserted into the tree for a field of the given schema.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam TSchema - Do not specify: default value used as implementation detail.\n * @public\n */\nexport type InsertableTreeFieldFromImplicitField<\n\tTSchemaInput extends ImplicitFieldSchema,\n\tTSchema = UnionToIntersection<TSchemaInput>,\n> = [TSchema] extends [FieldSchema<infer Kind, infer Types>]\n\t? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true>\n\t: [TSchema] extends [ImplicitAllowedTypes]\n\t\t? InsertableTreeNodeFromImplicitAllowedTypes<TSchema>\n\t\t: never;\n\n/**\n * Content which could be inserted into a field within a tree.\n *\n * @see {@link Input}\n * @remarks\n * Extended version of {@link InsertableTreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * @alpha\n */\nexport type InsertableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? InsertableTreeFieldFromImplicitField<TSchema>\n\t: [TSchema] extends [UnsafeUnknownSchema]\n\t\t? InsertableContent | undefined\n\t\t: never;\n\n/**\n * Content which could be read from a field within a tree.\n *\n * @remarks\n * Extended version of {@link TreeFieldFromImplicitField} that also allows {@link (UnsafeUnknownSchema:type)}.\n * Since reading from fields with non-exact schema is still safe, this is only useful (compared to {@link TreeFieldFromImplicitField}) when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}\n * for use\n * @system @alpha\n */\nexport type ReadableField<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> =\n\tTreeFieldFromImplicitField<ReadSchema<TSchema>>;\n\n/**\n * Adapter to remove {@link (UnsafeUnknownSchema:type)} from a schema type so it can be used with types for generating APIs for reading data.\n *\n * @remarks\n * Since reading with non-exact schema is still safe, this is mainly useful when the schema is also used as input and thus allows {@link (UnsafeUnknownSchema:type)}.\n * @system @alpha\n */\nexport type ReadSchema<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> = [\n\tTSchema,\n] extends [ImplicitFieldSchema]\n\t? TSchema\n\t: ImplicitFieldSchema;\n\n/**\n * Suitable for output.\n * For input must error on side of excluding undefined instead.\n * @system @public\n */\nexport type ApplyKind<T, Kind extends FieldKind> = {\n\t[FieldKind.Required]: T;\n\t[FieldKind.Optional]: T | undefined;\n\t[FieldKind.Identifier]: T;\n}[Kind];\n\n/**\n * Suitable for input.\n *\n * @see {@link Input}\n * @system @public\n */\nexport type ApplyKindInput<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = [\n\tKind,\n] extends [FieldKind.Required]\n\t? T\n\t: [Kind] extends [FieldKind.Optional]\n\t\t? T | undefined\n\t\t: [Kind] extends [FieldKind.Identifier]\n\t\t\t? DefaultsAreOptional extends true\n\t\t\t\t? T | undefined\n\t\t\t\t: T\n\t\t\t: never;\n"]}
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { typeNameSymbol, typeSchemaSymbol, contentSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type AllowedTypesFullEvaluated, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, type NodeFromSchema, isTreeNodeSchemaClass, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type InsertableTreeNodeFromAllowedTypes, type InsertableTypedNode, type NodeBuilderData, type Input, normalizeAllowedTypes, type NodeSchemaMetadata, type ImplicitAllowedTypes, type AllowedTypesMetadata, evaluateLazySchema, type UnannotateAllowedTypesList, type AllowedTypeMetadata, type AnnotatedAllowedTypes, type SchemaUpgrade, type LazyItem, type FlexList, type FlexListToUnion, type ExtractItemType, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, type SimpleNodeSchemaBase, withBufferedTreeEvents, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, AnnotatedAllowedTypesInternal, type NumberKeys, } from "./core/index.js";
5
+ export { typeNameSymbol, typeSchemaSymbol, contentSchemaSymbol, type WithType, type TreeNodeSchema, type AnnotatedAllowedType, type AllowedTypesFullEvaluated, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getInnerNode, getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, getKernel, type NodeFromSchema, isTreeNodeSchemaClass, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, type InsertableTreeNodeFromAllowedTypes, type InsertableTypedNode, type NodeBuilderData, type Input, normalizeAllowedTypes, type NodeSchemaMetadata, type ImplicitAllowedTypes, type AllowedTypesMetadata, evaluateLazySchema, type UnannotateAllowedTypesList, type AllowedTypeMetadata, type AnnotatedAllowedTypes, SchemaUpgrade, type LazyItem, type FlexList, type FlexListToUnion, type ExtractItemType, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, type SimpleNodeSchemaBase, withBufferedTreeEvents, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, AnnotatedAllowedTypesInternal, type NumberKeys, ExpectStored, createSchemaUpgrade, } from "./core/index.js";
6
6
  export { walkFieldSchema } from "./walkFieldSchema.js";
7
7
  export type { UnsafeUnknownSchema, Insertable } from "./unsafeUnknownSchema.js";
8
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type TreeSchema, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type SchemaStaticsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, getShouldIncrementallySummarizeAllowedTypes, type SchemaFactory_base, } from "./api/index.js";
8
+ export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, treeNodeApi, type TreeNodeApi, type NodeChangedData, borrowCursorFromTreeNodeOrValue, exportConcise, importConcise, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, type TreeSchemaEncodingOptions, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type TreeEncodingOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, SchemaCompatibilityTester, type Unenforced, type System_Unsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type TreeViewAlpha, type TreeViewBeta, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, getPropertyKeyFromStoredKey, getStoredKey, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type FieldSchemaAlphaUnsafe, getIdentifierFromNode, type TreeSchema, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, schemaStatics, type TreeChangeEvents, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, KeyEncodingOptions, type TreeParsingOptions, incrementalSummaryHint, getShouldIncrementallySummarizeAllowedTypes, type SchemaFactory_base, } from "./api/index.js";
9
9
  export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBaseAlpha, SimpleObjectFieldSchema, SimpleRecordNodeSchema, SimpleAllowedTypeAttributes, } from "./simpleSchema.js";
10
10
  export { type ImplicitFieldSchema, type TreeFieldFromImplicitField, FieldKind, FieldSchema, FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type DefaultProvider, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type ApplyKindInput, type ReadableField, type ReadSchema, } from "./fieldSchema.js";
11
11
  export { tryGetTreeNodeForField } from "./getTreeNodeForField.js";
@@ -15,4 +15,5 @@ export { prepareForInsertion, prepareForInsertionContextless, } from "./prepareF
15
15
  export { toStoredSchema, getStoredSchema, convertFieldKind, toUpgradeSchema, toInitialSchema, convertField, toUnhydratedSchema, restrictiveStoredSchemaGenerationOptions, permissiveStoredSchemaGenerationOptions, } from "./toStoredSchema.js";
16
16
  export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
17
17
  export type { LeafSchema } from "./leafNodeSchema.js";
18
+ export { encodeSimpleSchema, decodeSimpleSchema, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, } from "./api/index.js";
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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