@fluidframework/tree 2.2.0 → 2.3.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 (866) hide show
  1. package/.dependency-cruiser-known-violations.json +28 -40
  2. package/.vscode/Tree.code-workspace +0 -2
  3. package/CHANGELOG.md +92 -0
  4. package/README.md +6 -0
  5. package/alpha.d.ts +11 -0
  6. package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
  7. package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
  8. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  9. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  10. package/api-extractor/api-extractor.current.json +8 -0
  11. package/api-extractor/api-extractor.legacy.json +4 -0
  12. package/api-extractor.json +1 -1
  13. package/api-report/tree.alpha.api.md +21 -6
  14. package/api-report/tree.beta.api.md +21 -6
  15. package/api-report/tree.legacy.alpha.api.md +562 -0
  16. package/api-report/tree.legacy.public.api.md +559 -0
  17. package/api-report/tree.public.api.md +6 -6
  18. package/dist/alpha.d.ts +102 -0
  19. package/dist/beta.d.ts +6 -1
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +2 -2
  23. package/dist/core/index.js.map +1 -1
  24. package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  25. package/dist/core/revertible.d.ts.map +1 -0
  26. package/dist/core/revertible.js.map +1 -0
  27. package/dist/core/schema-stored/format.d.ts +3 -3
  28. package/dist/core/schema-stored/format.js +1 -1
  29. package/dist/core/schema-stored/format.js.map +1 -1
  30. package/dist/core/schema-stored/schema.d.ts +2 -7
  31. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  32. package/dist/core/schema-stored/schema.js +4 -6
  33. package/dist/core/schema-stored/schema.js.map +1 -1
  34. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  35. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  36. package/dist/core/tree/anchorSet.d.ts +4 -6
  37. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  38. package/dist/core/tree/anchorSet.js +15 -1
  39. package/dist/core/tree/anchorSet.js.map +1 -1
  40. package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
  41. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndex.js +1 -0
  43. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  44. package/dist/core/tree/visitDelta.d.ts +7 -2
  45. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  46. package/dist/core/tree/visitDelta.js.map +1 -1
  47. package/dist/events/emitter.d.ts +127 -0
  48. package/dist/events/emitter.d.ts.map +1 -0
  49. package/dist/events/{events.js → emitter.js} +49 -28
  50. package/dist/events/emitter.js.map +1 -0
  51. package/dist/events/index.d.ts +2 -1
  52. package/dist/events/index.d.ts.map +1 -1
  53. package/dist/events/index.js +4 -5
  54. package/dist/events/index.js.map +1 -1
  55. package/dist/events/interop.d.ts +36 -0
  56. package/dist/events/interop.d.ts.map +1 -0
  57. package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
  58. package/dist/events/interop.js.map +1 -0
  59. package/dist/events/listeners.d.ts +65 -0
  60. package/dist/events/listeners.d.ts.map +1 -0
  61. package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
  62. package/dist/events/listeners.js.map +1 -0
  63. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  64. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
  66. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  68. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  70. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  72. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  74. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  75. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  76. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  77. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  78. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  79. package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
  80. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  81. package/dist/feature-libraries/flex-map-tree/index.js +2 -1
  82. package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
  83. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
  84. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  85. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -115
  86. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  87. package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
  88. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  89. package/dist/feature-libraries/flex-tree/context.js +10 -7
  90. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  91. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
  92. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  93. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -32
  94. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  95. package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
  96. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  97. package/dist/feature-libraries/flex-tree/index.js +1 -3
  98. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  99. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  100. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
  102. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -29
  104. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  105. package/dist/feature-libraries/flex-tree/lazyField.js +11 -17
  106. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  107. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
  108. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  109. package/dist/feature-libraries/flex-tree/lazyNode.js +23 -159
  110. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  111. package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  112. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  113. package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
  114. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  115. package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
  116. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  117. package/dist/feature-libraries/flex-tree/utilities.js +3 -6
  118. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  120. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  121. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  122. package/dist/feature-libraries/index.d.ts +3 -5
  123. package/dist/feature-libraries/index.d.ts.map +1 -1
  124. package/dist/feature-libraries/index.js +5 -13
  125. package/dist/feature-libraries/index.js.map +1 -1
  126. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  127. package/dist/feature-libraries/modular-schema/comparison.js +3 -6
  128. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  129. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  130. package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
  131. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  135. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  137. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  138. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  139. package/dist/feature-libraries/schema-index/format.d.ts +3 -3
  140. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  141. package/dist/feature-libraries/storedToViewSchema.js +2 -4
  142. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  143. package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
  144. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  145. package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
  146. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  147. package/dist/feature-libraries/typed-schema/index.js +2 -2
  148. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  149. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  150. package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
  151. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  152. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  153. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  154. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
  155. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  156. package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
  157. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  158. package/dist/feature-libraries/typed-schema/view.js +5 -4
  159. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  160. package/dist/index.d.ts +3 -3
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +3 -1
  163. package/dist/index.js.map +1 -1
  164. package/dist/legacy.d.ts +83 -0
  165. package/dist/packageVersion.d.ts +1 -1
  166. package/dist/packageVersion.js +1 -1
  167. package/dist/packageVersion.js.map +1 -1
  168. package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  169. package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  170. package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
  171. package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
  172. package/dist/shared-tree/index.d.ts +3 -3
  173. package/dist/shared-tree/index.d.ts.map +1 -1
  174. package/dist/shared-tree/index.js +2 -2
  175. package/dist/shared-tree/index.js.map +1 -1
  176. package/dist/shared-tree/schematizeTree.d.ts +15 -4
  177. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  178. package/dist/shared-tree/schematizeTree.js +7 -8
  179. package/dist/shared-tree/schematizeTree.js.map +1 -1
  180. package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
  181. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  182. package/dist/shared-tree/schematizingTreeView.js +25 -12
  183. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  184. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  185. package/dist/shared-tree/sharedTree.js +2 -2
  186. package/dist/shared-tree/sharedTree.js.map +1 -1
  187. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  188. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  189. package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
  190. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  191. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  192. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  193. package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
  194. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  195. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  196. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  197. package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
  198. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  199. package/dist/shared-tree/treeApi.d.ts +1 -3
  200. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  201. package/dist/shared-tree/treeApi.js +6 -4
  202. package/dist/shared-tree/treeApi.js.map +1 -1
  203. package/dist/shared-tree/treeCheckout.d.ts +2 -13
  204. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  205. package/dist/shared-tree/treeCheckout.js +17 -1
  206. package/dist/shared-tree/treeCheckout.js.map +1 -1
  207. package/dist/shared-tree-core/branch.js +1 -1
  208. package/dist/shared-tree-core/branch.js.map +1 -1
  209. package/dist/simple-tree/api/create.d.ts.map +1 -1
  210. package/dist/simple-tree/api/create.js +1 -1
  211. package/dist/simple-tree/api/create.js.map +1 -1
  212. package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
  213. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  214. package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  215. package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
  216. package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  217. package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  218. package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  219. package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
  220. package/dist/simple-tree/api/index.d.ts +5 -0
  221. package/dist/simple-tree/api/index.d.ts.map +1 -1
  222. package/dist/simple-tree/api/index.js +7 -1
  223. package/dist/simple-tree/api/index.js.map +1 -1
  224. package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
  225. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
  226. package/dist/simple-tree/api/jsonSchema.js.map +1 -0
  227. package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
  228. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  229. package/dist/simple-tree/api/schemaFactory.js +43 -12
  230. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  231. package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  232. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
  233. package/dist/simple-tree/api/simpleSchema.js.map +1 -0
  234. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  235. package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  236. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  237. package/dist/simple-tree/api/tree.d.ts +1 -21
  238. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  239. package/dist/simple-tree/api/tree.js +3 -38
  240. package/dist/simple-tree/api/tree.js.map +1 -1
  241. package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
  242. package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  243. package/dist/simple-tree/api/treeApiBeta.js +26 -0
  244. package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
  245. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  246. package/dist/simple-tree/api/treeNodeApi.js +51 -21
  247. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  248. package/dist/simple-tree/api/verboseTree.js +2 -2
  249. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  250. package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  251. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  252. package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  253. package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
  254. package/dist/simple-tree/arrayNode.d.ts +2 -2
  255. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  256. package/dist/simple-tree/arrayNode.js +33 -38
  257. package/dist/simple-tree/arrayNode.js.map +1 -1
  258. package/dist/simple-tree/core/index.d.ts +2 -2
  259. package/dist/simple-tree/core/index.d.ts.map +1 -1
  260. package/dist/simple-tree/core/index.js +4 -1
  261. package/dist/simple-tree/core/index.js.map +1 -1
  262. package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
  263. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
  264. package/dist/simple-tree/core/schemaCaching.js +10 -1
  265. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  266. package/dist/simple-tree/core/treeNodeKernel.d.ts +78 -7
  267. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  268. package/dist/simple-tree/core/treeNodeKernel.js +219 -30
  269. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  270. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
  271. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  272. package/dist/simple-tree/core/types.d.ts +23 -8
  273. package/dist/simple-tree/core/types.d.ts.map +1 -1
  274. package/dist/simple-tree/core/types.js.map +1 -1
  275. package/dist/simple-tree/core/withType.d.ts +3 -2
  276. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  277. package/dist/simple-tree/core/withType.js.map +1 -1
  278. package/dist/simple-tree/index.d.ts +7 -9
  279. package/dist/simple-tree/index.d.ts.map +1 -1
  280. package/dist/simple-tree/index.js +15 -6
  281. package/dist/simple-tree/index.js.map +1 -1
  282. package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
  283. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  284. package/dist/simple-tree/leafNodeSchema.js +13 -11
  285. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  286. package/dist/simple-tree/mapNode.d.ts +1 -1
  287. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  288. package/dist/simple-tree/mapNode.js +38 -29
  289. package/dist/simple-tree/mapNode.js.map +1 -1
  290. package/dist/simple-tree/objectNode.d.ts +9 -7
  291. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  292. package/dist/simple-tree/objectNode.js +37 -31
  293. package/dist/simple-tree/objectNode.js.map +1 -1
  294. package/dist/simple-tree/proxies.d.ts +1 -14
  295. package/dist/simple-tree/proxies.d.ts.map +1 -1
  296. package/dist/simple-tree/proxies.js +12 -15
  297. package/dist/simple-tree/proxies.js.map +1 -1
  298. package/dist/simple-tree/proxyBinding.d.ts +2 -62
  299. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  300. package/dist/simple-tree/proxyBinding.js +8 -181
  301. package/dist/simple-tree/proxyBinding.js.map +1 -1
  302. package/dist/simple-tree/schemaTypes.d.ts +7 -7
  303. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  304. package/dist/simple-tree/schemaTypes.js +4 -4
  305. package/dist/simple-tree/schemaTypes.js.map +1 -1
  306. package/dist/simple-tree/toFlexSchema.d.ts +11 -1
  307. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/toFlexSchema.js +54 -31
  309. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  310. package/dist/simple-tree/toMapTree.d.ts +25 -37
  311. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  312. package/dist/simple-tree/toMapTree.js +53 -16
  313. package/dist/simple-tree/toMapTree.js.map +1 -1
  314. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  315. package/dist/simple-tree/treeNodeValid.js +7 -10
  316. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  317. package/dist/simple-tree/typesUnsafe.d.ts +13 -13
  318. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  319. package/dist/simple-tree/walkSchema.d.ts +26 -0
  320. package/dist/simple-tree/walkSchema.d.ts.map +1 -0
  321. package/dist/simple-tree/walkSchema.js +49 -0
  322. package/dist/simple-tree/walkSchema.js.map +1 -0
  323. package/dist/treeFactory.d.ts +2 -1
  324. package/dist/treeFactory.d.ts.map +1 -1
  325. package/dist/treeFactory.js +2 -1
  326. package/dist/treeFactory.js.map +1 -1
  327. package/dist/util/typeUtils.d.ts +2 -2
  328. package/dist/util/typeUtils.js.map +1 -1
  329. package/legacy.d.ts +11 -0
  330. package/lib/alpha.d.ts +102 -0
  331. package/lib/beta.d.ts +6 -1
  332. package/lib/core/index.d.ts +1 -1
  333. package/lib/core/index.d.ts.map +1 -1
  334. package/lib/core/index.js +1 -1
  335. package/lib/core/index.js.map +1 -1
  336. package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  337. package/lib/core/revertible.d.ts.map +1 -0
  338. package/lib/core/revertible.js.map +1 -0
  339. package/lib/core/schema-stored/format.d.ts +3 -3
  340. package/lib/core/schema-stored/format.js +1 -1
  341. package/lib/core/schema-stored/format.js.map +1 -1
  342. package/lib/core/schema-stored/schema.d.ts +2 -7
  343. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  344. package/lib/core/schema-stored/schema.js +4 -6
  345. package/lib/core/schema-stored/schema.js.map +1 -1
  346. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  347. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  348. package/lib/core/tree/anchorSet.d.ts +4 -6
  349. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  350. package/lib/core/tree/anchorSet.js +15 -1
  351. package/lib/core/tree/anchorSet.js.map +1 -1
  352. package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
  353. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  354. package/lib/core/tree/detachedFieldIndex.js +1 -0
  355. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  356. package/lib/core/tree/visitDelta.d.ts +7 -2
  357. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  358. package/lib/core/tree/visitDelta.js.map +1 -1
  359. package/lib/events/emitter.d.ts +127 -0
  360. package/lib/events/emitter.d.ts.map +1 -0
  361. package/lib/events/{events.js → emitter.js} +49 -27
  362. package/lib/events/emitter.js.map +1 -0
  363. package/lib/events/index.d.ts +2 -1
  364. package/lib/events/index.d.ts.map +1 -1
  365. package/lib/events/index.js +1 -1
  366. package/lib/events/index.js.map +1 -1
  367. package/lib/events/interop.d.ts +36 -0
  368. package/lib/events/interop.d.ts.map +1 -0
  369. package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
  370. package/lib/events/interop.js.map +1 -0
  371. package/lib/events/listeners.d.ts +65 -0
  372. package/lib/events/listeners.d.ts.map +1 -0
  373. package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
  374. package/lib/events/listeners.js.map +1 -0
  375. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  376. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  377. package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
  378. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  379. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  380. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  381. package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  382. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  383. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  384. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  385. package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  386. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  387. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  388. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  389. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  390. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  391. package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
  392. package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  393. package/lib/feature-libraries/flex-map-tree/index.js +1 -1
  394. package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
  395. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
  396. package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  397. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -116
  398. package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  399. package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
  400. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  401. package/lib/feature-libraries/flex-tree/context.js +10 -7
  402. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  403. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
  404. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  405. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -31
  406. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  407. package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
  408. package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
  409. package/lib/feature-libraries/flex-tree/index.js +2 -2
  410. package/lib/feature-libraries/flex-tree/index.js.map +1 -1
  411. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  412. package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  413. package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
  414. package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  415. package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -29
  416. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  417. package/lib/feature-libraries/flex-tree/lazyField.js +11 -16
  418. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  419. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
  420. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  421. package/lib/feature-libraries/flex-tree/lazyNode.js +24 -156
  422. package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  423. package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  424. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  425. package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
  426. package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
  427. package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
  428. package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  429. package/lib/feature-libraries/flex-tree/utilities.js +3 -6
  430. package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
  431. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  432. package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  433. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  434. package/lib/feature-libraries/index.d.ts +3 -5
  435. package/lib/feature-libraries/index.d.ts.map +1 -1
  436. package/lib/feature-libraries/index.js +5 -5
  437. package/lib/feature-libraries/index.js.map +1 -1
  438. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  439. package/lib/feature-libraries/modular-schema/comparison.js +3 -6
  440. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  441. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  442. package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
  443. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  444. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  445. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  446. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  447. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  448. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  449. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  450. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  451. package/lib/feature-libraries/schema-index/format.d.ts +3 -3
  452. package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  453. package/lib/feature-libraries/storedToViewSchema.js +3 -5
  454. package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
  455. package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
  456. package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
  457. package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
  458. package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
  459. package/lib/feature-libraries/typed-schema/index.js +2 -2
  460. package/lib/feature-libraries/typed-schema/index.js.map +1 -1
  461. package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  462. package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
  463. package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  464. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  465. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  466. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
  467. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  468. package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
  469. package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
  470. package/lib/feature-libraries/typed-schema/view.js +5 -4
  471. package/lib/feature-libraries/typed-schema/view.js.map +1 -1
  472. package/lib/index.d.ts +3 -3
  473. package/lib/index.d.ts.map +1 -1
  474. package/lib/index.js +3 -1
  475. package/lib/index.js.map +1 -1
  476. package/lib/legacy.d.ts +83 -0
  477. package/lib/packageVersion.d.ts +1 -1
  478. package/lib/packageVersion.js +1 -1
  479. package/lib/packageVersion.js.map +1 -1
  480. package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  481. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  482. package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
  483. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
  484. package/lib/shared-tree/index.d.ts +3 -3
  485. package/lib/shared-tree/index.d.ts.map +1 -1
  486. package/lib/shared-tree/index.js +1 -1
  487. package/lib/shared-tree/index.js.map +1 -1
  488. package/lib/shared-tree/schematizeTree.d.ts +15 -4
  489. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  490. package/lib/shared-tree/schematizeTree.js +8 -9
  491. package/lib/shared-tree/schematizeTree.js.map +1 -1
  492. package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
  493. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  494. package/lib/shared-tree/schematizingTreeView.js +26 -13
  495. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  496. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  497. package/lib/shared-tree/sharedTree.js +2 -2
  498. package/lib/shared-tree/sharedTree.js.map +1 -1
  499. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  500. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  501. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
  502. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  503. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  504. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  505. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
  506. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  507. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  508. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  509. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
  510. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  511. package/lib/shared-tree/treeApi.d.ts +1 -3
  512. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  513. package/lib/shared-tree/treeApi.js +7 -5
  514. package/lib/shared-tree/treeApi.js.map +1 -1
  515. package/lib/shared-tree/treeCheckout.d.ts +2 -13
  516. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  517. package/lib/shared-tree/treeCheckout.js +18 -2
  518. package/lib/shared-tree/treeCheckout.js.map +1 -1
  519. package/lib/shared-tree-core/branch.js +1 -1
  520. package/lib/shared-tree-core/branch.js.map +1 -1
  521. package/lib/simple-tree/api/create.d.ts.map +1 -1
  522. package/lib/simple-tree/api/create.js +2 -2
  523. package/lib/simple-tree/api/create.js.map +1 -1
  524. package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
  525. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  526. package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  527. package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
  528. package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  529. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  530. package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  531. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
  532. package/lib/simple-tree/api/index.d.ts +5 -0
  533. package/lib/simple-tree/api/index.d.ts.map +1 -1
  534. package/lib/simple-tree/api/index.js +3 -0
  535. package/lib/simple-tree/api/index.js.map +1 -1
  536. package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
  537. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
  538. package/lib/simple-tree/api/jsonSchema.js.map +1 -0
  539. package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
  540. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  541. package/lib/simple-tree/api/schemaFactory.js +43 -12
  542. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  543. package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  544. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
  545. package/lib/simple-tree/api/simpleSchema.js.map +1 -0
  546. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  547. package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  548. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  549. package/lib/simple-tree/api/tree.d.ts +1 -21
  550. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  551. package/lib/simple-tree/api/tree.js +2 -34
  552. package/lib/simple-tree/api/tree.js.map +1 -1
  553. package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
  554. package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  555. package/lib/simple-tree/api/treeApiBeta.js +23 -0
  556. package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
  557. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  558. package/lib/simple-tree/api/treeNodeApi.js +53 -23
  559. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  560. package/lib/simple-tree/api/verboseTree.js +1 -1
  561. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  562. package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  563. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  564. package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  565. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
  566. package/lib/simple-tree/arrayNode.d.ts +2 -2
  567. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  568. package/lib/simple-tree/arrayNode.js +36 -41
  569. package/lib/simple-tree/arrayNode.js.map +1 -1
  570. package/lib/simple-tree/core/index.d.ts +2 -2
  571. package/lib/simple-tree/core/index.d.ts.map +1 -1
  572. package/lib/simple-tree/core/index.js +2 -2
  573. package/lib/simple-tree/core/index.js.map +1 -1
  574. package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
  575. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
  576. package/lib/simple-tree/core/schemaCaching.js +8 -0
  577. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  578. package/lib/simple-tree/core/treeNodeKernel.d.ts +78 -7
  579. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  580. package/lib/simple-tree/core/treeNodeKernel.js +211 -24
  581. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  582. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
  583. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  584. package/lib/simple-tree/core/types.d.ts +23 -8
  585. package/lib/simple-tree/core/types.d.ts.map +1 -1
  586. package/lib/simple-tree/core/types.js.map +1 -1
  587. package/lib/simple-tree/core/withType.d.ts +3 -2
  588. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  589. package/lib/simple-tree/core/withType.js.map +1 -1
  590. package/lib/simple-tree/index.d.ts +7 -9
  591. package/lib/simple-tree/index.d.ts.map +1 -1
  592. package/lib/simple-tree/index.js +5 -5
  593. package/lib/simple-tree/index.js.map +1 -1
  594. package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
  595. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  596. package/lib/simple-tree/leafNodeSchema.js +14 -12
  597. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  598. package/lib/simple-tree/mapNode.d.ts +1 -1
  599. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  600. package/lib/simple-tree/mapNode.js +38 -29
  601. package/lib/simple-tree/mapNode.js.map +1 -1
  602. package/lib/simple-tree/objectNode.d.ts +9 -7
  603. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  604. package/lib/simple-tree/objectNode.js +40 -34
  605. package/lib/simple-tree/objectNode.js.map +1 -1
  606. package/lib/simple-tree/proxies.d.ts +1 -14
  607. package/lib/simple-tree/proxies.d.ts.map +1 -1
  608. package/lib/simple-tree/proxies.js +11 -14
  609. package/lib/simple-tree/proxies.js.map +1 -1
  610. package/lib/simple-tree/proxyBinding.d.ts +2 -62
  611. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  612. package/lib/simple-tree/proxyBinding.js +6 -174
  613. package/lib/simple-tree/proxyBinding.js.map +1 -1
  614. package/lib/simple-tree/schemaTypes.d.ts +7 -7
  615. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  616. package/lib/simple-tree/schemaTypes.js +4 -4
  617. package/lib/simple-tree/schemaTypes.js.map +1 -1
  618. package/lib/simple-tree/toFlexSchema.d.ts +11 -1
  619. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  620. package/lib/simple-tree/toFlexSchema.js +29 -8
  621. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  622. package/lib/simple-tree/toMapTree.d.ts +25 -37
  623. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  624. package/lib/simple-tree/toMapTree.js +54 -17
  625. package/lib/simple-tree/toMapTree.js.map +1 -1
  626. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  627. package/lib/simple-tree/treeNodeValid.js +8 -11
  628. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  629. package/lib/simple-tree/typesUnsafe.d.ts +13 -13
  630. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  631. package/lib/simple-tree/walkSchema.d.ts +26 -0
  632. package/lib/simple-tree/walkSchema.d.ts.map +1 -0
  633. package/lib/simple-tree/walkSchema.js +43 -0
  634. package/lib/simple-tree/walkSchema.js.map +1 -0
  635. package/lib/treeFactory.d.ts +2 -1
  636. package/lib/treeFactory.d.ts.map +1 -1
  637. package/lib/treeFactory.js +2 -1
  638. package/lib/treeFactory.js.map +1 -1
  639. package/lib/tsdoc-metadata.json +1 -1
  640. package/lib/util/typeUtils.d.ts +2 -2
  641. package/lib/util/typeUtils.js.map +1 -1
  642. package/package.json +58 -36
  643. package/src/core/index.ts +1 -1
  644. package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
  645. package/src/core/schema-stored/format.ts +1 -1
  646. package/src/core/schema-stored/schema.ts +6 -13
  647. package/src/core/tree/anchorSet.ts +35 -9
  648. package/src/core/tree/detachedFieldIndex.ts +6 -5
  649. package/src/core/tree/visitDelta.ts +7 -2
  650. package/src/events/{events.ts → emitter.ts} +55 -134
  651. package/src/events/index.ts +7 -7
  652. package/src/events/interop.ts +49 -0
  653. package/src/events/listeners.ts +68 -0
  654. package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
  655. package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
  656. package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
  657. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
  658. package/src/feature-libraries/flex-map-tree/index.ts +1 -0
  659. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -231
  660. package/src/feature-libraries/flex-tree/README.md +4 -75
  661. package/src/feature-libraries/flex-tree/context.ts +37 -16
  662. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -458
  663. package/src/feature-libraries/flex-tree/index.ts +7 -29
  664. package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
  665. package/src/feature-libraries/flex-tree/lazyField.ts +49 -79
  666. package/src/feature-libraries/flex-tree/lazyNode.ts +26 -306
  667. package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
  668. package/src/feature-libraries/flex-tree/utilities.ts +4 -8
  669. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
  670. package/src/feature-libraries/index.ts +2 -41
  671. package/src/feature-libraries/modular-schema/comparison.ts +4 -6
  672. package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
  673. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
  674. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
  675. package/src/feature-libraries/storedToViewSchema.ts +5 -6
  676. package/src/feature-libraries/typed-schema/flexList.ts +3 -3
  677. package/src/feature-libraries/typed-schema/index.ts +1 -3
  678. package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
  679. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
  680. package/src/feature-libraries/typed-schema/view.ts +4 -13
  681. package/src/index.ts +5 -1
  682. package/src/packageVersion.ts +1 -1
  683. package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
  684. package/src/shared-tree/index.ts +2 -7
  685. package/src/shared-tree/schematizeTree.ts +23 -12
  686. package/src/shared-tree/schematizingTreeView.ts +34 -24
  687. package/src/shared-tree/sharedTree.ts +6 -1
  688. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
  689. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
  690. package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
  691. package/src/shared-tree/treeApi.ts +10 -10
  692. package/src/shared-tree/treeCheckout.ts +26 -15
  693. package/src/shared-tree-core/branch.ts +1 -1
  694. package/src/simple-tree/ProxyBinding.md +23 -23
  695. package/src/simple-tree/api/create.ts +8 -3
  696. package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
  697. package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
  698. package/src/simple-tree/api/index.ts +20 -0
  699. package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
  700. package/src/simple-tree/api/schemaFactory.ts +44 -13
  701. package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
  702. package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
  703. package/src/simple-tree/api/tree.ts +2 -71
  704. package/src/simple-tree/api/treeApiBeta.ts +101 -0
  705. package/src/simple-tree/api/treeNodeApi.ts +63 -22
  706. package/src/simple-tree/api/verboseTree.ts +1 -1
  707. package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
  708. package/src/simple-tree/arrayNode.ts +38 -41
  709. package/src/simple-tree/core/index.ts +4 -0
  710. package/src/simple-tree/core/schemaCaching.ts +10 -0
  711. package/src/simple-tree/core/treeNodeKernel.ts +279 -27
  712. package/src/simple-tree/core/treeNodeSchema.ts +1 -1
  713. package/src/simple-tree/core/types.ts +23 -8
  714. package/src/simple-tree/core/withType.ts +3 -1
  715. package/src/simple-tree/index.ts +29 -20
  716. package/src/simple-tree/leafNodeSchema.ts +24 -28
  717. package/src/simple-tree/mapNode.ts +47 -29
  718. package/src/simple-tree/objectNode.ts +51 -46
  719. package/src/simple-tree/proxies.ts +22 -51
  720. package/src/simple-tree/proxyBinding.ts +3 -254
  721. package/src/simple-tree/schemaTypes.ts +8 -8
  722. package/src/simple-tree/toFlexSchema.ts +40 -7
  723. package/src/simple-tree/toMapTree.ts +113 -79
  724. package/src/simple-tree/treeNodeValid.ts +10 -13
  725. package/src/simple-tree/typesUnsafe.ts +13 -13
  726. package/src/simple-tree/walkSchema.ts +81 -0
  727. package/src/treeFactory.ts +2 -1
  728. package/src/util/typeUtils.ts +2 -2
  729. package/dist/core/revertible/index.d.ts.map +0 -1
  730. package/dist/core/revertible/index.js +0 -10
  731. package/dist/core/revertible/index.js.map +0 -1
  732. package/dist/core/revertible/revertible.d.ts.map +0 -1
  733. package/dist/core/revertible/revertible.js.map +0 -1
  734. package/dist/domains/index.d.ts +0 -8
  735. package/dist/domains/index.d.ts.map +0 -1
  736. package/dist/domains/index.js +0 -20
  737. package/dist/domains/index.js.map +0 -1
  738. package/dist/domains/json/index.d.ts +0 -7
  739. package/dist/domains/json/index.d.ts.map +0 -1
  740. package/dist/domains/json/index.js +0 -17
  741. package/dist/domains/json/index.js.map +0 -1
  742. package/dist/domains/json/jsonCursor.d.ts +0 -52
  743. package/dist/domains/json/jsonCursor.d.ts.map +0 -1
  744. package/dist/domains/json/jsonCursor.js +0 -197
  745. package/dist/domains/json/jsonCursor.js.map +0 -1
  746. package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
  747. package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
  748. package/dist/domains/json/jsonDomainSchema.js +0 -32
  749. package/dist/domains/json/jsonDomainSchema.js.map +0 -1
  750. package/dist/domains/leafDomain.d.ts +0 -72
  751. package/dist/domains/leafDomain.d.ts.map +0 -1
  752. package/dist/domains/leafDomain.js +0 -88
  753. package/dist/domains/leafDomain.js.map +0 -1
  754. package/dist/domains/schemaBuilder.d.ts +0 -103
  755. package/dist/domains/schemaBuilder.d.ts.map +0 -1
  756. package/dist/domains/schemaBuilder.js +0 -121
  757. package/dist/domains/schemaBuilder.js.map +0 -1
  758. package/dist/domains/testRecursiveDomain.d.ts +0 -17
  759. package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
  760. package/dist/domains/testRecursiveDomain.js +0 -35
  761. package/dist/domains/testRecursiveDomain.js.map +0 -1
  762. package/dist/events/events.d.ts +0 -201
  763. package/dist/events/events.d.ts.map +0 -1
  764. package/dist/events/events.js.map +0 -1
  765. package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
  766. package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
  767. package/dist/feature-libraries/schemaBuilder.js +0 -40
  768. package/dist/feature-libraries/schemaBuilder.js.map +0 -1
  769. package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
  770. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  771. package/dist/feature-libraries/schemaBuilderBase.js +0 -201
  772. package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
  773. package/dist/shared-tree/treeView.d.ts +0 -73
  774. package/dist/shared-tree/treeView.d.ts.map +0 -1
  775. package/dist/shared-tree/treeView.js.map +0 -1
  776. package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
  777. package/dist/simple-tree/getJsonSchema.js.map +0 -1
  778. package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
  779. package/dist/simple-tree/getSimpleSchema.js.map +0 -1
  780. package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
  781. package/dist/simple-tree/jsonSchema.js.map +0 -1
  782. package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
  783. package/dist/simple-tree/simpleSchema.js.map +0 -1
  784. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  785. package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  786. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  787. package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
  788. package/lib/core/revertible/index.d.ts.map +0 -1
  789. package/lib/core/revertible/index.js.map +0 -1
  790. package/lib/core/revertible/revertible.d.ts.map +0 -1
  791. package/lib/core/revertible/revertible.js.map +0 -1
  792. package/lib/domains/index.d.ts +0 -8
  793. package/lib/domains/index.d.ts.map +0 -1
  794. package/lib/domains/index.js +0 -8
  795. package/lib/domains/index.js.map +0 -1
  796. package/lib/domains/json/index.d.ts +0 -7
  797. package/lib/domains/json/index.d.ts.map +0 -1
  798. package/lib/domains/json/index.js +0 -7
  799. package/lib/domains/json/index.js.map +0 -1
  800. package/lib/domains/json/jsonCursor.d.ts +0 -52
  801. package/lib/domains/json/jsonCursor.d.ts.map +0 -1
  802. package/lib/domains/json/jsonCursor.js +0 -192
  803. package/lib/domains/json/jsonCursor.js.map +0 -1
  804. package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
  805. package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
  806. package/lib/domains/json/jsonDomainSchema.js +0 -29
  807. package/lib/domains/json/jsonDomainSchema.js.map +0 -1
  808. package/lib/domains/leafDomain.d.ts +0 -72
  809. package/lib/domains/leafDomain.d.ts.map +0 -1
  810. package/lib/domains/leafDomain.js +0 -85
  811. package/lib/domains/leafDomain.js.map +0 -1
  812. package/lib/domains/schemaBuilder.d.ts +0 -103
  813. package/lib/domains/schemaBuilder.d.ts.map +0 -1
  814. package/lib/domains/schemaBuilder.js +0 -117
  815. package/lib/domains/schemaBuilder.js.map +0 -1
  816. package/lib/domains/testRecursiveDomain.d.ts +0 -17
  817. package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
  818. package/lib/domains/testRecursiveDomain.js +0 -32
  819. package/lib/domains/testRecursiveDomain.js.map +0 -1
  820. package/lib/events/events.d.ts +0 -201
  821. package/lib/events/events.d.ts.map +0 -1
  822. package/lib/events/events.js.map +0 -1
  823. package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
  824. package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
  825. package/lib/feature-libraries/schemaBuilder.js +0 -36
  826. package/lib/feature-libraries/schemaBuilder.js.map +0 -1
  827. package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
  828. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  829. package/lib/feature-libraries/schemaBuilderBase.js +0 -195
  830. package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
  831. package/lib/shared-tree/treeView.d.ts +0 -73
  832. package/lib/shared-tree/treeView.d.ts.map +0 -1
  833. package/lib/shared-tree/treeView.js.map +0 -1
  834. package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
  835. package/lib/simple-tree/getJsonSchema.js.map +0 -1
  836. package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
  837. package/lib/simple-tree/getSimpleSchema.js.map +0 -1
  838. package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
  839. package/lib/simple-tree/jsonSchema.js.map +0 -1
  840. package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
  841. package/lib/simple-tree/simpleSchema.js.map +0 -1
  842. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  843. package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  844. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  845. package/src/domains/README.md +0 -6
  846. package/src/domains/fence.json +0 -5
  847. package/src/domains/index.ts +0 -19
  848. package/src/domains/json/fence.json +0 -5
  849. package/src/domains/json/index.ts +0 -13
  850. package/src/domains/json/jsonCursor.ts +0 -247
  851. package/src/domains/json/jsonDomainSchema.ts +0 -47
  852. package/src/domains/leafDomain.ts +0 -97
  853. package/src/domains/schemaBuilder.ts +0 -153
  854. package/src/domains/testRecursiveDomain.ts +0 -38
  855. package/src/events/fence.json +0 -5
  856. package/src/feature-libraries/schemaBuilder.ts +0 -45
  857. package/src/feature-libraries/schemaBuilderBase.ts +0 -393
  858. package/src/shared-tree/treeView.ts +0 -113
  859. /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
  860. /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  861. /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  862. /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
  863. /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
  864. /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  865. /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  866. /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind>;\n}\n"]}
1
+ {"version":3,"file":"withType.js","sourceRoot":"","sources":["../../../src/simple-tree/core/withType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GAAkB,MAAM,CAAC,eAAe,CAAC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind, TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.\n * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.\n * @system @public\n */\nexport const typeNameSymbol: unique symbol = Symbol(\"TreeNode Type\");\n\n/**\n * The type of a {@link TreeNode}.\n * For more information about the type, use `Tree.schema(theNode)` instead.\n * @remarks\n * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.\n * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.\n *\n * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.\n * Instead construct a real node of the desired type using its constructor.\n *\n * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.\n * @privateRemarks\n * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.\n * @system @public\n */\nexport const typeSchemaSymbol: unique symbol = Symbol(\"TreeNode Schema\");\n\n/**\n * Adds a type symbol to a type for stronger typing.\n *\n * @typeParam TName - Same as {@link TreeNodeSchema}'s \"Name\" parameter.\n * @typeParam TKind - Same as {@link TreeNodeSchema}'s \"Kind\" parameter.\n * @typeParam TInfo - Same as {@link TreeNodeSchema}'s \"Info\" parameter: format depends on the Kind.\n * @remarks\n * Powers {@link TreeNode}'s strong typing setup.\n * @example Narrow types for overloading based on NodeKind\n * ```typescript\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Array>): number[];\n * function getKeys(node: TreeNode & WithType<string, NodeKind.Map | NodeKind.Object>): string[];\n * function getKeys(node: TreeNode): string[] | number[];\n * function getKeys(node: TreeNode): string[] | number[] {\n * \tconst schema = Tree.schema(node);\n * \tswitch (schema.kind) {\n * \t\tcase NodeKind.Array: {\n * \t\t\tconst arrayNode = node as TreeArrayNode;\n * \t\t\tconst keys: number[] = [];\n * \t\t\tfor (let index = 0; index < arrayNode.length; index++) {\n * \t\t\t\tkeys.push(index);\n * \t\t\t}\n * \t\t\treturn keys;\n * \t\t}\n * \t\tcase NodeKind.Map:\n * \t\t\treturn [...(node as TreeMapNode).keys()];\n * \t\tcase NodeKind.Object:\n * \t\t\treturn Object.keys(node);\n * \t\tdefault:\n * \t\t\tthrow new Error(\"Unsupported Kind\");\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport interface WithType<\n\tout TName extends string = string,\n\tout TKind extends NodeKind = NodeKind,\n\tout TInfo = unknown,\n> {\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\tget [typeNameSymbol](): TName;\n\n\t/**\n\t * Type symbol, marking a type in a way to increase type safety via strong type checking.\n\t */\n\tget [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, unknown, never, boolean, TInfo>;\n}\n"]}
@@ -2,19 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeChangeEvents, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, } from "./core/index.js";
6
- export { type ITree, type TreeView, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, } from "./api/index.js";
5
+ export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeChangeEvents, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, } from "./core/index.js";
6
+ export { type ITree, type TreeView, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeSchema, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, getJsonSchema, getSimpleSchema, } from "./api/index.js";
7
7
  export { type NodeFromSchema, isTreeNodeSchemaClass, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type ImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, FieldKind, FieldSchema, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, type NodeBuilderData, type DefaultProvider, type FieldProps, normalizeFieldSchema, type ApplyKind, } from "./schemaTypes.js";
8
- export { getOrCreateInnerNode, tryDisposeTreeNode } from "./proxyBinding.js";
8
+ export { getOrCreateInnerNode } from "./proxyBinding.js";
9
9
  export { toFlexSchema } from "./toFlexSchema.js";
10
10
  export type { FieldHasDefaultUnsafe, ObjectFromSchemaRecordUnsafe, TreeObjectNodeUnsafe, TreeFieldFromImplicitFieldUnsafe, TreeNodeFromImplicitAllowedTypesUnsafe, FieldSchemaUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeFieldFromImplicitFieldUnsafe, InsertableTypedNodeUnsafe, NodeBuilderDataUnsafe, NodeFromSchemaUnsafe, ReadonlyMapInlined, } from "./typesUnsafe.js";
11
- export { getTreeNodeForField, type InsertableContent, prepareContentForHydration, } from "./proxies.js";
11
+ export { getTreeNodeForField, prepareContentForHydration, } from "./proxies.js";
12
12
  export { TreeArrayNode, IterableTreeArrayContent, type TreeArrayNodeBase, } from "./arrayNode.js";
13
13
  export { type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, type TreeObjectNode, setField, } from "./objectNode.js";
14
14
  export type { TreeMapNode, MapNodeInsertableData } from "./mapNode.js";
15
- export { mapTreeFromNodeData } from "./toMapTree.js";
16
- export type { SimpleTreeSchema } from "./simpleSchema.js";
17
- export { type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, } from "./jsonSchema.js";
18
- export { getJsonSchema } from "./getJsonSchema.js";
19
- export { getSimpleSchema } from "./getSimpleSchema.js";
15
+ export { mapTreeFromNodeData, type InsertableContent } from "./toMapTree.js";
16
+ export { toStoredSchema, getStoredSchema, getFlexSchema } from "./toFlexSchema.js";
17
+ export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
20
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,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,mBAAmB,EACnB,iBAAiB,EACjB,sCAAsC,EACtC,0CAA0C,EAC1C,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,KAAK,iBAAiB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,QAAQ,GACR,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,E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CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACX,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,gCAAgC,EAChC,sCAAsC,EACtC,iBAAiB,EACjB,gDAAgD,EAChD,mBAAmB,EACnB,iBAAiB,EACjB,sCAAsC,EACtC,0CAA0C,EAC1C,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,KAAK,iBAAiB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,QAAQ,GACR,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC"}
@@ -4,12 +4,13 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getSimpleSchema = exports.getJsonSchema = exports.mapTreeFromNodeData = exports.setField = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.prepareContentForHydration = exports.getTreeNodeForField = exports.toFlexSchema = exports.tryDisposeTreeNode = exports.getOrCreateInnerNode = exports.normalizeFieldSchema = exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.createFromInsertable = exports.cursorFromInsertable = exports.treeNodeApi = exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.typedObjectValues = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactory = exports.TreeViewConfiguration = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
7
+ exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getFlexSchema = exports.getStoredSchema = exports.toStoredSchema = exports.mapTreeFromNodeData = exports.setField = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.prepareContentForHydration = exports.getTreeNodeForField = exports.toFlexSchema = exports.getOrCreateInnerNode = exports.normalizeFieldSchema = exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.getSimpleSchema = exports.getJsonSchema = exports.TreeBeta = exports.createFromInsertable = exports.cursorFromInsertable = exports.treeNodeApi = exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.typedObjectValues = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactory = exports.TreeViewConfiguration = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
8
8
  var index_js_1 = require("./core/index.js");
9
9
  Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return index_js_1.typeNameSymbol; } });
10
10
  Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return index_js_1.typeSchemaSymbol; } });
11
11
  Object.defineProperty(exports, "NodeKind", { enumerable: true, get: function () { return index_js_1.NodeKind; } });
12
12
  Object.defineProperty(exports, "isTreeNode", { enumerable: true, get: function () { return index_js_1.isTreeNode; } });
13
+ Object.defineProperty(exports, "tryDisposeTreeNode", { enumerable: true, get: function () { return index_js_1.tryDisposeTreeNode; } });
13
14
  var index_js_2 = require("./api/index.js");
14
15
  Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return index_js_2.TreeViewConfiguration; } });
15
16
  Object.defineProperty(exports, "SchemaFactory", { enumerable: true, get: function () { return index_js_2.SchemaFactory; } });
@@ -23,6 +24,9 @@ Object.defineProperty(exports, "test_RecursiveObjectPojoMode", { enumerable: tru
23
24
  Object.defineProperty(exports, "treeNodeApi", { enumerable: true, get: function () { return index_js_2.treeNodeApi; } });
24
25
  Object.defineProperty(exports, "cursorFromInsertable", { enumerable: true, get: function () { return index_js_2.cursorFromInsertable; } });
25
26
  Object.defineProperty(exports, "createFromInsertable", { enumerable: true, get: function () { return index_js_2.createFromInsertable; } });
27
+ Object.defineProperty(exports, "TreeBeta", { enumerable: true, get: function () { return index_js_2.TreeBeta; } });
28
+ Object.defineProperty(exports, "getJsonSchema", { enumerable: true, get: function () { return index_js_2.getJsonSchema; } });
29
+ Object.defineProperty(exports, "getSimpleSchema", { enumerable: true, get: function () { return index_js_2.getSimpleSchema; } });
26
30
  var schemaTypes_js_1 = require("./schemaTypes.js");
27
31
  Object.defineProperty(exports, "isTreeNodeSchemaClass", { enumerable: true, get: function () { return schemaTypes_js_1.isTreeNodeSchemaClass; } });
28
32
  Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return schemaTypes_js_1.FieldKind; } });
@@ -30,7 +34,6 @@ Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function
30
34
  Object.defineProperty(exports, "normalizeFieldSchema", { enumerable: true, get: function () { return schemaTypes_js_1.normalizeFieldSchema; } });
31
35
  var proxyBinding_js_1 = require("./proxyBinding.js");
32
36
  Object.defineProperty(exports, "getOrCreateInnerNode", { enumerable: true, get: function () { return proxyBinding_js_1.getOrCreateInnerNode; } });
33
- Object.defineProperty(exports, "tryDisposeTreeNode", { enumerable: true, get: function () { return proxyBinding_js_1.tryDisposeTreeNode; } });
34
37
  var toFlexSchema_js_1 = require("./toFlexSchema.js");
35
38
  Object.defineProperty(exports, "toFlexSchema", { enumerable: true, get: function () { return toFlexSchema_js_1.toFlexSchema; } });
36
39
  var proxies_js_1 = require("./proxies.js");
@@ -43,8 +46,14 @@ var objectNode_js_1 = require("./objectNode.js");
43
46
  Object.defineProperty(exports, "setField", { enumerable: true, get: function () { return objectNode_js_1.setField; } });
44
47
  var toMapTree_js_1 = require("./toMapTree.js");
45
48
  Object.defineProperty(exports, "mapTreeFromNodeData", { enumerable: true, get: function () { return toMapTree_js_1.mapTreeFromNodeData; } });
46
- var getJsonSchema_js_1 = require("./getJsonSchema.js");
47
- Object.defineProperty(exports, "getJsonSchema", { enumerable: true, get: function () { return getJsonSchema_js_1.getJsonSchema; } });
48
- var getSimpleSchema_js_1 = require("./getSimpleSchema.js");
49
- Object.defineProperty(exports, "getSimpleSchema", { enumerable: true, get: function () { return getSimpleSchema_js_1.getSimpleSchema; } });
49
+ var toFlexSchema_js_2 = require("./toFlexSchema.js");
50
+ Object.defineProperty(exports, "toStoredSchema", { enumerable: true, get: function () { return toFlexSchema_js_2.toStoredSchema; } });
51
+ Object.defineProperty(exports, "getStoredSchema", { enumerable: true, get: function () { return toFlexSchema_js_2.getStoredSchema; } });
52
+ Object.defineProperty(exports, "getFlexSchema", { enumerable: true, get: function () { return toFlexSchema_js_2.getFlexSchema; } });
53
+ var leafNodeSchema_js_1 = require("./leafNodeSchema.js");
54
+ Object.defineProperty(exports, "numberSchema", { enumerable: true, get: function () { return leafNodeSchema_js_1.numberSchema; } });
55
+ Object.defineProperty(exports, "stringSchema", { enumerable: true, get: function () { return leafNodeSchema_js_1.stringSchema; } });
56
+ Object.defineProperty(exports, "booleanSchema", { enumerable: true, get: function () { return leafNodeSchema_js_1.booleanSchema; } });
57
+ Object.defineProperty(exports, "handleSchema", { enumerable: true, get: function () { return leafNodeSchema_js_1.handleSchema; } });
58
+ Object.defineProperty(exports, "nullSchema", { enumerable: true, get: function () { return leafNodeSchema_js_1.nullSchema; } });
50
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAgByB;AAfxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,oGAAA,QAAQ,OAAA;AAUR,sGAAA,UAAU,OAAA;AAEX,2CAwBwB;AApBvB,iHAAA,qBAAqB,OAAA;AAIrB,yGAAA,aAAa,OAAA;AAIb,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AAEjB,gHAAA,oBAAoB,OAAA;AACpB,qHAAA,yBAAyB,OAAA;AACzB,wHAAA,4BAA4B,OAAA;AAC5B,uGAAA,WAAW,OAAA;AAEX,gHAAA,oBAAoB,OAAA;AACpB,gHAAA,oBAAoB,OAAA;AAErB,mDAmB0B;AAjBzB,uHAAA,qBAAqB,OAAA;AAQrB,2GAAA,SAAS,OAAA;AACT,6GAAA,WAAW,OAAA;AAMX,sHAAA,oBAAoB,OAAA;AAGrB,qDAA6E;AAApE,uHAAA,oBAAoB,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AACjD,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAkBrB,2CAIsB;AAHrB,iHAAA,mBAAmB,OAAA;AAEnB,wHAAA,0BAA0B,OAAA;AAG3B,+CAIwB;AAHvB,6GAAA,aAAa,OAAA;AACb,wHAAA,wBAAwB,OAAA;AAGzB,iDAMyB;AADxB,yGAAA,QAAQ,OAAA;AAGT,+CAAqD;AAA5C,mHAAA,mBAAmB,OAAA;AAiB5B,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeChangeEvents,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\ttype EmptyObject,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n} from \"./api/index.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\ttype ApplyKind,\n} from \"./schemaTypes.js\";\nexport { getOrCreateInnerNode, tryDisposeTreeNode } from \"./proxyBinding.js\";\nexport { toFlexSchema } from \"./toFlexSchema.js\";\nexport type {\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n} from \"./typesUnsafe.js\";\nexport {\n\tgetTreeNodeForField,\n\ttype InsertableContent,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\n\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype TreeArrayNodeBase,\n} from \"./arrayNode.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n} from \"./objectNode.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport { mapTreeFromNodeData } from \"./toMapTree.js\";\nexport type { SimpleTreeSchema } from \"./simpleSchema.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mapp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AACZ,+GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeChangeEvents,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttypedObjectValues,\n\ttype EmptyObject,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n} from \"./api/index.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\ttype ApplyKind,\n} from \"./schemaTypes.js\";\nexport { getOrCreateInnerNode } from \"./proxyBinding.js\";\nexport { toFlexSchema } from \"./toFlexSchema.js\";\nexport type {\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n} from \"./typesUnsafe.js\";\nexport {\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\n\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype TreeArrayNodeBase,\n} from \"./arrayNode.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n} from \"./objectNode.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport { mapTreeFromNodeData, type InsertableContent } from \"./toMapTree.js\";\nexport { toStoredSchema, getStoredSchema, getFlexSchema } from \"./toFlexSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\n"]}
@@ -2,10 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { TreeNodeSchemaIdentifier, TreeValue } from "../core/index.js";
6
- import { type LeafNodeSchema as FlexLeafNodeSchema, type FlexTreeNode } from "../feature-libraries/index.js";
5
+ import { type TreeValue, ValueSchema } from "../core/index.js";
6
+ import { type FlexTreeNode } from "../feature-libraries/index.js";
7
7
  import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from "./core/index.js";
8
- type UnbrandedName<T extends FlexLeafNodeSchema> = T["name"] extends TreeNodeSchemaIdentifier<infer Name extends string> ? Name : T["name"];
9
8
  /**
10
9
  * Instances of this class are schema for leaf nodes.
11
10
  * @remarks
@@ -15,18 +14,17 @@ type UnbrandedName<T extends FlexLeafNodeSchema> = T["name"] extends TreeNodeSch
15
14
  * @privateRemarks
16
15
  * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.
17
16
  */
18
- export declare class LeafNodeSchema<T extends FlexLeafNodeSchema> implements TreeNodeSchemaNonClass<UnbrandedName<T>, NodeKind.Leaf, TreeValue<T["info"]>> {
19
- readonly identifier: UnbrandedName<T>;
17
+ export declare class LeafNodeSchema<Name extends string, const T extends ValueSchema> implements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>> {
18
+ readonly identifier: Name;
20
19
  readonly kind = NodeKind.Leaf;
21
- readonly info: T["info"];
20
+ readonly info: T;
22
21
  readonly implicitlyConstructable: true;
23
- create(data: TreeValue<T["info"]> | FlexTreeNode): TreeValue<T["info"]>;
24
- constructor(schema: T);
22
+ create(data: TreeValue<T> | FlexTreeNode): TreeValue<T>;
23
+ constructor(name: Name, t: T);
25
24
  }
26
25
  export declare const stringSchema: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>;
27
26
  export declare const numberSchema: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
28
27
  export declare const booleanSchema: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
29
28
  export declare const nullSchema: TreeNodeSchema<"com.fluidframework.leaf.null", NodeKind.Leaf, null, null>;
30
29
  export declare const handleSchema: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, import("@fluidframework/core-interfaces").IFluidHandle<unknown>, import("@fluidframework/core-interfaces").IFluidHandle<unknown>>;
31
- export {};
32
30
  //# sourceMappingURL=leafNodeSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leafNodeSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EACN,KAAK,cAAc,IAAI,kBAAkB,EACzC,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,KAAK,aAAa,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,wBAAwB,CAC5F,MAAM,IAAI,SAAS,MAAM,CACzB,GACE,IAAI,GACJ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEb;;;;;;;;GAQG;AACH,qBAAa,cAAc,CAAC,CAAC,SAAS,kBAAkB,CACvD,YAAW,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,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B;IACjD,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC;gBAS3C,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;CAMnC;AAmBD,eAAO,MAAM,YAAY,iFAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,iFAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,oFAA2C,CAAC;AACtE,eAAO,MAAM,UAAU,2EAAqC,CAAC;AAC7D,eAAO,MAAM,YAAY,mMAA8C,CAAC"}
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.handleSchema = exports.nullSchema = exports.booleanSchema = exports.numberSchema = exports.stringSchema = exports.LeafNodeSchema = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../domains/index.js");
9
+ const index_js_1 = require("../core/index.js");
10
10
  const index_js_2 = require("../feature-libraries/index.js");
11
11
  const index_js_3 = require("./core/index.js");
12
12
  /**
@@ -27,25 +27,27 @@ class LeafNodeSchema {
27
27
  }
28
28
  return data;
29
29
  }
30
- constructor(schema) {
30
+ constructor(name, t) {
31
31
  this.kind = index_js_3.NodeKind.Leaf;
32
32
  this.implicitlyConstructable = true;
33
+ const schema = new index_js_2.LeafNodeSchema({ name: "makeLeaf" }, name, t);
33
34
  (0, index_js_3.setFlexSchemaFromClassSchema)(this, schema);
34
- this.identifier = schema.name;
35
- this.info = schema.info;
35
+ this.identifier = name;
36
+ this.info = t;
36
37
  }
37
38
  }
38
39
  exports.LeafNodeSchema = LeafNodeSchema;
39
40
  /**
40
41
  * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.
41
42
  */
42
- function makeLeaf(schema) {
43
- return new LeafNodeSchema(schema);
43
+ function makeLeaf(name, t) {
44
+ // Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation
45
+ return new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);
44
46
  }
45
47
  // Leaf schema shared between all SchemaFactory instances.
46
- exports.stringSchema = makeLeaf(index_js_1.leaf.string);
47
- exports.numberSchema = makeLeaf(index_js_1.leaf.number);
48
- exports.booleanSchema = makeLeaf(index_js_1.leaf.boolean);
49
- exports.nullSchema = makeLeaf(index_js_1.leaf.null);
50
- exports.handleSchema = makeLeaf(index_js_1.leaf.handle);
48
+ exports.stringSchema = makeLeaf("string", index_js_1.ValueSchema.String);
49
+ exports.numberSchema = makeLeaf("number", index_js_1.ValueSchema.Number);
50
+ exports.booleanSchema = makeLeaf("boolean", index_js_1.ValueSchema.Boolean);
51
+ exports.nullSchema = makeLeaf("null", index_js_1.ValueSchema.Null);
52
+ exports.handleSchema = makeLeaf("handle", index_js_1.ValueSchema.FluidHandle);
51
53
  //# sourceMappingURL=leafNodeSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,kDAA2C;AAC3C,4DAKuC;AACvC,8CAKyB;AAQzB;;;;;;;;GAQG;AACH,MAAa,cAAc;IAOnB,MAAM,CAAC,IAAyC;QACtD,IAAI,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAA,iBAAM,EAAC,IAAA,4BAAiB,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,YAAmB,MAAS;QAZZ,SAAI,GAAG,mBAAQ,CAAC,IAAI,CAAC;QAErB,4BAAuB,GAAG,IAAa,CAAC;QAWvD,IAAA,uCAA4B,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAwB,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,CAAC;CACD;AArBD,wCAqBC;AAED;;GAEG;AACH,SAAS,QAAQ,CAChB,MAAS;IAOT,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,0DAA0D;AAC7C,QAAA,YAAY,GAAG,QAAQ,CAAC,eAAI,CAAC,MAAM,CAAC,CAAC;AACrC,QAAA,YAAY,GAAG,QAAQ,CAAC,eAAI,CAAC,MAAM,CAAC,CAAC;AACrC,QAAA,aAAa,GAAG,QAAQ,CAAC,eAAI,CAAC,OAAO,CAAC,CAAC;AACvC,QAAA,UAAU,GAAG,QAAQ,CAAC,eAAI,CAAC,IAAI,CAAC,CAAC;AACjC,QAAA,YAAY,GAAG,QAAQ,CAAC,eAAI,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { TreeNodeSchemaIdentifier, TreeValue } from \"../core/index.js\";\nimport { leaf } from \"../domains/index.js\";\nimport {\n\ttype LeafNodeSchema as FlexLeafNodeSchema,\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\nimport {\n\tsetFlexSchemaFromClassSchema,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n} from \"./core/index.js\";\n\ntype UnbrandedName<T extends FlexLeafNodeSchema> = T[\"name\"] extends TreeNodeSchemaIdentifier<\n\tinfer Name extends string\n>\n\t? Name\n\t: T[\"name\"];\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<T extends FlexLeafNodeSchema>\n\timplements TreeNodeSchemaNonClass<UnbrandedName<T>, NodeKind.Leaf, TreeValue<T[\"info\"]>>\n{\n\tpublic readonly identifier: UnbrandedName<T>;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T[\"info\"];\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic create(data: TreeValue<T[\"info\"]> | FlexTreeNode): TreeValue<T[\"info\"]> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic constructor(schema: T) {\n\t\tsetFlexSchemaFromClassSchema(this, schema);\n\t\tthis.identifier = schema.name as UnbrandedName<T>;\n\t\tthis.info = schema.info;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<T extends FlexLeafNodeSchema>(\n\tschema: T,\n): TreeNodeSchema<\n\tUnbrandedName<T>,\n\tNodeKind.Leaf,\n\tTreeValue<T[\"info\"]>,\n\tTreeValue<T[\"info\"]>\n> {\n\treturn new LeafNodeSchema(schema);\n}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(leaf.string);\nexport const numberSchema = makeLeaf(leaf.number);\nexport const booleanSchema = makeLeaf(leaf.boolean);\nexport const nullSchema = makeLeaf(leaf.null);\nexport const handleSchema = makeLeaf(leaf.handle);\n"]}
1
+ {"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAA+D;AAC/D,4DAKuC;AACvC,8CAKyB;AAEzB;;;;;;;;GAQG;AACH,MAAa,cAAc;IAOnB,MAAM,CAAC,IA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,EAAE,sBAAW,CAAC,WAAW,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type TreeValue, ValueSchema } from \"../core/index.js\";\nimport {\n\tLeafNodeSchema as FlexLeafNodeSchema,\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\nimport {\n\tsetFlexSchemaFromClassSchema,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n} from \"./core/index.js\";\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<Name extends string, const T extends ValueSchema>\n\timplements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>\n{\n\tpublic readonly identifier: Name;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T;\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic create(data: TreeValue<T> | FlexTreeNode): TreeValue<T> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic constructor(name: Name, t: T) {\n\t\tconst schema: FlexLeafNodeSchema = new FlexLeafNodeSchema({ name: \"makeLeaf\" }, name, t);\n\t\tsetFlexSchemaFromClassSchema(this, schema);\n\t\tthis.identifier = name;\n\t\tthis.info = t;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<Name extends string, const T extends ValueSchema>(\n\tname: Name,\n\tt: T,\n): TreeNodeSchema<\n\t`com.fluidframework.leaf.${Name}`,\n\tNodeKind.Leaf,\n\tTreeValue<T>,\n\tTreeValue<T>\n> {\n\t// Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n\treturn new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);\n}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(\"string\", ValueSchema.String);\nexport const numberSchema = makeLeaf(\"number\", ValueSchema.Number);\nexport const booleanSchema = makeLeaf(\"boolean\", ValueSchema.Boolean);\nexport const nullSchema = makeLeaf(\"null\", ValueSchema.Null);\nexport const handleSchema = makeLeaf(\"handle\", ValueSchema.FluidHandle);\n"]}
@@ -78,7 +78,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
78
78
  * @param base - base schema type to extend.
79
79
  * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).
80
80
  */
81
- export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean): TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map>, MapNodeInsertableData<T>, ImplicitlyConstructable, T>;
81
+ export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean): TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, unknown>, MapNodeInsertableData<T>, ImplicitlyConstructable, T>;
82
82
  /**
83
83
  * Content which can be used to construct a Map node, explicitly or implicitly.
84
84
  * @system @public
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG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AEjC;;;;;;OAMG;IACH,MAAM,IAAI,gBAAgB,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE;;;;;;OAMG;IACH,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3E;;;;;;OAMG;IACH,OAAO,CACN,UAAU,EAAE,CACX,KAAK,EAAE,gCAAgC,CAAC,CAAC,CAAC,EAC1C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC,KACzD,IAAI,EAGT,OAAO,CAAC,EAAE,GAAG,GACX,IAAI,CAAC;CACR;AA0FD;;;;;GAKG;AAEH,wBAAgB,SAAS,CACxB,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACpC,KAAK,CAAC,uBAAuB,SAAS,OAAO,EAE7C,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,OAAO,2JA2DxB;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,IAC7D,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1E,yBAAyB,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -8,12 +8,11 @@ exports.mapSchema = void 0;
8
8
  const index_js_1 = require("../feature-libraries/index.js");
9
9
  const proxies_js_1 = require("./proxies.js");
10
10
  const proxyBinding_js_1 = require("./proxyBinding.js");
11
- const index_js_2 = require("./core/index.js");
12
11
  const schemaTypes_js_1 = require("./schemaTypes.js");
13
- const index_js_3 = require("./core/index.js");
12
+ const index_js_2 = require("./core/index.js");
14
13
  const toMapTree_js_1 = require("./toMapTree.js");
15
14
  const toFlexSchema_js_1 = require("./toFlexSchema.js");
16
- const index_js_4 = require("../util/index.js");
15
+ const index_js_3 = require("../util/index.js");
17
16
  const treeNodeValid_js_1 = require("./treeNodeValid.js");
18
17
  const handler = {
19
18
  getPrototypeOf: () => {
@@ -24,12 +23,19 @@ class CustomMapNodeBase extends treeNodeValid_js_1.TreeNodeValid {
24
23
  [Symbol.iterator]() {
25
24
  return this.entries();
26
25
  }
26
+ get innerNode() {
27
+ return (0, proxyBinding_js_1.getOrCreateInnerNode)(this);
28
+ }
29
+ editor(key) {
30
+ const field = this.innerNode.getBoxed((0, index_js_3.brand)(key));
31
+ return field.editor;
32
+ }
27
33
  delete(key) {
28
- const field = (0, proxyBinding_js_1.getOrCreateInnerNode)(this).getBoxed(key);
29
- field.editor.set(undefined, field.length === 0);
34
+ const field = this.innerNode.getBoxed((0, index_js_3.brand)(key));
35
+ this.editor(key).set(undefined, field.length === 0);
30
36
  }
31
37
  *entries() {
32
- const node = (0, proxyBinding_js_1.getOrCreateInnerNode)(this);
38
+ const node = this.innerNode;
33
39
  for (const key of node.keys()) {
34
40
  yield [
35
41
  key,
@@ -38,30 +44,30 @@ class CustomMapNodeBase extends treeNodeValid_js_1.TreeNodeValid {
38
44
  }
39
45
  }
40
46
  get(key) {
41
- const node = (0, proxyBinding_js_1.getOrCreateInnerNode)(this);
42
- const field = node.getBoxed(key);
47
+ const node = this.innerNode;
48
+ const field = node.getBoxed((0, index_js_3.brand)(key));
43
49
  return (0, proxies_js_1.getTreeNodeForField)(field);
44
50
  }
45
51
  has(key) {
46
- return (0, proxyBinding_js_1.getOrCreateInnerNode)(this).tryGetField((0, index_js_4.brand)(key)) !== undefined;
52
+ return this.innerNode.tryGetField((0, index_js_3.brand)(key)) !== undefined;
47
53
  }
48
54
  keys() {
49
- const node = (0, proxyBinding_js_1.getOrCreateInnerNode)(this);
55
+ const node = this.innerNode;
50
56
  return node.keys();
51
57
  }
52
58
  set(key, value) {
53
- const node = (0, proxyBinding_js_1.getOrCreateInnerNode)(this);
54
- const classSchema = (0, index_js_2.getSimpleNodeSchema)(node.schema);
55
- const mapTree = (0, toMapTree_js_1.mapTreeFromNodeData)(value, (0, schemaTypes_js_1.createFieldSchema)(schemaTypes_js_1.FieldKind.Optional, classSchema.info), node.context?.nodeKeyManager, (0, index_js_1.getSchemaAndPolicy)(node));
56
- const field = node.getBoxed(key);
57
- if (node.context !== undefined) {
59
+ const kernel = (0, index_js_2.getKernel)(this);
60
+ const node = this.innerNode;
61
+ const mapTree = (0, toMapTree_js_1.mapTreeFromNodeData)(value, (0, schemaTypes_js_1.createFieldSchema)(schemaTypes_js_1.FieldKind.Optional, kernel.schema.info), node.context.isHydrated() ? node.context.nodeKeyManager : undefined, (0, index_js_1.getSchemaAndPolicy)(node));
62
+ const field = node.getBoxed((0, index_js_3.brand)(key));
63
+ if (node.context.isHydrated()) {
58
64
  (0, proxies_js_1.prepareContentForHydration)(mapTree, node.context.checkout.forest);
59
65
  }
60
- field.editor.set(mapTree, field.length === 0);
66
+ this.editor(key).set(mapTree, field.length === 0);
61
67
  return this;
62
68
  }
63
69
  get size() {
64
- return (0, index_js_4.count)((0, proxyBinding_js_1.getOrCreateInnerNode)(this).keys());
70
+ return (0, index_js_3.count)(this.innerNode.keys());
65
71
  }
66
72
  *values() {
67
73
  for (const [, value] of this.entries()) {
@@ -75,7 +81,7 @@ class CustomMapNodeBase extends treeNodeValid_js_1.TreeNodeValid {
75
81
  }
76
82
  }
77
83
  }
78
- CustomMapNodeBase.kind = index_js_3.NodeKind.Map;
84
+ CustomMapNodeBase.kind = index_js_2.NodeKind.Map;
79
85
  /**
80
86
  * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.
81
87
  *
@@ -85,7 +91,8 @@ CustomMapNodeBase.kind = index_js_3.NodeKind.Map;
85
91
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
86
92
  function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype) {
87
93
  let flexSchema;
88
- class schema extends CustomMapNodeBase {
94
+ let unhydratedContext;
95
+ class Schema extends CustomMapNodeBase {
89
96
  static prepareInstance(instance, flexNode) {
90
97
  if (useMapPrototype) {
91
98
  return new Proxy(instance, handler);
@@ -93,24 +100,26 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype) {
93
100
  return instance;
94
101
  }
95
102
  static buildRawNode(instance, input) {
96
- return (0, index_js_1.getOrCreateMapTreeNode)(flexSchema, (0, toMapTree_js_1.mapTreeFromNodeData)(input, this));
103
+ return (0, index_js_1.getOrCreateMapTreeNode)(unhydratedContext, flexSchema, (0, toMapTree_js_1.mapTreeFromNodeData)(input, this));
97
104
  }
98
105
  static oneTimeSetup() {
99
- flexSchema = (0, toFlexSchema_js_1.getFlexSchema)(this);
106
+ const schema = this;
107
+ flexSchema = (0, toFlexSchema_js_1.getFlexSchema)(schema);
108
+ unhydratedContext = new index_js_1.UnhydratedContext((0, toFlexSchema_js_1.toFlexSchema)(schema));
100
109
  }
101
110
  // eslint-disable-next-line import/no-deprecated
102
- get [index_js_3.typeNameSymbol]() {
111
+ get [index_js_2.typeNameSymbol]() {
103
112
  return identifier;
104
113
  }
105
- get [index_js_3.typeSchemaSymbol]() {
106
- return schema.constructorCached?.constructor;
114
+ get [index_js_2.typeSchemaSymbol]() {
115
+ return Schema.constructorCached?.constructor;
107
116
  }
108
117
  }
109
- schema.constructorCached = undefined;
110
- schema.identifier = identifier;
111
- schema.info = info;
112
- schema.implicitlyConstructable = implicitlyConstructable;
113
- const schemaErased = schema;
118
+ Schema.constructorCached = undefined;
119
+ Schema.identifier = identifier;
120
+ Schema.info = info;
121
+ Schema.implicitlyConstructable = implicitlyConstructable;
122
+ const schemaErased = Schema;
114
123
  return schemaErased;
115
124
  }
116
125
  exports.mapSchema = mapSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAMuC;AACvC,6CAKsB;AACtB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M,CAAC;IACX,OAAO,YAAY,CAAC;AACrB,CAAC;AA/DD,8BA+DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype FlexMapNodeSchema,\n\ttype FlexTreeNode,\n\ttype MapTreeNode,\n\tgetOrCreateMapTreeNode,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype FactoryContent,\n\ttype InsertableContent,\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nimport { getOrCreateInnerNode } from \"./proxyBinding.js\";\nimport { getSimpleNodeSchema } from \"./core/index.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n} from \"./core/index.js\";\nimport { mapTreeFromNodeData } from \"./toMapTree.js\";\nimport { getFlexSchema } from \"./toFlexSchema.js\";\nimport { brand, count, type RestrictiveReadonlyRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\nconst handler: ProxyHandler<TreeMapNode> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\tpublic delete(key: string): void {\n\t\tconst field = getOrCreateInnerNode(this).getBoxed(key);\n\t\tfield.editor.set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = getOrCreateInnerNode(this);\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = getOrCreateInnerNode(this);\n\t\tconst field = node.getBoxed(key);\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn getOrCreateInnerNode(this).tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = getOrCreateInnerNode(this);\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): TreeMapNode {\n\t\tconst node = getOrCreateInnerNode(this);\n\t\tconst classSchema = getSimpleNodeSchema(node.schema);\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, classSchema.info as ImplicitAllowedTypes),\n\t\t\tnode.context?.nodeKeyManager,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(key);\n\t\tif (node.context !== undefined) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tfield.editor.set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(getOrCreateInnerNode(this).keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n) {\n\tlet flexSchema: FlexMapNodeSchema;\n\n\tclass schema extends CustomMapNodeBase<T> implements TreeMapNode<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<schema>(instance as schema, handler);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): MapTreeNode {\n\t\t\treturn getOrCreateMapTreeNode(\n\t\t\t\tflexSchema,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): void {\n\t\t\tflexSchema = getFlexSchema(this as unknown as TreeNodeSchema) as FlexMapNodeSchema;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: TreeNodeSchemaClass<\n\t\tTName,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\tImplicitlyConstructable,\n\t\tT\n\t> = schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveReadonlyRecord<string, InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n"]}
1
+ {"version":3,"file":"mapNode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,EAAC,KAAuB,EAAE,IAAuC,CAAC,CACrF,CAAC;QACH,CAAC;QAIS,MAAM,CAAU,YAAY;YACrC,MAAM,MAAM,GAAG,IAAiC,CAAC;YACjD,UAAU,GAAG,IAAA,+BAAa,EAAC,MAAM,CAAsB,CAAC;YACxD,iBAAiB,GAAG,IAAI,4BAAiB,CAAC,IAAA,8BAAY,EAAC,MAAM,CAAC,CAAC,CAAC;QACjE,CAAC;QAOD,gDAAgD;QAChD,IAAW,CAAC,yBAAc,CAAC;YAC1B,OAAO,UAAU,CAAC;QACnB,CAAC;QACD,IAAW,CAAC,2BAAgB,CAAC;YAC5B,OAAO,MAAM,CAAC,iBAAiB,EAAE,WAA6C,CAAC;QAChF,CAAC;;IAnByB,wBAAiB,GAAgC,SAAS,CAAC;IAQ9D,iBAAU,GAAG,UAAU,CAAC;IACxB,WAAI,GAAG,IAAI,CAAC;IACZ,8BAAuB,GAC7C,uBAAuB,CAAC;IAU1B,MAAM,YAAY,GAOd,MAAM,CAAC;IACX,OAAO,YAAY,CAAC;AACrB,CAAC;AAnED,8BAmEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype FlexMapNodeSchema,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype MapTreeNode,\n\ttype OptionalFieldEditBuilder,\n\tUnhydratedContext,\n\tgetOrCreateMapTreeNode,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport { getTreeNodeForField, prepareContentForHydration } from \"./proxies.js\";\nimport { getOrCreateInnerNode } from \"./proxyBinding.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n} from \"./core/index.js\";\nimport {\n\tmapTreeFromNodeData,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"./toMapTree.js\";\nimport { getFlexSchema, toFlexSchema } from \"./toFlexSchema.js\";\nimport { brand, count, type RestrictiveReadonlyRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\nimport type { ExclusiveMapTree } from \"../core/index.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\nconst handler: ProxyHandler<TreeMapNode> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getOrCreateInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<ExclusiveMapTree> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): TreeMapNode {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context.isHydrated() ? node.context.nodeKeyManager : undefined,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\t\tif (node.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n) {\n\tlet flexSchema: FlexMapNodeSchema;\n\tlet unhydratedContext: UnhydratedContext;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNode<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): MapTreeNode {\n\t\t\treturn getOrCreateMapTreeNode(\n\t\t\t\tunhydratedContext,\n\t\t\t\tflexSchema,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): void {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tflexSchema = getFlexSchema(schema) as FlexMapNodeSchema;\n\t\t\tunhydratedContext = new UnhydratedContext(toFlexSchema(schema));\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: TreeNodeSchemaClass<\n\t\tTName,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\tImplicitlyConstructable,\n\t\tT\n\t> = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveReadonlyRecord<string, InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n"]}
@@ -4,14 +4,14 @@
4
4
  */
5
5
  import type { FieldKey } from "../core/index.js";
6
6
  import { type FlexTreeField } from "../feature-libraries/index.js";
7
- import { type InsertableContent } from "./proxies.js";
8
7
  import { type ImplicitFieldSchema, type TreeFieldFromImplicitField, type InsertableTreeFieldFromImplicitField, type FieldSchema, FieldKind } from "./schemaTypes.js";
9
8
  import { NodeKind, type WithType, type TreeNode } from "./core/index.js";
9
+ import { type InsertableContent } from "./toMapTree.js";
10
10
  import { type RestrictiveReadonlyRecord, type FlattenKeys } from "../util/index.js";
11
11
  import type { ObjectNodeSchema, ObjectNodeSchemaInternalData } from "./objectNodeTypes.js";
12
12
  /**
13
13
  * Helper used to produce types for object nodes.
14
- * @public
14
+ * @system @public
15
15
  */
16
16
  export type ObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
17
17
  -readonly [Property in keyof T]: TreeFieldFromImplicitField<T[Property]>;
@@ -27,7 +27,7 @@ export type ObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, I
27
27
  * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.
28
28
  * @public
29
29
  */
30
- export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object>;
30
+ export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName, NodeKind.Object, T>;
31
31
  /**
32
32
  * Type utility for determining whether or not an implicit field schema has a default value.
33
33
  *
@@ -35,13 +35,15 @@ export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitF
35
35
  * TODO: Account for field schemas with default value providers.
36
36
  * For now, this only captures field kinds that we know always have defaults - optional fields and identifier fields.
37
37
  *
38
- * @public
38
+ * @system @public
39
39
  */
40
40
  export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSchema<FieldKind.Optional | FieldKind.Identifier> ? true : false;
41
41
  /**
42
42
  * Helper used to produce types for:
43
43
  *
44
44
  * 1. Insertable content which can be used to construct an object node.
45
+ * In this case, only own properties are considered.
46
+ * This reduces the risk of incorrectly interpreting data at the cost of occasionally requiring users to convert data into a compatible format.
45
47
  *
46
48
  * 2. Insertable content which is an unhydrated object node.
47
49
  *
@@ -49,7 +51,7 @@ export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSche
49
51
  *
50
52
  * @privateRemarks TODO: consider separating these cases into different types.
51
53
  *
52
- * @public
54
+ * @system @public
53
55
  */
54
56
  export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = FlattenKeys<{
55
57
  readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property]>;
@@ -57,10 +59,10 @@ export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord
57
59
  readonly [Property in keyof T as FieldHasDefault<T[Property]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property]>;
58
60
  }>;
59
61
  /**
60
- * Maps from simple field keys ("view" keys) to information about the field.
62
+ * Maps from simple field keys ("property" keys) to information about the field.
61
63
  *
62
64
  * @remarks
63
- * A missing entry for a given view key indicates that no such field exists.
65
+ * A missing entry for a given property key indicates that no such field exists.
64
66
  * Keys with symbols are currently never used, but allowed to make lookups on non-field things
65
67
  * (returning undefined) easier.
66
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"objectNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAIN,KAAK,aAAa,EAQlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,KAAK,iBAAiB,EAGtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,KAAK,mBAAmB,EAGxB,KAAK,0BAA0B,EAC/B,KAAK,oCAAoC,EACzC,KAAK,WAAW,EAGhB,SAAS,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,QAAQ,EACR,KAAK,QAAQ,EAKb,KAAK,QAAQ,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,yBAAyB,EAAQ,KAAK,WAAW,EAAE,MAAM,k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