@fluidframework/tree 2.90.0-378676 → 2.91.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 (1244) hide show
  1. package/.vscode/settings.json +6 -5
  2. package/CHANGELOG.md +342 -0
  3. package/README.md +1 -1
  4. package/alpha.d.ts +2 -2
  5. package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
  6. package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
  7. package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
  8. package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
  9. package/api-extractor/api-extractor-lint-bundle.json +1 -1
  10. package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
  11. package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
  12. package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
  13. package/api-extractor/api-extractor-lint-public.esm.json +1 -1
  14. package/api-extractor/api-extractor.current.json +1 -1
  15. package/api-extractor/api-extractor.legacy.json +2 -1
  16. package/api-extractor.json +1 -0
  17. package/api-report/tree.alpha.api.md +144 -40
  18. package/api-report/tree.beta.api.md +30 -0
  19. package/api-report/tree.legacy.beta.api.md +30 -0
  20. package/beta.d.ts +2 -2
  21. package/dist/codec/codec.d.ts +2 -0
  22. package/dist/codec/codec.d.ts.map +1 -1
  23. package/dist/codec/codec.js +4 -3
  24. package/dist/codec/codec.js.map +1 -1
  25. package/dist/codec/index.d.ts +1 -1
  26. package/dist/codec/index.d.ts.map +1 -1
  27. package/dist/codec/index.js +2 -1
  28. package/dist/codec/index.js.map +1 -1
  29. package/dist/codec/versioned/codec.d.ts +13 -1
  30. package/dist/codec/versioned/codec.d.ts.map +1 -1
  31. package/dist/codec/versioned/codec.js +18 -3
  32. package/dist/codec/versioned/codec.js.map +1 -1
  33. package/dist/codec/versioned/format.d.ts +22 -1
  34. package/dist/codec/versioned/format.d.ts.map +1 -1
  35. package/dist/codec/versioned/format.js +16 -3
  36. package/dist/codec/versioned/format.js.map +1 -1
  37. package/dist/codec/versioned/index.d.ts +1 -1
  38. package/dist/codec/versioned/index.d.ts.map +1 -1
  39. package/dist/codec/versioned/index.js +2 -1
  40. package/dist/codec/versioned/index.js.map +1 -1
  41. package/dist/core/change-family/changeFamily.d.ts +1 -4
  42. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  43. package/dist/core/change-family/changeFamily.js.map +1 -1
  44. package/dist/core/change-family/index.d.ts +1 -1
  45. package/dist/core/change-family/index.d.ts.map +1 -1
  46. package/dist/core/change-family/index.js.map +1 -1
  47. package/dist/core/index.d.ts +3 -4
  48. package/dist/core/index.d.ts.map +1 -1
  49. package/dist/core/index.js +4 -8
  50. package/dist/core/index.js.map +1 -1
  51. package/dist/core/rebase/changeRebaser.d.ts +1 -6
  52. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  53. package/dist/core/rebase/changeRebaser.js.map +1 -1
  54. package/dist/core/rebase/index.d.ts +1 -1
  55. package/dist/core/rebase/index.d.ts.map +1 -1
  56. package/dist/core/rebase/index.js +1 -2
  57. package/dist/core/rebase/index.js.map +1 -1
  58. package/dist/core/rebase/types.d.ts +78 -1
  59. package/dist/core/rebase/types.d.ts.map +1 -1
  60. package/dist/core/rebase/types.js +1 -5
  61. package/dist/core/rebase/types.js.map +1 -1
  62. package/dist/core/rebase/utils.d.ts.map +1 -1
  63. package/dist/core/rebase/utils.js +7 -25
  64. package/dist/core/rebase/utils.js.map +1 -1
  65. package/dist/core/tree/delta.d.ts +0 -5
  66. package/dist/core/tree/delta.d.ts.map +1 -1
  67. package/dist/core/tree/delta.js.map +1 -1
  68. package/dist/core/tree/detachedFieldIndex.d.ts +1 -13
  69. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  70. package/dist/core/tree/detachedFieldIndex.js +1 -14
  71. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  72. package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  73. package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  74. package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
  75. package/dist/core/tree/index.d.ts +2 -2
  76. package/dist/core/tree/index.d.ts.map +1 -1
  77. package/dist/core/tree/index.js +3 -4
  78. package/dist/core/tree/index.js.map +1 -1
  79. package/dist/core/tree/pathTree.d.ts +3 -11
  80. package/dist/core/tree/pathTree.d.ts.map +1 -1
  81. package/dist/core/tree/pathTree.js +2 -14
  82. package/dist/core/tree/pathTree.js.map +1 -1
  83. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  84. package/dist/core/tree/visitDelta.js +13 -17
  85. package/dist/core/tree/visitDelta.js.map +1 -1
  86. package/dist/entrypoints/alpha.d.ts +6 -0
  87. package/dist/entrypoints/alpha.d.ts.map +1 -0
  88. package/dist/entrypoints/alpha.js +92 -0
  89. package/dist/entrypoints/alpha.js.map +1 -0
  90. package/dist/entrypoints/beta.d.ts +6 -0
  91. package/dist/entrypoints/beta.d.ts.map +1 -0
  92. package/dist/entrypoints/beta.js +43 -0
  93. package/dist/entrypoints/beta.js.map +1 -0
  94. package/{lib/core/schema-view/index.js → dist/entrypoints/internal.d.ts} +2 -2
  95. package/dist/entrypoints/internal.d.ts.map +1 -0
  96. package/dist/entrypoints/internal.js +28 -0
  97. package/dist/entrypoints/internal.js.map +1 -0
  98. package/dist/entrypoints/legacy.d.ts +6 -0
  99. package/dist/entrypoints/legacy.d.ts.map +1 -0
  100. package/dist/entrypoints/legacy.js +49 -0
  101. package/dist/entrypoints/legacy.js.map +1 -0
  102. package/dist/entrypoints/public.d.ts +6 -0
  103. package/dist/entrypoints/public.d.ts.map +1 -0
  104. package/dist/entrypoints/public.js +27 -0
  105. package/dist/entrypoints/public.js.map +1 -0
  106. package/dist/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  107. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  108. package/dist/feature-libraries/changeAtomIdBTree.js +2 -15
  109. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
  113. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
  116. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  118. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  119. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
  120. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  121. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  122. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  123. package/dist/feature-libraries/chunked-forest/index.js +2 -4
  124. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  125. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  126. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  127. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +70 -220
  128. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  129. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  130. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  131. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  132. package/dist/feature-libraries/default-schema/index.d.ts +1 -2
  133. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  134. package/dist/feature-libraries/default-schema/index.js +2 -4
  135. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  136. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  137. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  138. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  139. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  140. package/dist/feature-libraries/deltaUtils.d.ts +0 -1
  141. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  142. package/dist/feature-libraries/deltaUtils.js +1 -6
  143. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  144. package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
  145. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  146. package/dist/feature-libraries/flex-tree/context.js +0 -6
  147. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  148. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  149. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  150. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  151. package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  152. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  153. package/dist/feature-libraries/flex-tree/lazyField.js +8 -39
  154. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  155. package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
  156. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  157. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  158. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
  159. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  160. package/dist/feature-libraries/forest-summary/codec.js +33 -33
  161. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  162. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  163. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
  165. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  166. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  167. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  168. package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
  169. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  170. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  171. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  172. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  174. package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
  175. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  176. package/dist/feature-libraries/forest-summary/index.js +2 -2
  177. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  178. package/dist/feature-libraries/index.d.ts +6 -6
  179. package/dist/feature-libraries/index.d.ts.map +1 -1
  180. package/dist/feature-libraries/index.js +6 -11
  181. package/dist/feature-libraries/index.js.map +1 -1
  182. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  183. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  184. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  185. package/dist/feature-libraries/indexing/index.d.ts +1 -1
  186. package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
  187. package/dist/feature-libraries/indexing/index.js.map +1 -1
  188. package/dist/feature-libraries/indexing/types.d.ts +15 -13
  189. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  190. package/dist/feature-libraries/indexing/types.js.map +1 -1
  191. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  192. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  193. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  194. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  195. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +12 -8
  197. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  199. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  200. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  201. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  202. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  203. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  204. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  206. package/dist/feature-libraries/modular-schema/genericFieldKind.js +9 -4
  207. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/index.d.ts +3 -3
  209. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/index.js +3 -2
  211. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  212. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  213. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  214. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +158 -276
  215. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  216. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  217. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  218. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  219. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  220. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  221. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  222. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  223. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  224. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  225. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +468 -1392
  226. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  227. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  228. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  229. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  230. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  231. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +3 -3
  232. package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  233. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  234. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  235. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  236. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  237. package/dist/feature-libraries/optional-field/optionalField.d.ts +32 -13
  238. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  239. package/dist/feature-libraries/optional-field/optionalField.js +446 -257
  240. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  241. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  242. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  243. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  244. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  245. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  246. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
  247. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  248. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  249. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  250. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  251. package/dist/feature-libraries/optional-field/requiredField.d.ts +2 -3
  252. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  253. package/dist/feature-libraries/optional-field/requiredField.js +1 -6
  254. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
  255. package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
  256. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  257. package/dist/feature-libraries/sequence-field/compose.js +259 -81
  258. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  259. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  260. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  261. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  262. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  263. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  264. package/dist/feature-libraries/sequence-field/invert.js +167 -65
  265. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  266. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  267. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  268. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  269. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  270. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  271. package/dist/feature-libraries/sequence-field/moveEffectTable.js +90 -7
  272. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  273. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  274. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  275. package/dist/feature-libraries/sequence-field/rebase.js +116 -109
  276. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  277. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  278. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  279. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
  280. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  281. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  282. package/dist/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  283. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  284. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  285. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -1
  286. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  287. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  288. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  289. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -388
  290. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  291. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  292. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +62 -20
  293. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  294. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  295. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  296. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  297. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  298. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  299. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  300. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  301. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  302. package/dist/feature-libraries/sequence-field/types.d.ts +74 -37
  303. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  304. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  305. package/dist/feature-libraries/sequence-field/utils.d.ts +25 -20
  306. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  307. package/dist/feature-libraries/sequence-field/utils.js +320 -159
  308. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  309. package/dist/index.d.ts +9 -3
  310. package/dist/index.d.ts.map +1 -1
  311. package/dist/index.js +4 -2
  312. package/dist/index.js.map +1 -1
  313. package/dist/packageVersion.d.ts +1 -1
  314. package/dist/packageVersion.d.ts.map +1 -1
  315. package/dist/packageVersion.js +1 -1
  316. package/dist/packageVersion.js.map +1 -1
  317. package/dist/shared-tree/independentView.d.ts.map +1 -1
  318. package/dist/shared-tree/independentView.js +3 -3
  319. package/dist/shared-tree/independentView.js.map +1 -1
  320. package/dist/shared-tree/index.d.ts +1 -1
  321. package/dist/shared-tree/index.d.ts.map +1 -1
  322. package/dist/shared-tree/index.js.map +1 -1
  323. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  324. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  325. package/dist/shared-tree/schematizeTree.js +1 -2
  326. package/dist/shared-tree/schematizeTree.js.map +1 -1
  327. package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
  328. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  329. package/dist/shared-tree/schematizingTreeView.js +70 -28
  330. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  331. package/dist/shared-tree/sharedTree.d.ts +3 -9
  332. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  333. package/dist/shared-tree/sharedTree.js +8 -11
  334. package/dist/shared-tree/sharedTree.js.map +1 -1
  335. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  336. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  337. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -8
  338. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  339. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  340. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  341. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  342. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  343. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  344. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  345. package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
  346. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  347. package/dist/shared-tree/tree.js +1 -1
  348. package/dist/shared-tree/tree.js.map +1 -1
  349. package/dist/shared-tree/treeAlpha.d.ts +8 -1
  350. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  351. package/dist/shared-tree/treeAlpha.js +48 -8
  352. package/dist/shared-tree/treeAlpha.js.map +1 -1
  353. package/dist/shared-tree/treeCheckout.d.ts +46 -16
  354. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  355. package/dist/shared-tree/treeCheckout.js +131 -74
  356. package/dist/shared-tree/treeCheckout.js.map +1 -1
  357. package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
  358. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  359. package/dist/shared-tree/unhydratedTreeContext.js +56 -0
  360. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
  361. package/dist/shared-tree-core/branch.d.ts +2 -3
  362. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  363. package/dist/shared-tree-core/branch.js +3 -4
  364. package/dist/shared-tree-core/branch.js.map +1 -1
  365. package/dist/shared-tree-core/editManager.d.ts +2 -2
  366. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  367. package/dist/shared-tree-core/editManager.js +9 -9
  368. package/dist/shared-tree-core/editManager.js.map +1 -1
  369. package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
  370. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  371. package/dist/shared-tree-core/editManagerCodecs.js +2 -10
  372. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  373. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  374. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  375. package/dist/shared-tree-core/editManagerFormatCommons.js +0 -6
  376. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  377. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  378. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  379. package/dist/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  380. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  381. package/dist/shared-tree-core/index.d.ts +2 -2
  382. package/dist/shared-tree-core/index.d.ts.map +1 -1
  383. package/dist/shared-tree-core/index.js +1 -3
  384. package/dist/shared-tree-core/index.js.map +1 -1
  385. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  386. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  387. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  388. package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
  389. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  390. package/dist/shared-tree-core/messageCodecs.js +2 -10
  391. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  392. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  393. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  394. package/dist/shared-tree-core/messageFormat.js +0 -6
  395. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  396. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  397. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  398. package/dist/shared-tree-core/messageFormatV1ToV4.js +0 -1
  399. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  400. package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
  401. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  402. package/dist/shared-tree-core/sharedTreeCore.js +1 -1
  403. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  404. package/dist/shared-tree-core/transaction.d.ts +15 -27
  405. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  406. package/dist/shared-tree-core/transaction.js +7 -11
  407. package/dist/shared-tree-core/transaction.js.map +1 -1
  408. package/dist/simple-tree/api/configuration.d.ts +4 -0
  409. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  410. package/dist/simple-tree/api/configuration.js.map +1 -1
  411. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  412. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  413. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  414. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  415. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  416. package/dist/simple-tree/api/identifierIndex.js +1 -1
  417. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  418. package/dist/simple-tree/api/index.d.ts +6 -5
  419. package/dist/simple-tree/api/index.d.ts.map +1 -1
  420. package/dist/simple-tree/api/index.js +2 -2
  421. package/dist/simple-tree/api/index.js.map +1 -1
  422. package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
  423. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  424. package/dist/simple-tree/api/schemaFactory.js +3 -2
  425. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  426. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  427. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  428. package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
  429. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  430. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  431. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  432. package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
  433. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  434. package/dist/simple-tree/api/schemaStatics.js +13 -7
  435. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  436. package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  437. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  438. package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
  439. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  440. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  441. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  442. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  443. package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
  444. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  445. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  446. package/dist/simple-tree/api/tree.d.ts +69 -132
  447. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  448. package/dist/simple-tree/api/tree.js.map +1 -1
  449. package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
  450. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  451. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  452. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  453. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  454. package/dist/simple-tree/core/unhydratedFlexTree.js +8 -59
  455. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  456. package/dist/simple-tree/fieldSchema.d.ts +7 -6
  457. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  458. package/dist/simple-tree/fieldSchema.js +3 -4
  459. package/dist/simple-tree/fieldSchema.js.map +1 -1
  460. package/dist/simple-tree/index.d.ts +4 -4
  461. package/dist/simple-tree/index.d.ts.map +1 -1
  462. package/dist/simple-tree/index.js +3 -3
  463. package/dist/simple-tree/index.js.map +1 -1
  464. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  465. package/dist/simple-tree/node-kinds/array/arrayNode.js +3 -5
  466. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  467. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  468. package/dist/simple-tree/node-kinds/common.js +1 -1
  469. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  470. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  471. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  472. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  473. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
  474. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  475. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  476. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  477. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  478. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  479. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  480. package/dist/simple-tree/node-kinds/object/objectNode.js +19 -19
  481. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  482. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  483. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  484. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  485. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  486. package/dist/simple-tree/node-kinds/record/recordNode.js +2 -4
  487. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  488. package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
  489. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  490. package/dist/simple-tree/prepareForInsertion.js +125 -183
  491. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  492. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  493. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  494. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +13 -27
  495. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  496. package/dist/text/textDomain.d.ts +27 -9
  497. package/dist/text/textDomain.d.ts.map +1 -1
  498. package/dist/text/textDomain.js +43 -7
  499. package/dist/text/textDomain.js.map +1 -1
  500. package/dist/text/textDomainFormatted.d.ts +16 -12
  501. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  502. package/dist/text/textDomainFormatted.js +97 -25
  503. package/dist/text/textDomainFormatted.js.map +1 -1
  504. package/dist/treeFactory.d.ts.map +1 -1
  505. package/dist/treeFactory.js +2 -12
  506. package/dist/treeFactory.js.map +1 -1
  507. package/dist/util/index.d.ts +1 -1
  508. package/dist/util/index.d.ts.map +1 -1
  509. package/dist/util/index.js +1 -2
  510. package/dist/util/index.js.map +1 -1
  511. package/dist/util/rangeMap.d.ts +10 -14
  512. package/dist/util/rangeMap.d.ts.map +1 -1
  513. package/dist/util/rangeMap.js +22 -62
  514. package/dist/util/rangeMap.js.map +1 -1
  515. package/dist/util/typeCheck.d.ts.map +1 -1
  516. package/dist/util/typeCheck.js.map +1 -1
  517. package/dist/util/typeUtils.d.ts.map +1 -1
  518. package/dist/util/typeUtils.js.map +1 -1
  519. package/docs/main/sequence-field/move-composition.md +46 -0
  520. package/eslint.config.mts +10 -2
  521. package/internal.d.ts +2 -2
  522. package/legacy.d.ts +4 -3
  523. package/lib/codec/codec.d.ts +2 -0
  524. package/lib/codec/codec.d.ts.map +1 -1
  525. package/lib/codec/codec.js +4 -3
  526. package/lib/codec/codec.js.map +1 -1
  527. package/lib/codec/index.d.ts +1 -1
  528. package/lib/codec/index.d.ts.map +1 -1
  529. package/lib/codec/index.js +1 -1
  530. package/lib/codec/index.js.map +1 -1
  531. package/lib/codec/versioned/codec.d.ts +13 -1
  532. package/lib/codec/versioned/codec.d.ts.map +1 -1
  533. package/lib/codec/versioned/codec.js +18 -3
  534. package/lib/codec/versioned/codec.js.map +1 -1
  535. package/lib/codec/versioned/format.d.ts +22 -1
  536. package/lib/codec/versioned/format.d.ts.map +1 -1
  537. package/lib/codec/versioned/format.js +15 -2
  538. package/lib/codec/versioned/format.js.map +1 -1
  539. package/lib/codec/versioned/index.d.ts +1 -1
  540. package/lib/codec/versioned/index.d.ts.map +1 -1
  541. package/lib/codec/versioned/index.js +1 -1
  542. package/lib/codec/versioned/index.js.map +1 -1
  543. package/lib/core/change-family/changeFamily.d.ts +1 -4
  544. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  545. package/lib/core/change-family/changeFamily.js.map +1 -1
  546. package/lib/core/change-family/index.d.ts +1 -1
  547. package/lib/core/change-family/index.d.ts.map +1 -1
  548. package/lib/core/change-family/index.js.map +1 -1
  549. package/lib/core/index.d.ts +3 -4
  550. package/lib/core/index.d.ts.map +1 -1
  551. package/lib/core/index.js +2 -3
  552. package/lib/core/index.js.map +1 -1
  553. package/lib/core/rebase/changeRebaser.d.ts +1 -6
  554. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  555. package/lib/core/rebase/changeRebaser.js.map +1 -1
  556. package/lib/core/rebase/index.d.ts +1 -1
  557. package/lib/core/rebase/index.d.ts.map +1 -1
  558. package/lib/core/rebase/index.js +1 -1
  559. package/lib/core/rebase/index.js.map +1 -1
  560. package/lib/core/rebase/types.d.ts +78 -1
  561. package/lib/core/rebase/types.d.ts.map +1 -1
  562. package/lib/core/rebase/types.js +0 -3
  563. package/lib/core/rebase/types.js.map +1 -1
  564. package/lib/core/rebase/utils.d.ts.map +1 -1
  565. package/lib/core/rebase/utils.js +7 -25
  566. package/lib/core/rebase/utils.js.map +1 -1
  567. package/lib/core/tree/delta.d.ts +0 -5
  568. package/lib/core/tree/delta.d.ts.map +1 -1
  569. package/lib/core/tree/delta.js.map +1 -1
  570. package/lib/core/tree/detachedFieldIndex.d.ts +1 -13
  571. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  572. package/lib/core/tree/detachedFieldIndex.js +2 -15
  573. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  574. package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -4
  575. package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
  576. package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
  577. package/lib/core/tree/index.d.ts +2 -2
  578. package/lib/core/tree/index.d.ts.map +1 -1
  579. package/lib/core/tree/index.js +1 -1
  580. package/lib/core/tree/index.js.map +1 -1
  581. package/lib/core/tree/pathTree.d.ts +3 -11
  582. package/lib/core/tree/pathTree.d.ts.map +1 -1
  583. package/lib/core/tree/pathTree.js +1 -12
  584. package/lib/core/tree/pathTree.js.map +1 -1
  585. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  586. package/lib/core/tree/visitDelta.js +13 -17
  587. package/lib/core/tree/visitDelta.js.map +1 -1
  588. package/lib/entrypoints/alpha.d.ts +6 -0
  589. package/lib/entrypoints/alpha.d.ts.map +1 -0
  590. package/lib/entrypoints/alpha.js +12 -0
  591. package/lib/entrypoints/alpha.js.map +1 -0
  592. package/lib/entrypoints/beta.d.ts +6 -0
  593. package/lib/entrypoints/beta.d.ts.map +1 -0
  594. package/lib/entrypoints/beta.js +12 -0
  595. package/lib/entrypoints/beta.js.map +1 -0
  596. package/{src/core/schema-view/index.ts → lib/entrypoints/internal.d.ts} +2 -6
  597. package/lib/entrypoints/internal.d.ts.map +1 -0
  598. package/lib/entrypoints/internal.js +12 -0
  599. package/lib/entrypoints/internal.js.map +1 -0
  600. package/lib/entrypoints/legacy.d.ts +6 -0
  601. package/lib/entrypoints/legacy.d.ts.map +1 -0
  602. package/lib/entrypoints/legacy.js +15 -0
  603. package/lib/entrypoints/legacy.js.map +1 -0
  604. package/lib/entrypoints/public.d.ts +6 -0
  605. package/lib/entrypoints/public.d.ts.map +1 -0
  606. package/lib/entrypoints/public.js +10 -0
  607. package/lib/entrypoints/public.js.map +1 -0
  608. package/lib/feature-libraries/changeAtomIdBTree.d.ts +2 -3
  609. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  610. package/lib/feature-libraries/changeAtomIdBTree.js +3 -15
  611. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  612. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  613. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  614. package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
  615. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  616. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  617. package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
  618. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  619. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  620. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  621. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  622. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  623. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  624. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  625. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  626. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  627. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -92
  628. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  629. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +69 -217
  630. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  631. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  632. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -12
  633. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  634. package/lib/feature-libraries/default-schema/index.d.ts +1 -2
  635. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  636. package/lib/feature-libraries/default-schema/index.js +1 -2
  637. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  638. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  639. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  640. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  641. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  642. package/lib/feature-libraries/deltaUtils.d.ts +0 -1
  643. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  644. package/lib/feature-libraries/deltaUtils.js +1 -5
  645. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  646. package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
  647. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  648. package/lib/feature-libraries/flex-tree/context.js +0 -6
  649. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  650. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  651. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  652. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  653. package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  654. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  655. package/lib/feature-libraries/flex-tree/lazyField.js +9 -40
  656. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  657. package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
  658. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  659. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  660. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
  661. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  662. package/lib/feature-libraries/forest-summary/codec.js +35 -32
  663. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  664. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  665. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  666. package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
  667. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  668. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  669. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  670. package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
  671. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  672. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  673. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  674. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
  675. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  676. package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
  677. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  678. package/lib/feature-libraries/forest-summary/index.js +1 -1
  679. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  680. package/lib/feature-libraries/index.d.ts +6 -6
  681. package/lib/feature-libraries/index.d.ts.map +1 -1
  682. package/lib/feature-libraries/index.js +5 -5
  683. package/lib/feature-libraries/index.js.map +1 -1
  684. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  685. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  686. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  687. package/lib/feature-libraries/indexing/index.d.ts +1 -1
  688. package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
  689. package/lib/feature-libraries/indexing/index.js.map +1 -1
  690. package/lib/feature-libraries/indexing/types.d.ts +15 -13
  691. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  692. package/lib/feature-libraries/indexing/types.js.map +1 -1
  693. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  694. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  695. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  696. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +24 -100
  697. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  698. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +10 -7
  699. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  700. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  701. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  702. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  703. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  704. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -85
  705. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  706. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  707. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  708. package/lib/feature-libraries/modular-schema/genericFieldKind.js +9 -4
  709. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  710. package/lib/feature-libraries/modular-schema/index.d.ts +3 -3
  711. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  712. package/lib/feature-libraries/modular-schema/index.js +1 -1
  713. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  714. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +22 -18
  715. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  716. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +144 -267
  717. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  718. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  719. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  720. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  721. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +0 -1
  722. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  723. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +0 -8
  724. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  725. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +22 -56
  726. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  727. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +474 -1389
  728. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  729. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  730. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  731. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +2 -1
  732. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
  733. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
  734. package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
  735. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -49
  736. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  737. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  738. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  739. package/lib/feature-libraries/optional-field/optionalField.d.ts +32 -13
  740. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  741. package/lib/feature-libraries/optional-field/optionalField.js +442 -254
  742. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  743. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +31 -31
  744. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  745. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  746. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  747. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  748. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
  749. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  750. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  751. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  752. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  753. package/lib/feature-libraries/optional-field/requiredField.d.ts +2 -3
  754. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
  755. package/lib/feature-libraries/optional-field/requiredField.js +1 -5
  756. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
  757. package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
  758. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  759. package/lib/feature-libraries/sequence-field/compose.js +261 -83
  760. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  761. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  762. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  763. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  764. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  765. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  766. package/lib/feature-libraries/sequence-field/invert.js +169 -67
  767. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  768. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  769. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  770. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  771. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  772. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  773. package/lib/feature-libraries/sequence-field/moveEffectTable.js +84 -6
  774. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  775. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  776. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  777. package/lib/feature-libraries/sequence-field/rebase.js +118 -111
  778. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  779. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  780. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  781. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
  782. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  783. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  784. package/lib/feature-libraries/sequence-field/replaceRevisions.js +32 -19
  785. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  786. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  787. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +3 -2
  788. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  789. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  790. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  791. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +182 -379
  792. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  793. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  794. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +63 -21
  795. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  796. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  797. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  798. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -13
  799. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  800. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  801. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  802. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +111 -16
  803. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  804. package/lib/feature-libraries/sequence-field/types.d.ts +74 -37
  805. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  806. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  807. package/lib/feature-libraries/sequence-field/utils.d.ts +25 -20
  808. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  809. package/lib/feature-libraries/sequence-field/utils.js +313 -155
  810. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  811. package/lib/index.d.ts +9 -3
  812. package/lib/index.d.ts.map +1 -1
  813. package/lib/index.js +9 -1
  814. package/lib/index.js.map +1 -1
  815. package/lib/packageVersion.d.ts +1 -1
  816. package/lib/packageVersion.d.ts.map +1 -1
  817. package/lib/packageVersion.js +1 -1
  818. package/lib/packageVersion.js.map +1 -1
  819. package/lib/shared-tree/independentView.d.ts.map +1 -1
  820. package/lib/shared-tree/independentView.js +4 -4
  821. package/lib/shared-tree/independentView.js.map +1 -1
  822. package/lib/shared-tree/index.d.ts +1 -1
  823. package/lib/shared-tree/index.d.ts.map +1 -1
  824. package/lib/shared-tree/index.js.map +1 -1
  825. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  826. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  827. package/lib/shared-tree/schematizeTree.js +2 -3
  828. package/lib/shared-tree/schematizeTree.js.map +1 -1
  829. package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
  830. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  831. package/lib/shared-tree/schematizingTreeView.js +71 -30
  832. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  833. package/lib/shared-tree/sharedTree.d.ts +3 -9
  834. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  835. package/lib/shared-tree/sharedTree.js +9 -12
  836. package/lib/shared-tree/sharedTree.js.map +1 -1
  837. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +0 -1
  838. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  839. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -8
  840. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  841. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
  842. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  843. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
  844. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  845. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  846. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  847. package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
  848. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  849. package/lib/shared-tree/tree.js +1 -1
  850. package/lib/shared-tree/tree.js.map +1 -1
  851. package/lib/shared-tree/treeAlpha.d.ts +8 -1
  852. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  853. package/lib/shared-tree/treeAlpha.js +49 -9
  854. package/lib/shared-tree/treeAlpha.js.map +1 -1
  855. package/lib/shared-tree/treeCheckout.d.ts +46 -16
  856. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  857. package/lib/shared-tree/treeCheckout.js +134 -77
  858. package/lib/shared-tree/treeCheckout.js.map +1 -1
  859. package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
  860. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  861. package/lib/shared-tree/unhydratedTreeContext.js +52 -0
  862. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
  863. package/lib/shared-tree-core/branch.d.ts +2 -3
  864. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  865. package/lib/shared-tree-core/branch.js +3 -4
  866. package/lib/shared-tree-core/branch.js.map +1 -1
  867. package/lib/shared-tree-core/editManager.d.ts +2 -2
  868. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  869. package/lib/shared-tree-core/editManager.js +9 -9
  870. package/lib/shared-tree-core/editManager.js.map +1 -1
  871. package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
  872. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  873. package/lib/shared-tree-core/editManagerCodecs.js +1 -8
  874. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  875. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  876. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  877. package/lib/shared-tree-core/editManagerFormatCommons.js +0 -6
  878. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  879. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  880. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  881. package/lib/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  882. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  883. package/lib/shared-tree-core/index.d.ts +2 -2
  884. package/lib/shared-tree-core/index.d.ts.map +1 -1
  885. package/lib/shared-tree-core/index.js +2 -2
  886. package/lib/shared-tree-core/index.js.map +1 -1
  887. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  888. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  889. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  890. package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
  891. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  892. package/lib/shared-tree-core/messageCodecs.js +1 -8
  893. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  894. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  895. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  896. package/lib/shared-tree-core/messageFormat.js +0 -6
  897. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  898. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  899. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  900. package/lib/shared-tree-core/messageFormatV1ToV4.js +0 -1
  901. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  902. package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
  903. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  904. package/lib/shared-tree-core/sharedTreeCore.js +1 -1
  905. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  906. package/lib/shared-tree-core/transaction.d.ts +15 -27
  907. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  908. package/lib/shared-tree-core/transaction.js +7 -11
  909. package/lib/shared-tree-core/transaction.js.map +1 -1
  910. package/lib/simple-tree/api/configuration.d.ts +4 -0
  911. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  912. package/lib/simple-tree/api/configuration.js.map +1 -1
  913. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  914. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  915. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  916. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  917. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  918. package/lib/simple-tree/api/identifierIndex.js +2 -2
  919. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  920. package/lib/simple-tree/api/index.d.ts +6 -5
  921. package/lib/simple-tree/api/index.d.ts.map +1 -1
  922. package/lib/simple-tree/api/index.js +2 -2
  923. package/lib/simple-tree/api/index.js.map +1 -1
  924. package/lib/simple-tree/api/schemaFactory.d.ts +3 -2
  925. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  926. package/lib/simple-tree/api/schemaFactory.js +3 -2
  927. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  928. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
  929. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  930. package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
  931. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  932. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  933. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  934. package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
  935. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  936. package/lib/simple-tree/api/schemaStatics.js +14 -8
  937. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  938. package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  939. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  940. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  941. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  942. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  943. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  944. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  945. package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
  946. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  947. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  948. package/lib/simple-tree/api/tree.d.ts +69 -132
  949. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  950. package/lib/simple-tree/api/tree.js.map +1 -1
  951. package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
  952. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  953. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  954. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +12 -16
  955. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  956. package/lib/simple-tree/core/unhydratedFlexTree.js +8 -58
  957. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  958. package/lib/simple-tree/fieldSchema.d.ts +7 -6
  959. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  960. package/lib/simple-tree/fieldSchema.js +3 -4
  961. package/lib/simple-tree/fieldSchema.js.map +1 -1
  962. package/lib/simple-tree/index.d.ts +4 -4
  963. package/lib/simple-tree/index.d.ts.map +1 -1
  964. package/lib/simple-tree/index.js +2 -2
  965. package/lib/simple-tree/index.js.map +1 -1
  966. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  967. package/lib/simple-tree/node-kinds/array/arrayNode.js +4 -6
  968. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  969. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  970. package/lib/simple-tree/node-kinds/common.js +2 -2
  971. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  972. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  973. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  974. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  975. package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
  976. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  977. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  978. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  979. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  980. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  981. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  982. package/lib/simple-tree/node-kinds/object/objectNode.js +20 -20
  983. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  984. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  985. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  986. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  987. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  988. package/lib/simple-tree/node-kinds/record/recordNode.js +2 -4
  989. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  990. package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
  991. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  992. package/lib/simple-tree/prepareForInsertion.js +125 -184
  993. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  994. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +3 -8
  995. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  996. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -23
  997. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  998. package/lib/text/textDomain.d.ts +27 -9
  999. package/lib/text/textDomain.d.ts.map +1 -1
  1000. package/lib/text/textDomain.js +45 -9
  1001. package/lib/text/textDomain.js.map +1 -1
  1002. package/lib/text/textDomainFormatted.d.ts +16 -12
  1003. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  1004. package/lib/text/textDomainFormatted.js +80 -8
  1005. package/lib/text/textDomainFormatted.js.map +1 -1
  1006. package/lib/treeFactory.d.ts.map +1 -1
  1007. package/lib/treeFactory.js +3 -13
  1008. package/lib/treeFactory.js.map +1 -1
  1009. package/lib/util/index.d.ts +1 -1
  1010. package/lib/util/index.d.ts.map +1 -1
  1011. package/lib/util/index.js +1 -1
  1012. package/lib/util/index.js.map +1 -1
  1013. package/lib/util/rangeMap.d.ts +10 -14
  1014. package/lib/util/rangeMap.d.ts.map +1 -1
  1015. package/lib/util/rangeMap.js +22 -61
  1016. package/lib/util/rangeMap.js.map +1 -1
  1017. package/lib/util/typeCheck.d.ts.map +1 -1
  1018. package/lib/util/typeCheck.js.map +1 -1
  1019. package/lib/util/typeUtils.d.ts.map +1 -1
  1020. package/lib/util/typeUtils.js.map +1 -1
  1021. package/package.json +49 -49
  1022. package/scripts/generate-entrypoint-sources.sh +29 -0
  1023. package/src/codec/codec.ts +5 -4
  1024. package/src/codec/index.ts +1 -0
  1025. package/src/codec/versioned/codec.ts +32 -6
  1026. package/src/codec/versioned/format.ts +17 -2
  1027. package/src/codec/versioned/index.ts +1 -1
  1028. package/src/core/change-family/changeFamily.ts +0 -5
  1029. package/src/core/change-family/index.ts +0 -1
  1030. package/src/core/index.ts +3 -10
  1031. package/src/core/rebase/changeRebaser.ts +1 -6
  1032. package/src/core/rebase/index.ts +2 -1
  1033. package/src/core/rebase/types.ts +80 -4
  1034. package/src/core/rebase/utils.ts +7 -31
  1035. package/src/core/tree/delta.ts +0 -6
  1036. package/src/core/tree/detachedFieldIndex.ts +1 -29
  1037. package/src/core/tree/detachedFieldIndexTypes.ts +0 -5
  1038. package/src/core/tree/index.ts +12 -13
  1039. package/src/core/tree/pathTree.ts +4 -16
  1040. package/src/core/tree/visitDelta.ts +11 -31
  1041. package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +22 -11
  1042. package/{lib/beta.d.ts → src/entrypoints/beta.ts} +6 -6
  1043. package/src/entrypoints/internal.ts +13 -0
  1044. package/{lib/legacy.d.ts → src/entrypoints/legacy.ts} +6 -6
  1045. package/{lib/public.d.ts → src/entrypoints/public.ts} +2 -5
  1046. package/src/feature-libraries/changeAtomIdBTree.ts +3 -28
  1047. package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
  1048. package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
  1049. package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
  1050. package/src/feature-libraries/chunked-forest/index.ts +2 -3
  1051. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +127 -369
  1052. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +4 -13
  1053. package/src/feature-libraries/default-schema/index.ts +5 -16
  1054. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +9 -35
  1055. package/src/feature-libraries/deltaUtils.ts +1 -6
  1056. package/src/feature-libraries/flex-tree/context.ts +0 -17
  1057. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
  1058. package/src/feature-libraries/flex-tree/lazyField.ts +24 -65
  1059. package/src/feature-libraries/flex-tree/observer.ts +17 -0
  1060. package/src/feature-libraries/forest-summary/codec.ts +46 -56
  1061. package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
  1062. package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
  1063. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
  1064. package/src/feature-libraries/forest-summary/index.ts +1 -1
  1065. package/src/feature-libraries/index.ts +11 -26
  1066. package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
  1067. package/src/feature-libraries/indexing/index.ts +1 -1
  1068. package/src/feature-libraries/indexing/types.ts +15 -17
  1069. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -3
  1070. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +47 -149
  1071. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
  1072. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -113
  1073. package/src/feature-libraries/modular-schema/genericFieldKind.ts +18 -7
  1074. package/src/feature-libraries/modular-schema/index.ts +16 -16
  1075. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +329 -604
  1076. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +0 -1
  1077. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +0 -14
  1078. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +754 -2695
  1079. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +0 -1
  1080. package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +1 -1
  1081. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +10 -62
  1082. package/src/feature-libraries/optional-field/optionalField.ts +568 -359
  1083. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +35 -31
  1084. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
  1085. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  1086. package/src/feature-libraries/optional-field/requiredField.ts +2 -15
  1087. package/src/feature-libraries/sequence-field/compose.ts +522 -137
  1088. package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
  1089. package/src/feature-libraries/sequence-field/invert.ts +228 -102
  1090. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1091. package/src/feature-libraries/sequence-field/moveEffectTable.ts +195 -8
  1092. package/src/feature-libraries/sequence-field/rebase.ts +207 -171
  1093. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
  1094. package/src/feature-libraries/sequence-field/replaceRevisions.ts +52 -26
  1095. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -8
  1096. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +229 -677
  1097. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
  1098. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +30 -28
  1099. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +131 -21
  1100. package/src/feature-libraries/sequence-field/types.ts +79 -40
  1101. package/src/feature-libraries/sequence-field/utils.ts +370 -211
  1102. package/src/index.ts +25 -3
  1103. package/src/packageVersion.ts +1 -1
  1104. package/src/shared-tree/independentView.ts +9 -15
  1105. package/src/shared-tree/index.ts +2 -3
  1106. package/src/shared-tree/schematizeTree.ts +8 -21
  1107. package/src/shared-tree/schematizingTreeView.ts +111 -48
  1108. package/src/shared-tree/sharedTree.ts +23 -40
  1109. package/src/shared-tree/sharedTreeChangeCodecs.ts +0 -8
  1110. package/src/shared-tree/sharedTreeChangeFamily.ts +4 -7
  1111. package/src/shared-tree/sharedTreeEditBuilder.ts +8 -43
  1112. package/src/shared-tree/tree.ts +1 -1
  1113. package/src/shared-tree/treeAlpha.ts +64 -11
  1114. package/src/shared-tree/treeCheckout.ts +161 -115
  1115. package/src/shared-tree/unhydratedTreeContext.ts +87 -0
  1116. package/src/shared-tree-core/branch.ts +2 -8
  1117. package/src/shared-tree-core/editManager.ts +2 -16
  1118. package/src/shared-tree-core/editManagerCodecs.ts +1 -11
  1119. package/src/shared-tree-core/editManagerFormatCommons.ts +0 -6
  1120. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -3
  1121. package/src/shared-tree-core/index.ts +0 -2
  1122. package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -2
  1123. package/src/shared-tree-core/messageCodecs.ts +1 -11
  1124. package/src/shared-tree-core/messageFormat.ts +0 -6
  1125. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -3
  1126. package/src/shared-tree-core/sharedTreeCore.ts +1 -4
  1127. package/src/shared-tree-core/transaction.ts +19 -39
  1128. package/src/simple-tree/api/configuration.ts +4 -0
  1129. package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
  1130. package/src/simple-tree/api/identifierIndex.ts +4 -4
  1131. package/src/simple-tree/api/index.ts +15 -2
  1132. package/src/simple-tree/api/schemaFactory.ts +11 -3
  1133. package/src/simple-tree/api/schemaFactoryAlpha.ts +262 -25
  1134. package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
  1135. package/src/simple-tree/api/schemaStatics.ts +79 -21
  1136. package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
  1137. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
  1138. package/src/simple-tree/api/transactionTypes.ts +24 -26
  1139. package/src/simple-tree/api/tree.ts +92 -131
  1140. package/src/simple-tree/api/typesUnsafe.ts +49 -1
  1141. package/src/simple-tree/core/unhydratedFlexTree.ts +35 -82
  1142. package/src/simple-tree/fieldSchema.ts +33 -11
  1143. package/src/simple-tree/index.ts +15 -4
  1144. package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -7
  1145. package/src/simple-tree/node-kinds/common.ts +5 -2
  1146. package/src/simple-tree/node-kinds/index.ts +3 -0
  1147. package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
  1148. package/src/simple-tree/node-kinds/object/index.ts +3 -0
  1149. package/src/simple-tree/node-kinds/object/objectNode.ts +95 -37
  1150. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
  1151. package/src/simple-tree/node-kinds/record/recordNode.ts +9 -10
  1152. package/src/simple-tree/prepareForInsertion.ts +200 -342
  1153. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +15 -35
  1154. package/src/text/textDomain.ts +91 -12
  1155. package/src/text/textDomainFormatted.ts +127 -15
  1156. package/src/treeFactory.ts +4 -16
  1157. package/src/util/index.ts +0 -3
  1158. package/src/util/rangeMap.ts +34 -78
  1159. package/src/util/typeCheck.ts +1 -0
  1160. package/src/util/typeUtils.ts +4 -7
  1161. package/dist/beta.d.ts +0 -149
  1162. package/dist/core/schema-view/index.d.ts +0 -6
  1163. package/dist/core/schema-view/index.d.ts.map +0 -1
  1164. package/dist/core/schema-view/index.js +0 -10
  1165. package/dist/core/schema-view/index.js.map +0 -1
  1166. package/dist/core/schema-view/view.d.ts +0 -31
  1167. package/dist/core/schema-view/view.d.ts.map +0 -1
  1168. package/dist/core/schema-view/view.js +0 -18
  1169. package/dist/core/schema-view/view.js.map +0 -1
  1170. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1171. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1172. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -153
  1173. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1174. package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1175. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1176. package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
  1177. package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1178. package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1179. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1180. package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
  1181. package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1182. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1183. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1184. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -296
  1185. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1186. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1187. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1188. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -35
  1189. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1190. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1191. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1192. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
  1193. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1194. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1195. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1196. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
  1197. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1198. package/dist/legacy.d.ts +0 -156
  1199. package/dist/public.d.ts +0 -94
  1200. package/lib/alpha.d.ts +0 -300
  1201. package/lib/core/schema-view/index.d.ts +0 -6
  1202. package/lib/core/schema-view/index.d.ts.map +0 -1
  1203. package/lib/core/schema-view/index.js.map +0 -1
  1204. package/lib/core/schema-view/view.d.ts +0 -31
  1205. package/lib/core/schema-view/view.d.ts.map +0 -1
  1206. package/lib/core/schema-view/view.js +0 -14
  1207. package/lib/core/schema-view/view.js.map +0 -1
  1208. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -40
  1209. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1210. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -149
  1211. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1212. package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  1213. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  1214. package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
  1215. package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
  1216. package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  1217. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  1218. package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
  1219. package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
  1220. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1221. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1222. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -292
  1223. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1224. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -74
  1225. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1226. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -32
  1227. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1228. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1229. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1230. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
  1231. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1232. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1233. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1234. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
  1235. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1236. package/src/core/schema-view/README.md +0 -9
  1237. package/src/core/schema-view/view.ts +0 -38
  1238. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -231
  1239. package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
  1240. package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
  1241. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +0 -649
  1242. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +0 -67
  1243. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
  1244. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"typesUnsafe.js","sourceRoot":"","sources":["../../../src/simple-tree/api/typesUnsafe.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIsUnion,\n\tRestrictiveStringRecord,\n\tUnionToIntersection,\n} from \"../../util/index.js\";\nimport type {\n\tNodeKind,\n\tWithType,\n\tTreeNode,\n\tUnhydrated,\n\tInternalTreeNode,\n\tTreeNodeSchema,\n\tTreeNodeSchemaCore,\n\tTreeNodeSchemaClass,\n\tImplicitAllowedTypes,\n\tTreeLeafValue,\n\tFlexListToUnion,\n\tLazyItem,\n\tAnnotatedAllowedType,\n\tAnnotatedAllowedTypes,\n} from \"../core/index.js\";\nimport type {\n\tApplyKind,\n\tApplyKindInput,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n} from \"../fieldSchema.js\";\nimport type { TreeArrayNode } from \"../node-kinds/index.js\";\nimport type {\n\tSchemaType,\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n} from \"../simpleSchema.js\";\n\n/*\n * TODO:\n * Below are a bunch of \"unsafe\" versions of types from \"schemaTypes.ts\".\n * These types duplicate the ones in \"schemaTypes.ts\", except with some of the extends clauses unenforced.\n * This is not great for type safety or maintainability.\n * Eventually it would be great to do at least one of the following:\n * 1. Find a way to avoid needing these entirely, possibly by improving TSC's recursive type support.\n * 2. Deduplicate the safe and unsafe types (possibly by having the safe one call the unsafe ones, or some other trick).\n * 3. Add type tests that check that the two copies of these types produce identical results.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.\n *\n * These extends constraints only serve as documentation:\n * to avoid breaking compilation, this type has to not actually enforce anything, and thus is just `unknown`.\n * Therefore the type safety is the responsibility of the user of the API.\n * @public\n */\nexport type Unenforced<_DesiredExtendsConstraint> = unknown;\n\n/**\n * A collection of {@link Unenforced} types that are used in the implementation of recursive schema.\n * These are all `@system` types, and thus should not be used directly.\n * @privateRemarks\n * Due to limitations of API-Extractor, all types in this namespace are treated as `@public`:\n * therefore, non-public types should not be included in this namespace.\n * @system @public\n */\nexport namespace System_Unsafe {\n\t/**\n\t * {@link Unenforced} version of `ObjectFromSchemaRecord`.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This does not bother special casing `{}` since no one should make empty objects using the *Recursive APIs.\n\t * @system @public\n\t */\n\texport type ObjectFromSchemaRecordUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t> = {\n\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t? TreeFieldFromImplicitFieldUnsafe<T[Property]>\n\t\t\t: unknown;\n\t};\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchema}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeNodeSchemaUnsafe<\n\t\tName extends string = string,\n\t\tKind extends NodeKind = NodeKind,\n\t\tTNode extends Unenforced<TreeNode | TreeLeafValue> = unknown,\n\t\tTBuild = never,\n\t\tImplicitlyConstructable extends boolean = boolean,\n\t\tInfo = unknown,\n\t> =\n\t\t| TreeNodeSchemaClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaNonClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchemaClass}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport interface TreeNodeSchemaClassUnsafe<\n\t\tout Name extends string,\n\t\tout Kind extends NodeKind,\n\t\tout TNode extends Unenforced<TreeNode>,\n\t\tin TInsertable,\n\t\tout ImplicitlyConstructable extends boolean,\n\t\tout Info,\n\t\tout TCustomMetadata = unknown,\n\t> extends TreeNodeSchemaCore<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> {\n\t\t/**\n\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t * @remarks\n\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t * @sealed\n\t\t */\n\t\tnew (data: TInsertable | InternalTreeNode): Unhydrated<TNode>;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchemaNonClass}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport interface TreeNodeSchemaNonClassUnsafe<\n\t\tout Name extends string,\n\t\tout Kind extends NodeKind,\n\t\tout TNode extends Unenforced<TreeNode | TreeLeafValue>,\n\t\tin TInsertable,\n\t\tout ImplicitlyConstructable extends boolean,\n\t\tout Info = unknown,\n\t> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info> {\n\t\tcreate(data: TInsertable): TNode;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeObjectNode}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeObjectNodeUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t\tTypeName extends string = string,\n\t> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object, T>;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeFieldFromImplicitField}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeFieldFromImplicitFieldUnsafe<TSchema extends ImplicitFieldSchemaUnsafe> =\n\t\tTSchema extends FieldSchemaUnsafe<infer Kind, infer Types>\n\t\t\t? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind>\n\t\t\t: TSchema extends ImplicitAllowedTypesUnsafe\n\t\t\t\t? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema>\n\t\t\t\t: unknown;\n\n\t/**\n\t * {@link Unenforced} version of {@link AllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type AllowedTypesUnsafe = readonly LazyItem<TreeNodeSchemaUnsafe>[];\n\n\t/**\n\t * {@link Unenforced} version of {@link ImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is similar to `Unenforced<ImplicitAllowedTypes>` in that it avoids constraining the schema\n\t * (which is necessary to avoid breaking recursive types),\n\t * but is superior from a safety perspective because it constrains the structure containing the schema.\n\t * @system @public\n\t */\n\texport type ImplicitAllowedTypesUnsafe =\n\t\t| TreeNodeSchemaUnsafe\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n\t\t| readonly LazyItem<Unenforced<TreeNodeSchema>>[];\n\n\t/**\n\t * {@link Unenforced} version of {@link ImplicitFieldSchema}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is similar to `Unenforced<ImplicitFieldSchema>` in that it avoids constraining the schema\n\t * (which is necessary to avoid breaking recursive types),\n\t * but is superior from a safety perspective because it constrains the structure containing the schema.\n\t * @system @public\n\t */\n\texport type ImplicitFieldSchemaUnsafe =\n\t\t| FieldSchemaUnsafe<FieldKind, ImplicitAllowedTypesUnsafe>\n\t\t| ImplicitAllowedTypesUnsafe;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeFromImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeNodeFromImplicitAllowedTypesUnsafe<\n\t\tTSchema extends ImplicitAllowedTypesUnsafe,\n\t> = TSchema extends TreeNodeSchemaUnsafe\n\t\t? NodeFromSchemaUnsafe<TSchema>\n\t\t: TSchema extends AllowedTypesUnsafe\n\t\t\t? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>>\n\t\t\t: unknown;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<\n\t\tTSchema extends ImplicitAllowedTypesUnsafe,\n\t> = [TSchema] extends [TreeNodeSchemaUnsafe]\n\t\t? InsertableTypedNodeUnsafe<TSchema>\n\t\t: [TSchema] extends [AllowedTypesUnsafe]\n\t\t\t? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema>\n\t\t\t: never;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromAllowedTypes}.\n\t * @see {@link Input}\n\t * @privateRemarks\n\t * TODO: AB#36348: it seems like the order of the union this produces is what is non-deterministic in incremental builds\n\t * of the JsonAsTree schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> =\n\t\tIsUnion<TList> extends true\n\t\t\t? never\n\t\t\t: {\n\t\t\t\t\treadonly [Property in keyof TList]: TList[Property] extends LazyItem<\n\t\t\t\t\t\tinfer TSchema extends TreeNodeSchemaUnsafe\n\t\t\t\t\t>\n\t\t\t\t\t\t? InsertableTypedNodeUnsafe<TSchema>\n\t\t\t\t\t\t: never;\n\t\t\t\t}[number];\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTypedNode}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * TODO:\n\t * This is less strict than InsertableTypedNode when given non-exact schema to avoid compilation issues.\n\t * This should probably be fixed or documented somehow.\n\t * @system @public\n\t */\n\texport type InsertableTypedNodeUnsafe<\n\t\tTSchema extends TreeNodeSchemaUnsafe,\n\t\tT = UnionToIntersection<TSchema>,\n\t> =\n\t\t| (T extends TreeNodeSchemaUnsafe<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t\t? NodeBuilderDataUnsafe<T>\n\t\t\t\t: never)\n\t\t| (T extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<T> : never);\n\n\t/**\n\t * {@link Unenforced} version of {@link NodeFromSchema}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type NodeFromSchemaUnsafe<T extends Unenforced<TreeNodeSchema>> =\n\t\tT extends TreeNodeSchemaUnsafe<string, NodeKind, infer TNode> ? TNode : never;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> =\n\t\tT extends TreeNodeSchemaUnsafe<string, NodeKind, unknown, infer TBuild> ? TBuild : never;\n\n\t/**\n\t * {@link Unenforced} version of {@link (TreeArrayNode:interface)}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface TreeArrayNodeUnsafe<TAllowedTypes extends ImplicitAllowedTypesUnsafe>\n\t\textends TreeArrayNode<\n\t\t\tTAllowedTypes,\n\t\t\tTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>,\n\t\t\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>\n\t\t> {}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeMapNode}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface TreeMapNodeUnsafe<T extends ImplicitAllowedTypesUnsafe>\n\t\textends ReadonlyMapInlined<string, T>,\n\t\t\tTreeNode {\n\t\t/**\n\t\t * {@inheritdoc TreeMapNode.set}\n\t\t */\n\t\tset(\n\t\t\tkey: string,\n\t\t\tvalue: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined,\n\t\t): void;\n\n\t\t/**\n\t\t * {@inheritdoc TreeMapNode.delete}\n\t\t */\n\t\tdelete(key: string): void;\n\t}\n\n\t/**\n\t * Copy of TypeScript's ReadonlyMap, but with `TreeNodeFromImplicitAllowedTypesUnsafe<T>` inlined into it.\n\t * Using this instead of ReadonlyMap in TreeMapNodeUnsafe is necessary to make recursive map schema not generate compile errors in the d.ts files when exported.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is the same as `ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>` (Checked in test),\n\t * except that it avoids the above mentioned compile error.\n\t * Authored by manually inlining ReadonlyMap from from the TypeScript lib which can be found by navigating to the definition of `ReadonlyMap`.\n\t * @system @sealed @public\n\t */\n\texport interface ReadonlyMapInlined<K, T extends ImplicitAllowedTypesUnsafe> {\n\t\t/** Returns an iterable of entries in the map. */\n\t\t[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;\n\n\t\t/**\n\t\t * Returns an iterable of key, value pairs for every entry in the map.\n\t\t */\n\t\tentries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;\n\n\t\t/**\n\t\t * Returns an iterable of keys in the map\n\t\t */\n\t\tkeys(): IterableIterator<K>;\n\n\t\t/**\n\t\t * Returns an iterable of values in the map\n\t\t */\n\t\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;\n\n\t\tforEach(\n\t\t\tcallbackfn: (\n\t\t\t\tvalue: TreeNodeFromImplicitAllowedTypesUnsafe<T>,\n\t\t\t\tkey: K,\n\t\t\t\tmap: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t) => void,\n\t\t\tthisArg?: any,\n\t\t): void;\n\t\tget(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;\n\t\thas(key: K): boolean;\n\t\treadonly size: number;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of `FieldHasDefault`.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport type FieldHasDefaultUnsafe<T extends ImplicitFieldSchemaUnsafe> =\n\t\tT extends FieldSchemaUnsafe<\n\t\t\tFieldKind.Optional | FieldKind.Identifier,\n\t\t\tImplicitAllowedTypesUnsafe\n\t\t>\n\t\t\t? true\n\t\t\t: false;\n\n\t/**\n\t * {@link Unenforced} version of `InsertableObjectFromSchemaRecord`.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableObjectFromSchemaRecordUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t> = {\n\t\t// Field might not have a default, so make it required:\n\t\treadonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends false\n\t\t\t? Property\n\t\t\t: never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n\t} & {\n\t\t// Field might have a default, so allow optional.\n\t\t// Note that if the field could be either, this returns boolean, causing both fields to exist, resulting in required.\n\t\treadonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends true\n\t\t\t? Property\n\t\t\t: never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n\t};\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeFieldFromImplicitField}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeFieldFromImplicitFieldUnsafe<\n\t\tTSchemaInput extends ImplicitFieldSchemaUnsafe,\n\t\tTSchema = UnionToIntersection<TSchemaInput>,\n\t> = [TSchema] extends [FieldSchemaUnsafe<infer Kind, infer Types>]\n\t\t? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true>\n\t\t: [TSchema] extends [ImplicitAllowedTypes]\n\t\t\t? InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>\n\t\t\t: never;\n\n\t/**\n\t * {@link Unenforced} version of {@link FieldSchema}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface FieldSchemaUnsafe<\n\t\tout Kind extends FieldKind,\n\t\tout Types extends ImplicitAllowedTypesUnsafe,\n\t\tout TCustomMetadata = unknown,\n\t> extends FieldSchema<Kind, any, TCustomMetadata> {\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.kind}\n\t\t */\n\t\treadonly kind: Kind;\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.allowedTypes}\n\t\t */\n\t\treadonly allowedTypes: Types;\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.allowedTypeSet}\n\t\t */\n\t\treadonly allowedTypeSet: ReadonlySet<TreeNodeSchema>;\n\t}\n}\n\n/**\n * {@link Unenforced} version of {@link FieldSchemaAlpha}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @alpha\n */\nexport interface FieldSchemaAlphaUnsafe<\n\tout Kind extends FieldKind,\n\tout Types extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata = unknown,\n> extends FieldSchemaAlpha<Kind, any, TCustomMetadata>,\n\t\tSystem_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {\n\t/**\n\t * {@inheritDoc FieldSchema.allowedTypes}\n\t */\n\treadonly allowedTypes: Types;\n}\n\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n/**\n * {@link Unenforced} version of {@link ArrayNodeCustomizableSchema}s.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @alpha\n * @system\n */\nexport interface ArrayNodeCustomizableSchemaUnsafe<\n\tout TName extends string,\n\tin out T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Array,\n\t\t\tSystem_Unsafe.TreeArrayNodeUnsafe<T> & WithType<TName, NodeKind.Array, T>,\n\t\t\t{\n\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\tSystem_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>\n\t\t\t\t>;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleArrayNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * {@link Unenforced} version of {@link MapNodeCustomizableSchema}s.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @alpha\n * @system\n */\nexport interface MapNodeCustomizableSchemaUnsafe<\n\tout TName extends string,\n\tin out T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tSystem_Unsafe.TreeMapNodeUnsafe<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\t| {\n\t\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\t\t[string, System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>]\n\t\t\t\t\t>;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t },\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * {@link Unenforced} version of {@link TreeRecordNode}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface TreeRecordNodeUnsafe<\n\tTAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n> extends Record<string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>>,\n\t\tTreeNode {\n\t[Symbol.iterator](): IterableIterator<\n\t\t[string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>]\n\t>;\n}\n\n/**\n * {@link Unenforced} utility to remove {@link AnnotatedAllowedTypeUnsafe} wrappers.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @beta\n * @system\n */\nexport type UnannotateAllowedTypeUnsafe<\n\tT extends Unenforced<\n\t\tAnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>\n\t>,\n> = T extends AnnotatedAllowedTypeUnsafe<infer X> ? X : T;\n\n/**\n * {@link Unenforced} version of {@link AnnotatedAllowedType}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface AnnotatedAllowedTypeUnsafe<T = Unenforced<LazyItem<TreeNodeSchema>>>\n\textends AnnotatedAllowedType<T> {}\n\n/**\n * {@link Unenforced} version of {@link AnnotatedAllowedTypes}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface AnnotatedAllowedTypesUnsafe\n\textends AnnotatedAllowedTypes<LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>> {}\n\n/**\n * {@link Unenforced} version of {@link AllowedTypesFull}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @alpha\n */\nexport type AllowedTypesFullUnsafe<\n\tT extends readonly AnnotatedAllowedTypeUnsafe[] = readonly AnnotatedAllowedTypeUnsafe[],\n> = AnnotatedAllowedTypes<T> & UnannotateAllowedTypesListUnsafe<T>;\n\n/**\n * {@link Unenforced} version of {@link AllowedTypesFullFromMixed}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type AllowedTypesFullFromMixedUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = UnannotateAllowedTypesListUnsafe<T> &\n\tAnnotatedAllowedTypes<AnnotateAllowedTypesListUnsafe<T>>;\n\n/**\n * {@link Unenforced} version of {@link UnannotateAllowedTypesList}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type UnannotateAllowedTypesListUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = {\n\treadonly [I in keyof T]: T[I] extends { type: infer X } ? X : T[I];\n};\n\n/**\n * {@link Unenforced} version of {@link AnnotateAllowedTypesList}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type AnnotateAllowedTypesListUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = {\n\t[I in keyof T]: T[I] extends AnnotatedAllowedTypeUnsafe\n\t\t? T[I]\n\t\t: AnnotatedAllowedTypeUnsafe<T[I]>;\n};\n"]}
1
+ {"version":3,"file":"typesUnsafe.js","sourceRoot":"","sources":["../../../src/simple-tree/api/typesUnsafe.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIsUnion,\n\tRestrictiveStringRecord,\n\tUnionToIntersection,\n} from \"../../util/index.js\";\nimport type {\n\tNodeKind,\n\tWithType,\n\tTreeNode,\n\tUnhydrated,\n\tInternalTreeNode,\n\tTreeNodeSchema,\n\tTreeNodeSchemaCore,\n\tTreeNodeSchemaClass,\n\tImplicitAllowedTypes,\n\tTreeLeafValue,\n\tFlexListToUnion,\n\tLazyItem,\n\tAnnotatedAllowedType,\n\tAnnotatedAllowedTypes,\n} from \"../core/index.js\";\nimport type {\n\tApplyKind,\n\tApplyKindInput,\n\tDefaultProvider,\n\tFieldKind,\n\tFieldSchema,\n\tFieldSchemaAlpha,\n\tFieldPropsAlpha,\n} from \"../fieldSchema.js\";\nimport type { TreeArrayNode } from \"../node-kinds/index.js\";\nimport type {\n\tSchemaType,\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n} from \"../simpleSchema.js\";\n\n/*\n * TODO:\n * Below are a bunch of \"unsafe\" versions of types from \"schemaTypes.ts\".\n * These types duplicate the ones in \"schemaTypes.ts\", except with some of the extends clauses unenforced.\n * This is not great for type safety or maintainability.\n * Eventually it would be great to do at least one of the following:\n * 1. Find a way to avoid needing these entirely, possibly by improving TSC's recursive type support.\n * 2. Deduplicate the safe and unsafe types (possibly by having the safe one call the unsafe ones, or some other trick).\n * 3. Add type tests that check that the two copies of these types produce identical results.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.\n *\n * These extends constraints only serve as documentation:\n * to avoid breaking compilation, this type has to not actually enforce anything, and thus is just `unknown`.\n * Therefore the type safety is the responsibility of the user of the API.\n * @public\n */\nexport type Unenforced<_DesiredExtendsConstraint> = unknown;\n\n/**\n * A collection of {@link Unenforced} types that are used in the implementation of recursive schema.\n * These are all `@system` types, and thus should not be used directly.\n * @privateRemarks\n * Due to limitations of API-Extractor, all types in this namespace are treated as `@public`:\n * therefore, non-public types should not be included in this namespace.\n * @system @public\n */\nexport namespace System_Unsafe {\n\t/**\n\t * {@link Unenforced} version of `ObjectFromSchemaRecord`.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This does not bother special casing `{}` since no one should make empty objects using the *Recursive APIs.\n\t * @system @public\n\t */\n\texport type ObjectFromSchemaRecordUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t> = {\n\t\t-readonly [Property in keyof T]: Property extends string\n\t\t\t? TreeFieldFromImplicitFieldUnsafe<T[Property]>\n\t\t\t: unknown;\n\t};\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchema}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeNodeSchemaUnsafe<\n\t\tName extends string = string,\n\t\tKind extends NodeKind = NodeKind,\n\t\tTNode extends Unenforced<TreeNode | TreeLeafValue> = unknown,\n\t\tTBuild = never,\n\t\tImplicitlyConstructable extends boolean = boolean,\n\t\tInfo = unknown,\n\t> =\n\t\t| TreeNodeSchemaClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaNonClassUnsafe<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchemaClass}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport interface TreeNodeSchemaClassUnsafe<\n\t\tout Name extends string,\n\t\tout Kind extends NodeKind,\n\t\tout TNode extends Unenforced<TreeNode>,\n\t\tin TInsertable,\n\t\tout ImplicitlyConstructable extends boolean,\n\t\tout Info,\n\t\tout TCustomMetadata = unknown,\n\t> extends TreeNodeSchemaCore<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t\t> {\n\t\t/**\n\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t * @remarks\n\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t * @sealed\n\t\t */\n\t\tnew (data: TInsertable | InternalTreeNode): Unhydrated<TNode>;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeSchemaNonClass}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport interface TreeNodeSchemaNonClassUnsafe<\n\t\tout Name extends string,\n\t\tout Kind extends NodeKind,\n\t\tout TNode extends Unenforced<TreeNode | TreeLeafValue>,\n\t\tin TInsertable,\n\t\tout ImplicitlyConstructable extends boolean,\n\t\tout Info = unknown,\n\t> extends TreeNodeSchemaCore<Name, Kind, ImplicitlyConstructable, Info> {\n\t\tcreate(data: TInsertable): TNode;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeObjectNode}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeObjectNodeUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t\tTypeName extends string = string,\n\t> = TreeNode & ObjectFromSchemaRecordUnsafe<T> & WithType<TypeName, NodeKind.Object, T>;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeFieldFromImplicitField}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeFieldFromImplicitFieldUnsafe<TSchema extends ImplicitFieldSchemaUnsafe> =\n\t\tTSchema extends FieldSchemaUnsafe<infer Kind, infer Types>\n\t\t\t? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind>\n\t\t\t: TSchema extends ImplicitAllowedTypesUnsafe\n\t\t\t\t? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema>\n\t\t\t\t: unknown;\n\n\t/**\n\t * {@link Unenforced} version of {@link AllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type AllowedTypesUnsafe = readonly LazyItem<TreeNodeSchemaUnsafe>[];\n\n\t/**\n\t * {@link Unenforced} version of {@link ImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is similar to `Unenforced<ImplicitAllowedTypes>` in that it avoids constraining the schema\n\t * (which is necessary to avoid breaking recursive types),\n\t * but is superior from a safety perspective because it constrains the structure containing the schema.\n\t * @system @public\n\t */\n\texport type ImplicitAllowedTypesUnsafe =\n\t\t| TreeNodeSchemaUnsafe\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n\t\t| readonly LazyItem<Unenforced<TreeNodeSchema>>[];\n\n\t/**\n\t * {@link Unenforced} version of {@link ImplicitFieldSchema}.\n\t * @remarks\n\t * Do not use this type directly: it is only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is similar to `Unenforced<ImplicitFieldSchema>` in that it avoids constraining the schema\n\t * (which is necessary to avoid breaking recursive types),\n\t * but is superior from a safety perspective because it constrains the structure containing the schema.\n\t * @system @public\n\t */\n\texport type ImplicitFieldSchemaUnsafe =\n\t\t| FieldSchemaUnsafe<FieldKind, ImplicitAllowedTypesUnsafe>\n\t\t| ImplicitAllowedTypesUnsafe;\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeNodeFromImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type TreeNodeFromImplicitAllowedTypesUnsafe<\n\t\tTSchema extends ImplicitAllowedTypesUnsafe,\n\t> = TSchema extends TreeNodeSchemaUnsafe\n\t\t? NodeFromSchemaUnsafe<TSchema>\n\t\t: TSchema extends AllowedTypesUnsafe\n\t\t\t? NodeFromSchemaUnsafe<FlexListToUnion<TSchema>>\n\t\t\t: unknown;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<\n\t\tTSchema extends ImplicitAllowedTypesUnsafe,\n\t> = [TSchema] extends [TreeNodeSchemaUnsafe]\n\t\t? InsertableTypedNodeUnsafe<TSchema>\n\t\t: [TSchema] extends [AllowedTypesUnsafe]\n\t\t\t? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema>\n\t\t\t: never;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromAllowedTypes}.\n\t * @see {@link Input}\n\t * @privateRemarks\n\t * TODO: AB#36348: it seems like the order of the union this produces is what is non-deterministic in incremental builds\n\t * of the JsonAsTree schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> =\n\t\tIsUnion<TList> extends true\n\t\t\t? never\n\t\t\t: {\n\t\t\t\t\treadonly [Property in keyof TList]: TList[Property] extends LazyItem<\n\t\t\t\t\t\tinfer TSchema extends TreeNodeSchemaUnsafe\n\t\t\t\t\t>\n\t\t\t\t\t\t? InsertableTypedNodeUnsafe<TSchema>\n\t\t\t\t\t\t: never;\n\t\t\t\t}[number];\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTypedNode}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * TODO:\n\t * This is less strict than InsertableTypedNode when given non-exact schema to avoid compilation issues.\n\t * This should probably be fixed or documented somehow.\n\t * @system @public\n\t */\n\texport type InsertableTypedNodeUnsafe<\n\t\tTSchema extends TreeNodeSchemaUnsafe,\n\t\tT = UnionToIntersection<TSchema>,\n\t> =\n\t\t| (T extends TreeNodeSchemaUnsafe<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t\t? NodeBuilderDataUnsafe<T>\n\t\t\t\t: never)\n\t\t| (T extends TreeNodeSchemaUnsafe ? NodeFromSchemaUnsafe<T> : never);\n\n\t/**\n\t * {@link Unenforced} version of {@link NodeFromSchema}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type NodeFromSchemaUnsafe<T extends Unenforced<TreeNodeSchema>> =\n\t\tT extends TreeNodeSchemaUnsafe<string, NodeKind, infer TNode> ? TNode : never;\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeNodeFromImplicitAllowedTypes}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type NodeBuilderDataUnsafe<T extends Unenforced<TreeNodeSchema>> =\n\t\tT extends TreeNodeSchemaUnsafe<string, NodeKind, unknown, infer TBuild> ? TBuild : never;\n\n\t/**\n\t * {@link Unenforced} version of {@link (TreeArrayNode:interface)}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface TreeArrayNodeUnsafe<TAllowedTypes extends ImplicitAllowedTypesUnsafe>\n\t\textends TreeArrayNode<\n\t\t\tTAllowedTypes,\n\t\t\tTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>,\n\t\t\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>\n\t\t> {}\n\n\t/**\n\t * {@link Unenforced} version of {@link TreeMapNode}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface TreeMapNodeUnsafe<T extends ImplicitAllowedTypesUnsafe>\n\t\textends ReadonlyMapInlined<string, T>,\n\t\t\tTreeNode {\n\t\t/**\n\t\t * {@inheritdoc TreeMapNode.set}\n\t\t */\n\t\tset(\n\t\t\tkey: string,\n\t\t\tvalue: InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined,\n\t\t): void;\n\n\t\t/**\n\t\t * {@inheritdoc TreeMapNode.delete}\n\t\t */\n\t\tdelete(key: string): void;\n\t}\n\n\t/**\n\t * Copy of TypeScript's ReadonlyMap, but with `TreeNodeFromImplicitAllowedTypesUnsafe<T>` inlined into it.\n\t * Using this instead of ReadonlyMap in TreeMapNodeUnsafe is necessary to make recursive map schema not generate compile errors in the d.ts files when exported.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @privateRemarks\n\t * This is the same as `ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>` (Checked in test),\n\t * except that it avoids the above mentioned compile error.\n\t * Authored by manually inlining ReadonlyMap from from the TypeScript lib which can be found by navigating to the definition of `ReadonlyMap`.\n\t * @system @sealed @public\n\t */\n\texport interface ReadonlyMapInlined<K, T extends ImplicitAllowedTypesUnsafe> {\n\t\t/** Returns an iterable of entries in the map. */\n\t\t[Symbol.iterator](): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;\n\n\t\t/**\n\t\t * Returns an iterable of key, value pairs for every entry in the map.\n\t\t */\n\t\tentries(): IterableIterator<[K, TreeNodeFromImplicitAllowedTypesUnsafe<T>]>;\n\n\t\t/**\n\t\t * Returns an iterable of keys in the map\n\t\t */\n\t\tkeys(): IterableIterator<K>;\n\n\t\t/**\n\t\t * Returns an iterable of values in the map\n\t\t */\n\t\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypesUnsafe<T>>;\n\n\t\tforEach(\n\t\t\tcallbackfn: (\n\t\t\t\tvalue: TreeNodeFromImplicitAllowedTypesUnsafe<T>,\n\t\t\t\tkey: K,\n\t\t\t\tmap: ReadonlyMap<K, TreeNodeFromImplicitAllowedTypesUnsafe<T>>,\n\t\t\t) => void,\n\t\t\tthisArg?: any,\n\t\t): void;\n\t\tget(key: K): TreeNodeFromImplicitAllowedTypesUnsafe<T> | undefined;\n\t\thas(key: K): boolean;\n\t\treadonly size: number;\n\t}\n\n\t/**\n\t * {@link Unenforced} version of `FieldHasDefault`.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport type FieldHasDefaultUnsafe<T extends ImplicitFieldSchemaUnsafe> =\n\t\tT extends FieldSchemaUnsafe<\n\t\t\tFieldKind.Optional | FieldKind.Identifier,\n\t\t\tImplicitAllowedTypesUnsafe\n\t\t>\n\t\t\t? true\n\t\t\t: false;\n\n\t/**\n\t * {@link Unenforced} version of `InsertableObjectFromSchemaRecord`.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableObjectFromSchemaRecordUnsafe<\n\t\tT extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>,\n\t> = {\n\t\t// Field might not have a default, so make it required:\n\t\treadonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends false\n\t\t\t? Property\n\t\t\t: never]: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n\t} & {\n\t\t// Field might have a default, so allow optional.\n\t\t// Note that if the field could be either, this returns boolean, causing both fields to exist, resulting in required.\n\t\treadonly [Property in keyof T as FieldHasDefaultUnsafe<T[Property & string]> extends true\n\t\t\t? Property\n\t\t\t: never]?: InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n\t};\n\n\t/**\n\t * {@link Unenforced} version of {@link InsertableTreeFieldFromImplicitField}.\n\t * @see {@link Input}\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @public\n\t */\n\texport type InsertableTreeFieldFromImplicitFieldUnsafe<\n\t\tTSchemaInput extends ImplicitFieldSchemaUnsafe,\n\t\tTSchema = UnionToIntersection<TSchemaInput>,\n\t> = [TSchema] extends [FieldSchemaUnsafe<infer Kind, infer Types>]\n\t\t? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true>\n\t\t: [TSchema] extends [ImplicitAllowedTypes]\n\t\t\t? InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>\n\t\t\t: never;\n\n\t/**\n\t * {@link Unenforced} version of {@link FieldSchema}.\n\t * @remarks\n\t * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n\t * @system @sealed @public\n\t */\n\texport interface FieldSchemaUnsafe<\n\t\tout Kind extends FieldKind,\n\t\tout Types extends ImplicitAllowedTypesUnsafe,\n\t\tout TCustomMetadata = unknown,\n\t> extends FieldSchema<Kind, any, TCustomMetadata> {\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.kind}\n\t\t */\n\t\treadonly kind: Kind;\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.allowedTypes}\n\t\t */\n\t\treadonly allowedTypes: Types;\n\t\t/**\n\t\t * {@inheritDoc FieldSchema.allowedTypeSet}\n\t\t */\n\t\treadonly allowedTypeSet: ReadonlySet<TreeNodeSchema>;\n\t}\n}\n\n/**\n * {@link Unenforced} version of {@link FieldSchemaAlpha}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @alpha\n */\nexport interface FieldSchemaAlphaUnsafe<\n\tout Kind extends FieldKind,\n\tout Types extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata = unknown,\n\tout TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = undefined,\n> extends FieldSchemaAlpha<Kind, any, TCustomMetadata, TProps>,\n\t\tSystem_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {\n\t/**\n\t * {@inheritDoc FieldSchema.allowedTypes}\n\t */\n\treadonly allowedTypes: Types;\n}\n\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n/**\n * {@link Unenforced} version of {@link FieldHasDefaultAlpha}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @alpha\n */\nexport type FieldHasDefaultAlphaUnsafe<T extends System_Unsafe.ImplicitFieldSchemaUnsafe> =\n\tT extends FieldSchemaAlphaUnsafe<\n\t\tinfer Kind,\n\t\tSystem_Unsafe.ImplicitAllowedTypesUnsafe,\n\t\tunknown,\n\t\tinfer TProps\n\t>\n\t\t? Kind extends FieldKind.Optional | FieldKind.Identifier\n\t\t\t? true\n\t\t\t: TProps extends { defaultProvider: DefaultProvider }\n\t\t\t\t? true\n\t\t\t\t: false\n\t\t: System_Unsafe.FieldHasDefaultUnsafe<T>;\n\n/**\n * {@link Unenforced} version of {@link InsertableObjectFromSchemaRecordAlpha}.\n * @see {@link System_Unsafe.InsertableObjectFromSchemaRecordUnsafe}\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @alpha\n */\nexport type InsertableObjectFromSchemaRecordAlphaUnsafe<\n\tT extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>,\n> = {\n\t// Field does not have a known default, make it required:\n\treadonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<\n\t\tT[Property & string]\n\t> extends false\n\t\t? Property\n\t\t: never]: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n} & {\n\t// Field has a known default, make it optional:\n\treadonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<\n\t\tT[Property & string]\n\t> extends true\n\t\t? Property\n\t\t: never]?: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;\n};\n\n/**\n * {@link Unenforced} version of {@link ArrayNodeCustomizableSchema}s.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @alpha\n * @system\n */\nexport interface ArrayNodeCustomizableSchemaUnsafe<\n\tout TName extends string,\n\tin out T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Array,\n\t\t\tSystem_Unsafe.TreeArrayNodeUnsafe<T> & WithType<TName, NodeKind.Array, T>,\n\t\t\t{\n\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\tSystem_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>\n\t\t\t\t>;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleArrayNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * {@link Unenforced} version of {@link MapNodeCustomizableSchema}s.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @alpha\n * @system\n */\nexport interface MapNodeCustomizableSchemaUnsafe<\n\tout TName extends string,\n\tin out T extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n\tout TCustomMetadata,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tSystem_Unsafe.TreeMapNodeUnsafe<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\t| {\n\t\t\t\t\t[Symbol.iterator](): Iterator<\n\t\t\t\t\t\t[string, System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>]\n\t\t\t\t\t>;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\treadonly [P in string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;\n\t\t\t },\n\t\t\tfalse,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<SchemaType.View, TCustomMetadata> {}\n\n/**\n * {@link Unenforced} version of {@link TreeRecordNode}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface TreeRecordNodeUnsafe<\n\tTAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe,\n> extends Record<string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>>,\n\t\tTreeNode {\n\t[Symbol.iterator](): IterableIterator<\n\t\t[string, System_Unsafe.TreeNodeFromImplicitAllowedTypesUnsafe<TAllowedTypes>]\n\t>;\n}\n\n/**\n * {@link Unenforced} utility to remove {@link AnnotatedAllowedTypeUnsafe} wrappers.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @sealed\n * @beta\n * @system\n */\nexport type UnannotateAllowedTypeUnsafe<\n\tT extends Unenforced<\n\t\tAnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>\n\t>,\n> = T extends AnnotatedAllowedTypeUnsafe<infer X> ? X : T;\n\n/**\n * {@link Unenforced} version of {@link AnnotatedAllowedType}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface AnnotatedAllowedTypeUnsafe<T = Unenforced<LazyItem<TreeNodeSchema>>>\n\textends AnnotatedAllowedType<T> {}\n\n/**\n * {@link Unenforced} version of {@link AnnotatedAllowedTypes}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport interface AnnotatedAllowedTypesUnsafe\n\textends AnnotatedAllowedTypes<LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>> {}\n\n/**\n * {@link Unenforced} version of {@link AllowedTypesFull}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @alpha\n */\nexport type AllowedTypesFullUnsafe<\n\tT extends readonly AnnotatedAllowedTypeUnsafe[] = readonly AnnotatedAllowedTypeUnsafe[],\n> = AnnotatedAllowedTypes<T> & UnannotateAllowedTypesListUnsafe<T>;\n\n/**\n * {@link Unenforced} version of {@link AllowedTypesFullFromMixed}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type AllowedTypesFullFromMixedUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = UnannotateAllowedTypesListUnsafe<T> &\n\tAnnotatedAllowedTypes<AnnotateAllowedTypesListUnsafe<T>>;\n\n/**\n * {@link Unenforced} version of {@link UnannotateAllowedTypesList}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type UnannotateAllowedTypesListUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = {\n\treadonly [I in keyof T]: T[I] extends { type: infer X } ? X : T[I];\n};\n\n/**\n * {@link Unenforced} version of {@link AnnotateAllowedTypesList}.\n * @remarks\n * Do not use this type directly: it's only needed in the implementation of generic logic which define recursive schema, not when using recursive schema.\n * @system @sealed @beta\n */\nexport type AnnotateAllowedTypesListUnsafe<\n\tT extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],\n> = {\n\t[I in keyof T]: T[I] extends AnnotatedAllowedTypeUnsafe\n\t\t? T[I]\n\t\t: AnnotatedAllowedTypeUnsafe<T[I]>;\n};\n"]}
@@ -4,7 +4,7 @@
4
4
  */
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
- import { type FlexTreeContext, FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeUnknownUnboxed, flexTreeMarker, type FlexTreeHydratedContext, type FlexFieldKind, type RequiredFieldEditor, type FlexTreeHydratedContextMinimal, type FlexibleFieldContent, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, type HydratedFlexTreeNode, type FlexibleNodeContent, type OptionalFieldEditor, type MinimalFieldMap } from "../../feature-libraries/index.js";
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
8
  import type { ContextualFieldProvider } from "../fieldSchema.js";
9
9
  import type { Context } from "./context.js";
10
10
  import type { TreeNode } from "./treeNode.js";
@@ -14,7 +14,7 @@ type LocationInField = FlexTreeNode["parentField"];
14
14
  /**
15
15
  * The {@link Unhydrated} implementation of {@link FlexTreeNode}.
16
16
  */
17
- export declare class UnhydratedFlexTreeNode implements FlexTreeNode, MapTreeNodeViewGeneric<FlexTreeNode> {
17
+ export declare class UnhydratedFlexTreeNode implements FlexTreeNode, MapTreeNodeViewGeneric<UnhydratedFlexTreeNode> {
18
18
  #private;
19
19
  /**
20
20
  * The {@link NodeData} for this node.
@@ -122,12 +122,11 @@ export declare class UnhydratedContext implements FlexTreeContext {
122
122
  constructor(schemaPolicy: SchemaPolicy, schema: TreeStoredSchema);
123
123
  isDisposed(): boolean;
124
124
  isHydrated(): this is FlexTreeHydratedContext;
125
- runInTransaction(fn: () => void): void;
126
125
  }
127
126
  /**
128
127
  * The {@link Unhydrated} implementation of {@link FlexTreeField}.
129
128
  */
130
- export declare class UnhydratedFlexTreeField implements FlexTreeField, MapTreeFieldViewGeneric<FlexTreeNode> {
129
+ export declare class UnhydratedFlexTreeField implements FlexTreeField, MapTreeFieldViewGeneric<UnhydratedFlexTreeNode> {
131
130
  readonly context: FlexTreeContext;
132
131
  readonly schema: FieldKindIdentifier;
133
132
  readonly key: FieldKey;
@@ -149,7 +148,7 @@ export declare class UnhydratedFlexTreeField implements FlexTreeField, MapTreeFi
149
148
  * See {@link fillPendingDefaults}.
150
149
  * Note that any fields using a {@link ConstantFieldProvider} should be evaluated before constructing the UnhydratedFlexTreeField.
151
150
  */
152
- lazyChildren: FlexTreeNode[] | ContextualFieldProvider);
151
+ lazyChildren: UnhydratedFlexTreeNode[] | ContextualFieldProvider);
153
152
  borrowCursor(): ITreeCursorSynchronous;
154
153
  private getPendingDefault;
155
154
  /**
@@ -163,11 +162,11 @@ export declare class UnhydratedFlexTreeField implements FlexTreeField, MapTreeFi
163
162
  * Returns true if this field has a pending default due to defined defined using a {@link ContextualFieldProvider}.
164
163
  */
165
164
  get pendingDefault(): boolean;
166
- get children(): FlexTreeNode[];
165
+ get children(): UnhydratedFlexTreeNode[];
167
166
  get length(): number;
168
167
  is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2>;
169
168
  boxedAt(index: number): FlexTreeNode | undefined;
170
- [Symbol.iterator](): IterableIterator<FlexTreeNode>;
169
+ [Symbol.iterator](): IterableIterator<UnhydratedFlexTreeNode>;
171
170
  /**
172
171
  * Mutate this field.
173
172
  * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.
@@ -176,30 +175,27 @@ export declare class UnhydratedFlexTreeField implements FlexTreeField, MapTreeFi
176
175
  * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.
177
176
  * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.
178
177
  */
179
- protected edit(edit: (mapTrees: FlexTreeNode[]) => void | FlexTreeNode[]): void;
178
+ protected edit(edit: (mapTrees: UnhydratedFlexTreeNode[]) => void | UnhydratedFlexTreeNode[]): void;
180
179
  getFieldPath(): NormalizedFieldUpPath;
181
180
  /** Unboxes leaf nodes to their values */
182
- protected unboxed(index: number): TreeValue | FlexTreeNode;
181
+ protected unboxed(index: number): TreeValue | UnhydratedFlexTreeNode;
183
182
  }
184
183
  /**
185
184
  * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.
186
185
  */
187
186
  export declare class UnhydratedOptionalField extends UnhydratedFlexTreeField implements FlexTreeOptionalField {
188
- readonly editor: OptionalFieldEditor<FlexibleNodeContent, FlexTreeNode>;
187
+ readonly editor: {
188
+ set: (newContent: FlexibleNodeContent | undefined) => void;
189
+ };
189
190
  get content(): FlexTreeUnknownUnboxed | undefined;
190
191
  }
191
- export declare class UnhydratedRequiredField extends UnhydratedFlexTreeField implements FlexTreeRequiredField {
192
- readonly editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode>;
193
- get content(): FlexTreeUnknownUnboxed;
194
- }
195
192
  /**
196
193
  * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.
197
194
  */
198
195
  export declare class UnhydratedSequenceField extends UnhydratedFlexTreeField implements FlexTreeSequenceField {
199
196
  readonly editor: {
200
197
  insert: (index: number, newContent: FlexibleFieldContent) => void;
201
- remove: (index: number, count: number) => FlexTreeNode[];
202
- attach: (index: number, content: readonly FlexTreeNode[]) => void;
198
+ remove: (index: number, count: number) => UnhydratedFlexTreeNode[];
203
199
  move: (sourceIndex: number, count: number, destIndex: number, source?: UnhydratedSequenceField | undefined) => void;
204
200
  };
205
201
  at(index: number): FlexTreeUnknownUnboxed | undefined;
@@ -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,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,eAAe,EACpB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EAEd,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAIlB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAExB,KAAK,eAAe,EAEpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,uBAAuB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AgB,MAAM;qEACQ,IAAI;kDAgBT,sBAAsB,EAAE;uHAWA,IAAI;MA2BF;IAE5C,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS;IAOrD,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE;CAGnF;AAID,gDAAgD;AAChD,wBAAgB,WAAW,CAC1B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,GAC5D,uBAAuB,CAoBzB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAM7D"}
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  };
11
11
  var _UnhydratedFlexTreeNode_instances, _a, _UnhydratedFlexTreeNode_emitSubtreeChangedEvents, _b, _c;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.unsupportedUsageError = exports.createField = exports.UnhydratedSequenceField = exports.UnhydratedRequiredField = exports.UnhydratedOptionalField = exports.UnhydratedFlexTreeField = exports.UnhydratedContext = exports.UnhydratedFlexTreeNode = void 0;
13
+ exports.unsupportedUsageError = exports.createField = exports.UnhydratedSequenceField = exports.UnhydratedOptionalField = exports.UnhydratedFlexTreeField = exports.UnhydratedContext = exports.UnhydratedFlexTreeNode = void 0;
14
14
  const client_utils_1 = require("@fluid-internal/client-utils");
15
15
  const internal_1 = require("@fluidframework/core-utils/internal");
16
16
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
@@ -187,10 +187,6 @@ class UnhydratedContext {
187
187
  isHydrated() {
188
188
  return false;
189
189
  }
190
- runInTransaction(fn) {
191
- (0, internal_1.debugAssert)(() => !this.isDisposed() || "Disposed");
192
- fn();
193
- }
194
190
  }
195
191
  exports.UnhydratedContext = UnhydratedContext;
196
192
  // #region Fields
@@ -235,12 +231,7 @@ class UnhydratedFlexTreeField {
235
231
  // "Adopt" each child by updating its parent information to point to this field.
236
232
  if (Array.isArray(lazyChildren)) {
237
233
  for (const [i, child] of lazyChildren.entries()) {
238
- if (child instanceof UnhydratedFlexTreeNode) {
239
- child.adoptBy(this, i);
240
- }
241
- else {
242
- // TODO: hook up events from hydrated to unhydrated nodes.
243
- }
234
+ child.adoptBy(this, i);
244
235
  }
245
236
  }
246
237
  }
@@ -305,12 +296,12 @@ class UnhydratedFlexTreeField {
305
296
  edit(edit) {
306
297
  // Clear parents for all old map trees.
307
298
  for (const tree of this.children) {
308
- orphan(tree);
299
+ tree.adoptBy(undefined);
309
300
  }
310
301
  this.lazyChildren = edit(this.children) ?? this.children;
311
302
  // Set parents for all new map trees.
312
303
  for (const [index, tree] of this.children.entries()) {
313
- adoptNode(this, tree, index);
304
+ tree.adoptBy(this, index);
314
305
  }
315
306
  this.parent?.emitChangedEvent(this.key);
316
307
  }
@@ -328,22 +319,6 @@ class UnhydratedFlexTreeField {
328
319
  }
329
320
  }
330
321
  exports.UnhydratedFlexTreeField = UnhydratedFlexTreeField;
331
- function adoptNode(parent, node, index) {
332
- if (node instanceof UnhydratedFlexTreeNode) {
333
- node.adoptBy(parent, index);
334
- }
335
- else {
336
- // TODO: handle parenting for hydrated nodes.
337
- }
338
- }
339
- function orphan(node) {
340
- if (node instanceof UnhydratedFlexTreeNode) {
341
- node.adoptBy(undefined);
342
- }
343
- else {
344
- // TODO: handle unparenting for hydrated nodes.
345
- }
346
- }
347
322
  /**
348
323
  * The {@link Unhydrated} implementation of {@link FlexTreeOptionalField}.
349
324
  */
@@ -352,7 +327,6 @@ class UnhydratedOptionalField extends UnhydratedFlexTreeField {
352
327
  super(...arguments);
353
328
  this.editor = {
354
329
  set: (newContent) => {
355
- // If the new content is a UnhydratedFlexTreeNode, it needs to have its parent pointer updated
356
330
  if (newContent !== undefined) {
357
331
  (0, internal_1.assert)(newContent instanceof UnhydratedFlexTreeNode, 0xbb7 /* Expected unhydrated node */);
358
332
  }
@@ -365,12 +339,6 @@ class UnhydratedOptionalField extends UnhydratedFlexTreeField {
365
339
  }
366
340
  });
367
341
  },
368
- clear: () => {
369
- this.editor.set(undefined, true /* <- dummy wasEmpty argument */);
370
- },
371
- attach: (content) => {
372
- this.editor.set(content, true /* <- dummy wasEmpty argument */);
373
- },
374
342
  };
375
343
  }
376
344
  get content() {
@@ -382,29 +350,13 @@ class UnhydratedOptionalField extends UnhydratedFlexTreeField {
382
350
  }
383
351
  }
384
352
  exports.UnhydratedOptionalField = UnhydratedOptionalField;
385
- class UnhydratedRequiredField extends UnhydratedFlexTreeField {
386
- constructor() {
387
- super(...arguments);
388
- this.editor = {
389
- set: (newContent) => {
390
- (0, internal_1.assert)(newContent instanceof UnhydratedFlexTreeNode, 0xbb7 /* Expected unhydrated node */);
391
- this.edit((mapTrees) => {
392
- mapTrees[0] = newContent;
393
- });
394
- },
395
- attach: (content) => {
396
- this.editor.set(content);
397
- },
398
- };
399
- }
353
+ class UnhydratedRequiredField extends UnhydratedOptionalField {
400
354
  get content() {
401
- const value = this.children[0];
402
355
  // This cannot use ?? since null is a legal value here.
403
- (0, internal_1.assert)(value !== undefined, 0xa57 /* Expected EagerMapTree required field to have a value */);
404
- return this.unboxed(0);
356
+ (0, internal_1.assert)(super.content !== undefined, 0xa57 /* Expected EagerMapTree required field to have a value */);
357
+ return super.content;
405
358
  }
406
359
  }
407
- exports.UnhydratedRequiredField = UnhydratedRequiredField;
408
360
  /**
409
361
  * The {@link Unhydrated} implementation of {@link FlexTreeSequenceField}.
410
362
  */
@@ -415,7 +367,7 @@ class UnhydratedSequenceField extends UnhydratedFlexTreeField {
415
367
  insert: (index, newContent) => {
416
368
  for (const c of newContent) {
417
369
  (0, internal_1.assert)(c !== undefined, 0xa0a /* Unexpected sparse array content */);
418
- // TODO: ensure somewhere checks for not already having parents
370
+ (0, internal_1.assert)(c instanceof UnhydratedFlexTreeNode, 0xbb8 /* Expected unhydrated node */);
419
371
  }
420
372
  const newContentChecked = newContent;
421
373
  this.edit((mapTrees) => {
@@ -440,9 +392,6 @@ class UnhydratedSequenceField extends UnhydratedFlexTreeField {
440
392
  });
441
393
  return removed ?? (0, internal_1.fail)(0xb4a /* Expected removed to be set by edit */);
442
394
  },
443
- attach: (index, content) => {
444
- this.editor.insert(index, content);
445
- },
446
395
  move: (sourceIndex, count, destIndex, source) => {
447
396
  const sourceField = source ?? this;
448
397
  if (sourceField === this) {
@@ -1 +1 @@
1
- {"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+DAA6D;AAE7D,kEAAqF;AACrF,uEAAsE;AAEtE,kDAc6B;AAC7B,+DA4B0C;AAC1C,kDAAsF;AAgCtF;;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,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACtF,CAAC;IACH,CAAC;IAeD,IAAW,MAAM;QAEhB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;IACvC,CAAC;IAED;;OAEG;IACH;IACC;;OAEG;IACa,IAAc;IAC9B;;;;OAIG;IACc,SAAiD;IAClE;;;;;OAKG;IACa,aAAsB;;QAbtB,SAAI,GAAJ,IAAI,CAAU;QAMb,cAAS,GAAT,SAAS,CAAwC;QAOlD,kBAAa,GAAb,aAAa,CAAS;QAlD/B,aAAQ,GAAG,kBAAkB,CAAC;QAkBtB,QAAgB,GAAG,6BAAkB,CAAC,IAAa,CAAC;QAEnD,YAAO,GA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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, debugAssert } 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\tcursorForMapTreeNode,\n\ttype SequenceFieldEditor,\n\ttype RequiredFieldEditor,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype FlexibleFieldContent,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype HydratedFlexTreeNode,\n\ttype FlexibleNodeContent,\n\ttype OptionalFieldEditor,\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 SequenceFieldEditor<FlexibleFieldContent, readonly FlexTreeNode[]> {\n\t/**\n\t * Moves elements from a source position to a destination position.\n\t * Can move within the same field or from another unhydrated sequence field.\n\t * @param sourceIndex - The index of the first element to move.\n\t * @param count - The number of elements to move.\n\t * @param destIndex - The index at which to insert the moved elements.\n\t * @param source - The source field to move from (defaults to this field for within-field moves).\n\t */\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tsource?: UnhydratedSequenceField,\n\t): void;\n}\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<FlexTreeNode>\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<FlexTreeNode>>(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\tpublic runInTransaction(fn: () => void): void {\n\t\tdebugAssert(() => !this.isDisposed() || \"Disposed\");\n\t\tfn();\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<FlexTreeNode>\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: FlexTreeNode[] | 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\tif (child instanceof UnhydratedFlexTreeNode) {\n\t\t\t\t\tchild.adoptBy(this, i);\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: hook up events from hydrated to unhydrated nodes.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeField<MapTreeNodeViewGeneric<FlexTreeNode>>(this.children);\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(): FlexTreeNode[] {\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 FlexTreeNode[];\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<FlexTreeNode> {\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(edit: (mapTrees: FlexTreeNode[]) => void | FlexTreeNode[]): void {\n\t\t// Clear parents for all old map trees.\n\t\tfor (const tree of this.children) {\n\t\t\torphan(tree);\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\tadoptNode(this, tree, 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 | FlexTreeNode {\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\nfunction adoptNode(parent: UnhydratedFlexTreeField, node: FlexTreeNode, index: number): void {\n\tif (node instanceof UnhydratedFlexTreeNode) {\n\t\tnode.adoptBy(parent, index);\n\t} else {\n\t\t// TODO: handle parenting for hydrated nodes.\n\t}\n}\n\nfunction orphan(node: FlexTreeNode): void {\n\tif (node instanceof UnhydratedFlexTreeNode) {\n\t\tnode.adoptBy(undefined);\n\t} else {\n\t\t// TODO: handle unparenting for hydrated nodes.\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: OptionalFieldEditor<FlexibleNodeContent, FlexTreeNode> = {\n\t\tset: (newContent: FlexibleNodeContent | undefined): void => {\n\t\t\t// If the new content is a UnhydratedFlexTreeNode, it needs to have its parent pointer updated\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\tclear: (): void => {\n\t\t\tthis.editor.set(undefined, true /* <- dummy wasEmpty argument */);\n\t\t},\n\t\tattach: (content): void => {\n\t\t\tthis.editor.set(content, true /* <- dummy wasEmpty argument */);\n\t\t},\n\t};\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\nexport class UnhydratedRequiredField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeRequiredField\n{\n\tpublic readonly editor: RequiredFieldEditor<FlexibleNodeContent, FlexTreeNode> = {\n\t\tset: (newContent: FlexibleNodeContent): void => {\n\t\t\tassert(\n\t\t\t\tnewContent instanceof UnhydratedFlexTreeNode,\n\t\t\t\t0xbb7 /* Expected unhydrated node */,\n\t\t\t);\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tmapTrees[0] = newContent;\n\t\t\t});\n\t\t},\n\t\tattach: (content): void => {\n\t\t\tthis.editor.set(content);\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnknownUnboxed {\n\t\tconst value = this.children[0];\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tvalue !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn this.unboxed(0);\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\t// TODO: ensure somewhere checks for not already having parents\n\t\t\t}\n\t\t\tconst newContentChecked: readonly FlexTreeNode[] = newContent;\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): FlexTreeNode[] => {\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: FlexTreeNode[] | 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\tattach: (index, content: readonly FlexTreeNode[]): void => {\n\t\t\tthis.editor.insert(index, content);\n\t\t},\n\t\tmove: (sourceIndex, count, destIndex, source?): void => {\n\t\t\tconst sourceField = source ?? this;\n\t\t\tif (sourceField === this) {\n\t\t\t\t// Within-field move: do both operations in a single edit to emit only one event\n\t\t\t\tthis.edit((mapTrees) => {\n\t\t\t\t\tconst removed = mapTrees.splice(sourceIndex, count);\n\t\t\t\t\t// Adjust destination index if it comes after the source\n\t\t\t\t\tconst adjustedDest = destIndex > sourceIndex ? destIndex - count : destIndex;\n\t\t\t\t\tif (removed.length < 1000) {\n\t\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\t\tmapTrees.splice(adjustedDest, 0, ...removed);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// ...but we avoid using `splice` + spread for very large arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t...mapTrees.slice(0, adjustedDest),\n\t\t\t\t\t\t\t...removed,\n\t\t\t\t\t\t\t...mapTrees.slice(adjustedDest),\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Cross-field move: remove from source, insert into destination\n\t\t\t\t// Each field emits one event (correct behavior for different fields)\n\t\t\t\tconst removed = sourceField.editor.remove(sourceIndex, count);\n\t\t\t\tthis.editor.insert(destIndex, removed);\n\t\t\t}\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;AAgCtF;;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,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACtF,CAAC;IACH,CAAC;IAeD,IAAW,MAAM;QAEhB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;IACvC,CAAC;IAED;;OAEG;IACH;IACC;;OAEG;IACa,IAAc;IAC9B;;;;OAIG;IACc,SAAiD;IAClE;;;;;OAKG;IACa,aAAsB;;QAbtB,SAAI,GAAJ,IAAI,CAAU;QAMb,cAAS,GAAT,SAAS,CAAwC;QAOlD,kBAAa,GAAb,aAAa,CAAS;QAlD/B,aAAQ,GAAG,kBAAkB,CAAC;QAkBtB,QAAgB,GAAG,6BAAkB,CAAC,IAAa,CAAC;QAEnD,YAAO,GAAG,IAAA,4BAAa,GAAgC,CAAC;QAqCzE;;;;;;WAMG;QACa,WAAM,GAA6C;YAClE,GAAG,EAAE,CAAC,GAAa,EAAuC,EAAE,CAAC,IAAI,CAAC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ation 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\t/**\n\t * Moves elements from a source position to a destination position.\n\t * Can move within the same field or from another unhydrated sequence field.\n\t * @param sourceIndex - The index of the first element to move.\n\t * @param count - The number of elements to move.\n\t * @param destIndex - The index at which to insert the moved elements.\n\t * @param source - The source field to move from (defaults to this field for within-field moves).\n\t */\n\tmove(\n\t\tsourceIndex: number,\n\t\tcount: number,\n\t\tdestIndex: number,\n\t\tsource?: UnhydratedSequenceField,\n\t): void;\n}\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\tmove: (sourceIndex, count, destIndex, source?): void => {\n\t\t\tconst sourceField = source ?? this;\n\t\t\tif (sourceField === this) {\n\t\t\t\t// Within-field move: do both operations in a single edit to emit only one event\n\t\t\t\tthis.edit((mapTrees) => {\n\t\t\t\t\tconst removed = mapTrees.splice(sourceIndex, count);\n\t\t\t\t\t// Adjust destination index if it comes after the source\n\t\t\t\t\tconst adjustedDest = destIndex > sourceIndex ? destIndex - count : destIndex;\n\t\t\t\t\tif (removed.length < 1000) {\n\t\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\t\tmapTrees.splice(adjustedDest, 0, ...removed);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// ...but we avoid using `splice` + spread for very large arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t...mapTrees.slice(0, adjustedDest),\n\t\t\t\t\t\t\t...removed,\n\t\t\t\t\t\t\t...mapTrees.slice(adjustedDest),\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Cross-field move: remove from source, insert into destination\n\t\t\t\t// Each field emits one event (correct behavior for different fields)\n\t\t\t\tconst removed = sourceField.editor.remove(sourceIndex, count);\n\t\t\t\tthis.editor.insert(destIndex, removed);\n\t\t\t}\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"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { ErasedType } from "@fluidframework/core-interfaces";
6
6
  import type { FieldKey } from "../core/index.js";
7
- import type { FlexTreeHydratedContextMinimal, FlexTreeNode } from "../feature-libraries/index.js";
7
+ import type { FlexTreeHydratedContextMinimal } from "../feature-libraries/index.js";
8
8
  import { type MakeNominal, type UnionToIntersection, type JsonCompatibleReadOnlyObject } from "../util/index.js";
9
- import type { TreeNodeSchema, TreeNode, ImplicitAllowedTypes, TreeNodeFromImplicitAllowedTypes, TreeLeafValue, InsertableTreeNodeFromImplicitAllowedTypes, AllowedTypesFull } from "./core/index.js";
9
+ import type { TreeNodeSchema, TreeNode, UnhydratedFlexTreeNode, ImplicitAllowedTypes, TreeNodeFromImplicitAllowedTypes, TreeLeafValue, InsertableTreeNodeFromImplicitAllowedTypes, AllowedTypesFull } from "./core/index.js";
10
10
  import type { SchemaType, SimpleAllowedTypeAttributes, SimpleFieldSchema } from "./simpleSchema.js";
11
11
  import type { InsertableContent } from "./unhydratedFlexTreeFromInsertable.js";
12
12
  import type { UnsafeUnknownSchema } from "./unsafeUnknownSchema.js";
@@ -147,11 +147,11 @@ export interface FieldPropsAlpha<TCustomMetadata = unknown> extends FieldProps<T
147
147
  /**
148
148
  * A {@link FieldProvider} which requires additional context in order to produce its content
149
149
  */
150
- export type ContextualFieldProvider = (context: FlexTreeHydratedContextMinimal | "UseGlobalContext") => FlexTreeNode[];
150
+ export type ContextualFieldProvider = (context: FlexTreeHydratedContextMinimal | "UseGlobalContext") => UnhydratedFlexTreeNode[];
151
151
  /**
152
152
  * A {@link FieldProvider} which can produce its content in a vacuum.
153
153
  */
154
- export type ConstantFieldProvider = () => FlexTreeNode[];
154
+ export type ConstantFieldProvider = () => UnhydratedFlexTreeNode[];
155
155
  /**
156
156
  * A function which produces content for a field every time that it is called.
157
157
  */
@@ -211,7 +211,8 @@ export interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown> extends Fie
211
211
  /**
212
212
  * Package internal construction API.
213
213
  */
214
- export declare function createFieldSchema<Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(kind: Kind, annotatedTypes: Types, props?: FieldProps<TCustomMetadata>): FieldSchemaAlpha<Kind, Types, TCustomMetadata>;
214
+ export declare function createFieldSchema<Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(kind: Kind, annotatedTypes: Types): FieldSchemaAlpha<Kind, Types, TCustomMetadata>;
215
+ export declare function createFieldSchema<Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown, TProps extends FieldProps<TCustomMetadata> = FieldProps<TCustomMetadata>>(kind: Kind, annotatedTypes: Types, props: TProps): FieldSchemaAlpha<Kind, Types, TCustomMetadata, TProps>;
215
216
  /**
216
217
  * All policy for a specific field,
217
218
  * including functionality that does not have to be kept consistent across versions or deterministic.
@@ -288,7 +289,7 @@ export declare class FieldSchema<out Kind extends FieldKind = FieldKind, out Typ
288
289
  * This class will go away once the alpha APIs are stable and implemented by {@link FieldSchema}.
289
290
  * @sealed @alpha
290
291
  */
291
- export declare class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
292
+ export declare class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown, TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = FieldPropsAlpha<TCustomMetadata> | undefined> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
292
293
  private readonly propsAlpha;
293
294
  get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
294
295
  /**