@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
@@ -4,33 +4,49 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.convertAllowedTypes = exports.allowedTypeFilter = void 0;
7
+ exports.convertAllowedTypes = exports.allowedTypeFilter = exports.ExpectStored = void 0;
8
8
  const index_js_1 = require("../../util/index.js");
9
- const allowedTypes_js_1 = require("./allowedTypes.js");
9
+ const internal_1 = require("@fluidframework/telemetry-utils/internal");
10
+ /**
11
+ * Marker type indicating that the input schema is already a stored schema.
12
+ */
13
+ exports.ExpectStored = Symbol("ExpectStored");
10
14
  /**
11
15
  * Filters an allowed type based on the provided options.
12
16
  * @param allowedType - The allowed type to filter.
13
17
  * @param options - The options to use for filtering.
14
18
  * @returns Whether the allowed type passes the filter.
15
19
  */
16
- function allowedTypeFilter(allowedType, options) {
20
+ function allowedTypeFilter(data, options) {
21
+ if (options === exports.ExpectStored) {
22
+ if (data.isStaged !== undefined) {
23
+ throw new internal_1.UsageError("Failed to covert view schema to stored schema. The simple schema provided was indicated to be a stored schema by the use of `ExpectStored`, but view schema specific content was encountered which requires a `StoredFromViewSchemaGenerationOptions` to process.");
24
+ }
25
+ return true;
26
+ }
27
+ if (data.isStaged === undefined) {
28
+ throw new internal_1.UsageError("Failed to covert view schema to stored schema. The simple schema provided as the view schema was actually a stored schema. If this was intended, use `ExpectStored` for the `StoredSchemaGenerationOptions` to indicate the input is already a stored schema and only a format conversion is required.");
29
+ }
17
30
  // If the allowed type is staged, only include it if the options allow it.
18
- if (allowedType.metadata.stagedSchemaUpgrade !== undefined) {
19
- return options.includeStaged(allowedType.metadata.stagedSchemaUpgrade);
31
+ if (data.isStaged === false) {
32
+ return true;
20
33
  }
21
- return true;
34
+ return options.includeStaged(data.isStaged);
22
35
  }
23
36
  exports.allowedTypeFilter = allowedTypeFilter;
24
37
  /**
25
- * Converts an ImplicitAllowedTypes to a stored schema.
38
+ * Converts a {@link SimpleAllowedTypes} to a stored schema.
26
39
  * @param schema - The schema to convert.
27
40
  * @param options - The options to use for filtering.
28
41
  * @returns The converted stored schema.
29
42
  */
30
43
  function convertAllowedTypes(schema, options) {
31
- const filtered = (0, allowedTypes_js_1.normalizeAndEvaluateAnnotatedAllowedTypes)(schema)
32
- .types.filter((allowedType) => allowedTypeFilter(allowedType, options))
33
- .map((a) => (0, index_js_1.brand)(a.type.identifier));
44
+ const filtered = [];
45
+ for (const [type, data] of schema) {
46
+ if (allowedTypeFilter(data, options)) {
47
+ filtered.push((0, index_js_1.brand)(type));
48
+ }
49
+ }
34
50
  return new Set(filtered);
35
51
  }
36
52
  exports.convertAllowedTypes = convertAllowedTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"toStored.js","sourceRoot":"","sources":["../../../src/simple-tree/core/toStored.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAA4C;AAC5C,uDAK2B;AAe3B;;;;;GAKG;AACH,SAAgB,iBAAiB,CAChC,WAAiC,EACjC,OAAsC;IAEtC,0EAA0E;IAC1E,IAAI,WAAW,CAAC,QAAQ,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AATD,8CASC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAClC,MAA4B,EAC5B,OAAsC;IAEtC,MAAM,QAAQ,GAA+B,IAAA,2DAAyC,EACrF,MAAM,CACN;SACC,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;SACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAVD,kDAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { brand } from \"../../util/index.js\";\nimport {\n\tnormalizeAndEvaluateAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype ImplicitAllowedTypes,\n\ttype SchemaUpgrade,\n} from \"./allowedTypes.js\";\nimport type { TreeNodeSchemaIdentifier, TreeTypeSet } from \"../../core/index.js\";\n\n/**\n * Options for generating a {@link TreeStoredSchema} from view schema.\n */\nexport interface StoredSchemaGenerationOptions {\n\t/**\n\t * Determines whether to include staged schema in the resulting stored schema.\n\t * @remarks\n\t * Due to caching, the behavior of this function must be pure.\n\t */\n\tincludeStaged(upgrade: SchemaUpgrade): boolean;\n}\n\n/**\n * Filters an allowed type based on the provided options.\n * @param allowedType - The allowed type to filter.\n * @param options - The options to use for filtering.\n * @returns Whether the allowed type passes the filter.\n */\nexport function allowedTypeFilter(\n\tallowedType: AnnotatedAllowedType,\n\toptions: StoredSchemaGenerationOptions,\n): boolean {\n\t// If the allowed type is staged, only include it if the options allow it.\n\tif (allowedType.metadata.stagedSchemaUpgrade !== undefined) {\n\t\treturn options.includeStaged(allowedType.metadata.stagedSchemaUpgrade);\n\t}\n\treturn true;\n}\n\n/**\n * Converts an ImplicitAllowedTypes to a stored schema.\n * @param schema - The schema to convert.\n * @param options - The options to use for filtering.\n * @returns The converted stored schema.\n */\nexport function convertAllowedTypes(\n\tschema: ImplicitAllowedTypes,\n\toptions: StoredSchemaGenerationOptions,\n): TreeTypeSet {\n\tconst filtered: TreeNodeSchemaIdentifier[] = normalizeAndEvaluateAnnotatedAllowedTypes(\n\t\tschema,\n\t)\n\t\t.types.filter((allowedType) => allowedTypeFilter(allowedType, options))\n\t\t.map((a) => brand(a.type.identifier));\n\treturn new Set(filtered);\n}\n"]}
1
+ {"version":3,"file":"toStored.js","sourceRoot":"","sources":["../../../src/simple-tree/core/toStored.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAA4C;AAI5C,uEAAsE;AActE;;GAEG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAOnD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAChC,IAAiC,EACjC,OAAsC;IAEtC,IAAI,OAAO,KAAK,oBAAY,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,qBAAU,CACnB,mQAAmQ,CACnQ,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,qBAAU,CACnB,wSAAwS,CACxS,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAzBD,8CAyBC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAClC,MAA0B,EAC1B,OAAsC;IAEtC,MAAM,QAAQ,GAA+B,EAAE,CAAC;IAChD,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC;QACnC,IAAI,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,IAAA,gBAAK,EAA2B,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC;IACF,CAAC;IACD,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAXD,kDAWC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { brand } from \"../../util/index.js\";\nimport type { SchemaUpgrade } from \"./allowedTypes.js\";\nimport type { TreeNodeSchemaIdentifier, TreeTypeSet } from \"../../core/index.js\";\nimport type { SimpleAllowedTypeAttributes, SimpleAllowedTypes } from \"../simpleSchema.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Options for generating a {@link TreeStoredSchema} from view schema.\n */\nexport interface StoredFromViewSchemaGenerationOptions {\n\t/**\n\t * Determines whether to include staged schema in the resulting stored schema.\n\t * @remarks\n\t * Due to caching, the behavior of this function must be pure.\n\t */\n\tincludeStaged(upgrade: SchemaUpgrade): boolean;\n}\n\n/**\n * Marker type indicating that the input schema is already a stored schema.\n */\nexport const ExpectStored = Symbol(\"ExpectStored\");\nexport type ExpectStored = typeof ExpectStored;\n\nexport type StoredSchemaGenerationOptions =\n\t| StoredFromViewSchemaGenerationOptions\n\t| ExpectStored;\n\n/**\n * Filters an allowed type based on the provided options.\n * @param allowedType - The allowed type to filter.\n * @param options - The options to use for filtering.\n * @returns Whether the allowed type passes the filter.\n */\nexport function allowedTypeFilter(\n\tdata: SimpleAllowedTypeAttributes,\n\toptions: StoredSchemaGenerationOptions,\n): boolean {\n\tif (options === ExpectStored) {\n\t\tif (data.isStaged !== undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Failed to covert view schema to stored schema. The simple schema provided was indicated to be a stored schema by the use of `ExpectStored`, but view schema specific content was encountered which requires a `StoredFromViewSchemaGenerationOptions` to process.\",\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (data.isStaged === undefined) {\n\t\tthrow new UsageError(\n\t\t\t\"Failed to covert view schema to stored schema. The simple schema provided as the view schema was actually a stored schema. If this was intended, use `ExpectStored` for the `StoredSchemaGenerationOptions` to indicate the input is already a stored schema and only a format conversion is required.\",\n\t\t);\n\t}\n\n\t// If the allowed type is staged, only include it if the options allow it.\n\tif (data.isStaged === false) {\n\t\treturn true;\n\t}\n\n\treturn options.includeStaged(data.isStaged);\n}\n\n/**\n * Converts a {@link SimpleAllowedTypes} to a stored schema.\n * @param schema - The schema to convert.\n * @param options - The options to use for filtering.\n * @returns The converted stored schema.\n */\nexport function convertAllowedTypes(\n\tschema: SimpleAllowedTypes,\n\toptions: StoredSchemaGenerationOptions,\n): TreeTypeSet {\n\tconst filtered: TreeNodeSchemaIdentifier[] = [];\n\tfor (const [type, data] of schema) {\n\t\tif (allowedTypeFilter(data, options)) {\n\t\t\tfiltered.push(brand<TreeNodeSchemaIdentifier>(type));\n\t\t}\n\t}\n\treturn new Set(filtered);\n}\n"]}
@@ -10,7 +10,7 @@ const internal_1 = require("@fluidframework/core-utils/internal");
10
10
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
11
11
  const treeNodeKernel_js_1 = require("./treeNodeKernel.js");
12
12
  const treeNodeSchema_js_1 = require("./treeNodeSchema.js");
13
- // eslint-disable-next-line import/no-deprecated
13
+ // eslint-disable-next-line import-x/no-deprecated
14
14
  const withType_js_1 = require("./withType.js");
15
15
  const flexList_js_1 = require("./flexList.js");
16
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"treeNode.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,2DAA2D;AAC3D,2DAAyE;AACzE,gDAAgD;AAChD,+CAAqF;AACrF,+CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAsB,QAAQ;IAmEtB,MAAM,CAAC,mCAAC,MAAM,CAAC,WAAW,EAAC,CAA8B,KAAc;QAC7E,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,4BAAQ,CAAC,IAAI,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAA,iBAAM,EAAC,WAAW,IAAI,MAAM,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvE,OAAO,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,YAAsB,KAAc;QArFpC;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;QACM,kCAAiB;QA4DzB,IAAI,KAAK,KAAK,oBAAY,EAAE,CAAC;YAC5B,MAAM,IAAI,qBAAU,CAAC,+DAA+D,CAAC,CAAC;QACvF,CAAC;IACF,CAAC;CACD;AA3FD,4BA2FC;AACD,gJAAgJ;AAChJ,IAAA,uBAAS,EAAC,QAAQ,CAAC,CAAC;AAEpB;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,OAAsB,EAAE,IAAY;IACpE,IAAI,QAAQ,GAAG,OAAO,CAAC;IACvB,OAAO,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AATD,4CASC","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 { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { tryGetTreeNodeSchema } from \"./treeNodeKernel.js\";\nimport { NodeKind, type TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n// eslint-disable-next-line import/no-deprecated\nimport { type WithType, typeNameSymbol, type typeSchemaSymbol } from \"./withType.js\";\nimport { markEager } from \"./flexList.js\";\n\n/**\n * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes extend.\n *\n * This type can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * There are three ways to get instances of TreeNode:\n *\n * 1. From a {@link TreeView} loading nodes from an existing document, or creating local copies of nodes inserted by a remote collaborator.\n * This case provides an {@link InternalTreeNode} to the constructor: subclasses must not modify how the constructor handles this case.\n *\n * 2. Explicit construction of {@link Unhydrated} nodes using either {@link TreeNodeSchemaClass} as a constructor or {@link TreeNodeSchemaNonClass|TreeNodeSchemaNonClass.create}.\n * Either way the {@link TreeNodeSchema} produced must be produced using a {@link SchemaFactory}.\n * There are also higher level APIs which wrap these, including {@link (TreeBeta:interface).create}, {@link (TreeBeta:interface).clone},\n * and import APIs like {@link (TreeBeta:interface).importConcise}, {@link (TreeAlpha:interface).importVerbose}, and {@link (TreeAlpha:interface).importCompressed}.\n *\n * 3. Implicit construction: Several APIs which logically require an unhydrated TreeNode also allow passing in a value which could be used to explicitly construct the node instead.\n * These APIs internally call the constructor with the provided value (typically behaving like {@link (TreeAlpha:interface).create}), so it's really just a special case of the above option.\n * Note that when constructing nodes, sometimes implicit construction is not allowed\n * (either at runtime due to ambiguous types or at compile time due to TypeScript limitations):\n * in such cases, explicit construction must be used.\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.\n * @sealed @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic abstract get [typeNameSymbol](): string;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;\n\n\t/**\n\t * Provides `instanceof` support for testing if a value is a `TreeNode`.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Due to type-only export, this functionality is not available outside the package.\n\t */\n\tpublic static [Symbol.hasInstance](value: unknown): value is TreeNode;\n\n\t/**\n\t * Provides `instanceof` support for all schema classes with public constructors.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.\n\t */\n\tpublic static [Symbol.hasInstance]<\n\t\tTSchema extends abstract new (\n\t\t\t...args: any[]\n\t\t) => TreeNode,\n\t>(this: TSchema, value: unknown): value is InstanceType<TSchema>;\n\n\tpublic static [Symbol.hasInstance](this: { prototype: object }, value: unknown): boolean {\n\t\tconst schema = tryGetTreeNodeSchema(value);\n\n\t\tif (schema === undefined || schema.kind === NodeKind.Leaf) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(\"prototype\" in schema, 0x98a /* expected class based schema */);\n\t\treturn inPrototypeChain(schema.prototype, this.prototype);\n\t}\n\n\t/**\n\t * TreeNodes must extend schema classes created by SchemaFactory, and therefore this constructor should not be invoked directly by code outside this package.\n\t * @privateRemarks\n\t * `token` must be the {@link privateToken} value, which is not package exported.\n\t * This is used to detect invalid subclasses.\n\t *\n\t * All valid subclass should use {@link TreeNodeValid}, but this code doesn't directly reference it to avoid cyclic dependencies.\n\t */\n\tprotected constructor(token: unknown) {\n\t\tif (token !== privateToken) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.\nmarkEager(TreeNode);\n\n/**\n * `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.\n */\nexport const privateToken = {};\n\n/**\n * Check if the prototype derived's prototype chain contains `base`.\n * @param derived - prototype to check\n * @param base - prototype to search for\n * @returns true iff `base` is in the prototype chain starting at `derived`.\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function inPrototypeChain(derived: object | null, base: object): boolean {\n\tlet checking = derived;\n\twhile (checking !== null) {\n\t\tif (base === checking) {\n\t\t\treturn true;\n\t\t}\n\t\tchecking = Reflect.getPrototypeOf(checking);\n\t}\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"treeNode.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,2DAA2D;AAC3D,2DAAyE;AACzE,kDAAkD;AAClD,+CAAqF;AACrF,+CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAsB,QAAQ;IAmEtB,MAAM,CAAC,mCAAC,MAAM,CAAC,WAAW,EAAC,CAA8B,KAAc;QAC7E,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,4BAAQ,CAAC,IAAI,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAA,iBAAM,EAAC,WAAW,IAAI,MAAM,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvE,OAAO,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,YAAsB,KAAc;QArFpC;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;QACM,kCAAiB;QA4DzB,IAAI,KAAK,KAAK,oBAAY,EAAE,CAAC;YAC5B,MAAM,IAAI,qBAAU,CAAC,+DAA+D,CAAC,CAAC;QACvF,CAAC;IACF,CAAC;CACD;AA3FD,4BA2FC;AACD,gJAAgJ;AAChJ,IAAA,uBAAS,EAAC,QAAQ,CAAC,CAAC;AAEpB;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,OAAsB,EAAE,IAAY;IACpE,IAAI,QAAQ,GAAG,OAAO,CAAC;IACvB,OAAO,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AATD,4CASC","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 { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { tryGetTreeNodeSchema } from \"./treeNodeKernel.js\";\nimport { NodeKind, type TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n// eslint-disable-next-line import-x/no-deprecated\nimport { type WithType, typeNameSymbol, type typeSchemaSymbol } from \"./withType.js\";\nimport { markEager } from \"./flexList.js\";\n\n/**\n * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes extend.\n *\n * This type can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * There are three ways to get instances of TreeNode:\n *\n * 1. From a {@link TreeView} loading nodes from an existing document, or creating local copies of nodes inserted by a remote collaborator.\n * This case provides an {@link InternalTreeNode} to the constructor: subclasses must not modify how the constructor handles this case.\n *\n * 2. Explicit construction of {@link Unhydrated} nodes using either {@link TreeNodeSchemaClass} as a constructor or {@link TreeNodeSchemaNonClass|TreeNodeSchemaNonClass.create}.\n * Either way the {@link TreeNodeSchema} produced must be produced using a {@link SchemaFactory}.\n * There are also higher level APIs which wrap these, including {@link (TreeBeta:interface).create}, {@link (TreeBeta:interface).clone},\n * and import APIs like {@link (TreeBeta:interface).importConcise}, {@link (TreeAlpha:interface).importVerbose}, and {@link (TreeAlpha:interface).importCompressed}.\n *\n * 3. Implicit construction: Several APIs which logically require an unhydrated TreeNode also allow passing in a value which could be used to explicitly construct the node instead.\n * These APIs internally call the constructor with the provided value (typically behaving like {@link (TreeAlpha:interface).create}), so it's really just a special case of the above option.\n * Note that when constructing nodes, sometimes implicit construction is not allowed\n * (either at runtime due to ambiguous types or at compile time due to TypeScript limitations):\n * in such cases, explicit construction must be used.\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.\n * @sealed @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\tpublic abstract get [typeNameSymbol](): string;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;\n\n\t/**\n\t * Provides `instanceof` support for testing if a value is a `TreeNode`.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Due to type-only export, this functionality is not available outside the package.\n\t */\n\tpublic static [Symbol.hasInstance](value: unknown): value is TreeNode;\n\n\t/**\n\t * Provides `instanceof` support for all schema classes with public constructors.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.\n\t */\n\tpublic static [Symbol.hasInstance]<\n\t\tTSchema extends abstract new (\n\t\t\t...args: any[]\n\t\t) => TreeNode,\n\t>(this: TSchema, value: unknown): value is InstanceType<TSchema>;\n\n\tpublic static [Symbol.hasInstance](this: { prototype: object }, value: unknown): boolean {\n\t\tconst schema = tryGetTreeNodeSchema(value);\n\n\t\tif (schema === undefined || schema.kind === NodeKind.Leaf) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(\"prototype\" in schema, 0x98a /* expected class based schema */);\n\t\treturn inPrototypeChain(schema.prototype, this.prototype);\n\t}\n\n\t/**\n\t * TreeNodes must extend schema classes created by SchemaFactory, and therefore this constructor should not be invoked directly by code outside this package.\n\t * @privateRemarks\n\t * `token` must be the {@link privateToken} value, which is not package exported.\n\t * This is used to detect invalid subclasses.\n\t *\n\t * All valid subclass should use {@link TreeNodeValid}, but this code doesn't directly reference it to avoid cyclic dependencies.\n\t */\n\tprotected constructor(token: unknown) {\n\t\tif (token !== privateToken) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.\nmarkEager(TreeNode);\n\n/**\n * `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.\n */\nexport const privateToken = {};\n\n/**\n * Check if the prototype derived's prototype chain contains `base`.\n * @param derived - prototype to check\n * @param base - prototype to search for\n * @returns true iff `base` is in the prototype chain starting at `derived`.\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function inPrototypeChain(derived: object | null, base: object): boolean {\n\tlet checking = derived;\n\twhile (checking !== null) {\n\t\tif (base === checking) {\n\t\t\treturn true;\n\t\t}\n\t\tchecking = Reflect.getPrototypeOf(checking);\n\t}\n\treturn false;\n}\n"]}
@@ -9,10 +9,9 @@ import type { InternalTreeNode, Unhydrated } from "./types.js";
9
9
  import type { UnionToIntersection } from "../../util/index.js";
10
10
  import type { AllowedTypesFullEvaluated, AllowedTypesFull } from "./allowedTypes.js";
11
11
  import type { Context } from "./context.js";
12
- import type { FieldKey, NodeData, TreeNodeStoredSchema } from "../../core/index.js";
12
+ import type { FieldKey, NodeData } from "../../core/index.js";
13
13
  import type { UnhydratedFlexTreeField } from "./unhydratedFlexTree.js";
14
14
  import type { FactoryContent } from "../unhydratedFlexTreeFromInsertable.js";
15
- import type { StoredSchemaGenerationOptions } from "./toStored.js";
16
15
  /**
17
16
  * Schema for a {@link TreeNode} or {@link TreeLeafValue}.
18
17
  *
@@ -252,10 +251,6 @@ export interface TreeNodeSchemaPrivateData {
252
251
  * Idempotent initialization function that pre-caches data and can dereference lazy schema references.
253
252
  */
254
253
  idempotentInitialize(): TreeNodeSchemaInitializedData;
255
- /**
256
- * Converts a the schema into a {@link TreeNodeStoredSchema}.
257
- */
258
- toStored(options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;
259
254
  }
260
255
  /**
261
256
  * Additional data about a given schema which is private to this package.
@@ -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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IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,kCAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,MAAqD;IAErD,IAAA,iBAAM,EACL,yBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,yBAAiB,CAAC,CAAC;AACvC,CAAC;AATD,oEASC;AAED;;;;;GAKG;AACH,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,wBAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,SAAgB,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,CAAC;AApBD,sDAoBC","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,kEAA6D;AAqU7D;;GAEG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AA6GvD;;;;;;;;;;;;;;;GAeG;AACH,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC7B;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,yDAAO,CAAA;IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,kCAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,MAAqD;IAErD,IAAA,iBAAM,EACL,yBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,yBAAiB,CAAC,CAAC;AACvC,CAAC;AATD,oEASC;AAED;;;;;GAKG;AACH,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,wBAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,SAAgB,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,CAAC;AApBD,sDAoBC","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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iBAAiB,EAAE,SAAS,gBAAgB,EAAE,GAC5C,yBAAyB,CAU3B"}
@@ -170,7 +170,7 @@ exports.isClassBasedSchema = isClassBasedSchema;
170
170
  * @remarks
171
171
  * Such schema must extends {@link TreeNodeValid}.
172
172
  */
173
- function createTreeNodeSchemaPrivateData(schema, childAllowedTypes, toStored) {
173
+ function createTreeNodeSchemaPrivateData(schema, childAllowedTypes) {
174
174
  const schemaValid = schemaAsTreeNodeValid(schema);
175
175
  // Since this closes over the schema, ensure this schema is marked as most derived
176
176
  // so if some other subclass is used later, it will error instead of giving inconsistent results.
@@ -178,7 +178,6 @@ function createTreeNodeSchemaPrivateData(schema, childAllowedTypes, toStored) {
178
178
  return {
179
179
  idempotentInitialize: () => schemaValid.oneTimeInitialize().oneTimeInitialized,
180
180
  childAllowedTypes,
181
- toStored,
182
181
  };
183
182
  }
184
183
  exports.createTreeNodeSchemaPrivateData = createTreeNodeSchemaPrivateData;
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeValid.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,+DAAqF;AAErF,+CAAyE;AACzE,mEAAiE;AACjE,2DAM6B;AAC7B,2DAK6B;AAE7B,+CAAiD;AAIjD;;;;;;;GAOG;AACH,MAAsB,aAAsB,SAAQ,sBAAQ;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,IAAA,eAAI,EAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACO,MAAM,CAAC,YAAY;QAG5B,IAAA,eAAI,EAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAA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T 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,kEAAmE;AACnE,uEAAsE;AAEtE,+DAAqF;AAErF,+C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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,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;;;;;GAMG;AACH,oBAAY,SAAS;IACpB;;;;OAIG;IACH,QAAQ,IAAA;IACR;;;;OAIG;IACH,QAAQ,IAAA;IACR;;;;;;OAMG;IACH,UAAU,IAAA;CACV;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,GAAG,QAAQ,CAE5F;AAED;;;GAGG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;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,IAClF,0BAA0B,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,IAAI;IACnF,OAAO;CACP,SAAS,CAAC,mBAAmB,CAAC,GAC5B,OAAO,GACP,mBAAmB,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,IAAI,SAAS,SAAS,IAAI;IAClD,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACpC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;CAC1B,CAAC,IAAI,CAAC,CAAC;AAER;;;;;GAKG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,IAAI,SAAS,SAAS,EAAE,mBAAmB,SAAS,OAAO,IAAI;IAC5F,IAAI;CACJ,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,GAC3B,CAAC,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"}
@@ -162,14 +162,7 @@ class FieldSchemaAlpha extends FieldSchema {
162
162
  return this.allowedTypesFull.evaluateIdentifiers();
163
163
  }
164
164
  get simpleAllowedTypes() {
165
- const types = this.allowedTypesFull.evaluate().types;
166
- const info = new Map();
167
- for (const type of types) {
168
- info.set(type.type.identifier, {
169
- isStaged: type.metadata.stagedSchemaUpgrade !== undefined,
170
- });
171
- }
172
- return info;
165
+ return index_js_2.AnnotatedAllowedTypesInternal.evaluateSimpleAllowedTypes(this.allowedTypesFull);
173
166
  }
174
167
  constructor(kind, types, props) {
175
168
  super(kind, types, props);