@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 +0,0 @@
1
- {"version":3,"file":"simpleSchemaToJsonSchema.js","sourceRoot":"","sources":["../../src/simple-tree/simpleSchemaToJsonSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AACtE,uEAAsE;AACtE,+CAA+C;AAC/C,+CAA+C;AAa/C,qDAA6C;AAS7C,8CAA2C;AAE3C;;;GAGG;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AAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,MAAM,KAAK,GAAoB,EAAE,CAAC;QAClC,KAAK,MAAM,WAAW,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;QAC1C,CAAC;QAED,UAAU,CAAC,GAAG,CAAC,GAAG;YACjB,KAAK;SACL,CAAC;QACF,IAAI,KAAK,CAAC,IAAI,KAAK,0BAAS,CAAC,QAAQ,EAAE,CAAC;YACvC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,mBAAmB,EAAE,mBAAQ,CAAC,MAAM;QACpC,UAAU;QACV,QAAQ;QACR,oBAAoB,EAAE,KAAK;KAC3B,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,MAA2B;IACxD,MAAM,YAAY,GAAoB,EAAE,CAAC;IACzC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACpC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,mBAAmB,EAAE,mBAAQ,CAAC,GAAG;QACjC,iBAAiB,EAAE;YAClB,MAAM,EAAE;gBACP,KAAK,EAAE,YAAY;aACnB;SACD;KACD,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACxC,OAAO;QACN,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC;KAC/B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACtC,OAAO,WAAW,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { ValueSchema } from \"../core/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\nimport type {\n\tJsonArrayNodeSchema,\n\tJsonFieldSchema,\n\tJsonSchemaRef,\n\tJsonRefPath,\n\tJsonLeafNodeSchema,\n\tJsonMapNodeSchema,\n\tJsonNodeSchema,\n\tJsonObjectNodeSchema,\n\tJsonTreeSchema,\n\tJsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nimport { FieldKind } from \"./schemaTypes.js\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleTreeSchema,\n} from \"./simpleSchema.js\";\nimport { NodeKind } from \"./core/index.js\";\n\n/**\n * Generates a JSON Schema representation from a simple tree schema.\n * @internal\n */\nexport function toJsonSchema(schema: SimpleTreeSchema): JsonTreeSchema {\n\tconst definitions = convertDefinitions(schema.definitions);\n\n\tconst anyOf: JsonSchemaRef[] = [];\n\tfor (const allowedType of schema.allowedTypes) {\n\t\tanyOf.push(createSchemaRef(allowedType));\n\t}\n\n\treturn {\n\t\t$defs: definitions,\n\t\tanyOf,\n\t};\n}\n\nfunction convertDefinitions(\n\tdefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n): Record<string, JsonNodeSchema> {\n\tconst result: Record<string, JsonNodeSchema> = {};\n\tfor (const [key, value] of definitions) {\n\t\tresult[key] = convertNodeSchema(value);\n\t}\n\treturn result;\n}\n\n/**\n * Private symbol under which the results of {@link convertNodeSchema} are cached on an input {@link SimpleNodeSchema}.\n */\nconst nodeJsonSchemaCache = new WeakMap<SimpleNodeSchema, JsonNodeSchema>();\n\n/**\n * Converts an input {@link SimpleNodeSchema} to a {@link JsonNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n */\nfunction convertNodeSchema(schema: SimpleNodeSchema): JsonNodeSchema {\n\treturn getOrCreate(nodeJsonSchemaCache, schema, () => {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array:\n\t\t\t\treturn convertArrayNodeSchema(schema);\n\t\t\tcase NodeKind.Leaf:\n\t\t\t\treturn convertLeafNodeSchema(schema);\n\t\t\tcase NodeKind.Map:\n\t\t\t\treturn convertMapNodeSchema(schema);\n\t\t\tcase NodeKind.Object:\n\t\t\t\treturn convertObjectNodeSchema(schema);\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError(`Unknown node schema kind: ${(schema as SimpleNodeSchema).kind}`);\n\t\t}\n\t});\n}\n\nfunction convertArrayNodeSchema(schema: SimpleArrayNodeSchema): JsonArrayNodeSchema {\n\tconst allowedTypes: JsonSchemaRef[] = [];\n\tschema.allowedTypes.forEach((type) => {\n\t\tallowedTypes.push(createSchemaRef(type));\n\t});\n\treturn {\n\t\ttype: \"array\",\n\t\t_treeNodeSchemaKind: NodeKind.Array,\n\t\titems: {\n\t\t\tanyOf: allowedTypes,\n\t\t},\n\t};\n}\n\nfunction convertLeafNodeSchema(schema: SimpleLeafNodeSchema): JsonLeafNodeSchema {\n\tlet type: JsonLeafSchemaType;\n\tswitch (schema.leafKind) {\n\t\tcase ValueSchema.String:\n\t\t\ttype = \"string\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Number:\n\t\t\ttype = \"number\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Boolean:\n\t\t\ttype = \"boolean\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Null:\n\t\t\ttype = \"null\";\n\t\t\tbreak;\n\t\tcase ValueSchema.FluidHandle:\n\t\t\tthrow new UsageError(\"Fluid handles are not supported via JSON Schema.\");\n\t\tdefault:\n\t\t\tunreachableCase(schema.leafKind);\n\t}\n\n\treturn {\n\t\ttype,\n\t\t_treeNodeSchemaKind: NodeKind.Leaf,\n\t};\n}\n\nfunction convertObjectNodeSchema(schema: SimpleObjectNodeSchema): JsonObjectNodeSchema {\n\tconst properties: Record<string, JsonFieldSchema> = {};\n\tconst required: string[] = [];\n\tfor (const [key, value] of Object.entries(schema.fields)) {\n\t\tconst anyOf: JsonSchemaRef[] = [];\n\t\tfor (const allowedType of value.allowedTypes) {\n\t\t\tanyOf.push(createSchemaRef(allowedType));\n\t\t}\n\n\t\tproperties[key] = {\n\t\t\tanyOf,\n\t\t};\n\t\tif (value.kind === FieldKind.Required) {\n\t\t\trequired.push(key);\n\t\t}\n\t}\n\treturn {\n\t\ttype: \"object\",\n\t\t_treeNodeSchemaKind: NodeKind.Object,\n\t\tproperties,\n\t\trequired,\n\t\tadditionalProperties: false,\n\t};\n}\n\nfunction convertMapNodeSchema(schema: SimpleMapNodeSchema): JsonMapNodeSchema {\n\tconst allowedTypes: JsonSchemaRef[] = [];\n\tschema.allowedTypes.forEach((type) => {\n\t\tallowedTypes.push(createSchemaRef(type));\n\t});\n\treturn {\n\t\ttype: \"object\",\n\t\t_treeNodeSchemaKind: NodeKind.Map,\n\t\tpatternProperties: {\n\t\t\t\"^.*$\": {\n\t\t\t\tanyOf: allowedTypes,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction createSchemaRef(schemaId: string): JsonSchemaRef {\n\treturn {\n\t\t\"$ref\": createRefPath(schemaId),\n\t};\n}\n\nfunction createRefPath(schemaId: string): JsonRefPath {\n\treturn `#/$defs/${schemaId}`;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewSchemaToSimpleSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/viewSchemaToSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,oBAAoB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAOX,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAM3B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,gBAAgB,CAYjF"}
@@ -1 +0,0 @@
1
- {"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;IACzD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,mBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YACpB,mCAAmC;YACnC,MAAM;QACP,CAAC;QACD,KAAK,mBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YACnB,0FAA0F;YAE1F,4DAA4D;YAC5D,MAAM,WAAW,GAAG,IAAA,qCAAoB,EAAC,MAAM,CAAC,IAA4B,CAAC,CAAC;YAC9E,iCAAiC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAC5D,MAAM;QACP,CAAC;QACD,KAAK,mBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACrB,6FAA6F;YAE7F,4DAA4D;YAC5D,MAAM,WAAW,GAAG,IAAA,qCAAoB,EAAC,MAAM,CAAC,IAA4B,CAAC,CAAC;YAC9E,iCAAiC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAC5D,MAAM;QACP,CAAC;QACD,KAAK,mBAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACtB,IAAA,iBAAM,EAAC,IAAA,uCAAkB,EAAC,MAAM,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvE,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBACvC,iCAAiC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACvD,CAAC;YACD,MAAM;QACP,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tnormalizeFieldSchema,\n\ttype FieldSchema,\n\ttype ImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleTreeSchema,\n} from \"./simpleSchema.js\";\nimport type { ValueSchema } from \"../core/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\nimport { isObjectNodeSchema, type ObjectNodeSchema } from \"./objectNodeTypes.js\";\nimport { NodeKind, type TreeNodeSchema } from \"./core/index.js\";\n\n/**\n * Converts a \"view\" schema to a \"simple\" schema representation.\n */\nexport function toSimpleTreeSchema(schema: ImplicitAllowedTypes): SimpleTreeSchema {\n\tconst normalizedSchema = normalizeFieldSchema(schema);\n\n\tconst allowedTypes = allowedTypesFromFieldSchema(normalizedSchema);\n\n\tconst definitions = new Map<string, SimpleNodeSchema>();\n\tpopulateSchemaDefinitionsForField(normalizedSchema, definitions);\n\n\treturn {\n\t\tallowedTypes,\n\t\tdefinitions,\n\t};\n}\n\n/**\n * Cache in which the results of {@link toSimpleNodeSchema} are saved.\n */\nconst simpleNodeSchemaCache = new WeakMap<TreeNodeSchema, SimpleNodeSchema>();\n\n/**\n * Creates a {@link SimpleNodeSchema} from a {@link TreeNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n */\nfunction toSimpleNodeSchema(schema: TreeNodeSchema): SimpleNodeSchema {\n\treturn getOrCreate(simpleNodeSchemaCache, schema, () => {\n\t\tconst kind = schema.kind;\n\t\tswitch (kind) {\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\treturn leafSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Map: {\n\t\t\t\treturn mapSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Array: {\n\t\t\t\treturn arraySchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xa06 /* Expected object schema */);\n\t\t\t\treturn objectSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(kind);\n\t\t\t}\n\t\t}\n\t});\n}\n\n// TODO: Use a stronger type for leaf schemas once one is available (see object schema handler for an example).\nfunction leafSchemaToSimpleSchema(schema: TreeNodeSchema): SimpleLeafNodeSchema {\n\treturn {\n\t\tkind: NodeKind.Leaf,\n\t\tleafKind: schema.info as ValueSchema,\n\t};\n}\n\n// TODO: Use a stronger type for array schemas once one is available (see object schema handler for an example).\nfunction arraySchemaToSimpleSchema(schema: TreeNodeSchema): SimpleArrayNodeSchema {\n\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\tconst allowedTypes = allowedTypesFromFieldSchema(fieldSchema);\n\treturn {\n\t\tkind: NodeKind.Array,\n\t\tallowedTypes,\n\t};\n}\n\n// TODO: Use a stronger type for map schemas once one is available (see object schema handler for an example).\nfunction mapSchemaToSimpleSchema(schema: TreeNodeSchema): SimpleMapNodeSchema {\n\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\tconst allowedTypes = allowedTypesFromFieldSchema(fieldSchema);\n\treturn {\n\t\tkind: NodeKind.Map,\n\t\tallowedTypes,\n\t};\n}\n\nfunction objectSchemaToSimpleSchema(schema: ObjectNodeSchema): SimpleObjectNodeSchema {\n\tconst fields: Record<string, SimpleFieldSchema> = {};\n\tfor (const [key, field] of schema.fields) {\n\t\tfields[key] = fieldSchemaToSimpleSchema(field);\n\t}\n\treturn {\n\t\tkind: NodeKind.Object,\n\t\tfields,\n\t};\n}\n\n/**\n * Private symbol under which the results of {@link toSimpleNodeSchema} are cached on an input {@link TreeNodeSchema}.\n */\nconst simpleFieldSchemaCacheSymbol = Symbol(\"simpleFieldSchemaCache\");\n\nfunction fieldSchemaToSimpleSchema(schema: FieldSchema): SimpleFieldSchema {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tif ((schema as any)[simpleFieldSchemaCacheSymbol] !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\treturn (schema as any)[simpleFieldSchemaCacheSymbol] as SimpleFieldSchema;\n\t}\n\n\tconst allowedTypes = allowedTypesFromFieldSchema(schema);\n\tconst result = {\n\t\tkind: schema.kind,\n\t\tallowedTypes,\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(schema as any)[simpleFieldSchemaCacheSymbol] = result;\n\n\treturn result;\n}\n\nfunction allowedTypesFromFieldSchema(schema: FieldSchema): Set<string> {\n\tconst allowedTypes = new Set<string>();\n\tfor (const type of schema.allowedTypeSet) {\n\t\tallowedTypes.add(type.identifier);\n\t}\n\treturn allowedTypes;\n}\n\n/**\n * Recursively populates `definitions` by walking the input field schema tree.\n */\nfunction populateSchemaDefinitionsForField(\n\tschema: FieldSchema,\n\tdefinitions: Map<string, SimpleNodeSchema>,\n): void {\n\tfor (const child of schema.allowedTypeSet) {\n\t\tpopulateSchemaDefinitionsForNode(child, definitions);\n\t}\n}\n\n/**\n * Recursively populates `definitions` by walking the input node schema tree.\n */\nfunction populateSchemaDefinitionsForNode(\n\tschema: TreeNodeSchema,\n\tdefinitions: Map<string, SimpleNodeSchema>,\n): void {\n\tif (definitions.has(schema.identifier)) {\n\t\t// If the definition has already been populated, no need to recurse.\n\t\treturn;\n\t}\n\n\t// Populate definition for this schema\n\tdefinitions.set(schema.identifier, toSimpleNodeSchema(schema));\n\n\t// Recurse into children to populate definitions for them\n\tconst kind = schema.kind;\n\tswitch (kind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\t// Leaf node, so no need to recurse\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\t// TODO: Utilize a map schema type-guard once one exists (see object case for an example).\n\n\t\t\t// Recursively populate definitions for allowed map children\n\t\t\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\t\t\tpopulateSchemaDefinitionsForField(fieldSchema, definitions);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\t// TODO: Utilize an array schema type-guard once one exists (see object case for an example).\n\n\t\t\t// Recursively populate definitions for allowed map children\n\t\t\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\t\t\tpopulateSchemaDefinitionsForField(fieldSchema, definitions);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Object: {\n\t\t\tassert(isObjectNodeSchema(schema), 0xa07 /* Expected object schema */);\n\t\t\tfor (const [, field] of schema.fields) {\n\t\t\t\tpopulateSchemaDefinitionsForField(field, definitions);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(kind);\n\t\t}\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/revertible/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/revertible/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Revertible, RevertibleStatus } from \"./revertible.js\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"revertible.d.ts","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,oBAAY,gBAAgB;IAC3B,sCAAsC;IACtC,KAAK,IAAA;IACL,0EAA0E;IAC1E,QAAQ,IAAA;CACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"revertible.js","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmCH;;;;GAIG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,sCAAsC;IACtC,yDAAK,CAAA;IACL,0EAA0E;IAC1E,+DAAQ,CAAA;AACT,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Allows reversion of a change made to SharedTree.\n *\n * @remarks\n * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.\n *\n * @sealed @public\n */\nexport interface Revertible {\n\t/**\n\t * The current status of the revertible.\n\t */\n\treadonly status: RevertibleStatus;\n\n\t/**\n\t * Reverts the associated change and disposes it.\n\t */\n\trevert(): void;\n\t/**\n\t * Reverts the associated change and optionally disposes it.\n\t *\n\t * @param dispose - If true, the revertible will be disposed after being reverted.\n\t * If false, the revertible will remain valid. This can be useful for scenarios where the revert may be dropped\n\t * due to merge conflicts, and one wants to attempt reverting again.\n\t */\n\trevert(dispose: boolean): void;\n\n\t/**\n\t * Disposes this revertible, allowing associated resources to be released.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The status of a {@link Revertible}.\n *\n * @public\n */\nexport enum RevertibleStatus {\n\t/** The revertible can be reverted. */\n\tValid,\n\t/** The revertible has been disposed. Reverting it will have no effect. */\n\tDisposed,\n}\n"]}
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { SchemaBuilder } from "./schemaBuilder.js";
6
- export { cursorToJsonObject, jsonArray, jsonObject, jsonRoot, jsonSchema, singleJsonCursor, typedJsonCursor, type TypedJsonCompatible, type TypedJsonCompatibleObject, } from "./json/index.js";
7
- export { leaf } from "./leafDomain.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { SchemaBuilder } from "./schemaBuilder.js";
6
- export { cursorToJsonObject, jsonArray, jsonObject, jsonRoot, jsonSchema, singleJsonCursor, typedJsonCursor, } from "./json/index.js";
7
- export { leaf } from "./leafDomain.js";
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,eAAe,GAGf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SchemaBuilder } from \"./schemaBuilder.js\";\nexport {\n\tcursorToJsonObject,\n\tjsonArray,\n\tjsonObject,\n\tjsonRoot,\n\tjsonSchema,\n\tsingleJsonCursor,\n\ttypedJsonCursor,\n\ttype TypedJsonCompatible,\n\ttype TypedJsonCompatibleObject,\n} from \"./json/index.js\";\n\nexport { leaf } from \"./leafDomain.js\";\n"]}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { singleJsonCursor, cursorToJsonObject, typedJsonCursor, type TypedJsonCompatible, type TypedJsonCompatibleObject, } from "./jsonCursor.js";
6
- export { jsonSchema, jsonObject, jsonArray, jsonRoot } from "./jsonDomainSchema.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domains/json/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export { singleJsonCursor, cursorToJsonObject, typedJsonCursor, } from "./jsonCursor.js";
6
- export { jsonSchema, jsonObject, jsonArray, jsonRoot } from "./jsonDomainSchema.js";
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domains/json/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tsingleJsonCursor,\n\tcursorToJsonObject,\n\ttypedJsonCursor,\n\ttype TypedJsonCompatible,\n\ttype TypedJsonCompatibleObject,\n} from \"./jsonCursor.js\";\nexport { jsonSchema, jsonObject, jsonArray, jsonRoot } from \"./jsonDomainSchema.js\";\n"]}
@@ -1,52 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { type ITreeCursor, type ITreeCursorSynchronous } from "../../core/index.js";
6
- import { TreeNodeSchemaBase } from "../../feature-libraries/index.js";
7
- import { type JsonCompatible } from "../../util/index.js";
8
- import type { IFluidHandle } from "@fluidframework/core-interfaces/internal";
9
- /**
10
- * Used to read generic json compatible data as a tree in the JSON domain.
11
- * The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.
12
- *
13
- * @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.
14
- */
15
- export declare function singleJsonCursor(root: JsonCompatible): ITreeCursorSynchronous;
16
- /**
17
- * Extract a JS object tree from the contents of the given ITreeCursor.
18
- * Assumes that ITreeCursor contains only unaugmented JsonTypes.
19
- */
20
- export declare function cursorToJsonObject(reader: ITreeCursor): JsonCompatible;
21
- /** Used to construct a {@link TypedJsonCursor} */
22
- export interface TypedJsonCompatibleObject {
23
- [key: string]: TypedJsonCompatible;
24
- [typedJsonSymbol]: string | TreeNodeSchemaBase;
25
- }
26
- /** Used to construct a {@link TypedJsonCursor} */
27
- export type TypedJsonCompatible = JsonCompatible | TypedJsonCompatibleObject | TypedJsonCompatible[] | IFluidHandle | JsonCompatible;
28
- declare const typedJsonSymbol: unique symbol;
29
- /**
30
- * A variant of {@link singleJsonCursor} which allows types to be provided for nodes.
31
- *
32
- * @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.
33
- *
34
- * This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an "array node" but are directly interpreted as sequence fields).
35
- *
36
- * It also allows Fluid handles as input.
37
- *
38
- * @example
39
- * ```ts
40
- * const cursor = typedJsonCursor({
41
- * [typedJsonCursor.type]: Point,
42
- * x: 3,
43
- * y: 42
44
- * });
45
- * ```
46
- */
47
- declare const singleTypedJsonCursor: {
48
- (root: TypedJsonCompatible): ITreeCursorSynchronous;
49
- type: typeof typedJsonSymbol;
50
- };
51
- export { singleTypedJsonCursor as typedJsonCursor };
52
- //# sourceMappingURL=jsonCursor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonCursor.d.ts","sourceRoot":"","sources":["../../../src/domains/json/jsonCursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGN,kBAAkB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKlF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAqE7E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,sBAAsB,CAE7E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,CAqCtE;AAID,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACnC,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAC/C;AAED,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAC5B,cAAc,GACd,yBAAyB,GACzB,mBAAmB,EAAE,GACrB,YAAY,GACZ,cAAc,CAAC;AAElB,QAAA,MAAM,eAAe,eAA6B,CAAC;AAyDnD;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,qBAAqB;WAAmB,mBAAmB,GAAG,sBAAsB;;CAEzF,CAAC;AAIF,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAC"}
@@ -1,192 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { assert } from "@fluidframework/core-utils/internal";
6
- import { EmptyKey, mapCursorField, mapCursorFields, } from "../../core/index.js";
7
- import { stackTreeNodeCursor, TreeNodeSchemaBase, } from "../../feature-libraries/index.js";
8
- import { brand, isReadonlyArray } from "../../util/index.js";
9
- import { leaf } from "../leafDomain.js";
10
- import { jsonArray, jsonObject } from "./jsonDomainSchema.js";
11
- import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
12
- const adapter = {
13
- value: (node) => node !== null && typeof node === "object"
14
- ? undefined // arrays and objects have no defined value
15
- : node, // null, boolean, numbers, and strings are their own values
16
- type: (node) => {
17
- const type = typeof node;
18
- switch (type) {
19
- case "number":
20
- return leaf.number.name;
21
- case "string":
22
- return leaf.string.name;
23
- case "boolean":
24
- return leaf.boolean.name;
25
- default:
26
- if (node === null) {
27
- return leaf.null.name;
28
- }
29
- else if (isReadonlyArray(node)) {
30
- return jsonArray.name;
31
- }
32
- else {
33
- return jsonObject.name;
34
- }
35
- }
36
- },
37
- keysFromNode: (node) => {
38
- switch (typeof node) {
39
- case "object":
40
- if (node === null) {
41
- return [];
42
- }
43
- else if (isReadonlyArray(node)) {
44
- return node.length === 0 ? [] : [EmptyKey];
45
- }
46
- else {
47
- return Object.keys(node);
48
- }
49
- default:
50
- return [];
51
- }
52
- },
53
- getFieldFromNode: (node, key) => {
54
- // Object.prototype.hasOwnProperty can return true for strings (ex: with key "0"), so we have to filter them out.
55
- // Rather than just special casing strings, we can handle them with an early return for all primitives.
56
- if (typeof node !== "object") {
57
- return [];
58
- }
59
- if (node === null) {
60
- return [];
61
- }
62
- if (isReadonlyArray(node)) {
63
- return key === EmptyKey ? node : [];
64
- }
65
- if (Object.prototype.hasOwnProperty.call(node, key)) {
66
- const field = node[key];
67
- assert(field !== undefined, 0x41e /* explicit undefined fields should not be preserved in JSON */);
68
- return [field];
69
- }
70
- return [];
71
- },
72
- };
73
- /**
74
- * Used to read generic json compatible data as a tree in the JSON domain.
75
- * The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.
76
- *
77
- * @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.
78
- */
79
- export function singleJsonCursor(root) {
80
- return stackTreeNodeCursor(adapter, root);
81
- }
82
- /**
83
- * Extract a JS object tree from the contents of the given ITreeCursor.
84
- * Assumes that ITreeCursor contains only unaugmented JsonTypes.
85
- */
86
- export function cursorToJsonObject(reader) {
87
- const type = reader.type;
88
- switch (type) {
89
- case leaf.number.name:
90
- case leaf.boolean.name:
91
- case leaf.string.name:
92
- assert(reader.value !== undefined, 0x84f /* out of schema: missing value */);
93
- assert(!isFluidHandle(reader.value), 0x850 /* out of schema: unexpected FluidHandle */);
94
- return reader.value;
95
- case jsonArray.name: {
96
- reader.enterField(EmptyKey);
97
- const result = mapCursorField(reader, cursorToJsonObject);
98
- reader.exitField();
99
- return result;
100
- }
101
- case jsonObject.name: {
102
- const result = {};
103
- mapCursorFields(reader, (cursor) => {
104
- const key = cursor.getFieldKey();
105
- assert(cursor.firstNode(), 0x420 /* expected non-empty field */);
106
- // like `result[key] = cursorToJsonObject(reader);` except safe when keyString == "__proto__".
107
- Object.defineProperty(result, key, {
108
- enumerable: true,
109
- configurable: true,
110
- writable: true,
111
- value: cursorToJsonObject(reader),
112
- });
113
- assert(!cursor.nextNode(), 0x421 /* expected exactly one node */);
114
- });
115
- return result;
116
- }
117
- default: {
118
- assert(type === leaf.null.name, 0x422 /* unexpected type */);
119
- return null;
120
- }
121
- }
122
- }
123
- const typedJsonSymbol = Symbol("JSON Cursor Type");
124
- function isObject(json) {
125
- if (typeof json === "object" && json !== null) {
126
- const typed = json;
127
- return typed[typedJsonSymbol] !== undefined;
128
- }
129
- return false;
130
- }
131
- const typedAdapter = {
132
- value: (node) => {
133
- if (isFluidHandle(node)) {
134
- return node;
135
- }
136
- // TODO: Get rid of this cast by combining TypedJsonCompatible and JsonCompatible into a single cursor with flags to configure behavior.
137
- // This cast is necessary because TypedJsonCompatible can have Fluid handles underneath it, however, `adapter` only cares if `node` itself is a FluidHandle, which it is not.
138
- return adapter.value(node);
139
- },
140
- type: (node) => {
141
- if (isFluidHandle(node)) {
142
- return leaf.handle.name;
143
- }
144
- if (isObject(node)) {
145
- const type = node[typedJsonSymbol];
146
- return type instanceof TreeNodeSchemaBase ? type.name : brand(type);
147
- }
148
- return adapter.type(node);
149
- },
150
- keysFromNode: (node) => {
151
- if (isFluidHandle(node)) {
152
- return [];
153
- }
154
- return adapter.keysFromNode(node);
155
- },
156
- getFieldFromNode: (node, key) => {
157
- if (isFluidHandle(node)) {
158
- return [];
159
- }
160
- const field = adapter.getFieldFromNode(node, key);
161
- if (isReadonlyArray(field) && field.length === 1 && isReadonlyArray(field[0])) {
162
- // If the field is an array wrapping another array, then unbox to the inner array
163
- return field[0];
164
- }
165
- return field;
166
- },
167
- };
168
- /**
169
- * A variant of {@link singleJsonCursor} which allows types to be provided for nodes.
170
- *
171
- * @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.
172
- *
173
- * This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an "array node" but are directly interpreted as sequence fields).
174
- *
175
- * It also allows Fluid handles as input.
176
- *
177
- * @example
178
- * ```ts
179
- * const cursor = typedJsonCursor({
180
- * [typedJsonCursor.type]: Point,
181
- * x: 3,
182
- * y: 42
183
- * });
184
- * ```
185
- */
186
- const singleTypedJsonCursor = function (root) {
187
- return stackTreeNodeCursor(typedAdapter, root);
188
- };
189
- singleTypedJsonCursor.type = typedJsonSymbol;
190
- export { singleTypedJsonCursor as typedJsonCursor };
191
- // #endregion TypedJsonCursor
192
- //# sourceMappingURL=jsonCursor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonCursor.js","sourceRoot":"","sources":["../../../src/domains/json/jsonCursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,QAAQ,EAIR,cAAc,EACd,eAAe,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAGvE,MAAM,OAAO,GAAkC;IAC9C,KAAK,EAAE,CAAC,IAAoB,EAAE,EAAE,CAC/B,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QACxC,CAAC,CAAC,SAAS,CAAC,2CAA2C;QACvD,CAAC,CAAC,IAAI,EAAE,2DAA2D;IACrE,IAAI,EAAE,CAAC,IAAoB,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC;QAEzB,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,QAAQ;gBACZ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACzB,KAAK,QAAQ;gBACZ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACzB,KAAK,SAAS;gBACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YAC1B;gBACC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBACnB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBACvB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AAE,qBAAqB,IAAI,eAAe,EAAE,CAAC;AAEpD,6BAA6B","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 {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n} from \"../../core/index.js\";\nimport {\n\ttype CursorAdapter,\n\tstackTreeNodeCursor,\n\tTreeNodeSchemaBase,\n} from \"../../feature-libraries/index.js\";\nimport { brand, isReadonlyArray, type JsonCompatible } from \"../../util/index.js\";\nimport { leaf } from \"../leafDomain.js\";\n\nimport { jsonArray, jsonObject } from \"./jsonDomainSchema.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces/internal\";\n\nconst adapter: CursorAdapter<JsonCompatible> = {\n\tvalue: (node: JsonCompatible) =>\n\t\tnode !== null && typeof node === \"object\"\n\t\t\t? undefined // arrays and objects have no defined value\n\t\t\t: node, // null, boolean, numbers, and strings are their own values\n\ttype: (node: JsonCompatible) => {\n\t\tconst type = typeof node;\n\n\t\tswitch (type) {\n\t\t\tcase \"number\":\n\t\t\t\treturn leaf.number.name;\n\t\t\tcase \"string\":\n\t\t\t\treturn leaf.string.name;\n\t\t\tcase \"boolean\":\n\t\t\t\treturn leaf.boolean.name;\n\t\t\tdefault:\n\t\t\t\tif (node === null) {\n\t\t\t\t\treturn leaf.null.name;\n\t\t\t\t} else if (isReadonlyArray(node)) {\n\t\t\t\t\treturn jsonArray.name;\n\t\t\t\t} else {\n\t\t\t\t\treturn jsonObject.name;\n\t\t\t\t}\n\t\t}\n\t},\n\tkeysFromNode: (node: JsonCompatible): readonly FieldKey[] => {\n\t\tswitch (typeof node) {\n\t\t\tcase \"object\":\n\t\t\t\tif (node === null) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else if (isReadonlyArray(node)) {\n\t\t\t\t\treturn node.length === 0 ? [] : [EmptyKey];\n\t\t\t\t} else {\n\t\t\t\t\treturn Object.keys(node) as FieldKey[];\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn [];\n\t\t}\n\t},\n\tgetFieldFromNode: (node: JsonCompatible, key: FieldKey): readonly JsonCompatible[] => {\n\t\t// Object.prototype.hasOwnProperty can return true for strings (ex: with key \"0\"), so we have to filter them out.\n\t\t// Rather than just special casing strings, we can handle them with an early return for all primitives.\n\t\tif (typeof node !== \"object\") {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (node === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (isReadonlyArray(node)) {\n\t\t\treturn key === EmptyKey ? node : [];\n\t\t}\n\n\t\tif (Object.prototype.hasOwnProperty.call(node, key)) {\n\t\t\tconst field = node[key];\n\t\t\tassert(\n\t\t\t\tfield !== undefined,\n\t\t\t\t0x41e /* explicit undefined fields should not be preserved in JSON */,\n\t\t\t);\n\t\t\treturn [field];\n\t\t}\n\n\t\treturn [];\n\t},\n};\n\n/**\n * Used to read generic json compatible data as a tree in the JSON domain.\n * The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.\n */\nexport function singleJsonCursor(root: JsonCompatible): ITreeCursorSynchronous {\n\treturn stackTreeNodeCursor(adapter, root);\n}\n\n/**\n * Extract a JS object tree from the contents of the given ITreeCursor.\n * Assumes that ITreeCursor contains only unaugmented JsonTypes.\n */\nexport function cursorToJsonObject(reader: ITreeCursor): JsonCompatible {\n\tconst type = reader.type;\n\n\tswitch (type) {\n\t\tcase leaf.number.name:\n\t\tcase leaf.boolean.name:\n\t\tcase leaf.string.name:\n\t\t\tassert(reader.value !== undefined, 0x84f /* out of schema: missing value */);\n\t\t\tassert(!isFluidHandle(reader.value), 0x850 /* out of schema: unexpected FluidHandle */);\n\t\t\treturn reader.value;\n\t\tcase jsonArray.name: {\n\t\t\treader.enterField(EmptyKey);\n\t\t\tconst result = mapCursorField(reader, cursorToJsonObject);\n\t\t\treader.exitField();\n\t\t\treturn result;\n\t\t}\n\t\tcase jsonObject.name: {\n\t\t\tconst result: JsonCompatible = {};\n\t\t\tmapCursorFields(reader, (cursor) => {\n\t\t\t\tconst key = cursor.getFieldKey();\n\t\t\t\tassert(cursor.firstNode(), 0x420 /* expected non-empty field */);\n\t\t\t\t// like `result[key] = cursorToJsonObject(reader);` except safe when keyString == \"__proto__\".\n\t\t\t\tObject.defineProperty(result, key, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: cursorToJsonObject(reader),\n\t\t\t\t});\n\t\t\t\tassert(!cursor.nextNode(), 0x421 /* expected exactly one node */);\n\t\t\t});\n\t\t\treturn result;\n\t\t}\n\t\tdefault: {\n\t\t\tassert(type === leaf.null.name, 0x422 /* unexpected type */);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n// #region TypedJsonCursor\n\n/** Used to construct a {@link TypedJsonCursor} */\nexport interface TypedJsonCompatibleObject {\n\t[key: string]: TypedJsonCompatible;\n\t[typedJsonSymbol]: string | TreeNodeSchemaBase;\n}\n\n/** Used to construct a {@link TypedJsonCursor} */\nexport type TypedJsonCompatible =\n\t| JsonCompatible\n\t| TypedJsonCompatibleObject\n\t| TypedJsonCompatible[]\n\t| IFluidHandle\n\t| JsonCompatible;\n\nconst typedJsonSymbol = Symbol(\"JSON Cursor Type\");\n\nfunction isObject(json: TypedJsonCompatible): json is TypedJsonCompatibleObject {\n\tif (typeof json === \"object\" && json !== null) {\n\t\tconst typed = json as Partial<TypedJsonCompatibleObject>;\n\t\treturn typed[typedJsonSymbol] !== undefined;\n\t}\n\n\treturn false;\n}\n\nconst typedAdapter: CursorAdapter<TypedJsonCompatible> = {\n\tvalue: (node: TypedJsonCompatible) => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn node;\n\t\t}\n\n\t\t// TODO: Get rid of this cast by combining TypedJsonCompatible and JsonCompatible into a single cursor with flags to configure behavior.\n\t\t// This cast is necessary because TypedJsonCompatible can have Fluid handles underneath it, however, `adapter` only cares if `node` itself is a FluidHandle, which it is not.\n\t\treturn adapter.value(node as JsonCompatible);\n\t},\n\ttype: (node: TypedJsonCompatible) => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn leaf.handle.name;\n\t\t}\n\n\t\tif (isObject(node)) {\n\t\t\tconst type = node[typedJsonSymbol];\n\t\t\treturn type instanceof TreeNodeSchemaBase ? type.name : brand(type);\n\t\t}\n\n\t\treturn adapter.type(node as JsonCompatible);\n\t},\n\tkeysFromNode: (node: TypedJsonCompatible): readonly FieldKey[] => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn [];\n\t\t}\n\t\treturn adapter.keysFromNode(node as JsonCompatible);\n\t},\n\tgetFieldFromNode: (\n\t\tnode: TypedJsonCompatible,\n\t\tkey: FieldKey,\n\t): readonly TypedJsonCompatible[] => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst field = adapter.getFieldFromNode(node as JsonCompatible, key);\n\t\tif (isReadonlyArray(field) && field.length === 1 && isReadonlyArray(field[0])) {\n\t\t\t// If the field is an array wrapping another array, then unbox to the inner array\n\t\t\treturn field[0];\n\t\t}\n\n\t\treturn field;\n\t},\n};\n\n/**\n * A variant of {@link singleJsonCursor} which allows types to be provided for nodes.\n *\n * @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.\n *\n * This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an \"array node\" but are directly interpreted as sequence fields).\n *\n * It also allows Fluid handles as input.\n *\n * @example\n * ```ts\n * const cursor = typedJsonCursor({\n * [typedJsonCursor.type]: Point,\n * x: 3,\n * y: 42\n * });\n * ```\n */\nconst singleTypedJsonCursor = function (root: TypedJsonCompatible): ITreeCursorSynchronous {\n\treturn stackTreeNodeCursor(typedAdapter, root);\n};\n\nsingleTypedJsonCursor.type = typedJsonSymbol;\n\nexport { singleTypedJsonCursor as typedJsonCursor };\n\n// #endregion TypedJsonCursor\n"]}
@@ -1,24 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ValueSchema } from "../../core/index.js";
6
- import { FlexFieldSchema } from "../../feature-libraries/index.js";
7
- /**
8
- * Types allowed as roots of Json content.
9
- */
10
- export declare const jsonRoot: readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
11
- readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
12
- }>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
13
- readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
14
- }>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>];
15
- export declare const jsonObject: import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
16
- readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
17
- }>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
18
- readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
19
- }>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>;
20
- export declare const jsonArray: import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
21
- readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", any>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", any>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
22
- }>;
23
- export declare const jsonSchema: import("../../feature-libraries/schemaBuilderBase.js").SchemaLibrary;
24
- //# sourceMappingURL=jsonDomainSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonDomainSchema.d.ts","sourceRoot":"","sources":["../../../src/domains/json/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAY,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAGN,eAAe,EAEf,MAAM,kCAAkC,CAAC;AAW1C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;qcAAkE,CAAC;AAOxF,eAAO,MAAM,UAAU;;;;ucAGtB,CAAC;AAEF,eAAO,MAAM,SAAS;;EAEpB,CAAC;AAEH,eAAO,MAAM,UAAU,sEAAwB,CAAC"}
@@ -1,29 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- // Adding this unused import makes the generated d.ts file produced by TypeScript stop breaking API-Extractor's rollup generation.
6
- // Without this import, TypeScript generates inline `import("../..")` statements in the d.ts file,
7
- // which API-Extractor leaves as is when generating the rollup, leaving them pointing at the wrong directory.
8
- // API-Extractor issue: https://github.com/microsoft/rushstack/issues/4507
9
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
10
- import { EmptyKey } from "../../core/index.js";
11
- import { FieldKinds, FlexFieldSchema, SchemaBuilderInternal, } from "../../feature-libraries/index.js";
12
- import { leaf } from "../leafDomain.js";
13
- const builder = new SchemaBuilderInternal({
14
- scope: "com.fluidframework.json",
15
- libraries: [leaf.library],
16
- });
17
- const jsonPrimitives = [...leaf.primitives, leaf.null];
18
- /**
19
- * Types allowed as roots of Json content.
20
- */
21
- export const jsonRoot = [() => jsonObject, () => jsonArray, ...jsonPrimitives];
22
- {
23
- }
24
- export const jsonObject = builder.mapRecursive("object", FlexFieldSchema.createUnsafe(FieldKinds.optional, jsonRoot));
25
- export const jsonArray = builder.objectRecursive("array", {
26
- [EmptyKey]: FlexFieldSchema.createUnsafe(FieldKinds.sequence, jsonRoot),
27
- });
28
- export const jsonSchema = builder.intoLibrary();
29
- //# sourceMappingURL=jsonDomainSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonDomainSchema.js","sourceRoot":"","sources":["../../../src/domains/json/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kIAAkI;AAClI,kGAAkG;AAClG,6GAA6G;AAC7G,0EAA0E;AAC1E,+FAA+F;AAC/F,OAAO,EAAE,QAAQ,EAAe,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACN,UAAU,EAEV,eAAe,EACf,qBAAqB,GACrB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC;IACzC,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,cAAc,CAAU,CAAC;AAExF,CAAC;AAGD,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAC7C,QAAQ,EACR,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE;IACzD,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;CACvE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Adding this unused import makes the generated d.ts file produced by TypeScript stop breaking API-Extractor's rollup generation.\n// Without this import, TypeScript generates inline `import(\"../..\")` statements in the d.ts file,\n// which API-Extractor leaves as is when generating the rollup, leaving them pointing at the wrong directory.\n// API-Extractor issue: https://github.com/microsoft/rushstack/issues/4507\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports\nimport { EmptyKey, ValueSchema } from \"../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\tSchemaBuilderInternal,\n} from \"../../feature-libraries/index.js\";\nimport type { requireAssignableTo } from \"../../util/index.js\";\nimport { leaf } from \"../leafDomain.js\";\n\nconst builder = new SchemaBuilderInternal({\n\tscope: \"com.fluidframework.json\",\n\tlibraries: [leaf.library],\n});\n\nconst jsonPrimitives = [...leaf.primitives, leaf.null] as const;\n\n/**\n * Types allowed as roots of Json content.\n */\nexport const jsonRoot = [() => jsonObject, () => jsonArray, ...jsonPrimitives] as const;\n\n{\n\t// Recursive objects don't get this type checking automatically, so confirm it\n\ttype _check = requireAssignableTo<typeof jsonRoot, FlexAllowedTypes>;\n}\n\nexport const jsonObject = builder.mapRecursive(\n\t\"object\",\n\tFlexFieldSchema.createUnsafe(FieldKinds.optional, jsonRoot),\n);\n\nexport const jsonArray = builder.objectRecursive(\"array\", {\n\t[EmptyKey]: FlexFieldSchema.createUnsafe(FieldKinds.sequence, jsonRoot),\n});\n\nexport const jsonSchema = builder.intoLibrary();\n"]}
@@ -1,72 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { ValueSchema } from "../core/index.js";
6
- /**
7
- * Built-in {@link LeafNodeSchema}.
8
- */
9
- export declare const leaf: {
10
- /**
11
- * {@link LeafNodeSchema} for holding a JavaScript `number`.
12
- *
13
- * @remarks
14
- * The number is a [double-precision 64-bit binary format IEEE 754](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) value, however there are some exceptions:
15
- * - `NaN`, and the infinities should not be used.
16
- * - `-0` may be converted to `0` in some cases.
17
- *
18
- * These limitations match the limitations of JSON.
19
- * @privateRemarks
20
- * TODO:
21
- * We should be much more clear about what happens if you use problematic values.
22
- * We should validate and/or normalize them when inserting content.
23
- */
24
- number: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>;
25
- /**
26
- * {@link LeafNodeSchema} for holding a boolean.
27
- */
28
- boolean: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>;
29
- /**
30
- * {@link LeafNodeSchema} for holding a JavaScript `string`.
31
- *
32
- * @remarks
33
- * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.
34
- *
35
- * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.
36
- * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.
37
- * @privateRemarks
38
- * TODO:
39
- * We should be much more clear about what happens if you use problematic values.
40
- * We should validate and/or normalize them when inserting content.
41
- */
42
- string: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>;
43
- /**
44
- * {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
45
- */
46
- handle: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>;
47
- /**
48
- * {@link LeafNodeSchema} for JavaScript `null`.
49
- *
50
- * @remarks
51
- * There are good [reasons to avoid using null](https://www.npmjs.com/package/%40rushstack/eslint-plugin#rushstackno-new-null) in JavaScript, however sometimes it is desired.
52
- * This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.
53
- * Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.
54
- */
55
- null: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>;
56
- /**
57
- * The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.
58
- */
59
- primitives: readonly [import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>];
60
- /**
61
- * All {@link LeafNodeSchema} defined in this library..
62
- */
63
- all: readonly [import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>];
64
- /**
65
- * {@link SchemaLibrary} of the {@link LeafNodeSchema}.
66
- *
67
- * @privateRemarks
68
- * This is included by default in schema produced with {@link SchemaBuilder}.
69
- */
70
- library: import("../feature-libraries/schemaBuilderBase.js").SchemaLibrary;
71
- };
72
- //# sourceMappingURL=leafDomain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leafDomain.d.ts","sourceRoot":"","sources":["../../src/domains/leafDomain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmB/C;;GAEG;AACH,eAAO,MAAM,IAAI;IAChB;;;;;;;;;;;;;OAaG;;IAGH;;OAEG;;IAGH;;;;;;;;;;;;OAYG;;IAGH;;OAEG;;IAGH;;;;;;;OAOG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;CAEH,CAAC"}