@fluidframework/tree 2.80.0 → 2.81.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 (1138) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-report/tree.alpha.api.md +42 -7
  3. package/dist/alpha.d.ts +5 -0
  4. package/dist/codec/codec.d.ts +2 -2
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +8 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/versioned/codec.d.ts +1 -1
  9. package/dist/codec/versioned/codec.d.ts.map +1 -1
  10. package/dist/codec/versioned/codec.js +12 -12
  11. package/dist/codec/versioned/codec.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/rebase/index.d.ts +1 -1
  16. package/dist/core/rebase/index.d.ts.map +1 -1
  17. package/dist/core/rebase/index.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +44 -7
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/rebase/utils.d.ts.map +1 -1
  22. package/dist/core/rebase/utils.js +5 -1
  23. package/dist/core/rebase/utils.js.map +1 -1
  24. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV2.js +4 -4
  26. package/dist/core/schema-stored/formatV2.js.map +1 -1
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +2 -1
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  34. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  36. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -3
  37. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -2
  40. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  43. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexFormatV2.js +4 -4
  46. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  47. package/dist/core/tree/visitDelta.d.ts +1 -1
  48. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  49. package/dist/core/tree/visitDelta.js +3 -2
  50. package/dist/core/tree/visitDelta.js.map +1 -1
  51. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  52. package/dist/core/tree/visitorUtils.js +59 -19
  53. package/dist/core/tree/visitorUtils.js.map +1 -1
  54. package/dist/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  55. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  56. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  62. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  79. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -1
  82. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  88. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +17 -15
  91. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  92. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  93. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  94. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +23 -64
  95. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  96. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  97. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  98. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  99. package/dist/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  100. package/dist/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  101. package/dist/feature-libraries/fieldKindIdentifiers.js +16 -0
  102. package/dist/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  103. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  104. package/dist/feature-libraries/flex-tree/lazyField.js +8 -8
  105. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  106. package/dist/feature-libraries/flex-tree/observer.d.ts +1 -1
  107. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  108. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  110. package/dist/feature-libraries/forest-summary/codec.js +1 -1
  111. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  113. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  114. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  115. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  122. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  124. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  125. package/dist/feature-libraries/index.d.ts +1 -1
  126. package/dist/feature-libraries/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/index.js.map +1 -1
  128. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  129. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  131. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  133. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  135. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  139. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  142. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  145. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  146. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  147. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  148. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  149. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  151. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  153. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  154. package/dist/feature-libraries/object-forest/objectForest.js +5 -3
  155. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  156. package/dist/feature-libraries/optional-field/index.d.ts +3 -3
  157. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  158. package/dist/feature-libraries/optional-field/index.js +4 -8
  159. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  160. package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -2
  161. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  162. package/dist/feature-libraries/optional-field/optionalField.js +13 -1
  163. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  164. package/dist/feature-libraries/optional-field/requiredField.d.ts +36 -0
  165. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  166. package/dist/feature-libraries/optional-field/requiredField.js +27 -0
  167. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -0
  168. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  169. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  170. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +7 -7
  171. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  172. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  173. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  174. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  175. package/dist/feature-libraries/schemaChecker.js +1 -1
  176. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  177. package/dist/feature-libraries/sequence-field/index.d.ts +2 -14
  178. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  179. package/dist/feature-libraries/sequence-field/index.js +3 -30
  180. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  181. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  182. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  183. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  184. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  185. package/dist/feature-libraries/sequence-field/sequenceKind.js +24 -0
  186. package/dist/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  187. package/dist/index.d.ts +3 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +5 -1
  190. package/dist/index.js.map +1 -1
  191. package/dist/packageVersion.d.ts +1 -1
  192. package/dist/packageVersion.js +1 -1
  193. package/dist/packageVersion.js.map +1 -1
  194. package/dist/shared-tree/independentView.d.ts.map +1 -1
  195. package/dist/shared-tree/independentView.js +7 -7
  196. package/dist/shared-tree/independentView.js.map +1 -1
  197. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  198. package/dist/shared-tree/schematizingTreeView.js +12 -10
  199. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  200. package/dist/shared-tree/sharedTree.d.ts +2 -2
  201. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  202. package/dist/shared-tree/sharedTree.js +6 -33
  203. package/dist/shared-tree/sharedTree.js.map +1 -1
  204. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  206. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  207. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  208. package/dist/shared-tree/sharedTreeChangeEnricher.js +75 -58
  209. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  210. package/dist/shared-tree/tree.d.ts.map +1 -1
  211. package/dist/shared-tree/tree.js +14 -14
  212. package/dist/shared-tree/tree.js.map +1 -1
  213. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  214. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  215. package/dist/shared-tree/treeAlpha.js +77 -77
  216. package/dist/shared-tree/treeAlpha.js.map +1 -1
  217. package/dist/shared-tree/treeCheckout.d.ts +21 -6
  218. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  219. package/dist/shared-tree/treeCheckout.js +93 -37
  220. package/dist/shared-tree/treeCheckout.js.map +1 -1
  221. package/dist/shared-tree-core/branch.d.ts +1 -1
  222. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  223. package/dist/shared-tree-core/branch.js +5 -1
  224. package/dist/shared-tree-core/branch.js.map +1 -1
  225. package/dist/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  226. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  227. package/dist/shared-tree-core/branchCommitEnricher.js +24 -76
  228. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  229. package/dist/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  230. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  231. package/dist/shared-tree-core/changeEnricher.d.ts +8 -43
  232. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  233. package/dist/shared-tree-core/changeEnricher.js +0 -13
  234. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  235. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  236. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  237. package/dist/shared-tree-core/defaultResubmitMachine.js +26 -36
  238. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  239. package/dist/shared-tree-core/editManager.d.ts +1 -1
  240. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  241. package/dist/shared-tree-core/editManager.js +13 -7
  242. package/dist/shared-tree-core/editManager.js.map +1 -1
  243. package/dist/shared-tree-core/editManagerCodecs.d.ts +1 -1
  244. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  245. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  246. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  247. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  248. package/dist/shared-tree-core/editManagerCodecsCommons.js +1 -2
  249. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  250. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  251. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  252. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  253. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  254. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  255. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  256. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  257. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  258. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  259. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  260. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  261. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  262. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  263. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  264. package/dist/shared-tree-core/index.d.ts +2 -2
  265. package/dist/shared-tree-core/index.d.ts.map +1 -1
  266. package/dist/shared-tree-core/index.js +1 -3
  267. package/dist/shared-tree-core/index.js.map +1 -1
  268. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  269. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  270. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -1
  271. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  272. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  273. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  274. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  275. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  276. package/dist/shared-tree-core/messageCodecs.d.ts +2 -2
  277. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  279. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  280. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  281. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  282. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  283. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  284. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  285. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -4
  286. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  287. package/dist/shared-tree-core/sharedTreeCore.js +13 -13
  288. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  289. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  290. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  291. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  292. package/dist/simple-tree/api/configuration.d.ts +2 -2
  293. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  294. package/dist/simple-tree/api/configuration.js +14 -14
  295. package/dist/simple-tree/api/configuration.js.map +1 -1
  296. package/dist/simple-tree/api/create.d.ts +1 -1
  297. package/dist/simple-tree/api/create.d.ts.map +1 -1
  298. package/dist/simple-tree/api/create.js +7 -7
  299. package/dist/simple-tree/api/create.js.map +1 -1
  300. package/dist/simple-tree/api/dirtyIndex.d.ts +1 -1
  301. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  302. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  303. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  304. package/dist/simple-tree/api/discrepancies.js +23 -23
  305. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  306. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  307. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  309. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  310. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  311. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  312. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  313. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  314. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  315. package/dist/simple-tree/api/incrementalAllowedTypes.js +6 -6
  316. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  317. package/dist/simple-tree/api/index.d.ts +1 -1
  318. package/dist/simple-tree/api/index.d.ts.map +1 -1
  319. package/dist/simple-tree/api/index.js +2 -1
  320. package/dist/simple-tree/api/index.js.map +1 -1
  321. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  322. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  323. package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
  324. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  325. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  326. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  327. package/dist/simple-tree/api/schemaCreationUtilities.js +7 -7
  328. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  329. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  330. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  331. package/dist/simple-tree/api/schemaFactory.js +7 -7
  332. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  333. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  334. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  335. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  336. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  337. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  338. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  339. package/dist/simple-tree/api/schemaFactoryBeta.js +2 -1
  340. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  341. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  342. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  345. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  346. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  347. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  348. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  349. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  350. package/dist/simple-tree/api/simpleSchemaCodec.js +17 -17
  351. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  352. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  353. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  354. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  355. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  356. package/dist/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  357. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  358. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  359. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  360. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  361. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  362. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +298 -2
  363. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  366. package/dist/simple-tree/api/tree.d.ts +5 -3
  367. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  368. package/dist/simple-tree/api/tree.js.map +1 -1
  369. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  370. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  371. package/dist/simple-tree/api/treeBeta.js +2 -2
  372. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  373. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  374. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  375. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  376. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  377. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  378. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  379. package/dist/simple-tree/api/verboseTree.d.ts +1 -1
  380. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  381. package/dist/simple-tree/api/verboseTree.js +22 -22
  382. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  383. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  384. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  385. package/dist/simple-tree/core/allowedTypes.js +7 -7
  386. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  387. package/dist/simple-tree/core/context.d.ts.map +1 -1
  388. package/dist/simple-tree/core/context.js.map +1 -1
  389. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  390. package/dist/simple-tree/core/treeNode.js +1 -1
  391. package/dist/simple-tree/core/treeNode.js.map +1 -1
  392. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  393. package/dist/simple-tree/core/treeNodeKernel.js +7 -5
  394. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  395. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -5
  396. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  397. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  398. package/dist/simple-tree/core/treeNodeValid.d.ts +3 -3
  399. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  400. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  401. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  402. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  403. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  404. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  405. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  406. package/dist/simple-tree/core/withType.js.map +1 -1
  407. package/dist/simple-tree/createContext.d.ts.map +1 -1
  408. package/dist/simple-tree/createContext.js.map +1 -1
  409. package/dist/simple-tree/fieldSchema.d.ts +1 -1
  410. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  411. package/dist/simple-tree/fieldSchema.js.map +1 -1
  412. package/dist/simple-tree/index.d.ts +1 -1
  413. package/dist/simple-tree/index.d.ts.map +1 -1
  414. package/dist/simple-tree/index.js +3 -2
  415. package/dist/simple-tree/index.js.map +1 -1
  416. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  417. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  418. package/dist/simple-tree/leafNodeSchema.js +15 -15
  419. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  420. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  421. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  422. package/dist/simple-tree/node-kinds/array/arrayNode.js +46 -46
  423. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  424. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  425. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  426. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  427. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  428. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  429. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  430. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  431. package/dist/simple-tree/node-kinds/map/mapNode.js +24 -24
  432. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  433. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  434. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  435. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  436. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  437. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  438. package/dist/simple-tree/node-kinds/object/objectNode.js +9 -9
  439. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  440. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  441. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  442. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  443. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  444. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  445. package/dist/simple-tree/node-kinds/record/recordNode.js +34 -34
  446. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  447. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  448. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  449. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  450. package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
  451. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  452. package/dist/simple-tree/prepareForInsertion.js +13 -13
  453. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  454. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  455. package/dist/simple-tree/simpleSchema.js.map +1 -1
  456. package/dist/simple-tree/treeSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/treeSchema.js.map +1 -1
  458. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  459. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  460. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -10
  461. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  462. package/dist/tableSchema.d.ts.map +1 -1
  463. package/dist/tableSchema.js +22 -21
  464. package/dist/tableSchema.js.map +1 -1
  465. package/dist/text/index.d.ts +7 -0
  466. package/dist/text/index.d.ts.map +1 -0
  467. package/dist/text/index.js +12 -0
  468. package/dist/text/index.js.map +1 -0
  469. package/dist/text/textDomain.d.ts +146 -0
  470. package/dist/text/textDomain.d.ts.map +1 -0
  471. package/dist/text/textDomain.js +122 -0
  472. package/dist/text/textDomain.js.map +1 -0
  473. package/dist/text/textDomainFormatted.d.ts +572 -0
  474. package/dist/text/textDomainFormatted.d.ts.map +1 -0
  475. package/dist/text/textDomainFormatted.js +183 -0
  476. package/dist/text/textDomainFormatted.js.map +1 -0
  477. package/dist/treeFactory.d.ts.map +1 -1
  478. package/dist/treeFactory.js +9 -9
  479. package/dist/treeFactory.js.map +1 -1
  480. package/dist/util/bTreeUtils.d.ts +12 -4
  481. package/dist/util/bTreeUtils.d.ts.map +1 -1
  482. package/dist/util/bTreeUtils.js +14 -18
  483. package/dist/util/bTreeUtils.js.map +1 -1
  484. package/dist/util/nestedMap.js +12 -12
  485. package/dist/util/nestedMap.js.map +1 -1
  486. package/dist/util/readSnapshotBlob.d.ts +1 -1
  487. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  488. package/dist/util/readSnapshotBlob.js.map +1 -1
  489. package/docs/user-facing/merge-semantics.md +3 -2
  490. package/eslint.config.mts +8 -36
  491. package/lib/alpha.d.ts +5 -0
  492. package/lib/codec/codec.d.ts +2 -2
  493. package/lib/codec/codec.d.ts.map +1 -1
  494. package/lib/codec/codec.js +1 -1
  495. package/lib/codec/codec.js.map +1 -1
  496. package/lib/codec/versioned/codec.d.ts +1 -1
  497. package/lib/codec/versioned/codec.d.ts.map +1 -1
  498. package/lib/codec/versioned/codec.js +2 -2
  499. package/lib/codec/versioned/codec.js.map +1 -1
  500. package/lib/core/index.d.ts +1 -1
  501. package/lib/core/index.d.ts.map +1 -1
  502. package/lib/core/index.js.map +1 -1
  503. package/lib/core/rebase/index.d.ts +1 -1
  504. package/lib/core/rebase/index.d.ts.map +1 -1
  505. package/lib/core/rebase/index.js.map +1 -1
  506. package/lib/core/rebase/types.d.ts +44 -7
  507. package/lib/core/rebase/types.d.ts.map +1 -1
  508. package/lib/core/rebase/types.js.map +1 -1
  509. package/lib/core/rebase/utils.d.ts.map +1 -1
  510. package/lib/core/rebase/utils.js +5 -1
  511. package/lib/core/rebase/utils.js.map +1 -1
  512. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  513. package/lib/core/schema-stored/formatV2.js +1 -1
  514. package/lib/core/schema-stored/formatV2.js.map +1 -1
  515. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  516. package/lib/core/tree/anchorSet.js +2 -1
  517. package/lib/core/tree/anchorSet.js.map +1 -1
  518. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  519. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  520. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  521. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  522. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  523. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  524. package/lib/core/tree/detachedFieldIndexCodecV1.js +1 -1
  525. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  526. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  527. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -2
  528. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  529. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  530. package/lib/core/tree/detachedFieldIndexFormatV1.js +2 -2
  531. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  532. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  533. package/lib/core/tree/detachedFieldIndexFormatV2.js +2 -2
  534. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  535. package/lib/core/tree/visitDelta.d.ts +1 -1
  536. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  537. package/lib/core/tree/visitDelta.js +3 -2
  538. package/lib/core/tree/visitDelta.js.map +1 -1
  539. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  540. package/lib/core/tree/visitorUtils.js +59 -19
  541. package/lib/core/tree/visitorUtils.js.map +1 -1
  542. package/lib/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  543. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  544. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  546. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  547. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  549. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  550. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  551. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  556. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  557. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  558. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  559. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  560. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  561. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  562. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  563. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  564. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  565. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  566. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  568. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  569. package/lib/feature-libraries/chunked-forest/codec/format.js +1 -1
  570. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  571. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  572. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  573. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  574. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  576. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  577. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  578. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -3
  579. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  580. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  581. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  582. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -45
  583. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  584. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  585. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  586. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  587. package/lib/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  588. package/lib/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  589. package/lib/feature-libraries/fieldKindIdentifiers.js +13 -0
  590. package/lib/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  591. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  592. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  593. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  594. package/lib/feature-libraries/flex-tree/observer.d.ts +1 -1
  595. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  596. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  597. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  599. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  600. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  601. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  602. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  603. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  604. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  605. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  606. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  607. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  608. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  609. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  610. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  611. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  612. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  613. package/lib/feature-libraries/index.d.ts +1 -1
  614. package/lib/feature-libraries/index.d.ts.map +1 -1
  615. package/lib/feature-libraries/index.js.map +1 -1
  616. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  617. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  618. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  623. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  637. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  638. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  639. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  640. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  641. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  642. package/lib/feature-libraries/object-forest/objectForest.js +5 -3
  643. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  644. package/lib/feature-libraries/optional-field/index.d.ts +3 -3
  645. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  646. package/lib/feature-libraries/optional-field/index.js +2 -2
  647. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  648. package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -2
  649. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  650. package/lib/feature-libraries/optional-field/optionalField.js +14 -2
  651. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  652. package/lib/feature-libraries/optional-field/requiredField.d.ts +36 -0
  653. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  654. package/lib/feature-libraries/optional-field/requiredField.js +24 -0
  655. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -0
  656. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  657. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -1
  659. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  660. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  661. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  662. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  663. package/lib/feature-libraries/schemaChecker.js +1 -1
  664. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  665. package/lib/feature-libraries/sequence-field/index.d.ts +2 -14
  666. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  667. package/lib/feature-libraries/sequence-field/index.js +1 -13
  668. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  669. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  670. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  671. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  672. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  673. package/lib/feature-libraries/sequence-field/sequenceKind.js +21 -0
  674. package/lib/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  675. package/lib/index.d.ts +3 -2
  676. package/lib/index.d.ts.map +1 -1
  677. package/lib/index.js +2 -1
  678. package/lib/index.js.map +1 -1
  679. package/lib/packageVersion.d.ts +1 -1
  680. package/lib/packageVersion.js +1 -1
  681. package/lib/packageVersion.js.map +1 -1
  682. package/lib/shared-tree/independentView.d.ts.map +1 -1
  683. package/lib/shared-tree/independentView.js +3 -3
  684. package/lib/shared-tree/independentView.js.map +1 -1
  685. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  686. package/lib/shared-tree/schematizingTreeView.js +12 -10
  687. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  688. package/lib/shared-tree/sharedTree.d.ts +2 -2
  689. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  690. package/lib/shared-tree/sharedTree.js +6 -33
  691. package/lib/shared-tree/sharedTree.js.map +1 -1
  692. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  693. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  694. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  695. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  696. package/lib/shared-tree/sharedTreeChangeEnricher.js +73 -55
  697. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  698. package/lib/shared-tree/tree.d.ts.map +1 -1
  699. package/lib/shared-tree/tree.js +7 -7
  700. package/lib/shared-tree/tree.js.map +1 -1
  701. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  702. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  703. package/lib/shared-tree/treeAlpha.js +3 -3
  704. package/lib/shared-tree/treeAlpha.js.map +1 -1
  705. package/lib/shared-tree/treeCheckout.d.ts +21 -6
  706. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  707. package/lib/shared-tree/treeCheckout.js +67 -11
  708. package/lib/shared-tree/treeCheckout.js.map +1 -1
  709. package/lib/shared-tree-core/branch.d.ts +1 -1
  710. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  711. package/lib/shared-tree-core/branch.js +5 -1
  712. package/lib/shared-tree-core/branch.js.map +1 -1
  713. package/lib/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  714. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  715. package/lib/shared-tree-core/branchCommitEnricher.js +24 -76
  716. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  717. package/lib/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  718. package/lib/shared-tree-core/branchIdCodec.js.map +1 -1
  719. package/lib/shared-tree-core/changeEnricher.d.ts +8 -43
  720. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  721. package/lib/shared-tree-core/changeEnricher.js +1 -11
  722. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  723. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  724. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  725. package/lib/shared-tree-core/defaultResubmitMachine.js +28 -38
  726. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  727. package/lib/shared-tree-core/editManager.d.ts +1 -1
  728. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  729. package/lib/shared-tree-core/editManager.js +13 -7
  730. package/lib/shared-tree-core/editManager.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +1 -2
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  744. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  746. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  747. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  748. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  749. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  750. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  751. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  752. package/lib/shared-tree-core/index.d.ts +2 -2
  753. package/lib/shared-tree-core/index.d.ts.map +1 -1
  754. package/lib/shared-tree-core/index.js +0 -1
  755. package/lib/shared-tree-core/index.js.map +1 -1
  756. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  757. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  758. package/lib/shared-tree-core/messageCodecV1ToV4.js +1 -1
  759. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  760. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  761. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  762. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  763. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  764. package/lib/shared-tree-core/messageCodecs.d.ts +2 -2
  765. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  766. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  767. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  768. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  769. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  770. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  771. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  772. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  773. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -4
  774. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  775. package/lib/shared-tree-core/sharedTreeCore.js +14 -14
  776. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  777. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  778. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  779. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  780. package/lib/simple-tree/api/configuration.d.ts +2 -2
  781. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  782. package/lib/simple-tree/api/configuration.js +4 -4
  783. package/lib/simple-tree/api/configuration.js.map +1 -1
  784. package/lib/simple-tree/api/create.d.ts +1 -1
  785. package/lib/simple-tree/api/create.d.ts.map +1 -1
  786. package/lib/simple-tree/api/create.js +1 -1
  787. package/lib/simple-tree/api/create.js.map +1 -1
  788. package/lib/simple-tree/api/dirtyIndex.d.ts +1 -1
  789. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  790. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  791. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  792. package/lib/simple-tree/api/discrepancies.js +3 -3
  793. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  794. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  795. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  796. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  797. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  798. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  799. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  800. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  801. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  802. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  803. package/lib/simple-tree/api/incrementalAllowedTypes.js +3 -3
  804. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  805. package/lib/simple-tree/api/index.d.ts +1 -1
  806. package/lib/simple-tree/api/index.d.ts.map +1 -1
  807. package/lib/simple-tree/api/index.js +1 -1
  808. package/lib/simple-tree/api/index.js.map +1 -1
  809. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  810. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  811. package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
  812. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  813. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  814. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  815. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  816. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  817. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  818. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  819. package/lib/simple-tree/api/schemaFactory.js +2 -2
  820. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  821. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  822. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  823. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  824. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  825. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  826. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  827. package/lib/simple-tree/api/schemaFactoryBeta.js +2 -1
  828. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  829. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  830. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  831. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  832. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  833. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  834. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  835. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  836. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  837. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  838. package/lib/simple-tree/api/simpleSchemaCodec.js +3 -3
  839. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  840. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  841. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  842. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  843. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  844. package/lib/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  845. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  846. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  847. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  848. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  849. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  850. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +271 -1
  851. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  852. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  853. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  854. package/lib/simple-tree/api/tree.d.ts +5 -3
  855. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  856. package/lib/simple-tree/api/tree.js.map +1 -1
  857. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  858. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  859. package/lib/simple-tree/api/treeBeta.js +2 -2
  860. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  861. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  862. package/lib/simple-tree/api/treeNodeApi.js +4 -4
  863. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  864. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  865. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  866. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  867. package/lib/simple-tree/api/verboseTree.d.ts +1 -1
  868. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  869. package/lib/simple-tree/api/verboseTree.js +3 -3
  870. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  871. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  872. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  873. package/lib/simple-tree/core/allowedTypes.js +2 -2
  874. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  875. package/lib/simple-tree/core/context.d.ts.map +1 -1
  876. package/lib/simple-tree/core/context.js.map +1 -1
  877. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  878. package/lib/simple-tree/core/treeNode.js +1 -1
  879. package/lib/simple-tree/core/treeNode.js.map +1 -1
  880. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  881. package/lib/simple-tree/core/treeNodeKernel.js +7 -5
  882. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  883. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -5
  884. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  885. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  886. package/lib/simple-tree/core/treeNodeValid.d.ts +3 -3
  887. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  888. package/lib/simple-tree/core/treeNodeValid.js +2 -2
  889. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  890. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  891. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  892. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  893. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  894. package/lib/simple-tree/core/withType.js.map +1 -1
  895. package/lib/simple-tree/createContext.d.ts.map +1 -1
  896. package/lib/simple-tree/createContext.js.map +1 -1
  897. package/lib/simple-tree/fieldSchema.d.ts +1 -1
  898. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  899. package/lib/simple-tree/fieldSchema.js.map +1 -1
  900. package/lib/simple-tree/index.d.ts +1 -1
  901. package/lib/simple-tree/index.d.ts.map +1 -1
  902. package/lib/simple-tree/index.js +1 -1
  903. package/lib/simple-tree/index.js.map +1 -1
  904. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  905. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  906. package/lib/simple-tree/leafNodeSchema.js +2 -2
  907. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  908. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  909. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  910. package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -5
  911. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  912. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  913. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  914. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  915. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  916. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  917. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  918. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  919. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -6
  920. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  921. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  922. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  923. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  924. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  925. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  926. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  927. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  928. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  929. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  930. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  931. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  932. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  933. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -4
  934. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  935. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  936. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  937. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  938. package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
  939. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  940. package/lib/simple-tree/prepareForInsertion.js +4 -4
  941. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  942. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  943. package/lib/simple-tree/simpleSchema.js.map +1 -1
  944. package/lib/simple-tree/treeSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/treeSchema.js.map +1 -1
  946. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  947. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  948. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +2 -2
  949. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  950. package/lib/tableSchema.d.ts.map +1 -1
  951. package/lib/tableSchema.js +2 -1
  952. package/lib/tableSchema.js.map +1 -1
  953. package/lib/text/index.d.ts +7 -0
  954. package/lib/text/index.d.ts.map +1 -0
  955. package/lib/text/index.js +7 -0
  956. package/lib/text/index.js.map +1 -0
  957. package/lib/text/textDomain.d.ts +146 -0
  958. package/lib/text/textDomain.d.ts.map +1 -0
  959. package/lib/text/textDomain.js +118 -0
  960. package/lib/text/textDomain.js.map +1 -0
  961. package/lib/text/textDomainFormatted.d.ts +572 -0
  962. package/lib/text/textDomainFormatted.d.ts.map +1 -0
  963. package/lib/text/textDomainFormatted.js +180 -0
  964. package/lib/text/textDomainFormatted.js.map +1 -0
  965. package/lib/treeFactory.d.ts.map +1 -1
  966. package/lib/treeFactory.js +2 -2
  967. package/lib/treeFactory.js.map +1 -1
  968. package/lib/util/bTreeUtils.d.ts +12 -4
  969. package/lib/util/bTreeUtils.d.ts.map +1 -1
  970. package/lib/util/bTreeUtils.js +15 -19
  971. package/lib/util/bTreeUtils.js.map +1 -1
  972. package/lib/util/nestedMap.js +12 -12
  973. package/lib/util/nestedMap.js.map +1 -1
  974. package/lib/util/readSnapshotBlob.d.ts +1 -1
  975. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  976. package/lib/util/readSnapshotBlob.js.map +1 -1
  977. package/package.json +25 -25
  978. package/src/codec/codec.ts +10 -7
  979. package/src/codec/versioned/codec.ts +3 -3
  980. package/src/core/index.ts +2 -0
  981. package/src/core/rebase/index.ts +2 -0
  982. package/src/core/rebase/types.ts +57 -20
  983. package/src/core/rebase/utils.ts +8 -4
  984. package/src/core/schema-stored/formatV2.ts +2 -1
  985. package/src/core/tree/anchorSet.ts +2 -1
  986. package/src/core/tree/detachedFieldIndex.ts +1 -1
  987. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  988. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -2
  989. package/src/core/tree/detachedFieldIndexCodecV2.ts +3 -3
  990. package/src/core/tree/detachedFieldIndexFormatV1.ts +3 -2
  991. package/src/core/tree/detachedFieldIndexFormatV2.ts +3 -2
  992. package/src/core/tree/visitDelta.ts +8 -5
  993. package/src/core/tree/visitorUtils.ts +57 -20
  994. package/src/feature-libraries/changeAtomIdBTree.ts +9 -1
  995. package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -1
  996. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -1
  997. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +1 -1
  998. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  999. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
  1000. package/src/feature-libraries/chunked-forest/codec/codecs.ts +2 -2
  1001. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -1
  1002. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1003. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -0
  1004. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +3 -3
  1005. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -10
  1006. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -110
  1007. package/src/feature-libraries/default-schema/index.ts +0 -5
  1008. package/src/feature-libraries/fieldKindIdentifiers.ts +16 -0
  1009. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1010. package/src/feature-libraries/flex-tree/observer.ts +3 -1
  1011. package/src/feature-libraries/forest-summary/codec.ts +1 -1
  1012. package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -7
  1013. package/src/feature-libraries/forest-summary/formatV1.ts +1 -0
  1014. package/src/feature-libraries/forest-summary/formatV2.ts +1 -0
  1015. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +9 -7
  1016. package/src/feature-libraries/forest-summary/summaryTypes.ts +1 -0
  1017. package/src/feature-libraries/index.ts +0 -5
  1018. package/src/feature-libraries/mapTreeCursor.ts +1 -1
  1019. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +1 -0
  1020. package/src/feature-libraries/modular-schema/genericFieldKind.ts +2 -2
  1021. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +3 -1
  1022. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +2 -2
  1023. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -2
  1024. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +83 -74
  1025. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1026. package/src/feature-libraries/object-forest/objectForest.ts +5 -3
  1027. package/src/feature-libraries/optional-field/index.ts +6 -8
  1028. package/src/feature-libraries/optional-field/optionalField.ts +31 -0
  1029. package/src/feature-libraries/optional-field/requiredField.ts +62 -0
  1030. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +1 -1
  1031. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1032. package/src/feature-libraries/schemaChecker.ts +3 -2
  1033. package/src/feature-libraries/sequence-field/index.ts +2 -51
  1034. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1035. package/src/feature-libraries/sequence-field/sequenceKind.ts +40 -0
  1036. package/src/index.ts +7 -0
  1037. package/src/packageVersion.ts +1 -1
  1038. package/src/shared-tree/independentView.ts +4 -3
  1039. package/src/shared-tree/schematizingTreeView.ts +17 -13
  1040. package/src/shared-tree/sharedTree.ts +9 -46
  1041. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -0
  1042. package/src/shared-tree/sharedTreeChangeEnricher.ts +87 -66
  1043. package/src/shared-tree/tree.ts +10 -10
  1044. package/src/shared-tree/treeAlpha.ts +26 -25
  1045. package/src/shared-tree/treeCheckout.ts +119 -23
  1046. package/src/shared-tree-core/branch.ts +9 -5
  1047. package/src/shared-tree-core/branchCommitEnricher.ts +25 -77
  1048. package/src/shared-tree-core/branchIdCodec.ts +1 -0
  1049. package/src/shared-tree-core/changeEnricher.ts +8 -52
  1050. package/src/shared-tree-core/defaultResubmitMachine.ts +39 -51
  1051. package/src/shared-tree-core/editManager.ts +32 -32
  1052. package/src/shared-tree-core/editManagerCodecs.ts +2 -2
  1053. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -6
  1054. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1055. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1056. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -0
  1057. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -0
  1058. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +3 -2
  1059. package/src/shared-tree-core/index.ts +2 -5
  1060. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  1061. package/src/shared-tree-core/messageCodecVSharedBranches.ts +4 -4
  1062. package/src/shared-tree-core/messageCodecs.ts +2 -2
  1063. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -0
  1064. package/src/shared-tree-core/messageFormatVSharedBranches.ts +1 -0
  1065. package/src/shared-tree-core/messageTypes.ts +1 -0
  1066. package/src/shared-tree-core/sharedTreeCore.ts +27 -28
  1067. package/src/shared-tree-core/versionedSummarizer.ts +3 -1
  1068. package/src/simple-tree/api/configuration.ts +9 -9
  1069. package/src/simple-tree/api/create.ts +7 -6
  1070. package/src/simple-tree/api/dirtyIndex.ts +4 -2
  1071. package/src/simple-tree/api/discrepancies.ts +9 -8
  1072. package/src/simple-tree/api/getJsonSchema.ts +4 -3
  1073. package/src/simple-tree/api/identifierIndex.ts +4 -2
  1074. package/src/simple-tree/api/incrementalAllowedTypes.ts +6 -5
  1075. package/src/simple-tree/api/index.ts +3 -0
  1076. package/src/simple-tree/api/schemaCompatibilityTester.ts +3 -3
  1077. package/src/simple-tree/api/schemaCreationUtilities.ts +4 -3
  1078. package/src/simple-tree/api/schemaFactory.ts +16 -17
  1079. package/src/simple-tree/api/schemaFactoryAlpha.ts +22 -22
  1080. package/src/simple-tree/api/schemaFactoryBeta.ts +18 -16
  1081. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  1082. package/src/simple-tree/api/schemaFromSimple.ts +1 -1
  1083. package/src/simple-tree/api/schemaStatics.ts +2 -0
  1084. package/src/simple-tree/api/simpleSchemaCodec.ts +12 -11
  1085. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +24 -22
  1086. package/src/simple-tree/api/simpleTreeIndex.ts +6 -4
  1087. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +504 -1
  1088. package/src/simple-tree/api/storedSchema.ts +2 -1
  1089. package/src/simple-tree/api/tree.ts +5 -3
  1090. package/src/simple-tree/api/treeBeta.ts +3 -3
  1091. package/src/simple-tree/api/treeNodeApi.ts +14 -13
  1092. package/src/simple-tree/api/typesUnsafe.ts +7 -8
  1093. package/src/simple-tree/api/verboseTree.ts +6 -5
  1094. package/src/simple-tree/core/allowedTypes.ts +4 -4
  1095. package/src/simple-tree/core/context.ts +1 -1
  1096. package/src/simple-tree/core/treeNode.ts +1 -1
  1097. package/src/simple-tree/core/treeNodeKernel.ts +7 -5
  1098. package/src/simple-tree/core/treeNodeSchema.ts +7 -6
  1099. package/src/simple-tree/core/treeNodeValid.ts +9 -9
  1100. package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
  1101. package/src/simple-tree/core/withType.ts +3 -2
  1102. package/src/simple-tree/createContext.ts +1 -0
  1103. package/src/simple-tree/fieldSchema.ts +1 -2
  1104. package/src/simple-tree/index.ts +3 -0
  1105. package/src/simple-tree/leafNodeSchema.ts +3 -3
  1106. package/src/simple-tree/node-kinds/array/arrayNode.ts +17 -16
  1107. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +2 -2
  1108. package/src/simple-tree/node-kinds/common.ts +1 -1
  1109. package/src/simple-tree/node-kinds/map/mapNode.ts +16 -15
  1110. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +2 -2
  1111. package/src/simple-tree/node-kinds/object/objectNode.ts +11 -11
  1112. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +8 -7
  1113. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1114. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +1 -2
  1115. package/src/simple-tree/prepareForInsertion.ts +10 -8
  1116. package/src/simple-tree/simpleSchema.ts +1 -0
  1117. package/src/simple-tree/treeSchema.ts +1 -0
  1118. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -2
  1119. package/src/tableSchema.ts +3 -1
  1120. package/src/text/README.md +8 -0
  1121. package/src/text/index.ts +7 -0
  1122. package/src/text/textDomain.ts +199 -0
  1123. package/src/text/textDomainFormatted.ts +309 -0
  1124. package/src/treeFactory.ts +4 -4
  1125. package/src/util/bTreeUtils.ts +33 -22
  1126. package/src/util/nestedMap.ts +12 -12
  1127. package/src/util/readSnapshotBlob.ts +4 -2
  1128. package/.eslintrc.cjs +0 -125
  1129. package/assertTagging.config.mjs +0 -14
  1130. package/dist/shared-tree-core/transactionEnricher.d.ts +0 -23
  1131. package/dist/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1132. package/dist/shared-tree-core/transactionEnricher.js +0 -74
  1133. package/dist/shared-tree-core/transactionEnricher.js.map +0 -1
  1134. package/lib/shared-tree-core/transactionEnricher.d.ts +0 -23
  1135. package/lib/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1136. package/lib/shared-tree-core/transactionEnricher.js +0 -70
  1137. package/lib/shared-tree-core/transactionEnricher.js.map +0 -1
  1138. package/src/shared-tree-core/transactionEnricher.ts +0 -74
@@ -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,OA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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"]}
1
+ {"version":3,"file":"treeNodeSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,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 type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey, NodeData } from \"../../core/index.js\";\nimport type { UnionToIntersection } from \"../../util/index.js\";\nimport type { FactoryContent } from \"../unhydratedFlexTreeFromInsertable.js\";\n\nimport type { AllowedTypesFullEvaluated, AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { Context } from \"./context.js\";\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { InternalTreeNode, Unhydrated } from \"./types.js\";\nimport type { UnhydratedFlexTreeField } from \"./unhydratedFlexTree.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"]}
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type FlexTreeNode } from "../../feature-libraries/index.js";
6
+ import type { AllowedTypesFull } from "./allowedTypes.js";
7
+ import type { SimpleNodeSchemaBase } from "./simpleNodeSchemaBase.js";
6
8
  import { TreeNode } from "./treeNode.js";
7
- import { UnhydratedFlexTreeNode } from "./unhydratedFlexTree.js";
8
9
  import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaCore, type TreeNodeSchemaInitializedData, type TreeNodeSchemaPrivateData } from "./treeNodeSchema.js";
9
10
  import type { InternalTreeNode } from "./types.js";
10
- import type { AllowedTypesFull } from "./allowedTypes.js";
11
- import type { SimpleNodeSchemaBase } from "./simpleNodeSchemaBase.js";
11
+ import { UnhydratedFlexTreeNode } from "./unhydratedFlexTree.js";
12
12
  /**
13
13
  * Class which all {@link TreeNode}s must extend.
14
14
  * 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.
@@ -1 +1 @@
1
- {"version":3,"file":"treeNodeValid.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAkC,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACN,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAAC,MAAM,CAAE,SAAQ,QAAQ;IAC3D;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EACjC,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,YAAY,GACjB,aAAa,CAAC,CAAC,CAAC;IAInB;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAC9B,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,CAAC,GACN,sBAAsB;IAIzB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAC9B,IAAI,E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OAAO,CAAC,EACrD,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,GAC5C,yBAAyB,CAU3B"}
@@ -9,9 +9,9 @@ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const index_js_1 = require("../../feature-libraries/index.js");
11
11
  const treeNode_js_1 = require("./treeNode.js");
12
- const unhydratedFlexTree_js_1 = require("./unhydratedFlexTree.js");
13
- const treeNodeSchema_js_1 = require("./treeNodeSchema.js");
14
12
  const treeNodeKernel_js_1 = require("./treeNodeKernel.js");
13
+ const treeNodeSchema_js_1 = require("./treeNodeSchema.js");
14
+ const unhydratedFlexTree_js_1 = require("./unhydratedFlexTree.js");
15
15
  const withType_js_1 = require("./withType.js");
16
16
  /**
17
17
  * Class which all {@link TreeNode}s must extend.
@@ -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,CAAC;IAsBD;;OAEG;IACI,MAAM,CAAC,eAAe;QAC5B,IAAA,iBAAM,EAAC,IAA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AAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,MAAM;QAClB,MAAM,QAAQ,GAA6B,EAAE,CAAC;QAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAkB,CAAC,EAAE,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;QAED,QAAQ;QACR,+HAA+H;QAC/H,qDAAqD;QACrD,qCAAqC;QACrC,2DAA2D;QAE3D,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,MAAM,EAAE,MAAM;QACrB,OAAO,YAAY,CAAC,MAAkC,CAAC,KAAK,SAAS,CAAC;IACvE,CAAC;CACD,CAAC;AAEF,SAAS,kBAAkB,CAC1B,MAAe,EACf,MAAuC;IAEvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { type FlexTreeNode, isFlexTreeNode } from \"../../feature-libraries/index.js\";\n\nimport { inPrototypeChain, privateToken, TreeNode } from \"./treeNode.js\";\nimport { UnhydratedFlexTreeNode } from \"./unhydratedFlexTree.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaPrivateData,\n} from \"./treeNodeSchema.js\";\nimport {\n\tgetSimpleNodeSchemaFromInnerNode,\n\tisTreeNode,\n\tTreeNodeKernel,\n\ttype InnerNode,\n} from \"./treeNodeKernel.js\";\nimport type { InternalTreeNode } from \"./types.js\";\nimport { typeSchemaSymbol } from \"./withType.js\";\nimport type { AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\n\n/**\n * Class which all {@link TreeNode}s must extend.\n * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.\n *\n * This has static members which schema classes can override to provide schema specific functionality.\n * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.\n * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.\n */\nexport abstract class TreeNodeValid<TInput> extends TreeNode {\n\t/**\n\t * Schema classes can override this to control what happens at the end of the constructor.\n\t * The return value from this is returned from the constructor, allowing substituting a proxy if desired.\n\t *\n\t * This is not simply done in the derived constructor to enable:\n\t * - this class to access the value which is being returned before it's returned from the constructor.\n\t * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.\n\t */\n\tprotected static prepareInstance<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: FlexTreeNode,\n\t): TreeNodeValid<T> {\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Schema classes must override to provide an implementation of RawTreeNode construction.\n\t */\n\tprotected static buildRawNode<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: T,\n\t): UnhydratedFlexTreeNode {\n\t\treturn fail(0xae4 /* Schema must override buildRawNode */);\n\t}\n\n\t/**\n\t * Schema classes can override to provide a callback that is called once when the first node is constructed.\n\t * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.\n\t * @remarks\n\t * It is valid to dereference LazyItem schema references in this function (or anything that runs after it).\n\t */\n\tprotected static oneTimeSetup<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t): TreeNodeSchemaInitializedData {\n\t\tfail(0xae5 /* Missing oneTimeSetup */);\n\t}\n\n\t/**\n\t * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.\n\t * @remarks\n\t * Captured when an instance is constructed.\n\t *\n\t * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single \"most derived\" class (the constructor actually invoked the the user with `new`).\n\t *\n\t * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.\n\t *\n\t * Also used to detect if oneTimeSetup has run.\n\t *\n\t * @privateRemarks\n\t * This defaults to \"default\", which is used to trigger an error if not overridden in the derived class.\n\t *\n\t * The value of this on TreeNodeValid must only be overridden by base classes and never modified.\n\t * Ways to enforce this immutability prevent it from being overridden,\n\t * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.\n\t */\n\tprotected static constructorCached: MostDerivedData | \"default\" | undefined = \"default\";\n\n\t/**\n\t * Indicate that `this` is the most derived version of a schema, and thus the only one allowed to be used (other than by being subclassed a single time).\n\t */\n\tpublic static markMostDerived(this: typeof TreeNodeValid & TreeNodeSchema): MostDerivedData {\n\t\tassert(this.constructorCached !== \"default\", 0x95f /* invalid schema class */);\n\n\t\tif (this.constructorCached === undefined) {\n\t\t\t// Set the constructorCached on the layer of the prototype chain that declared it.\n\t\t\t// This is necessary to ensure there is only one subclass of that type used:\n\t\t\t// if constructorCached was simply set on `schema`,\n\t\t\t// then a base classes between `schema` (exclusive) and where `constructorCached` is set (inclusive) and other subclasses of them\n\t\t\t// would not see the stored `constructorCached`, and the validation above against multiple derived classes would not work.\n\n\t\t\t// This is not just an alias of `this`, but a reference to the item in the prototype chain being walked, which happens to start at `this`.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment\n\t\t\tlet schemaBase: typeof TreeNodeValid = this;\n\t\t\twhile (!Object.prototype.hasOwnProperty.call(schemaBase, \"constructorCached\")) {\n\t\t\t\tschemaBase = Reflect.getPrototypeOf(schemaBase) as typeof TreeNodeValid;\n\t\t\t}\n\t\t\tassert(schemaBase.constructorCached === undefined, 0x962 /* overwriting wrong cache */);\n\t\t\tschemaBase.constructorCached = { constructor: this, oneTimeInitialized: undefined };\n\t\t\tassert(\n\t\t\t\tthis.constructorCached === schemaBase.constructorCached,\n\t\t\t\t0x9b5 /* Inheritance should work */,\n\t\t\t);\n\t\t\treturn this.constructorCached;\n\t\t} else if (this.constructorCached.constructor === this) {\n\t\t\treturn this.constructorCached;\n\t\t}\n\n\t\t// If users trying to diagnose the cause of this error becomes a common issue, more information could be captured.\n\t\t// The call stack to when a schema is first marked most derived could be captured in debug builds and stored in the `MostDerivedData` object:\n\t\t// This could then be included in the error to aid in debugging this error.\n\t\tthrow new UsageError(\n\t\t\t`Two schema classes were used (${this.name} and ${\n\t\t\t\tthis.constructorCached.constructor.name\n\t\t\t}) which derived from the same SchemaFactory generated class (${JSON.stringify(\n\t\t\t\tthis.identifier,\n\t\t\t)}). This is invalid.`,\n\t\t);\n\t}\n\n\t/**\n\t * Node creation function for implementing the TreeNodeSchemaNonClass half of TreeNodeSchemaBoth.\n\t * @remarks\n\t * When used as TreeNodeSchemaNonClass and subclassed,\n\t * does not actually have the correct compile time type for the return value due to TypeScript limitations.\n\t * This is why this is not exposed as part of TreeNodeSchemaClass where subclassing is allowed.\n\t */\n\tpublic static create<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * See {@link TreeNodeSchemaCore.createFromInsertable}.\n\t */\n\tpublic static createFromInsertable<TInput, TOut, TThis extends new (args: TInput) => TOut>(\n\t\tthis: TThis,\n\t\tinput: TInput,\n\t): TOut {\n\t\treturn new this(input);\n\t}\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tpublic static oneTimeInitialize(\n\t\tthis: typeof TreeNodeValid & TreeNodeSchema,\n\t): Required<MostDerivedData> {\n\t\tconst cache = this.markMostDerived();\n\t\tcache.oneTimeInitialized ??= this.oneTimeSetup();\n\t\t// TypeScript fails to narrow the type of `oneTimeInitialized` to `Context` here, so use a cast:\n\t\treturn cache as MostDerivedData & { oneTimeInitialized: TreeNodeSchemaInitializedData };\n\t}\n\n\tpublic constructor(input: TInput | InternalTreeNode) {\n\t\tsuper(privateToken);\n\t\tconst schema = this.constructor as typeof TreeNodeValid & TreeNodeSchema;\n\t\tconst cache = schema.oneTimeInitialize();\n\n\t\tif (isTreeNode(input)) {\n\t\t\t// TODO: update this once TreeBeta.clone is stable.\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing nodes may not be used as the constructor parameter for a new node. The existing node may be used directly instead of creating a new one, used as a child of the new node (if it has not yet been inserted into the tree). If the desired result is copying the provided node, it must be deep copied (since any child node would be parented under both the new and old nodes). `TreeBeta.clone` can be used to do this.\",\n\t\t\t);\n\t\t}\n\n\t\tconst node: InnerNode = isFlexTreeNode(input) ? input : schema.buildRawNode(this, input);\n\t\tassert(\n\t\t\tgetSimpleNodeSchemaFromInnerNode(node) === schema,\n\t\t\t0x83b /* building node with wrong schema */,\n\t\t);\n\n\t\tconst result = schema.prepareInstance(this, node);\n\t\t// For unhydrated nodes, grab the context from the `simpleContext` (which likely is from cache.oneTimeInitialized.context,\n\t\t// but might be customized for better schema evolution support like unknown optional fields like in clone)\n\t\t// For hydrated nodes, this context is unused, so using the default from cache.oneTimeInitialized.context is always fine.\n\t\tconst context =\n\t\t\tnode instanceof UnhydratedFlexTreeNode\n\t\t\t\t? node.simpleContext\n\t\t\t\t: cache.oneTimeInitialized.context;\n\t\t// The TreeNodeKernel associates itself the TreeNode (result here, not node) so it can be looked up later via getKernel.\n\t\t// If desired this could be put in a non-enumerable symbol property for lookup instead, but that gets messy going through proxies,\n\t\t// so just relying on the WeakMap seems like the cleanest approach.\n\t\tnew TreeNodeKernel(result, schema, node, context);\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Data cached about the most derived type in a schema's class hierarchy.\n * @remarks\n * The most derived type is the only one allowed to be referenced by other schema or constructed as a node.\n * It has to be discovered lazily (when a node is constructed or when a {@link TreeViewConfiguration} is made),\n * since JavaScript provides no way to find derived classes, or inject static class initialization time logic into base classes.\n * Additionally since schema can reference other schema through lazy references which might be forward or recursive references,\n * this can not be evaluated for one schema when referenced by another schema.\n *\n * See {@link TreeNodeValid.constructorCached} and {@link TreeNodeValid.markMostDerived}.\n */\nexport interface MostDerivedData {\n\treadonly constructor: typeof TreeNodeValid & TreeNodeSchema;\n\toneTimeInitialized?: TreeNodeSchemaInitializedData;\n}\n\n/**\n * Cast `schema` to a {@link TreeNodeValid}, asserting it actually extends it.\n */\nexport function schemaAsTreeNodeValid(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): typeof TreeNodeValid & TreeNodeSchema {\n\tif (!isClassBasedSchema(schema)) {\n\t\t// Use JSON.stringify to quote and escape identifier string.\n\t\tthrow new UsageError(\n\t\t\t`Schema for ${JSON.stringify(\n\t\t\t\tschema.identifier,\n\t\t\t)} does not extend a SchemaFactory generated class. This is invalid.`,\n\t\t);\n\t}\n\n\treturn schema;\n}\n\n/**\n * Check if a schema is a {@link TreeNodeValid}.\n */\nexport function isClassBasedSchema(\n\tschema: SimpleNodeSchemaBase<NodeKind>,\n): schema is typeof TreeNodeValid & TreeNodeSchema {\n\treturn inPrototypeChain(schema, TreeNodeValid);\n}\n\n/**\n * Provides the {@link TreeNodeSchemaPrivateData} for class based implementations of {@link asTreeNodeSchemaCorePrivate}.\n * @remarks\n * Such schema must extends {@link TreeNodeValid}.\n */\nexport function createTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n\tchildAllowedTypes: readonly AllowedTypesFull[],\n): TreeNodeSchemaPrivateData {\n\tconst schemaValid = schemaAsTreeNodeValid(schema);\n\t// Since this closes over the schema, ensure this schema is marked as most derived\n\t// so if some other subclass is used later, it will error instead of giving inconsistent results.\n\tschemaValid.markMostDerived();\n\n\treturn {\n\t\tidempotentInitialize: () => schemaValid.oneTimeInitialize().oneTimeInitialized,\n\t\tchildAllowedTypes,\n\t};\n}\n\n// #region NodeJS custom inspect for TreeNodes.\n\n/**\n * Used to customize \"inspect\" behavior in NodeJS.\n * See https://nodejs.org/api/util.html#utilinspectcustom for details.\n *\n * VS-Code's debugger also uses this to inspect objects,\n * see https://github.com/microsoft/vscode-js-debug/blob/64df2686c92bac402909dee5c3c389bbb7a81f6d/src/adapter/templates/getStringyProps.ts#L11 for details.\n */\nconst customInspectSymbol = Symbol.for(\"nodejs.util.inspect.custom\");\n\n/**\n * Node inspecting function for use with {@link customInspectSymbol}.\n */\nfunction inspectNodeFunction(\n\tthis: TreeNodeValid<unknown>,\n\tdepth: number,\n\toptions?: unknown,\n\tinspect?: unknown,\n): unknown {\n\tconst schema = this[typeSchemaSymbol];\n\tconst title = `${schema.name}: ${NodeKind[schema.kind]} Node (${schema.identifier})`;\n\n\tif (depth < 2) {\n\t\tconst short = shortContent(this);\n\t\tif (short !== undefined) {\n\t\t\treturn `${title} ${short}`;\n\t\t}\n\t\treturn title;\n\t}\n\tconst content = `${title} ${JSON.stringify(this)}`;\n\treturn content;\n}\n\n/**\n * If the node has no items, a short JSON string for it.\n */\nfunction shortContent(node: TreeNodeValid<unknown>): string | undefined {\n\tif (Object.values(node).length === 0) {\n\t\treturn JSON.stringify(node);\n\t}\n\treturn undefined;\n}\n\n/**\n * Add inherited non-enumerable symbol for NodeJS inspection to all nodes.\n *\n * See {@link customInspectSymbol}.\n */\nObject.defineProperty(TreeNodeValid.prototype, customInspectSymbol, {\n\tvalue: inspectNodeFunction,\n\tenumerable: false,\n});\n\n// #endregion\n\n// #region Browser custom debug format for TreeNodes\n\n// This section has side-effects, so including it in this file ensures its loaded whenever TreeNodes could exist.\n// Supported in at least Chrome and FireFox, more details at https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n// For this to work the browser's dev tools generally have to \"Enable custom formatters\".\n\n// This formatter is inspired by https://github.com/andrewdavey/immutable-devtools/blob/master/src/createFormatters.js which provides a similar formatter for the immutable.js library.\n\nconst globals = typeof window === \"undefined\" ? globalThis : window;\nconst formatters = ((\n\tglobals as { devtoolsFormatters?: DevtoolsFormatter.DevtoolsFormatter[] }\n).devtoolsFormatters ??= []);\n\nconst nodeFormatter: DevtoolsFormatter.DevtoolsFormatter = {\n\theader(object, config) {\n\t\tif (isTreeNode(object)) {\n\t\t\treturn [\"span\", `${inspectNodeFunction.call(object, 1)}`];\n\t\t}\n\t\treturn null;\n\t},\n\tbody(object, config): DevtoolsFormatter.Item {\n\t\tconst children: DevtoolsFormatter.Item[] = [];\n\t\tfor (const [key, value] of Object.entries(object as TreeNode)) {\n\t\t\tchildren.push([\"li\", [\"span\", `${key}: `], formattedReference(value)]);\n\t\t}\n\n\t\t// TODO:\n\t\t// for array nodes, this isn't great since (at least in FireFox) the list items show up with a prefixed number starting from 1.\n\t\t// This looks messy when followed by the array index.\n\t\t// Find a way to hide the list index.\n\t\t// { style: 'list-style-type: none` } did not seem to work.\n\n\t\treturn [\"ol\", ...children];\n\t},\n\thasBody(object, config) {\n\t\treturn shortContent(object as TreeNodeValid<undefined>) === undefined;\n\t},\n};\n\nfunction formattedReference(\n\tobject: unknown,\n\tconfig?: DevtoolsFormatter.ObjectConfig,\n): DevtoolsFormatter.Item {\n\tif (object === undefined) {\n\t\treturn [\"span\", \"undefined\"];\n\t} else if (object === \"null\") {\n\t\treturn [\"span\", \"null\"];\n\t}\n\n\treturn [\"object\", { object, config }];\n}\n\nformatters.push(nodeFormatter);\n\n// #endregion\n\n// These types are based on https://github.com/BenjaminAster/Better-TypeScript/blob/main/types/devtools-formatters.d.ts\n// however the original package causes multiple compile errors due to some of its other types it used, so the relevant part has been extracted and adjusted to better match our conventions.\ndeclare namespace DevtoolsFormatter {\n\ttype ObjectConfig = Record<string | symbol, unknown>;\n\n\ttype ElementTagName = \"div\" | \"span\" | \"ol\" | \"li\" | \"table\" | \"tr\" | \"td\";\n\n\ttype ElementTemplate = StyledElementTemplate | UnstyledElementTemplate;\n\n\ttype StyledElementTemplate = readonly [\n\t\tElementTagName,\n\t\t{\n\t\t\tstyle?: string;\n\t\t},\n\t\t...Item[],\n\t];\n\n\ttype UnstyledElementTemplate = readonly [ElementTagName, ...Item[]];\n\n\ttype ObjectReference = readonly [\n\t\t\"object\",\n\t\t{\n\t\t\tobject: unknown;\n\t\t\tconfig?: ObjectConfig;\n\t\t},\n\t];\n\n\ttype Item = string | ElementTemplate | ObjectReference;\n\n\tinterface DevtoolsFormatter {\n\t\theader(\n\t\t\tobject?: unknown,\n\t\t\tconfig?: ObjectConfig,\n\t\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\t): Item | null;\n\t\thasBody(object?: unknown, config?: ObjectConfig): boolean;\n\t\tbody(object?: unknown, config?: ObjectConfig): Item;\n\t}\n}\n"]}
1
+ {"version":3,"file":"treeNodeValid.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,+DAAqF;AAIrF,+CAAyE;AACzE,2DAK6B;AAC7B,2DAM6B;AAE7B,mEAAiE;AACjE,+CAAiD;AAEjD;;;;;;;GAOG;AACH,MAAsB,aAAsB,SAAQ,sBAAQ;IAC3D;;;;;;;OAOG;IACO,M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AC;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 type { AllowedTypesFull } from \"./allowedTypes.js\";\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nimport { inPrototypeChain, privateToken, TreeNode } from \"./treeNode.js\";\nimport {\n\tgetSimpleNodeSchemaFromInnerNode,\n\tisTreeNode,\n\tTreeNodeKernel,\n\ttype InnerNode,\n} from \"./treeNodeKernel.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaCore,\n\ttype TreeNodeSchemaInitializedData,\n\ttype TreeNodeSchemaPrivateData,\n} from \"./treeNodeSchema.js\";\nimport type { InternalTreeNode } from \"./types.js\";\nimport { UnhydratedFlexTreeNode } from \"./unhydratedFlexTree.js\";\nimport { typeSchemaSymbol } from \"./withType.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"]}
@@ -5,8 +5,8 @@
5
5
  import type { HasListeners, Listenable } from "@fluidframework/core-interfaces/internal";
6
6
  import { type AnchorEvents, type FieldKey, type FieldKindIdentifier, type ITreeCursorSynchronous, type NodeData, type NormalizedFieldUpPath, type SchemaPolicy, type TreeNodeSchemaIdentifier, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeValue, type Value } from "../../core/index.js";
7
7
  import { type FlexTreeContext, FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeUnknownUnboxed, flexTreeMarker, type FlexTreeHydratedContext, type FlexFieldKind, type FlexibleNodeContent, type FlexTreeHydratedContextMinimal, type FlexibleFieldContent, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, type HydratedFlexTreeNode, type MinimalFieldMap } from "../../feature-libraries/index.js";
8
- import type { Context } from "./context.js";
9
8
  import type { ContextualFieldProvider } from "../fieldSchema.js";
9
+ import type { Context } from "./context.js";
10
10
  import type { TreeNode } from "./treeNode.js";
11
11
  type UnhydratedFlexTreeNodeEvents = Pick<AnchorEvents, "childrenChangedAfterBatch" | "subtreeChangedAfterBatch">;
12
12
  /** A node's parent field and its index in that field */
@@ -1 +1 @@
1
- {"version":3,"file":"unhydratedFlexTree.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAIzF,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,oBA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U,CAAC,CAAC,CAAC;YACrC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YACrC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;YACtC,mHAAmH;YACnH,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;AACF,CAAC;AAtBD,kCAsBC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { HasListeners, Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\tdummyRoot,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NodeData,\n\ttype NormalizedFieldUpPath,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n\ttype OptionalFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype FlexibleFieldContent,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype HydratedFlexTreeNode,\n\tcursorForMapTreeField,\n\ttype MinimalFieldMap,\n\tcurrentObserver,\n} from \"../../feature-libraries/index.js\";\nimport { brand, filterIterable, getOrCreate, mapIterable } from \"../../util/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport type { ContextualFieldProvider } from \"../fieldSchema.js\";\nimport type { TreeNode } from \"./treeNode.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<FlexibleFieldContent, UnhydratedFlexTreeNode[]> {}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<\n\tAnchorEvents,\n\t\"childrenChangedAfterBatch\" | \"subtreeChangedAfterBatch\"\n>;\n\n/** A node's parent field and its index in that field */\ntype LocationInField = FlexTreeNode[\"parentField\"];\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeNode}.\n */\nexport class UnhydratedFlexTreeNode\n\timplements FlexTreeNode, MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic isHydrated(): this is HydratedFlexTreeNode {\n\t\treturn false;\n\t}\n\n\tprivate location = unparentedLocation;\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.data.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\t/**\n\t * Cache storing the {@link TreeNode} for this inner node.\n\t * @remarks\n\t * When creating a `TreeNode` for this `UnhydratedFlexTreeNode`, cache the `TreeNode` in this property.\n\t * Currently this is done by {@link TreeNodeKernel}.\n\t *\n\t * See {@link getOrCreateNodeFromInnerNode} how to get the `TreeNode`, even if not already created, regardless of hydration status.\n\t */\n\tpublic treeNode: TreeNode | undefined;\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> &\n\t\tHasListeners<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The {@link NodeData} for this node.\n\t\t */\n\t\tpublic readonly data: NodeData,\n\t\t/**\n\t\t * All {@link UnhydratedFlexTreeField} for this node that have been created so far.\n\t\t * @remarks\n\t\t * This includes all non-empty fields, but also any empty fields which have been previously requested.\n\t\t */\n\t\tprivate readonly fieldsAll: Map<FieldKey, UnhydratedFlexTreeField>,\n\t\t/**\n\t\t * The {@link Context} for this node.\n\t\t * @remarks\n\t\t * Provides access to all schema reachable from this node.\n\t\t * See {@link getUnhydratedContext}.\n\t\t */\n\t\tpublic readonly simpleContext: Context,\n\t) {\n\t\tfor (const [_key, field] of this.fieldsAll) {\n\t\t\tfield.parent = this;\n\t\t}\n\t}\n\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is needed to implement {@link MapTreeNodeViewGeneric.fields}, which must omit empty fields.\n\t * Due to having to detect if a field is empty, this forces the evaluation of any pending defaults in the fields.\n\t * Use {@link allFieldsLazy} to avoid evaluating pending defaults.\n\t */\n\tpublic readonly fields: MinimalFieldMap<UnhydratedFlexTreeField> = {\n\t\tget: (key: FieldKey): UnhydratedFlexTreeField | undefined => this.tryGetField(key),\n\t\t[Symbol.iterator]: (): IterableIterator<[FieldKey, UnhydratedFlexTreeField]> => {\n\t\t\tcurrentObserver?.observeNodeFields(this);\n\t\t\treturn filterIterable(this.fieldsAll, ([, field]) => field.length > 0);\n\t\t},\n\t};\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeField> {\n\t\treturn mapIterable(this.fields, ([, field]) => field)[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Gets all fields, without filtering out empty ones.\n\t * @remarks\n\t * This avoids forcing the evaluating of pending defaults in the fields, and also saves a copy on access.\n\t */\n\tpublic get allFieldsLazy(): ReadonlyMap<FieldKey, UnhydratedFlexTreeField> {\n\t\treturn this.fieldsAll;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.data.type;\n\t}\n\n\tprivate getOrCreateField(key: FieldKey): UnhydratedFlexTreeField {\n\t\treturn getOrCreate(this.fieldsAll, key, () => {\n\t\t\tconst stored = this.storedSchema.getFieldSchema(key).kind;\n\t\t\tconst field = createField(this.context, stored, key, []);\n\t\t\tfield.parent = this;\n\t\t\treturn field;\n\t\t});\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent === undefined) {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t} else {\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tif (this.location !== unparentedLocation) {\n\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t}\n\t\t\tlet unhydratedNode: UnhydratedFlexTreeNode | undefined = parent.parent;\n\t\t\twhile (unhydratedNode !== undefined) {\n\t\t\t\tif (unhydratedNode === this) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"A node may not be inserted into a location that is under itself\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst parentNode: FlexTreeNode | undefined = unhydratedNode.parentField.parent.parent;\n\t\t\t\tassert(\n\t\t\t\t\tparentNode === undefined || parentNode instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xb77 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t\t\t);\n\t\t\t\tunhydratedNode = parentNode;\n\t\t\t}\n\t\t\tthis.location = { parent, index };\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tcurrentObserver?.observeParentOf(this);\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(this);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tcurrentObserver?.observeNodeField(this, key);\n\n\t\tconst field = this.fieldsAll.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn field;\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): UnhydratedFlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\n\t\tcurrentObserver?.observeNodeField(this, fieldKey);\n\n\t\treturn this.getOrCreateField(fieldKey);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn Array.from(this.fields, ([key]) => key)[Symbol.iterator]();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.data.value;\n\t}\n\n\tpublic emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\n\t\t// Also emit subtree changed event for this node and all ancestors.\n\t\tthis.#emitSubtreeChangedEvents();\n\t}\n\n\t/**\n\t * Emit subtree changed events for this node and all ancestors.\n\t */\n\t#emitSubtreeChangedEvents(): void {\n\t\tthis._events.emit(\"subtreeChangedAfterBatch\");\n\n\t\tconst parent = this.parentField.parent.parent;\n\t\tassert(\n\t\t\tparent === undefined || parent instanceof UnhydratedFlexTreeNode,\n\t\t\t0xb76 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t);\n\t\tif (parent !== undefined) {\n\t\t\tparent.#emitSubtreeChangedEvents();\n\t\t}\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isDisposed(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n *\n * TODO: make this make sense.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\tkey: dummyRoot,\n\t\tparent: undefined,\n\t\tschema: brand(FieldKinds.optional.identifier),\n\t},\n\tindex: 0,\n};\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeField}.\n */\nexport class UnhydratedFlexTreeField\n\timplements FlexTreeField, MapTreeFieldViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic parent: UnhydratedFlexTreeNode | undefined = undefined;\n\n\tpublic constructor(\n\t\tpublic readonly context: FlexTreeContext,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\t/**\n\t\t * The children of this field.\n\t\t * @remarks\n\t\t * This is either an array of {@link UnhydratedFlexTreeNode}s or a {@link ContextualFieldProvider} that will be used to populate the children lazily (after which it will become an array).\n\t\t * See {@link fillPendingDefaults}.\n\t\t * Note that any fields using a {@link ConstantFieldProvider} should be evaluated before constructing the UnhydratedFlexTreeField.\n\t\t */\n\t\tprivate lazyChildren: UnhydratedFlexTreeNode[] | ContextualFieldProvider,\n\t) {\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tif (Array.isArray(lazyChildren)) {\n\t\t\tfor (const [i, child] of lazyChildren.entries()) {\n\t\t\t\tchild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeField<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(\n\t\t\tthis.children,\n\t\t);\n\t}\n\n\tprivate getPendingDefault(): ContextualFieldProvider | undefined {\n\t\treturn Array.isArray(this.lazyChildren) ? undefined : this.lazyChildren;\n\t}\n\n\t/**\n\t * Populate pending default (if present) using the provided context.\n\t * @remarks\n\t * This apply to just this field: caller will likely want to recursively walk the tree.\n\t * @see {@link pendingDefault}.\n\t */\n\tpublic fillPendingDefaults(context: FlexTreeHydratedContextMinimal): void {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(context);\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if this field has a pending default due to defined defined using a {@link ContextualFieldProvider}.\n\t */\n\tpublic get pendingDefault(): boolean {\n\t\treturn this.getPendingDefault() !== undefined;\n\t}\n\n\tpublic get children(): UnhydratedFlexTreeNode[] {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(\"UseGlobalContext\");\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t\treturn this.lazyChildren as UnhydratedFlexTreeNode[];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.children.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.children[i];\n\t\treturn m;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode> {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(\n\t\tedit: (mapTrees: UnhydratedFlexTreeNode[]) => void | UnhydratedFlexTreeNode[],\n\t): void {\n\t\t// Clear parents for all old map trees.\n\t\tfor (const tree of this.children) {\n\t\t\ttree.adoptBy(undefined);\n\t\t}\n\n\t\tthis.lazyChildren = edit(this.children) ?? this.children;\n\n\t\t// Set parents for all new map trees.\n\t\tfor (const [index, tree] of this.children.entries()) {\n\t\t\ttree.adoptBy(this, index);\n\t\t}\n\n\t\tthis.parent?.emitChangedEvent(this.key);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): TreeValue | UnhydratedFlexTreeNode {\n\t\tconst child = this.children[index] ?? oob();\n\t\tconst value = child.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\treturn child;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.\n */\nexport class UnhydratedOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: FlexibleNodeContent | undefined): void => {\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tnewContent instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xbb7 /* Expected unhydrated node */,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t} satisfies OptionalFieldEditBuilder<FlexibleNodeContent> &\n\t\tValueFieldEditBuilder<FlexibleNodeContent>;\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.children[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass UnhydratedRequiredField\n\textends UnhydratedOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.\n */\nexport class UnhydratedSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (const c of newContent) {\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tassert(c instanceof UnhydratedFlexTreeNode, 0xbb8 /* Expected unhydrated node */);\n\t\t\t}\n\t\t\tconst newContentChecked = newContent as readonly UnhydratedFlexTreeNode[];\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContentChecked);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn [...mapTrees.slice(0, index), ...newContentChecked, ...mapTrees.slice(index)];\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): UnhydratedFlexTreeNode[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.children[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t}\n\t\t\tlet removed: UnhydratedFlexTreeNode[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t} satisfies UnhydratedTreeSequenceFieldEditBuilder;\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n}\n\n// #endregion Fields\n\n/** Creates a field with the given attributes */\nexport function createField(\n\t...args: ConstructorParameters<typeof UnhydratedFlexTreeField>\n): UnhydratedFlexTreeField {\n\tswitch (args[1]) {\n\t\tcase FieldKinds.required.identifier:\n\t\tcase FieldKinds.identifier.identifier: {\n\t\t\treturn new UnhydratedRequiredField(...args);\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\treturn new UnhydratedOptionalField(...args);\n\t\t}\n\t\tcase FieldKinds.sequence.identifier: {\n\t\t\treturn new UnhydratedSequenceField(...args);\n\t\t}\n\t\tcase FieldKinds.forbidden.identifier: {\n\t\t\t// TODO: this seems to used by unknown optional fields. They should probably use \"optional\" not \"Forbidden\" schema.\n\t\t\treturn new UnhydratedFlexTreeField(...args);\n\t\t}\n\t\tdefault: {\n\t\t\treturn fail(0xb9d /* unsupported field kind */);\n\t\t}\n\t}\n}\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
1
+ {"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+DAA6D;AAE7D,kEAAwE;AACxE,uEAAsE;AAEtE,kDAc6B;AAC7B,+DA4B0C;AAC1C,kDAAsF;AAiBtF;;GAEG;AACH,MAAa,sBAAsB;IAG3B,UAAU;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IAID,IAAW,YAAY;QACtB,OAAO,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,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AU,CAAC,UAAU,CAAC,CAAC,CAAC;YACvC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YACrC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;YACrC,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,KAAK,qBAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;YACtC,mHAAmH;YACnH,OAAO,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,IAAA,eAAI,EAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;AACF,CAAC;AAtBD,kCAsBC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { HasListeners, Listenable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\tdummyRoot,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype NodeData,\n\ttype NormalizedFieldUpPath,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n\ttype OptionalFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype FlexibleFieldContent,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype HydratedFlexTreeNode,\n\tcursorForMapTreeField,\n\ttype MinimalFieldMap,\n\tcurrentObserver,\n} from \"../../feature-libraries/index.js\";\nimport { brand, filterIterable, getOrCreate, mapIterable } from \"../../util/index.js\";\nimport type { ContextualFieldProvider } from \"../fieldSchema.js\";\n\nimport type { Context } from \"./context.js\";\nimport type { TreeNode } from \"./treeNode.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<FlexibleFieldContent, UnhydratedFlexTreeNode[]> {}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<\n\tAnchorEvents,\n\t\"childrenChangedAfterBatch\" | \"subtreeChangedAfterBatch\"\n>;\n\n/** A node's parent field and its index in that field */\ntype LocationInField = FlexTreeNode[\"parentField\"];\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeNode}.\n */\nexport class UnhydratedFlexTreeNode\n\timplements FlexTreeNode, MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic isHydrated(): this is HydratedFlexTreeNode {\n\t\treturn false;\n\t}\n\n\tprivate location = unparentedLocation;\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.data.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\t/**\n\t * Cache storing the {@link TreeNode} for this inner node.\n\t * @remarks\n\t * When creating a `TreeNode` for this `UnhydratedFlexTreeNode`, cache the `TreeNode` in this property.\n\t * Currently this is done by {@link TreeNodeKernel}.\n\t *\n\t * See {@link getOrCreateNodeFromInnerNode} how to get the `TreeNode`, even if not already created, regardless of hydration status.\n\t */\n\tpublic treeNode: TreeNode | undefined;\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> &\n\t\tHasListeners<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The {@link NodeData} for this node.\n\t\t */\n\t\tpublic readonly data: NodeData,\n\t\t/**\n\t\t * All {@link UnhydratedFlexTreeField} for this node that have been created so far.\n\t\t * @remarks\n\t\t * This includes all non-empty fields, but also any empty fields which have been previously requested.\n\t\t */\n\t\tprivate readonly fieldsAll: Map<FieldKey, UnhydratedFlexTreeField>,\n\t\t/**\n\t\t * The {@link Context} for this node.\n\t\t * @remarks\n\t\t * Provides access to all schema reachable from this node.\n\t\t * See {@link getUnhydratedContext}.\n\t\t */\n\t\tpublic readonly simpleContext: Context,\n\t) {\n\t\tfor (const [_key, field] of this.fieldsAll) {\n\t\t\tfield.parent = this;\n\t\t}\n\t}\n\n\t/**\n\t * The non-empty fields on this node.\n\t * @remarks\n\t * This is needed to implement {@link MapTreeNodeViewGeneric.fields}, which must omit empty fields.\n\t * Due to having to detect if a field is empty, this forces the evaluation of any pending defaults in the fields.\n\t * Use {@link allFieldsLazy} to avoid evaluating pending defaults.\n\t */\n\tpublic readonly fields: MinimalFieldMap<UnhydratedFlexTreeField> = {\n\t\tget: (key: FieldKey): UnhydratedFlexTreeField | undefined => this.tryGetField(key),\n\t\t[Symbol.iterator]: (): IterableIterator<[FieldKey, UnhydratedFlexTreeField]> => {\n\t\t\tcurrentObserver?.observeNodeFields(this);\n\t\t\treturn filterIterable(this.fieldsAll, ([, field]) => field.length > 0);\n\t\t},\n\t};\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeField> {\n\t\treturn mapIterable(this.fields, ([, field]) => field)[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Gets all fields, without filtering out empty ones.\n\t * @remarks\n\t * This avoids forcing the evaluating of pending defaults in the fields, and also saves a copy on access.\n\t */\n\tpublic get allFieldsLazy(): ReadonlyMap<FieldKey, UnhydratedFlexTreeField> {\n\t\treturn this.fieldsAll;\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.data.type;\n\t}\n\n\tprivate getOrCreateField(key: FieldKey): UnhydratedFlexTreeField {\n\t\treturn getOrCreate(this.fieldsAll, key, () => {\n\t\t\tconst stored = this.storedSchema.getFieldSchema(key).kind;\n\t\t\tconst field = createField(this.context, stored, key, []);\n\t\t\tfield.parent = this;\n\t\t\treturn field;\n\t\t});\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent === undefined) {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t} else {\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tif (this.location !== unparentedLocation) {\n\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t}\n\t\t\tlet unhydratedNode: UnhydratedFlexTreeNode | undefined = parent.parent;\n\t\t\twhile (unhydratedNode !== undefined) {\n\t\t\t\tif (unhydratedNode === this) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"A node may not be inserted into a location that is under itself\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst parentNode: FlexTreeNode | undefined = unhydratedNode.parentField.parent.parent;\n\t\t\t\tassert(\n\t\t\t\t\tparentNode === undefined || parentNode instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xb77 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t\t\t);\n\t\t\t\tunhydratedNode = parentNode;\n\t\t\t}\n\t\t\tthis.location = { parent, index };\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tcurrentObserver?.observeParentOf(this);\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(this);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tcurrentObserver?.observeNodeField(this, key);\n\n\t\tconst field = this.fieldsAll.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn field;\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): UnhydratedFlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\n\t\tcurrentObserver?.observeNodeField(this, fieldKey);\n\n\t\treturn this.getOrCreateField(fieldKey);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn Array.from(this.fields, ([key]) => key)[Symbol.iterator]();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.data.value;\n\t}\n\n\tpublic emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\n\t\t// Also emit subtree changed event for this node and all ancestors.\n\t\tthis.#emitSubtreeChangedEvents();\n\t}\n\n\t/**\n\t * Emit subtree changed events for this node and all ancestors.\n\t */\n\t#emitSubtreeChangedEvents(): void {\n\t\tthis._events.emit(\"subtreeChangedAfterBatch\");\n\n\t\tconst parent = this.parentField.parent.parent;\n\t\tassert(\n\t\t\tparent === undefined || parent instanceof UnhydratedFlexTreeNode,\n\t\t\t0xb76 /* Unhydrated node's parent should be an unhydrated node */,\n\t\t);\n\t\tif (parent !== undefined) {\n\t\t\tparent.#emitSubtreeChangedEvents();\n\t\t}\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isDisposed(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n *\n * TODO: make this make sense.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\tkey: dummyRoot,\n\t\tparent: undefined,\n\t\tschema: brand(FieldKinds.optional.identifier),\n\t},\n\tindex: 0,\n};\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeField}.\n */\nexport class UnhydratedFlexTreeField\n\timplements FlexTreeField, MapTreeFieldViewGeneric<UnhydratedFlexTreeNode>\n{\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic parent: UnhydratedFlexTreeNode | undefined = undefined;\n\n\tpublic constructor(\n\t\tpublic readonly context: FlexTreeContext,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\t/**\n\t\t * The children of this field.\n\t\t * @remarks\n\t\t * This is either an array of {@link UnhydratedFlexTreeNode}s or a {@link ContextualFieldProvider} that will be used to populate the children lazily (after which it will become an array).\n\t\t * See {@link fillPendingDefaults}.\n\t\t * Note that any fields using a {@link ConstantFieldProvider} should be evaluated before constructing the UnhydratedFlexTreeField.\n\t\t */\n\t\tprivate lazyChildren: UnhydratedFlexTreeNode[] | ContextualFieldProvider,\n\t) {\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tif (Array.isArray(lazyChildren)) {\n\t\t\tfor (const [i, child] of lazyChildren.entries()) {\n\t\t\t\tchild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeField<MapTreeNodeViewGeneric<UnhydratedFlexTreeNode>>(\n\t\t\tthis.children,\n\t\t);\n\t}\n\n\tprivate getPendingDefault(): ContextualFieldProvider | undefined {\n\t\treturn Array.isArray(this.lazyChildren) ? undefined : this.lazyChildren;\n\t}\n\n\t/**\n\t * Populate pending default (if present) using the provided context.\n\t * @remarks\n\t * This apply to just this field: caller will likely want to recursively walk the tree.\n\t * @see {@link pendingDefault}.\n\t */\n\tpublic fillPendingDefaults(context: FlexTreeHydratedContextMinimal): void {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(context);\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if this field has a pending default due to defined defined using a {@link ContextualFieldProvider}.\n\t */\n\tpublic get pendingDefault(): boolean {\n\t\treturn this.getPendingDefault() !== undefined;\n\t}\n\n\tpublic get children(): UnhydratedFlexTreeNode[] {\n\t\tconst provider = this.getPendingDefault();\n\t\tif (provider) {\n\t\t\tconst content = provider(\"UseGlobalContext\");\n\t\t\tthis.lazyChildren = content;\n\t\t}\n\t\treturn this.lazyChildren as UnhydratedFlexTreeNode[];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.children.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.children[i];\n\t\treturn m;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode> {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(\n\t\tedit: (mapTrees: UnhydratedFlexTreeNode[]) => void | UnhydratedFlexTreeNode[],\n\t): void {\n\t\t// Clear parents for all old map trees.\n\t\tfor (const tree of this.children) {\n\t\t\ttree.adoptBy(undefined);\n\t\t}\n\n\t\tthis.lazyChildren = edit(this.children) ?? this.children;\n\n\t\t// Set parents for all new map trees.\n\t\tfor (const [index, tree] of this.children.entries()) {\n\t\t\ttree.adoptBy(this, index);\n\t\t}\n\n\t\tthis.parent?.emitChangedEvent(this.key);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): TreeValue | UnhydratedFlexTreeNode {\n\t\tconst child = this.children[index] ?? oob();\n\t\tconst value = child.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\t\treturn child;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.\n */\nexport class UnhydratedOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: FlexibleNodeContent | undefined): void => {\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tnewContent instanceof UnhydratedFlexTreeNode,\n\t\t\t\t\t0xbb7 /* Expected unhydrated node */,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent === undefined) {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t} satisfies OptionalFieldEditBuilder<FlexibleNodeContent> &\n\t\tValueFieldEditBuilder<FlexibleNodeContent>;\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.children[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass UnhydratedRequiredField\n\textends UnhydratedOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\n/**\n * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.\n */\nexport class UnhydratedSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (const c of newContent) {\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tassert(c instanceof UnhydratedFlexTreeNode, 0xbb8 /* Expected unhydrated node */);\n\t\t\t}\n\t\t\tconst newContentChecked = newContent as readonly UnhydratedFlexTreeNode[];\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContentChecked);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn [...mapTrees.slice(0, index), ...newContentChecked, ...mapTrees.slice(index)];\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): UnhydratedFlexTreeNode[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.children[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t}\n\t\t\tlet removed: UnhydratedFlexTreeNode[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t} satisfies UnhydratedTreeSequenceFieldEditBuilder;\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n}\n\n// #endregion Fields\n\n/** Creates a field with the given attributes */\nexport function createField(\n\t...args: ConstructorParameters<typeof UnhydratedFlexTreeField>\n): UnhydratedFlexTreeField {\n\tswitch (args[1]) {\n\t\tcase FieldKinds.required.identifier:\n\t\tcase FieldKinds.identifier.identifier: {\n\t\t\treturn new UnhydratedRequiredField(...args);\n\t\t}\n\t\tcase FieldKinds.optional.identifier: {\n\t\t\treturn new UnhydratedOptionalField(...args);\n\t\t}\n\t\tcase FieldKinds.sequence.identifier: {\n\t\t\treturn new UnhydratedSequenceField(...args);\n\t\t}\n\t\tcase FieldKinds.forbidden.identifier: {\n\t\t\t// TODO: this seems to used by unknown optional fields. They should probably use \"optional\" not \"Forbidden\" schema.\n\t\t\treturn new UnhydratedFlexTreeField(...args);\n\t\t}\n\t\tdefault: {\n\t\t\treturn fail(0xb9d /* unsupported field kind */);\n\t\t}\n\t}\n}\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withType.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAKzE;;;;;;;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GAAG,MAAM,EACjC,GAAG,CAAC,KAAK,SAAS,QAAQ,GAAG,QAAQ,EACrC,GAAG,CAAC,KAAK,GAAG,OAAO;IAEnB;;;OAGG;IACH,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;IAE9B;;OAEG;IACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;CAC7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,mBAAmB,GAAkB,MAAM,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n// Used by doc links:\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports\nimport type { TreeAlpha } from \"../../shared-tree/index.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * The intended type of insertable content that is to become a {@link TreeNode}.\n * @remarks Use the type-safe {@link (TreeAlpha:interface).tagContentSchema} function to tag insertable content with this symbol.\n *\n * If a property with this symbol key is present on an object that is inserted into the tree,\n * the tree will use the schema identifier specified by the value of this property when creating the node.\n * This is particularly useful for specifying the intended schema of untyped content when it would otherwise be ambiguous.\n * @example\n * ```typescript\n * const sf = new SchemaFactory(\"example\");\n * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n * // ...\n * view.root.pet = { name: \"Max\" }; // Error: ambiguous schema - is it a Dog or a Cat?\n * view.root.pet = { name: \"Max\", [contentSchemaSymbol]: \"example.Dog\" }; // No error - it's a Dog.\n * ```\n * @alpha\n */\nexport const contentSchemaSymbol: unique symbol = Symbol(\"SharedTree Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @typeParam TInfo - Same as {@link TreeNodeSchema}'s \"Info\" parameter: format depends on the Kind.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n\tout TInfo = unknown,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;\n}\n"]}
1
+ {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,mBAAmB,GAAkB,MAAM,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Used by doc links:\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports\nimport type { TreeAlpha } from \"../../shared-tree/index.js\";\n\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * The intended type of insertable content that is to become a {@link TreeNode}.\n * @remarks Use the type-safe {@link (TreeAlpha:interface).tagContentSchema} function to tag insertable content with this symbol.\n *\n * If a property with this symbol key is present on an object that is inserted into the tree,\n * the tree will use the schema identifier specified by the value of this property when creating the node.\n * This is particularly useful for specifying the intended schema of untyped content when it would otherwise be ambiguous.\n * @example\n * ```typescript\n * const sf = new SchemaFactory(\"example\");\n * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n * // ...\n * view.root.pet = { name: \"Max\" }; // Error: ambiguous schema - is it a Dog or a Cat?\n * view.root.pet = { name: \"Max\", [contentSchemaSymbol]: \"example.Dog\" }; // No error - it's a Dog.\n * ```\n * @alpha\n */\nexport const contentSchemaSymbol: unique symbol = Symbol(\"SharedTree Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @typeParam TInfo - Same as {@link TreeNodeSchema}'s \"Info\" parameter: format depends on the Kind.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n\tout TInfo = unknown,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createContext.d.ts","sourceRoot":"","sources":["../../src/simple-tree/createContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,OAAO,EAGP,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUlF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAyBzE;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC/C,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,IAAI,CAAC,6BAA6B,EAAE,eAAe,GAAG,0BAA0B,CAAC,GACxF,6BAA6B,CAO/B"}
1
+ {"version":3,"file":"createContext.d.ts","sourceRoot":"","sources":["../../src/simple-tree/createContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,OAAO,EAGP,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUlF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO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AAsB,EACtB,OAA0F;IAE1F,MAAM,IAAI,GAAG,IAAA,uCAA4B,EAAC,MAAM,CAAC,CAAC;IAClD,OAAO;QACN,GAAG,OAAO;QACV,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;KAClE,CAAC;AACH,CAAC;AAVD,4EAUC","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 { defaultSchemaPolicy } from \"../feature-libraries/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\n\nimport {\n\tContext,\n\tgetTreeNodeSchemaPrivateData,\n\tUnhydratedContext,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaInitializedData,\n} from \"./core/index.js\";\nimport { normalizeFieldSchema, type ImplicitFieldSchema } from \"./fieldSchema.js\";\nimport { toStoredSchema, toUnhydratedSchema } from \"./toStoredSchema.js\";\n\nconst contextCache: WeakMap<ImplicitFieldSchema, Context> = new WeakMap();\n\n/**\n * See note in {@link getUnhydratedContext}.\n */\nlet getUnhydratedContextIsRunning = false;\n\n/**\n * Utility for creating {@link Context}s for unhydrated nodes.\n * @remarks\n * The resulting context will not allow any unknown optional fields.\n */\nexport function getUnhydratedContext(schema: ImplicitFieldSchema): Context {\n\t// Due to caching, calling this reentrantly can cause issues.\n\t// Due to recursive schema, and generally lots of lazy initialization code depending on this, bugs with this going reentrant are not uncommon.\n\t// To make debugging such cases much easier, we assert that this is not called reentrantly.\n\tassert(\n\t\t!getUnhydratedContextIsRunning,\n\t\t0xca7 /* getUnhydratedContext should not be reentrant */,\n\t);\n\tgetUnhydratedContextIsRunning = true;\n\ttry {\n\t\treturn getOrCreate(contextCache, schema, (s) => {\n\t\t\tconst normalized = normalizeFieldSchema(schema);\n\n\t\t\tconst flexContext = new UnhydratedContext(\n\t\t\t\tdefaultSchemaPolicy,\n\t\t\t\ttoStoredSchema(schema, toUnhydratedSchema),\n\t\t\t);\n\t\t\treturn new Context(\n\t\t\t\tflexContext,\n\t\t\t\tContext.schemaMapFromRootSchema(normalized.allowedTypesFull.evaluate()),\n\t\t\t);\n\t\t});\n\t} finally {\n\t\tgetUnhydratedContextIsRunning = false;\n\t}\n}\n\n/**\n * Utility for creating {@link TreeNodeSchemaInitializedData}.\n */\nexport function getTreeNodeSchemaInitializedData(\n\tschema: TreeNodeSchema,\n\thandler: Pick<TreeNodeSchemaInitializedData, \"toFlexContent\" | \"shallowCompatibilityTest\">,\n): TreeNodeSchemaInitializedData {\n\tconst data = getTreeNodeSchemaPrivateData(schema);\n\treturn {\n\t\t...handler,\n\t\tcontext: getUnhydratedContext(schema),\n\t\tchildAllowedTypes: data.childAllowedTypes.map((t) => t.evaluate()),\n\t};\n}\n"]}
1
+ {"version":3,"file":"createContext.js","sourceRoot":"","sources":["../../src/simple-tree/createContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,4DAAoE;AACpE,+CAA+C;AAE/C,8CAMyB;AACzB,qDAAkF;AAClF,2DAAyE;AAEzE,MAAM,YAAY,GAA0C,IAAI,OAAO,EAAE,CAAC;AAE1E;;GAEG;AACH,IAAI,6BAA6B,GAAG,KAAK,CAAC;AAE1C;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,MAA2B;IAC/D,6DAA6D;IAC7D,8IAA8I;IAC9I,2FAA2F;IAC3F,IAAA,iBAAM,EACL,CAAC,6BAA6B,EAC9B,KAAK,CAAC,kDAAkD,CACxD,CAAC;IACF,6BAA6B,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC;QACJ,OAAO,IAAA,sBAAW,EAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YAC9C,MAAM,UAAU,GAAG,IAAA,qCAAoB,EAAC,MAAM,CAAC,CAAC;YAEhD,MAAM,WAAW,GAAG,IAAI,4BAAiB,CACxC,8BAAmB,EACnB,IAAA,kCAAc,EAAC,MAAM,EAAE,sCAAkB,CAAC,CAC1C,CAAC;YACF,OAAO,IAAI,kBAAO,CACjB,WAAW,EACX,kBAAO,CAAC,uBAAuB,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACvE,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,6BAA6B,GAAG,KAAK,CAAC;IACvC,CAAC;AACF,CAAC;AAzBD,oDAyBC;AAED;;GAEG;AACH,SAAgB,gCAAgC,CAC/C,MAAsB,EACtB,OAA0F;IAE1F,MAAM,IAAI,GAAG,IAAA,uCAA4B,EAAC,MAAM,CAAC,CAAC;IAClD,OAAO;QACN,GAAG,OAAO;QACV,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;KAClE,CAAC;AACH,CAAC;AAVD,4EAUC","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\";\n\nimport { defaultSchemaPolicy } from \"../feature-libraries/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\n\nimport {\n\tContext,\n\tgetTreeNodeSchemaPrivateData,\n\tUnhydratedContext,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaInitializedData,\n} from \"./core/index.js\";\nimport { normalizeFieldSchema, type ImplicitFieldSchema } from \"./fieldSchema.js\";\nimport { toStoredSchema, toUnhydratedSchema } from \"./toStoredSchema.js\";\n\nconst contextCache: WeakMap<ImplicitFieldSchema, Context> = new WeakMap();\n\n/**\n * See note in {@link getUnhydratedContext}.\n */\nlet getUnhydratedContextIsRunning = false;\n\n/**\n * Utility for creating {@link Context}s for unhydrated nodes.\n * @remarks\n * The resulting context will not allow any unknown optional fields.\n */\nexport function getUnhydratedContext(schema: ImplicitFieldSchema): Context {\n\t// Due to caching, calling this reentrantly can cause issues.\n\t// Due to recursive schema, and generally lots of lazy initialization code depending on this, bugs with this going reentrant are not uncommon.\n\t// To make debugging such cases much easier, we assert that this is not called reentrantly.\n\tassert(\n\t\t!getUnhydratedContextIsRunning,\n\t\t0xca7 /* getUnhydratedContext should not be reentrant */,\n\t);\n\tgetUnhydratedContextIsRunning = true;\n\ttry {\n\t\treturn getOrCreate(contextCache, schema, (s) => {\n\t\t\tconst normalized = normalizeFieldSchema(schema);\n\n\t\t\tconst flexContext = new UnhydratedContext(\n\t\t\t\tdefaultSchemaPolicy,\n\t\t\t\ttoStoredSchema(schema, toUnhydratedSchema),\n\t\t\t);\n\t\t\treturn new Context(\n\t\t\t\tflexContext,\n\t\t\t\tContext.schemaMapFromRootSchema(normalized.allowedTypesFull.evaluate()),\n\t\t\t);\n\t\t});\n\t} finally {\n\t\tgetUnhydratedContextIsRunning = false;\n\t}\n}\n\n/**\n * Utility for creating {@link TreeNodeSchemaInitializedData}.\n */\nexport function getTreeNodeSchemaInitializedData(\n\tschema: TreeNodeSchema,\n\thandler: Pick<TreeNodeSchemaInitializedData, \"toFlexContent\" | \"shallowCompatibilityTest\">,\n): TreeNodeSchemaInitializedData {\n\tconst data = getTreeNodeSchemaPrivateData(schema);\n\treturn {\n\t\t...handler,\n\t\tcontext: getUnhydratedContext(schema),\n\t\tchildAllowedTypes: data.childAllowedTypes.map((t) => t.evaluate()),\n\t};\n}\n"]}