@fluidframework/tree 2.3.0-288113 → 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 (869) 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 -42
  14. package/api-report/tree.beta.api.md +21 -11
  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 +8 -13
  18. package/dist/alpha.d.ts +102 -0
  19. package/dist/beta.d.ts +6 -2
  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.map +1 -1
  37. package/dist/core/tree/anchorSet.js +6 -2
  38. package/dist/core/tree/anchorSet.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
  40. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndex.js +1 -0
  42. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  43. package/dist/core/tree/visitDelta.d.ts +7 -2
  44. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  45. package/dist/core/tree/visitDelta.js.map +1 -1
  46. package/dist/events/emitter.d.ts +127 -0
  47. package/dist/events/emitter.d.ts.map +1 -0
  48. package/dist/events/{events.js → emitter.js} +48 -30
  49. package/dist/events/emitter.js.map +1 -0
  50. package/dist/events/index.d.ts +2 -1
  51. package/dist/events/index.d.ts.map +1 -1
  52. package/dist/events/index.js +4 -5
  53. package/dist/events/index.js.map +1 -1
  54. package/dist/events/interop.d.ts +36 -0
  55. package/dist/events/interop.d.ts.map +1 -0
  56. package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
  57. package/dist/events/interop.js.map +1 -0
  58. package/dist/events/listeners.d.ts +65 -0
  59. package/dist/events/listeners.d.ts.map +1 -0
  60. package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
  61. package/dist/events/listeners.js.map +1 -0
  62. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
  63. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
  65. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
  67. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
  69. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
  71. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
  73. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
  75. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
  77. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  78. package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
  79. package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/flex-map-tree/index.js +2 -1
  81. package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
  82. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
  83. package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
  84. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -103
  85. package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
  86. package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
  87. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  88. package/dist/feature-libraries/flex-tree/context.js +10 -7
  89. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  90. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
  91. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  92. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -3
  93. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  94. package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
  95. package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
  96. package/dist/feature-libraries/flex-tree/index.js.map +1 -1
  97. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
  98. package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
  99. package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
  100. package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
  101. package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -28
  102. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  103. package/dist/feature-libraries/flex-tree/lazyField.js +11 -14
  104. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  105. package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  106. package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  107. package/dist/feature-libraries/flex-tree/lazyNode.js +23 -74
  108. package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
  109. package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
  110. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
  111. package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
  112. package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
  113. package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
  114. package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
  115. package/dist/feature-libraries/flex-tree/utilities.js +3 -6
  116. package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
  119. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  120. package/dist/feature-libraries/index.d.ts +3 -5
  121. package/dist/feature-libraries/index.d.ts.map +1 -1
  122. package/dist/feature-libraries/index.js +5 -11
  123. package/dist/feature-libraries/index.js.map +1 -1
  124. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  125. package/dist/feature-libraries/modular-schema/comparison.js +3 -6
  126. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  127. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  128. package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
  129. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
  131. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
  133. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
  135. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  136. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
  137. package/dist/feature-libraries/schema-index/format.d.ts +3 -3
  138. package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
  139. package/dist/feature-libraries/storedToViewSchema.js +2 -4
  140. package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
  141. package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
  142. package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
  143. package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
  144. package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
  145. package/dist/feature-libraries/typed-schema/index.js +2 -2
  146. package/dist/feature-libraries/typed-schema/index.js.map +1 -1
  147. package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
  148. package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
  149. package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
  150. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
  151. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
  152. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
  153. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
  154. package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
  155. package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
  156. package/dist/feature-libraries/typed-schema/view.js +5 -4
  157. package/dist/feature-libraries/typed-schema/view.js.map +1 -1
  158. package/dist/index.d.ts +4 -4
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +33 -36
  161. package/dist/index.js.map +1 -1
  162. package/dist/legacy.d.ts +83 -0
  163. package/dist/packageVersion.d.ts +1 -1
  164. package/dist/packageVersion.d.ts.map +1 -1
  165. package/dist/packageVersion.js +1 -1
  166. package/dist/packageVersion.js.map +1 -1
  167. package/dist/public.d.ts +0 -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 +1 -1
  246. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  247. package/dist/simple-tree/api/treeNodeApi.js +21 -19
  248. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  249. package/dist/simple-tree/api/verboseTree.js +2 -2
  250. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  251. package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  252. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  253. package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  254. package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
  255. package/dist/simple-tree/arrayNode.d.ts +2 -2
  256. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  257. package/dist/simple-tree/arrayNode.js +30 -21
  258. package/dist/simple-tree/arrayNode.js.map +1 -1
  259. package/dist/simple-tree/core/index.d.ts +3 -3
  260. package/dist/simple-tree/core/index.d.ts.map +1 -1
  261. package/dist/simple-tree/core/index.js +4 -1
  262. package/dist/simple-tree/core/index.js.map +1 -1
  263. package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
  264. package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
  265. package/dist/simple-tree/core/schemaCaching.js +10 -1
  266. package/dist/simple-tree/core/schemaCaching.js.map +1 -1
  267. package/dist/simple-tree/core/treeNodeKernel.d.ts +61 -3
  268. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  269. package/dist/simple-tree/core/treeNodeKernel.js +166 -13
  270. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  271. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
  272. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  273. package/dist/simple-tree/core/types.d.ts +17 -20
  274. package/dist/simple-tree/core/types.d.ts.map +1 -1
  275. package/dist/simple-tree/core/types.js.map +1 -1
  276. package/dist/simple-tree/core/withType.d.ts +3 -2
  277. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  278. package/dist/simple-tree/core/withType.js.map +1 -1
  279. package/dist/simple-tree/index.d.ts +7 -9
  280. package/dist/simple-tree/index.d.ts.map +1 -1
  281. package/dist/simple-tree/index.js +15 -6
  282. package/dist/simple-tree/index.js.map +1 -1
  283. package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
  284. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  285. package/dist/simple-tree/leafNodeSchema.js +13 -11
  286. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  287. package/dist/simple-tree/mapNode.d.ts +1 -1
  288. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  289. package/dist/simple-tree/mapNode.js +38 -29
  290. package/dist/simple-tree/mapNode.js.map +1 -1
  291. package/dist/simple-tree/objectNode.d.ts +9 -7
  292. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  293. package/dist/simple-tree/objectNode.js +37 -31
  294. package/dist/simple-tree/objectNode.js.map +1 -1
  295. package/dist/simple-tree/proxies.d.ts +1 -14
  296. package/dist/simple-tree/proxies.d.ts.map +1 -1
  297. package/dist/simple-tree/proxies.js +12 -15
  298. package/dist/simple-tree/proxies.js.map +1 -1
  299. package/dist/simple-tree/proxyBinding.d.ts +2 -62
  300. package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
  301. package/dist/simple-tree/proxyBinding.js +8 -181
  302. package/dist/simple-tree/proxyBinding.js.map +1 -1
  303. package/dist/simple-tree/schemaTypes.d.ts +7 -7
  304. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  305. package/dist/simple-tree/schemaTypes.js +4 -4
  306. package/dist/simple-tree/schemaTypes.js.map +1 -1
  307. package/dist/simple-tree/toFlexSchema.d.ts +11 -1
  308. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  309. package/dist/simple-tree/toFlexSchema.js +54 -31
  310. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  311. package/dist/simple-tree/toMapTree.d.ts +25 -37
  312. package/dist/simple-tree/toMapTree.d.ts.map +1 -1
  313. package/dist/simple-tree/toMapTree.js +53 -16
  314. package/dist/simple-tree/toMapTree.js.map +1 -1
  315. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  316. package/dist/simple-tree/treeNodeValid.js +7 -10
  317. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  318. package/dist/simple-tree/typesUnsafe.d.ts +13 -13
  319. package/dist/simple-tree/typesUnsafe.js.map +1 -1
  320. package/dist/simple-tree/walkSchema.d.ts +26 -0
  321. package/dist/simple-tree/walkSchema.d.ts.map +1 -0
  322. package/dist/simple-tree/walkSchema.js +49 -0
  323. package/dist/simple-tree/walkSchema.js.map +1 -0
  324. package/dist/treeFactory.d.ts +2 -1
  325. package/dist/treeFactory.d.ts.map +1 -1
  326. package/dist/treeFactory.js +2 -1
  327. package/dist/treeFactory.js.map +1 -1
  328. package/dist/util/typeUtils.d.ts +2 -2
  329. package/dist/util/typeUtils.js.map +1 -1
  330. package/legacy.d.ts +11 -0
  331. package/lib/alpha.d.ts +102 -0
  332. package/lib/beta.d.ts +6 -2
  333. package/lib/core/index.d.ts +1 -1
  334. package/lib/core/index.d.ts.map +1 -1
  335. package/lib/core/index.js +1 -1
  336. package/lib/core/index.js.map +1 -1
  337. package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
  338. package/lib/core/revertible.d.ts.map +1 -0
  339. package/lib/core/revertible.js.map +1 -0
  340. package/lib/core/schema-stored/format.d.ts +3 -3
  341. package/lib/core/schema-stored/format.js +1 -1
  342. package/lib/core/schema-stored/format.js.map +1 -1
  343. package/lib/core/schema-stored/schema.d.ts +2 -7
  344. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  345. package/lib/core/schema-stored/schema.js +4 -6
  346. package/lib/core/schema-stored/schema.js.map +1 -1
  347. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  348. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  349. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  350. package/lib/core/tree/anchorSet.js +6 -2
  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} +48 -29
  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 -33
  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 -104
  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 -190
  404. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  405. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -2
  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 +1 -1
  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 -28
  416. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  417. package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
  418. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  419. package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
  420. package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
  421. package/lib/feature-libraries/flex-tree/lazyNode.js +23 -72
  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 +4 -4
  473. package/lib/index.d.ts.map +1 -1
  474. package/lib/index.js +3 -5
  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.d.ts.map +1 -1
  479. package/lib/packageVersion.js +1 -1
  480. package/lib/packageVersion.js.map +1 -1
  481. package/lib/public.d.ts +0 -1
  482. package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
  483. package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
  484. package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
  485. package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
  486. package/lib/shared-tree/index.d.ts +3 -3
  487. package/lib/shared-tree/index.d.ts.map +1 -1
  488. package/lib/shared-tree/index.js +1 -1
  489. package/lib/shared-tree/index.js.map +1 -1
  490. package/lib/shared-tree/schematizeTree.d.ts +15 -4
  491. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  492. package/lib/shared-tree/schematizeTree.js +8 -9
  493. package/lib/shared-tree/schematizeTree.js.map +1 -1
  494. package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
  495. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  496. package/lib/shared-tree/schematizingTreeView.js +26 -13
  497. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  498. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  499. package/lib/shared-tree/sharedTree.js +2 -2
  500. package/lib/shared-tree/sharedTree.js.map +1 -1
  501. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
  502. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  503. package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
  504. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  505. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
  506. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  507. package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
  508. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  509. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
  510. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  511. package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
  512. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  513. package/lib/shared-tree/treeApi.d.ts +1 -3
  514. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  515. package/lib/shared-tree/treeApi.js +7 -5
  516. package/lib/shared-tree/treeApi.js.map +1 -1
  517. package/lib/shared-tree/treeCheckout.d.ts +2 -13
  518. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  519. package/lib/shared-tree/treeCheckout.js +18 -2
  520. package/lib/shared-tree/treeCheckout.js.map +1 -1
  521. package/lib/shared-tree-core/branch.js +1 -1
  522. package/lib/shared-tree-core/branch.js.map +1 -1
  523. package/lib/simple-tree/api/create.d.ts.map +1 -1
  524. package/lib/simple-tree/api/create.js +2 -2
  525. package/lib/simple-tree/api/create.js.map +1 -1
  526. package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
  527. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
  528. package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
  529. package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
  530. package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
  531. package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
  532. package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
  533. package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
  534. package/lib/simple-tree/api/index.d.ts +5 -0
  535. package/lib/simple-tree/api/index.d.ts.map +1 -1
  536. package/lib/simple-tree/api/index.js +3 -0
  537. package/lib/simple-tree/api/index.js.map +1 -1
  538. package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
  539. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
  540. package/lib/simple-tree/api/jsonSchema.js.map +1 -0
  541. package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
  542. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  543. package/lib/simple-tree/api/schemaFactory.js +43 -12
  544. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  545. package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
  546. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
  547. package/lib/simple-tree/api/simpleSchema.js.map +1 -0
  548. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
  549. package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
  550. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
  551. package/lib/simple-tree/api/tree.d.ts +1 -21
  552. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  553. package/lib/simple-tree/api/tree.js +2 -34
  554. package/lib/simple-tree/api/tree.js.map +1 -1
  555. package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
  556. package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
  557. package/lib/simple-tree/api/treeApiBeta.js +23 -0
  558. package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
  559. package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
  560. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  561. package/lib/simple-tree/api/treeNodeApi.js +23 -21
  562. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  563. package/lib/simple-tree/api/verboseTree.js +1 -1
  564. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  565. package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
  566. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
  567. package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
  568. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
  569. package/lib/simple-tree/arrayNode.d.ts +2 -2
  570. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  571. package/lib/simple-tree/arrayNode.js +33 -24
  572. package/lib/simple-tree/arrayNode.js.map +1 -1
  573. package/lib/simple-tree/core/index.d.ts +3 -3
  574. package/lib/simple-tree/core/index.d.ts.map +1 -1
  575. package/lib/simple-tree/core/index.js +2 -2
  576. package/lib/simple-tree/core/index.js.map +1 -1
  577. package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
  578. package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
  579. package/lib/simple-tree/core/schemaCaching.js +8 -0
  580. package/lib/simple-tree/core/schemaCaching.js.map +1 -1
  581. package/lib/simple-tree/core/treeNodeKernel.d.ts +61 -3
  582. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  583. package/lib/simple-tree/core/treeNodeKernel.js +156 -5
  584. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  585. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
  586. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  587. package/lib/simple-tree/core/types.d.ts +17 -20
  588. package/lib/simple-tree/core/types.d.ts.map +1 -1
  589. package/lib/simple-tree/core/types.js.map +1 -1
  590. package/lib/simple-tree/core/withType.d.ts +3 -2
  591. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  592. package/lib/simple-tree/core/withType.js.map +1 -1
  593. package/lib/simple-tree/index.d.ts +7 -9
  594. package/lib/simple-tree/index.d.ts.map +1 -1
  595. package/lib/simple-tree/index.js +5 -5
  596. package/lib/simple-tree/index.js.map +1 -1
  597. package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
  598. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  599. package/lib/simple-tree/leafNodeSchema.js +14 -12
  600. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  601. package/lib/simple-tree/mapNode.d.ts +1 -1
  602. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  603. package/lib/simple-tree/mapNode.js +38 -29
  604. package/lib/simple-tree/mapNode.js.map +1 -1
  605. package/lib/simple-tree/objectNode.d.ts +9 -7
  606. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  607. package/lib/simple-tree/objectNode.js +40 -34
  608. package/lib/simple-tree/objectNode.js.map +1 -1
  609. package/lib/simple-tree/proxies.d.ts +1 -14
  610. package/lib/simple-tree/proxies.d.ts.map +1 -1
  611. package/lib/simple-tree/proxies.js +11 -14
  612. package/lib/simple-tree/proxies.js.map +1 -1
  613. package/lib/simple-tree/proxyBinding.d.ts +2 -62
  614. package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
  615. package/lib/simple-tree/proxyBinding.js +6 -174
  616. package/lib/simple-tree/proxyBinding.js.map +1 -1
  617. package/lib/simple-tree/schemaTypes.d.ts +7 -7
  618. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  619. package/lib/simple-tree/schemaTypes.js +4 -4
  620. package/lib/simple-tree/schemaTypes.js.map +1 -1
  621. package/lib/simple-tree/toFlexSchema.d.ts +11 -1
  622. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  623. package/lib/simple-tree/toFlexSchema.js +29 -8
  624. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  625. package/lib/simple-tree/toMapTree.d.ts +25 -37
  626. package/lib/simple-tree/toMapTree.d.ts.map +1 -1
  627. package/lib/simple-tree/toMapTree.js +54 -17
  628. package/lib/simple-tree/toMapTree.js.map +1 -1
  629. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  630. package/lib/simple-tree/treeNodeValid.js +8 -11
  631. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  632. package/lib/simple-tree/typesUnsafe.d.ts +13 -13
  633. package/lib/simple-tree/typesUnsafe.js.map +1 -1
  634. package/lib/simple-tree/walkSchema.d.ts +26 -0
  635. package/lib/simple-tree/walkSchema.d.ts.map +1 -0
  636. package/lib/simple-tree/walkSchema.js +43 -0
  637. package/lib/simple-tree/walkSchema.js.map +1 -0
  638. package/lib/treeFactory.d.ts +2 -1
  639. package/lib/treeFactory.d.ts.map +1 -1
  640. package/lib/treeFactory.js +2 -1
  641. package/lib/treeFactory.js.map +1 -1
  642. package/lib/tsdoc-metadata.json +1 -1
  643. package/lib/util/typeUtils.d.ts +2 -2
  644. package/lib/util/typeUtils.js.map +1 -1
  645. package/package.json +57 -25
  646. package/src/core/index.ts +1 -1
  647. package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
  648. package/src/core/schema-stored/format.ts +1 -1
  649. package/src/core/schema-stored/schema.ts +6 -13
  650. package/src/core/tree/anchorSet.ts +18 -3
  651. package/src/core/tree/detachedFieldIndex.ts +6 -5
  652. package/src/core/tree/visitDelta.ts +7 -2
  653. package/src/events/{events.ts → emitter.ts} +52 -139
  654. package/src/events/index.ts +7 -7
  655. package/src/events/interop.ts +49 -0
  656. package/src/events/listeners.ts +68 -0
  657. package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
  658. package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
  659. package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
  660. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
  661. package/src/feature-libraries/flex-map-tree/index.ts +1 -0
  662. package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -210
  663. package/src/feature-libraries/flex-tree/README.md +4 -75
  664. package/src/feature-libraries/flex-tree/context.ts +37 -16
  665. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -291
  666. package/src/feature-libraries/flex-tree/index.ts +7 -13
  667. package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
  668. package/src/feature-libraries/flex-tree/lazyField.ts +49 -73
  669. package/src/feature-libraries/flex-tree/lazyNode.ts +25 -154
  670. package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
  671. package/src/feature-libraries/flex-tree/utilities.ts +4 -8
  672. package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
  673. package/src/feature-libraries/index.ts +2 -27
  674. package/src/feature-libraries/modular-schema/comparison.ts +4 -6
  675. package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
  676. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
  677. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
  678. package/src/feature-libraries/storedToViewSchema.ts +5 -6
  679. package/src/feature-libraries/typed-schema/flexList.ts +3 -3
  680. package/src/feature-libraries/typed-schema/index.ts +1 -3
  681. package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
  682. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
  683. package/src/feature-libraries/typed-schema/view.ts +4 -13
  684. package/src/index.ts +4 -8
  685. package/src/packageVersion.ts +1 -1
  686. package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
  687. package/src/shared-tree/index.ts +2 -7
  688. package/src/shared-tree/schematizeTree.ts +23 -12
  689. package/src/shared-tree/schematizingTreeView.ts +34 -24
  690. package/src/shared-tree/sharedTree.ts +6 -1
  691. package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
  692. package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
  693. package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
  694. package/src/shared-tree/treeApi.ts +10 -10
  695. package/src/shared-tree/treeCheckout.ts +26 -15
  696. package/src/shared-tree-core/branch.ts +1 -1
  697. package/src/simple-tree/ProxyBinding.md +23 -23
  698. package/src/simple-tree/api/create.ts +8 -3
  699. package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
  700. package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
  701. package/src/simple-tree/api/index.ts +20 -0
  702. package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
  703. package/src/simple-tree/api/schemaFactory.ts +44 -13
  704. package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
  705. package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
  706. package/src/simple-tree/api/tree.ts +2 -71
  707. package/src/simple-tree/api/treeApiBeta.ts +101 -0
  708. package/src/simple-tree/api/treeNodeApi.ts +32 -23
  709. package/src/simple-tree/api/verboseTree.ts +1 -1
  710. package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
  711. package/src/simple-tree/arrayNode.ts +37 -31
  712. package/src/simple-tree/core/index.ts +4 -1
  713. package/src/simple-tree/core/schemaCaching.ts +10 -0
  714. package/src/simple-tree/core/treeNodeKernel.ts +198 -5
  715. package/src/simple-tree/core/treeNodeSchema.ts +1 -1
  716. package/src/simple-tree/core/types.ts +16 -27
  717. package/src/simple-tree/core/withType.ts +3 -1
  718. package/src/simple-tree/index.ts +29 -21
  719. package/src/simple-tree/leafNodeSchema.ts +24 -28
  720. package/src/simple-tree/mapNode.ts +47 -29
  721. package/src/simple-tree/objectNode.ts +51 -46
  722. package/src/simple-tree/proxies.ts +22 -51
  723. package/src/simple-tree/proxyBinding.ts +3 -254
  724. package/src/simple-tree/schemaTypes.ts +8 -8
  725. package/src/simple-tree/toFlexSchema.ts +40 -7
  726. package/src/simple-tree/toMapTree.ts +113 -79
  727. package/src/simple-tree/treeNodeValid.ts +10 -13
  728. package/src/simple-tree/typesUnsafe.ts +13 -13
  729. package/src/simple-tree/walkSchema.ts +81 -0
  730. package/src/treeFactory.ts +2 -1
  731. package/src/util/typeUtils.ts +2 -2
  732. package/dist/core/revertible/index.d.ts.map +0 -1
  733. package/dist/core/revertible/index.js +0 -10
  734. package/dist/core/revertible/index.js.map +0 -1
  735. package/dist/core/revertible/revertible.d.ts.map +0 -1
  736. package/dist/core/revertible/revertible.js.map +0 -1
  737. package/dist/domains/index.d.ts +0 -8
  738. package/dist/domains/index.d.ts.map +0 -1
  739. package/dist/domains/index.js +0 -20
  740. package/dist/domains/index.js.map +0 -1
  741. package/dist/domains/json/index.d.ts +0 -7
  742. package/dist/domains/json/index.d.ts.map +0 -1
  743. package/dist/domains/json/index.js +0 -17
  744. package/dist/domains/json/index.js.map +0 -1
  745. package/dist/domains/json/jsonCursor.d.ts +0 -52
  746. package/dist/domains/json/jsonCursor.d.ts.map +0 -1
  747. package/dist/domains/json/jsonCursor.js +0 -197
  748. package/dist/domains/json/jsonCursor.js.map +0 -1
  749. package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
  750. package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
  751. package/dist/domains/json/jsonDomainSchema.js +0 -32
  752. package/dist/domains/json/jsonDomainSchema.js.map +0 -1
  753. package/dist/domains/leafDomain.d.ts +0 -72
  754. package/dist/domains/leafDomain.d.ts.map +0 -1
  755. package/dist/domains/leafDomain.js +0 -88
  756. package/dist/domains/leafDomain.js.map +0 -1
  757. package/dist/domains/schemaBuilder.d.ts +0 -103
  758. package/dist/domains/schemaBuilder.d.ts.map +0 -1
  759. package/dist/domains/schemaBuilder.js +0 -121
  760. package/dist/domains/schemaBuilder.js.map +0 -1
  761. package/dist/domains/testRecursiveDomain.d.ts +0 -17
  762. package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
  763. package/dist/domains/testRecursiveDomain.js +0 -35
  764. package/dist/domains/testRecursiveDomain.js.map +0 -1
  765. package/dist/events/events.d.ts +0 -207
  766. package/dist/events/events.d.ts.map +0 -1
  767. package/dist/events/events.js.map +0 -1
  768. package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
  769. package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
  770. package/dist/feature-libraries/schemaBuilder.js +0 -40
  771. package/dist/feature-libraries/schemaBuilder.js.map +0 -1
  772. package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
  773. package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  774. package/dist/feature-libraries/schemaBuilderBase.js +0 -201
  775. package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
  776. package/dist/shared-tree/treeView.d.ts +0 -73
  777. package/dist/shared-tree/treeView.d.ts.map +0 -1
  778. package/dist/shared-tree/treeView.js.map +0 -1
  779. package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
  780. package/dist/simple-tree/getJsonSchema.js.map +0 -1
  781. package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
  782. package/dist/simple-tree/getSimpleSchema.js.map +0 -1
  783. package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
  784. package/dist/simple-tree/jsonSchema.js.map +0 -1
  785. package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
  786. package/dist/simple-tree/simpleSchema.js.map +0 -1
  787. package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  788. package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  789. package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  790. package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
  791. package/lib/core/revertible/index.d.ts.map +0 -1
  792. package/lib/core/revertible/index.js.map +0 -1
  793. package/lib/core/revertible/revertible.d.ts.map +0 -1
  794. package/lib/core/revertible/revertible.js.map +0 -1
  795. package/lib/domains/index.d.ts +0 -8
  796. package/lib/domains/index.d.ts.map +0 -1
  797. package/lib/domains/index.js +0 -8
  798. package/lib/domains/index.js.map +0 -1
  799. package/lib/domains/json/index.d.ts +0 -7
  800. package/lib/domains/json/index.d.ts.map +0 -1
  801. package/lib/domains/json/index.js +0 -7
  802. package/lib/domains/json/index.js.map +0 -1
  803. package/lib/domains/json/jsonCursor.d.ts +0 -52
  804. package/lib/domains/json/jsonCursor.d.ts.map +0 -1
  805. package/lib/domains/json/jsonCursor.js +0 -192
  806. package/lib/domains/json/jsonCursor.js.map +0 -1
  807. package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
  808. package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
  809. package/lib/domains/json/jsonDomainSchema.js +0 -29
  810. package/lib/domains/json/jsonDomainSchema.js.map +0 -1
  811. package/lib/domains/leafDomain.d.ts +0 -72
  812. package/lib/domains/leafDomain.d.ts.map +0 -1
  813. package/lib/domains/leafDomain.js +0 -85
  814. package/lib/domains/leafDomain.js.map +0 -1
  815. package/lib/domains/schemaBuilder.d.ts +0 -103
  816. package/lib/domains/schemaBuilder.d.ts.map +0 -1
  817. package/lib/domains/schemaBuilder.js +0 -117
  818. package/lib/domains/schemaBuilder.js.map +0 -1
  819. package/lib/domains/testRecursiveDomain.d.ts +0 -17
  820. package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
  821. package/lib/domains/testRecursiveDomain.js +0 -32
  822. package/lib/domains/testRecursiveDomain.js.map +0 -1
  823. package/lib/events/events.d.ts +0 -207
  824. package/lib/events/events.d.ts.map +0 -1
  825. package/lib/events/events.js.map +0 -1
  826. package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
  827. package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
  828. package/lib/feature-libraries/schemaBuilder.js +0 -36
  829. package/lib/feature-libraries/schemaBuilder.js.map +0 -1
  830. package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
  831. package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
  832. package/lib/feature-libraries/schemaBuilderBase.js +0 -195
  833. package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
  834. package/lib/shared-tree/treeView.d.ts +0 -73
  835. package/lib/shared-tree/treeView.d.ts.map +0 -1
  836. package/lib/shared-tree/treeView.js.map +0 -1
  837. package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
  838. package/lib/simple-tree/getJsonSchema.js.map +0 -1
  839. package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
  840. package/lib/simple-tree/getSimpleSchema.js.map +0 -1
  841. package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
  842. package/lib/simple-tree/jsonSchema.js.map +0 -1
  843. package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
  844. package/lib/simple-tree/simpleSchema.js.map +0 -1
  845. package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
  846. package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
  847. package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
  848. package/src/domains/README.md +0 -6
  849. package/src/domains/fence.json +0 -5
  850. package/src/domains/index.ts +0 -19
  851. package/src/domains/json/fence.json +0 -5
  852. package/src/domains/json/index.ts +0 -13
  853. package/src/domains/json/jsonCursor.ts +0 -247
  854. package/src/domains/json/jsonDomainSchema.ts +0 -47
  855. package/src/domains/leafDomain.ts +0 -97
  856. package/src/domains/schemaBuilder.ts +0 -153
  857. package/src/domains/testRecursiveDomain.ts +0 -38
  858. package/src/events/fence.json +0 -5
  859. package/src/feature-libraries/schemaBuilder.ts +0 -45
  860. package/src/feature-libraries/schemaBuilderBase.ts +0 -393
  861. package/src/shared-tree/treeView.ts +0 -113
  862. /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
  863. /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  864. /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  865. /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
  866. /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
  867. /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
  868. /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
  869. /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,4CAUyB;AATxB,8GAAA,kBAAkB,OAAA;AAClB,qGAAA,SAAS,OAAA;AACT,sGAAA,UAAU,OAAA;AACV,oGAAA,QAAQ,OAAA;AACR,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AAKhB,iDAAuC;AAA9B,qGAAA,IAAI,OAAA","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,17 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.jsonRoot = exports.jsonArray = exports.jsonObject = exports.jsonSchema = exports.typedJsonCursor = exports.cursorToJsonObject = exports.singleJsonCursor = void 0;
8
- var jsonCursor_js_1 = require("./jsonCursor.js");
9
- Object.defineProperty(exports, "singleJsonCursor", { enumerable: true, get: function () { return jsonCursor_js_1.singleJsonCursor; } });
10
- Object.defineProperty(exports, "cursorToJsonObject", { enumerable: true, get: function () { return jsonCursor_js_1.cursorToJsonObject; } });
11
- Object.defineProperty(exports, "typedJsonCursor", { enumerable: true, get: function () { return jsonCursor_js_1.typedJsonCursor; } });
12
- var jsonDomainSchema_js_1 = require("./jsonDomainSchema.js");
13
- Object.defineProperty(exports, "jsonSchema", { enumerable: true, get: function () { return jsonDomainSchema_js_1.jsonSchema; } });
14
- Object.defineProperty(exports, "jsonObject", { enumerable: true, get: function () { return jsonDomainSchema_js_1.jsonObject; } });
15
- Object.defineProperty(exports, "jsonArray", { enumerable: true, get: function () { return jsonDomainSchema_js_1.jsonArray; } });
16
- Object.defineProperty(exports, "jsonRoot", { enumerable: true, get: function () { return jsonDomainSchema_js_1.jsonRoot; } });
17
- //# 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,iDAMyB;AALxB,iHAAA,gBAAgB,OAAA;AAChB,mHAAA,kBAAkB,OAAA;AAClB,gHAAA,eAAe,OAAA;AAIhB,6DAAoF;AAA3E,iHAAA,UAAU,OAAA;AAAE,iHAAA,UAAU,OAAA;AAAE,gHAAA,SAAS,OAAA;AAAE,+GAAA,QAAQ,OAAA","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,197 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.typedJsonCursor = exports.cursorToJsonObject = exports.singleJsonCursor = void 0;
8
- const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../../core/index.js");
10
- const index_js_2 = require("../../feature-libraries/index.js");
11
- const index_js_3 = require("../../util/index.js");
12
- const leafDomain_js_1 = require("../leafDomain.js");
13
- const jsonDomainSchema_js_1 = require("./jsonDomainSchema.js");
14
- const internal_2 = require("@fluidframework/runtime-utils/internal");
15
- const adapter = {
16
- value: (node) => node !== null && typeof node === "object"
17
- ? undefined // arrays and objects have no defined value
18
- : node, // null, boolean, numbers, and strings are their own values
19
- type: (node) => {
20
- const type = typeof node;
21
- switch (type) {
22
- case "number":
23
- return leafDomain_js_1.leaf.number.name;
24
- case "string":
25
- return leafDomain_js_1.leaf.string.name;
26
- case "boolean":
27
- return leafDomain_js_1.leaf.boolean.name;
28
- default:
29
- if (node === null) {
30
- return leafDomain_js_1.leaf.null.name;
31
- }
32
- else if ((0, index_js_3.isReadonlyArray)(node)) {
33
- return jsonDomainSchema_js_1.jsonArray.name;
34
- }
35
- else {
36
- return jsonDomainSchema_js_1.jsonObject.name;
37
- }
38
- }
39
- },
40
- keysFromNode: (node) => {
41
- switch (typeof node) {
42
- case "object":
43
- if (node === null) {
44
- return [];
45
- }
46
- else if ((0, index_js_3.isReadonlyArray)(node)) {
47
- return node.length === 0 ? [] : [index_js_1.EmptyKey];
48
- }
49
- else {
50
- return Object.keys(node);
51
- }
52
- default:
53
- return [];
54
- }
55
- },
56
- getFieldFromNode: (node, key) => {
57
- // Object.prototype.hasOwnProperty can return true for strings (ex: with key "0"), so we have to filter them out.
58
- // Rather than just special casing strings, we can handle them with an early return for all primitives.
59
- if (typeof node !== "object") {
60
- return [];
61
- }
62
- if (node === null) {
63
- return [];
64
- }
65
- if ((0, index_js_3.isReadonlyArray)(node)) {
66
- return key === index_js_1.EmptyKey ? node : [];
67
- }
68
- if (Object.prototype.hasOwnProperty.call(node, key)) {
69
- const field = node[key];
70
- (0, internal_1.assert)(field !== undefined, 0x41e /* explicit undefined fields should not be preserved in JSON */);
71
- return [field];
72
- }
73
- return [];
74
- },
75
- };
76
- /**
77
- * Used to read generic json compatible data as a tree in the JSON domain.
78
- * The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.
79
- *
80
- * @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.
81
- */
82
- function singleJsonCursor(root) {
83
- return (0, index_js_2.stackTreeNodeCursor)(adapter, root);
84
- }
85
- exports.singleJsonCursor = singleJsonCursor;
86
- /**
87
- * Extract a JS object tree from the contents of the given ITreeCursor.
88
- * Assumes that ITreeCursor contains only unaugmented JsonTypes.
89
- */
90
- function cursorToJsonObject(reader) {
91
- const type = reader.type;
92
- switch (type) {
93
- case leafDomain_js_1.leaf.number.name:
94
- case leafDomain_js_1.leaf.boolean.name:
95
- case leafDomain_js_1.leaf.string.name:
96
- (0, internal_1.assert)(reader.value !== undefined, 0x84f /* out of schema: missing value */);
97
- (0, internal_1.assert)(!(0, internal_2.isFluidHandle)(reader.value), 0x850 /* out of schema: unexpected FluidHandle */);
98
- return reader.value;
99
- case jsonDomainSchema_js_1.jsonArray.name: {
100
- reader.enterField(index_js_1.EmptyKey);
101
- const result = (0, index_js_1.mapCursorField)(reader, cursorToJsonObject);
102
- reader.exitField();
103
- return result;
104
- }
105
- case jsonDomainSchema_js_1.jsonObject.name: {
106
- const result = {};
107
- (0, index_js_1.mapCursorFields)(reader, (cursor) => {
108
- const key = cursor.getFieldKey();
109
- (0, internal_1.assert)(cursor.firstNode(), 0x420 /* expected non-empty field */);
110
- // like `result[key] = cursorToJsonObject(reader);` except safe when keyString == "__proto__".
111
- Object.defineProperty(result, key, {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: cursorToJsonObject(reader),
116
- });
117
- (0, internal_1.assert)(!cursor.nextNode(), 0x421 /* expected exactly one node */);
118
- });
119
- return result;
120
- }
121
- default: {
122
- (0, internal_1.assert)(type === leafDomain_js_1.leaf.null.name, 0x422 /* unexpected type */);
123
- return null;
124
- }
125
- }
126
- }
127
- exports.cursorToJsonObject = cursorToJsonObject;
128
- const typedJsonSymbol = Symbol("JSON Cursor Type");
129
- function isObject(json) {
130
- if (typeof json === "object" && json !== null) {
131
- const typed = json;
132
- return typed[typedJsonSymbol] !== undefined;
133
- }
134
- return false;
135
- }
136
- const typedAdapter = {
137
- value: (node) => {
138
- if ((0, internal_2.isFluidHandle)(node)) {
139
- return node;
140
- }
141
- // TODO: Get rid of this cast by combining TypedJsonCompatible and JsonCompatible into a single cursor with flags to configure behavior.
142
- // 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.
143
- return adapter.value(node);
144
- },
145
- type: (node) => {
146
- if ((0, internal_2.isFluidHandle)(node)) {
147
- return leafDomain_js_1.leaf.handle.name;
148
- }
149
- if (isObject(node)) {
150
- const type = node[typedJsonSymbol];
151
- return type instanceof index_js_2.TreeNodeSchemaBase ? type.name : (0, index_js_3.brand)(type);
152
- }
153
- return adapter.type(node);
154
- },
155
- keysFromNode: (node) => {
156
- if ((0, internal_2.isFluidHandle)(node)) {
157
- return [];
158
- }
159
- return adapter.keysFromNode(node);
160
- },
161
- getFieldFromNode: (node, key) => {
162
- if ((0, internal_2.isFluidHandle)(node)) {
163
- return [];
164
- }
165
- const field = adapter.getFieldFromNode(node, key);
166
- if ((0, index_js_3.isReadonlyArray)(field) && field.length === 1 && (0, index_js_3.isReadonlyArray)(field[0])) {
167
- // If the field is an array wrapping another array, then unbox to the inner array
168
- return field[0];
169
- }
170
- return field;
171
- },
172
- };
173
- /**
174
- * A variant of {@link singleJsonCursor} which allows types to be provided for nodes.
175
- *
176
- * @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.
177
- *
178
- * 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).
179
- *
180
- * It also allows Fluid handles as input.
181
- *
182
- * @example
183
- * ```ts
184
- * const cursor = typedJsonCursor({
185
- * [typedJsonCursor.type]: Point,
186
- * x: 3,
187
- * y: 42
188
- * });
189
- * ```
190
- */
191
- const singleTypedJsonCursor = function (root) {
192
- return (0, index_js_2.stackTreeNodeCursor)(typedAdapter, root);
193
- };
194
- exports.typedJsonCursor = singleTypedJsonCursor;
195
- singleTypedJsonCursor.type = typedJsonSymbol;
196
- // #endregion TypedJsonCursor
197
- //# sourceMappingURL=jsonCursor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonCursor.js","sourceRoot":"","sources":["../../../src/domains/json/jsonCursor.ts"],"names":[],"mappings":"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","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,32 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.jsonSchema = exports.jsonArray = exports.jsonObject = exports.jsonRoot = void 0;
8
- // Adding this unused import makes the generated d.ts file produced by TypeScript stop breaking API-Extractor's rollup generation.
9
- // Without this import, TypeScript generates inline `import("../..")` statements in the d.ts file,
10
- // which API-Extractor leaves as is when generating the rollup, leaving them pointing at the wrong directory.
11
- // API-Extractor issue: https://github.com/microsoft/rushstack/issues/4507
12
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
13
- const index_js_1 = require("../../core/index.js");
14
- const index_js_2 = require("../../feature-libraries/index.js");
15
- const leafDomain_js_1 = require("../leafDomain.js");
16
- const builder = new index_js_2.SchemaBuilderInternal({
17
- scope: "com.fluidframework.json",
18
- libraries: [leafDomain_js_1.leaf.library],
19
- });
20
- const jsonPrimitives = [...leafDomain_js_1.leaf.primitives, leafDomain_js_1.leaf.null];
21
- /**
22
- * Types allowed as roots of Json content.
23
- */
24
- exports.jsonRoot = [() => exports.jsonObject, () => exports.jsonArray, ...jsonPrimitives];
25
- {
26
- }
27
- exports.jsonObject = builder.mapRecursive("object", index_js_2.FlexFieldSchema.createUnsafe(index_js_2.FieldKinds.optional, exports.jsonRoot));
28
- exports.jsonArray = builder.objectRecursive("array", {
29
- [index_js_1.EmptyKey]: index_js_2.FlexFieldSchema.createUnsafe(index_js_2.FieldKinds.sequence, exports.jsonRoot),
30
- });
31
- exports.jsonSchema = builder.intoLibrary();
32
- //# 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,kDAA4D;AAC5D,+DAK0C;AAE1C,oDAAwC;AAExC,MAAM,OAAO,GAAG,IAAI,gCAAqB,CAAC;IACzC,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,CAAC,oBAAI,CAAC,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,GAAG,oBAAI,CAAC,UAAU,EAAE,oBAAI,CAAC,IAAI,CAAU,CAAC;AAEhE;;GAEG;AACU,QAAA,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,kBAAU,EAAE,GAAG,EAAE,CAAC,iBAAS,EAAE,GAAG,cAAc,CAAU,CAAC;AAExF,CAAC;AAGD,CAAC;AAEY,QAAA,UAAU,GAAG,OAAO,CAAC,YAAY,CAC7C,QAAQ,EACR,0BAAe,CAAC,YAAY,CAAC,qBAAU,CAAC,QAAQ,EAAE,gBAAQ,CAAC,CAC3D,CAAC;AAEW,QAAA,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE;IACzD,CAAC,mBAAQ,CAAC,EAAE,0BAAe,CAAC,YAAY,CAAC,qBAAU,CAAC,QAAQ,EAAE,gBAAQ,CAAC;CACvE,CAAC,CAAC;AAEU,QAAA,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"}
@@ -1,88 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.leaf = void 0;
8
- const index_js_1 = require("../core/index.js");
9
- const index_js_2 = require("../feature-libraries/index.js");
10
- /**
11
- * Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation
12
- */
13
- const builder = new index_js_2.SchemaBuilderInternal({ scope: "com.fluidframework.leaf" });
14
- const number = builder.leaf("number", index_js_1.ValueSchema.Number);
15
- const boolean = builder.leaf("boolean", index_js_1.ValueSchema.Boolean);
16
- const string = builder.leaf("string", index_js_1.ValueSchema.String);
17
- const handle = builder.leaf("handle", index_js_1.ValueSchema.FluidHandle);
18
- const nullSchema = builder.leaf("null", index_js_1.ValueSchema.Null);
19
- const primitives = [number, boolean, string];
20
- const all = [handle, nullSchema, ...primitives];
21
- const library = builder.intoLibrary();
22
- /**
23
- * Built-in {@link LeafNodeSchema}.
24
- */
25
- exports.leaf = {
26
- /**
27
- * {@link LeafNodeSchema} for holding a JavaScript `number`.
28
- *
29
- * @remarks
30
- * 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:
31
- * - `NaN`, and the infinities should not be used.
32
- * - `-0` may be converted to `0` in some cases.
33
- *
34
- * These limitations match the limitations of JSON.
35
- * @privateRemarks
36
- * TODO:
37
- * We should be much more clear about what happens if you use problematic values.
38
- * We should validate and/or normalize them when inserting content.
39
- */
40
- number,
41
- /**
42
- * {@link LeafNodeSchema} for holding a boolean.
43
- */
44
- boolean,
45
- /**
46
- * {@link LeafNodeSchema} for holding a JavaScript `string`.
47
- *
48
- * @remarks
49
- * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.
50
- *
51
- * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.
52
- * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.
53
- * @privateRemarks
54
- * TODO:
55
- * We should be much more clear about what happens if you use problematic values.
56
- * We should validate and/or normalize them when inserting content.
57
- */
58
- string,
59
- /**
60
- * {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
61
- */
62
- handle,
63
- /**
64
- * {@link LeafNodeSchema} for JavaScript `null`.
65
- *
66
- * @remarks
67
- * 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.
68
- * This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.
69
- * 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.
70
- */
71
- null: nullSchema,
72
- /**
73
- * The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.
74
- */
75
- primitives,
76
- /**
77
- * All {@link LeafNodeSchema} defined in this library..
78
- */
79
- all,
80
- /**
81
- * {@link SchemaLibrary} of the {@link LeafNodeSchema}.
82
- *
83
- * @privateRemarks
84
- * This is included by default in schema produced with {@link SchemaBuilder}.
85
- */
86
- library,
87
- };
88
- //# sourceMappingURL=leafDomain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leafDomain.js","sourceRoot":"","sources":["../../src/domains/leafDomain.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA+C;AAC/C,4DAAsE;AAEtE;;GAEG;AACH,MAAM,OAAO,GAAG,IAAI,gCAAqB,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAEhF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,sBAAW,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAW,CAAC,OAAO,CAAC,CAAC;AAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,sBAAW,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,sBAAW,CAAC,WAAW,CAAC,CAAC;AAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,sBAAW,CAAC,IAAI,CAAC,CAAC;AAE1D,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AACtD,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAU,CAAC;AAEzD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;AAEtC;;GAEG;AACU,QAAA,IAAI,GAAG;IACnB;;;;;;;;;;;;;OAaG;IACH,MAAM;IAEN;;OAEG;IACH,OAAO;IAEP;;;;;;;;;;;;OAYG;IACH,MAAM;IAEN;;OAEG;IACH,MAAM;IAEN;;;;;;;OAOG;IACH,IAAI,EAAE,UAAU;IAEhB;;OAEG;IACH,UAAU;IAEV;;OAEG;IACH,GAAG;IAEH;;;;;OAKG;IACH,OAAO;CACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ValueSchema } from \"../core/index.js\";\nimport { SchemaBuilderInternal } from \"../feature-libraries/index.js\";\n\n/**\n * Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n */\nconst builder = new SchemaBuilderInternal({ scope: \"com.fluidframework.leaf\" });\n\nconst number = builder.leaf(\"number\", ValueSchema.Number);\nconst boolean = builder.leaf(\"boolean\", ValueSchema.Boolean);\nconst string = builder.leaf(\"string\", ValueSchema.String);\nconst handle = builder.leaf(\"handle\", ValueSchema.FluidHandle);\nconst nullSchema = builder.leaf(\"null\", ValueSchema.Null);\n\nconst primitives = [number, boolean, string] as const;\nconst all = [handle, nullSchema, ...primitives] as const;\n\nconst library = builder.intoLibrary();\n\n/**\n * Built-in {@link LeafNodeSchema}.\n */\nexport const leaf = {\n\t/**\n\t * {@link LeafNodeSchema} for holding a JavaScript `number`.\n\t *\n\t * @remarks\n\t * 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:\n\t * - `NaN`, and the infinities should not be used.\n\t * - `-0` may be converted to `0` in some cases.\n\t *\n\t * These limitations match the limitations of JSON.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\tnumber,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding a boolean.\n\t */\n\tboolean,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding a JavaScript `string`.\n\t *\n\t * @remarks\n\t * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.\n\t *\n\t * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.\n\t * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\tstring,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.\n\t */\n\thandle,\n\n\t/**\n\t * {@link LeafNodeSchema} for JavaScript `null`.\n\t *\n\t * @remarks\n\t * 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.\n\t * This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.\n\t * 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.\n\t */\n\tnull: nullSchema,\n\n\t/**\n\t * The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.\n\t */\n\tprimitives,\n\n\t/**\n\t * All {@link LeafNodeSchema} defined in this library..\n\t */\n\tall,\n\n\t/**\n\t * {@link SchemaLibrary} of the {@link LeafNodeSchema}.\n\t *\n\t * @privateRemarks\n\t * This is included by default in schema produced with {@link SchemaBuilder}.\n\t */\n\tlibrary,\n};\n"]}