@fluidframework/tree 2.11.0 → 2.12.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 (537) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/tree.alpha.api.md +2 -2
  3. package/api-report/tree.beta.api.md +1 -1
  4. package/api-report/tree.legacy.alpha.api.md +1 -1
  5. package/api-report/tree.legacy.public.api.md +1 -1
  6. package/api-report/tree.public.api.md +1 -1
  7. package/dist/core/index.d.ts +2 -2
  8. package/dist/core/index.d.ts.map +1 -1
  9. package/dist/core/index.js +5 -3
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/core/rebase/utils.d.ts.map +1 -1
  12. package/dist/core/rebase/utils.js +2 -9
  13. package/dist/core/rebase/utils.js.map +1 -1
  14. package/dist/core/schema-stored/format.d.ts +0 -3
  15. package/dist/core/schema-stored/format.d.ts.map +1 -1
  16. package/dist/core/schema-stored/format.js.map +1 -1
  17. package/dist/core/schema-stored/schema.d.ts +12 -10
  18. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  19. package/dist/core/schema-stored/schema.js +3 -5
  20. package/dist/core/schema-stored/schema.js.map +1 -1
  21. package/dist/core/schema-view/index.d.ts +1 -1
  22. package/dist/core/schema-view/index.d.ts.map +1 -1
  23. package/dist/core/schema-view/index.js +1 -2
  24. package/dist/core/schema-view/index.js.map +1 -1
  25. package/dist/core/schema-view/view.d.ts +0 -7
  26. package/dist/core/schema-view/view.d.ts.map +1 -1
  27. package/dist/core/schema-view/view.js +1 -12
  28. package/dist/core/schema-view/view.js.map +1 -1
  29. package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
  30. package/dist/core/tree/chunk.d.ts.map +1 -0
  31. package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.js +2 -2
  32. package/dist/core/tree/chunk.js.map +1 -0
  33. package/dist/core/tree/index.d.ts +1 -0
  34. package/dist/core/tree/index.d.ts.map +1 -1
  35. package/dist/core/tree/index.js +5 -1
  36. package/dist/core/tree/index.js.map +1 -1
  37. package/dist/core/tree/treeTextFormat.d.ts +0 -5
  38. package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
  39. package/dist/core/tree/treeTextFormat.js.map +1 -1
  40. package/dist/core/tree/types.d.ts +0 -5
  41. package/dist/core/tree/types.d.ts.map +1 -1
  42. package/dist/core/tree/types.js +0 -1
  43. package/dist/core/tree/types.js.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
  45. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  46. package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -14
  47. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
  49. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -3
  51. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
  53. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  54. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
  56. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
  59. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  65. package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/emptyChunk.js +2 -3
  67. package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  69. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/index.js +5 -5
  71. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  73. package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/sequenceChunk.js +2 -2
  75. package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
  77. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/uniformChunk.js +13 -13
  79. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  80. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  81. package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
  82. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  83. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/schemaChecker.js +2 -1
  85. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  86. package/dist/feature-libraries/index.d.ts +1 -1
  87. package/dist/feature-libraries/index.d.ts.map +1 -1
  88. package/dist/feature-libraries/index.js +6 -2
  89. package/dist/feature-libraries/index.js.map +1 -1
  90. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
  91. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  92. package/dist/feature-libraries/indexing/anchorTreeIndex.js +31 -5
  93. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  94. package/dist/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
  95. package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  96. package/dist/feature-libraries/modular-schema/discrepancies.js +32 -33
  97. package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  98. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  99. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  100. package/dist/feature-libraries/modular-schema/index.js +5 -1
  101. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
  103. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -1
  105. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  106. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  107. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  108. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  109. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  110. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
  111. package/dist/feature-libraries/sequence-field/formatV1.d.ts +99 -99
  112. package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  113. package/dist/feature-libraries/sequence-field/formatV2.d.ts +76 -76
  114. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  115. package/dist/feature-libraries/sequence-field/formatV3.d.ts +54 -54
  116. package/dist/feature-libraries/sequence-field/types.d.ts +0 -1
  117. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  118. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  119. package/dist/index.d.ts +4 -5
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +1 -14
  122. package/dist/index.js.map +1 -1
  123. package/dist/packageVersion.d.ts +1 -1
  124. package/dist/packageVersion.js +1 -1
  125. package/dist/packageVersion.js.map +1 -1
  126. package/dist/shared-tree/index.d.ts +1 -1
  127. package/dist/shared-tree/index.d.ts.map +1 -1
  128. package/dist/shared-tree/index.js.map +1 -1
  129. package/dist/shared-tree/schematizeTree.d.ts +1 -1
  130. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  131. package/dist/shared-tree/schematizeTree.js +6 -6
  132. package/dist/shared-tree/schematizeTree.js.map +1 -1
  133. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  134. package/dist/shared-tree/schematizingTreeView.js +8 -12
  135. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  136. package/dist/shared-tree/sharedTree.d.ts +25 -7
  137. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  138. package/dist/shared-tree/sharedTree.js +104 -15
  139. package/dist/shared-tree/sharedTree.js.map +1 -1
  140. package/dist/shared-tree/treeCheckout.d.ts +35 -12
  141. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  142. package/dist/shared-tree/treeCheckout.js +159 -127
  143. package/dist/shared-tree/treeCheckout.js.map +1 -1
  144. package/dist/shared-tree-core/branch.d.ts +13 -35
  145. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  146. package/dist/shared-tree-core/branch.js +12 -77
  147. package/dist/shared-tree-core/branch.js.map +1 -1
  148. package/dist/shared-tree-core/branchCommitEnricher.d.ts +7 -1
  149. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  150. package/dist/shared-tree-core/branchCommitEnricher.js +16 -18
  151. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  152. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  153. package/dist/shared-tree-core/editManager.js +2 -2
  154. package/dist/shared-tree-core/editManager.js.map +1 -1
  155. package/dist/shared-tree-core/index.d.ts +3 -3
  156. package/dist/shared-tree-core/index.d.ts.map +1 -1
  157. package/dist/shared-tree-core/index.js +2 -2
  158. package/dist/shared-tree-core/index.js.map +1 -1
  159. package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -9
  160. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  161. package/dist/shared-tree-core/sharedTreeCore.js +4 -16
  162. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  163. package/dist/shared-tree-core/transaction.d.ts +38 -0
  164. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  165. package/dist/shared-tree-core/transaction.js +118 -6
  166. package/dist/shared-tree-core/transaction.js.map +1 -1
  167. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  168. package/dist/simple-tree/api/conciseTree.js +1 -1
  169. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  170. package/dist/simple-tree/api/create.d.ts.map +1 -1
  171. package/dist/simple-tree/api/create.js +5 -1
  172. package/dist/simple-tree/api/create.js.map +1 -1
  173. package/dist/simple-tree/api/customTree.d.ts +14 -2
  174. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  175. package/dist/simple-tree/api/customTree.js +53 -3
  176. package/dist/simple-tree/api/customTree.js.map +1 -1
  177. package/dist/simple-tree/api/index.d.ts +2 -2
  178. package/dist/simple-tree/api/index.d.ts.map +1 -1
  179. package/dist/simple-tree/api/index.js +4 -1
  180. package/dist/simple-tree/api/index.js.map +1 -1
  181. package/dist/simple-tree/api/schemaFactory.d.ts +48 -0
  182. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  183. package/dist/simple-tree/api/schemaFactory.js +5 -2
  184. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  185. package/dist/simple-tree/api/simpleSchema.d.ts +3 -1
  186. package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
  187. package/dist/simple-tree/api/simpleSchema.js.map +1 -1
  188. package/dist/simple-tree/api/simpleTreeIndex.js +3 -1
  189. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  190. package/dist/simple-tree/api/storedSchema.d.ts +4 -4
  191. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  192. package/dist/simple-tree/api/storedSchema.js +8 -21
  193. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  194. package/dist/simple-tree/api/tree.d.ts +1 -0
  195. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  196. package/dist/simple-tree/api/tree.js.map +1 -1
  197. package/dist/simple-tree/api/verboseTree.js +1 -1
  198. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  199. package/dist/simple-tree/api/view.d.ts +14 -9
  200. package/dist/simple-tree/api/view.d.ts.map +1 -1
  201. package/dist/simple-tree/api/view.js +129 -40
  202. package/dist/simple-tree/api/view.js.map +1 -1
  203. package/dist/simple-tree/index.d.ts +2 -2
  204. package/dist/simple-tree/index.d.ts.map +1 -1
  205. package/dist/simple-tree/index.js +5 -2
  206. package/dist/simple-tree/index.js.map +1 -1
  207. package/dist/simple-tree/leafNodeSchema.d.ts +0 -15
  208. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  209. package/dist/simple-tree/leafNodeSchema.js +0 -15
  210. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  211. package/dist/simple-tree/objectNode.d.ts +8 -3
  212. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  213. package/dist/simple-tree/objectNode.js +18 -2
  214. package/dist/simple-tree/objectNode.js.map +1 -1
  215. package/dist/simple-tree/objectNodeTypes.d.ts +4 -0
  216. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  217. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  218. package/dist/simple-tree/schemaTypes.d.ts +4 -2
  219. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  220. package/dist/simple-tree/schemaTypes.js.map +1 -1
  221. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  222. package/dist/simple-tree/toStoredSchema.js +18 -13
  223. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  224. package/dist/util/brand.d.ts +0 -2
  225. package/dist/util/brand.d.ts.map +1 -1
  226. package/dist/util/brand.js +0 -1
  227. package/dist/util/brand.js.map +1 -1
  228. package/dist/util/index.d.ts +1 -1
  229. package/dist/util/index.d.ts.map +1 -1
  230. package/dist/util/index.js +2 -1
  231. package/dist/util/index.js.map +1 -1
  232. package/dist/util/typeCheck.d.ts +0 -2
  233. package/dist/util/typeCheck.d.ts.map +1 -1
  234. package/dist/util/typeCheck.js.map +1 -1
  235. package/dist/util/utils.d.ts +13 -0
  236. package/dist/util/utils.d.ts.map +1 -1
  237. package/dist/util/utils.js +23 -1
  238. package/dist/util/utils.js.map +1 -1
  239. package/lib/core/index.d.ts +2 -2
  240. package/lib/core/index.d.ts.map +1 -1
  241. package/lib/core/index.js +2 -2
  242. package/lib/core/index.js.map +1 -1
  243. package/lib/core/rebase/utils.d.ts.map +1 -1
  244. package/lib/core/rebase/utils.js +3 -10
  245. package/lib/core/rebase/utils.js.map +1 -1
  246. package/lib/core/schema-stored/format.d.ts +0 -3
  247. package/lib/core/schema-stored/format.d.ts.map +1 -1
  248. package/lib/core/schema-stored/format.js.map +1 -1
  249. package/lib/core/schema-stored/schema.d.ts +12 -10
  250. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  251. package/lib/core/schema-stored/schema.js +3 -5
  252. package/lib/core/schema-stored/schema.js.map +1 -1
  253. package/lib/core/schema-view/index.d.ts +1 -1
  254. package/lib/core/schema-view/index.d.ts.map +1 -1
  255. package/lib/core/schema-view/index.js +1 -1
  256. package/lib/core/schema-view/index.js.map +1 -1
  257. package/lib/core/schema-view/view.d.ts +0 -7
  258. package/lib/core/schema-view/view.d.ts.map +1 -1
  259. package/lib/core/schema-view/view.js +0 -11
  260. package/lib/core/schema-view/view.js.map +1 -1
  261. package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
  262. package/lib/core/tree/chunk.d.ts.map +1 -0
  263. package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.js +1 -1
  264. package/lib/core/tree/chunk.js.map +1 -0
  265. package/lib/core/tree/index.d.ts +1 -0
  266. package/lib/core/tree/index.d.ts.map +1 -1
  267. package/lib/core/tree/index.js +1 -0
  268. package/lib/core/tree/index.js.map +1 -1
  269. package/lib/core/tree/treeTextFormat.d.ts +0 -5
  270. package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
  271. package/lib/core/tree/treeTextFormat.js.map +1 -1
  272. package/lib/core/tree/types.d.ts +0 -5
  273. package/lib/core/tree/types.d.ts.map +1 -1
  274. package/lib/core/tree/types.js +0 -1
  275. package/lib/core/tree/types.js.map +1 -1
  276. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
  277. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  278. package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
  279. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  280. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
  281. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  282. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -2
  283. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  284. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
  285. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  286. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  287. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
  288. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
  289. package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
  290. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
  291. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  292. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  293. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  294. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  295. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  296. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
  297. package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
  298. package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -2
  299. package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
  300. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  301. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  302. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  303. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  304. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
  305. package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
  306. package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
  307. package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
  308. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
  309. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  310. package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
  311. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  312. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  313. package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
  314. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  315. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  316. package/lib/feature-libraries/default-schema/schemaChecker.js +2 -1
  317. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  318. package/lib/feature-libraries/index.d.ts +1 -1
  319. package/lib/feature-libraries/index.d.ts.map +1 -1
  320. package/lib/feature-libraries/index.js +1 -1
  321. package/lib/feature-libraries/index.js.map +1 -1
  322. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
  323. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  324. package/lib/feature-libraries/indexing/anchorTreeIndex.js +31 -5
  325. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  326. package/lib/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
  327. package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
  328. package/lib/feature-libraries/modular-schema/discrepancies.js +25 -28
  329. package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
  330. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  331. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  332. package/lib/feature-libraries/modular-schema/index.js +1 -1
  333. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  334. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
  335. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  336. package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -1
  337. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  338. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
  339. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
  340. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
  341. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
  342. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
  343. package/lib/feature-libraries/sequence-field/formatV1.d.ts +99 -99
  344. package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
  345. package/lib/feature-libraries/sequence-field/formatV2.d.ts +76 -76
  346. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  347. package/lib/feature-libraries/sequence-field/formatV3.d.ts +54 -54
  348. package/lib/feature-libraries/sequence-field/types.d.ts +0 -1
  349. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  350. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  351. package/lib/index.d.ts +4 -5
  352. package/lib/index.d.ts.map +1 -1
  353. package/lib/index.js +2 -3
  354. package/lib/index.js.map +1 -1
  355. package/lib/packageVersion.d.ts +1 -1
  356. package/lib/packageVersion.js +1 -1
  357. package/lib/packageVersion.js.map +1 -1
  358. package/lib/shared-tree/index.d.ts +1 -1
  359. package/lib/shared-tree/index.d.ts.map +1 -1
  360. package/lib/shared-tree/index.js.map +1 -1
  361. package/lib/shared-tree/schematizeTree.d.ts +1 -1
  362. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  363. package/lib/shared-tree/schematizeTree.js +7 -7
  364. package/lib/shared-tree/schematizeTree.js.map +1 -1
  365. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  366. package/lib/shared-tree/schematizingTreeView.js +10 -14
  367. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  368. package/lib/shared-tree/sharedTree.d.ts +25 -7
  369. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  370. package/lib/shared-tree/sharedTree.js +105 -16
  371. package/lib/shared-tree/sharedTree.js.map +1 -1
  372. package/lib/shared-tree/treeCheckout.d.ts +35 -12
  373. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  374. package/lib/shared-tree/treeCheckout.js +161 -129
  375. package/lib/shared-tree/treeCheckout.js.map +1 -1
  376. package/lib/shared-tree-core/branch.d.ts +13 -35
  377. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  378. package/lib/shared-tree-core/branch.js +12 -76
  379. package/lib/shared-tree-core/branch.js.map +1 -1
  380. package/lib/shared-tree-core/branchCommitEnricher.d.ts +7 -1
  381. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  382. package/lib/shared-tree-core/branchCommitEnricher.js +16 -18
  383. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  384. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  385. package/lib/shared-tree-core/editManager.js +3 -3
  386. package/lib/shared-tree-core/editManager.js.map +1 -1
  387. package/lib/shared-tree-core/index.d.ts +3 -3
  388. package/lib/shared-tree-core/index.d.ts.map +1 -1
  389. package/lib/shared-tree-core/index.js +2 -2
  390. package/lib/shared-tree-core/index.js.map +1 -1
  391. package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -9
  392. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  393. package/lib/shared-tree-core/sharedTreeCore.js +4 -16
  394. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  395. package/lib/shared-tree-core/transaction.d.ts +38 -0
  396. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  397. package/lib/shared-tree-core/transaction.js +112 -1
  398. package/lib/shared-tree-core/transaction.js.map +1 -1
  399. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  400. package/lib/simple-tree/api/conciseTree.js +2 -2
  401. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  402. package/lib/simple-tree/api/create.d.ts.map +1 -1
  403. package/lib/simple-tree/api/create.js +5 -1
  404. package/lib/simple-tree/api/create.js.map +1 -1
  405. package/lib/simple-tree/api/customTree.d.ts +14 -2
  406. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  407. package/lib/simple-tree/api/customTree.js +50 -2
  408. package/lib/simple-tree/api/customTree.js.map +1 -1
  409. package/lib/simple-tree/api/index.d.ts +2 -2
  410. package/lib/simple-tree/api/index.d.ts.map +1 -1
  411. package/lib/simple-tree/api/index.js +2 -1
  412. package/lib/simple-tree/api/index.js.map +1 -1
  413. package/lib/simple-tree/api/schemaFactory.d.ts +48 -0
  414. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  415. package/lib/simple-tree/api/schemaFactory.js +4 -1
  416. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  417. package/lib/simple-tree/api/simpleSchema.d.ts +3 -1
  418. package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
  419. package/lib/simple-tree/api/simpleSchema.js.map +1 -1
  420. package/lib/simple-tree/api/simpleTreeIndex.js +3 -1
  421. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  422. package/lib/simple-tree/api/storedSchema.d.ts +4 -4
  423. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  424. package/lib/simple-tree/api/storedSchema.js +5 -18
  425. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  426. package/lib/simple-tree/api/tree.d.ts +1 -0
  427. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  428. package/lib/simple-tree/api/tree.js.map +1 -1
  429. package/lib/simple-tree/api/verboseTree.js +2 -2
  430. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  431. package/lib/simple-tree/api/view.d.ts +14 -9
  432. package/lib/simple-tree/api/view.d.ts.map +1 -1
  433. package/lib/simple-tree/api/view.js +131 -42
  434. package/lib/simple-tree/api/view.js.map +1 -1
  435. package/lib/simple-tree/index.d.ts +2 -2
  436. package/lib/simple-tree/index.d.ts.map +1 -1
  437. package/lib/simple-tree/index.js +2 -2
  438. package/lib/simple-tree/index.js.map +1 -1
  439. package/lib/simple-tree/leafNodeSchema.d.ts +0 -15
  440. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  441. package/lib/simple-tree/leafNodeSchema.js +0 -15
  442. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  443. package/lib/simple-tree/objectNode.d.ts +8 -3
  444. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  445. package/lib/simple-tree/objectNode.js +16 -1
  446. package/lib/simple-tree/objectNode.js.map +1 -1
  447. package/lib/simple-tree/objectNodeTypes.d.ts +4 -0
  448. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  449. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  450. package/lib/simple-tree/schemaTypes.d.ts +4 -2
  451. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  452. package/lib/simple-tree/schemaTypes.js.map +1 -1
  453. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  454. package/lib/simple-tree/toStoredSchema.js +19 -14
  455. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  456. package/lib/util/brand.d.ts +0 -2
  457. package/lib/util/brand.d.ts.map +1 -1
  458. package/lib/util/brand.js +0 -1
  459. package/lib/util/brand.js.map +1 -1
  460. package/lib/util/index.d.ts +1 -1
  461. package/lib/util/index.d.ts.map +1 -1
  462. package/lib/util/index.js +1 -1
  463. package/lib/util/index.js.map +1 -1
  464. package/lib/util/typeCheck.d.ts +0 -2
  465. package/lib/util/typeCheck.d.ts.map +1 -1
  466. package/lib/util/typeCheck.js.map +1 -1
  467. package/lib/util/utils.d.ts +13 -0
  468. package/lib/util/utils.d.ts.map +1 -1
  469. package/lib/util/utils.js +21 -0
  470. package/lib/util/utils.js.map +1 -1
  471. package/package.json +22 -22
  472. package/src/core/index.ts +5 -1
  473. package/src/core/rebase/utils.ts +17 -20
  474. package/src/core/schema-stored/format.ts +0 -3
  475. package/src/core/schema-stored/schema.ts +13 -10
  476. package/src/core/schema-view/index.ts +0 -1
  477. package/src/core/schema-view/view.ts +0 -11
  478. package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
  479. package/src/core/tree/index.ts +8 -0
  480. package/src/core/tree/treeTextFormat.ts +0 -5
  481. package/src/core/tree/types.ts +0 -5
  482. package/src/feature-libraries/chunked-forest/basicChunk.ts +4 -2
  483. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -1
  484. package/src/feature-libraries/chunked-forest/chunkedForest.ts +2 -1
  485. package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +1 -2
  486. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -2
  487. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  488. package/src/feature-libraries/chunked-forest/emptyChunk.ts +4 -2
  489. package/src/feature-libraries/chunked-forest/index.ts +1 -1
  490. package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
  491. package/src/feature-libraries/chunked-forest/uniformChunk.ts +4 -1
  492. package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
  493. package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
  494. package/src/feature-libraries/index.ts +13 -0
  495. package/src/feature-libraries/indexing/anchorTreeIndex.ts +34 -5
  496. package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
  497. package/src/feature-libraries/modular-schema/index.ts +13 -0
  498. package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
  499. package/src/feature-libraries/sequence-field/types.ts +0 -1
  500. package/src/index.ts +1 -29
  501. package/src/packageVersion.ts +1 -1
  502. package/src/shared-tree/index.ts +1 -0
  503. package/src/shared-tree/schematizeTree.ts +6 -10
  504. package/src/shared-tree/schematizingTreeView.ts +11 -21
  505. package/src/shared-tree/sharedTree.ts +173 -41
  506. package/src/shared-tree/treeCheckout.ts +224 -175
  507. package/src/shared-tree-core/branch.ts +29 -122
  508. package/src/shared-tree-core/branchCommitEnricher.ts +19 -20
  509. package/src/shared-tree-core/editManager.ts +3 -8
  510. package/src/shared-tree-core/index.ts +2 -1
  511. package/src/shared-tree-core/sharedTreeCore.ts +8 -19
  512. package/src/shared-tree-core/transaction.ts +145 -0
  513. package/src/simple-tree/api/conciseTree.ts +2 -2
  514. package/src/simple-tree/api/create.ts +5 -1
  515. package/src/simple-tree/api/customTree.ts +69 -1
  516. package/src/simple-tree/api/index.ts +12 -2
  517. package/src/simple-tree/api/schemaFactory.ts +62 -1
  518. package/src/simple-tree/api/simpleSchema.ts +3 -1
  519. package/src/simple-tree/api/simpleTreeIndex.ts +2 -0
  520. package/src/simple-tree/api/storedSchema.ts +7 -22
  521. package/src/simple-tree/api/tree.ts +6 -0
  522. package/src/simple-tree/api/verboseTree.ts +2 -2
  523. package/src/simple-tree/api/view.ts +197 -51
  524. package/src/simple-tree/index.ts +6 -0
  525. package/src/simple-tree/leafNodeSchema.ts +0 -19
  526. package/src/simple-tree/objectNode.ts +26 -2
  527. package/src/simple-tree/objectNodeTypes.ts +5 -0
  528. package/src/simple-tree/schemaTypes.ts +7 -2
  529. package/src/simple-tree/toStoredSchema.ts +25 -19
  530. package/src/util/brand.ts +0 -2
  531. package/src/util/index.ts +1 -0
  532. package/src/util/typeCheck.ts +0 -2
  533. package/src/util/utils.ts +26 -0
  534. package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
  535. package/dist/feature-libraries/chunked-forest/chunk.js.map +0 -1
  536. package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
  537. package/lib/feature-libraries/chunked-forest/chunk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/util/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,eAAe,MAAM,yBAAyB,CAAC;AA8BtD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAI,QAAW;IACvC,OAAO,QAAsB,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC;GACG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IACnC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,CAAyB;IAC3D,+EAA+E;IAC/E,wEAAwE;IACxE,oEAAoE;IACpE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAI,IAAY,EAAE,MAA4B;IACtE,MAAM,KAA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AAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB,MAAM,CAAC,4BAA4B,CAAC,CAAC;AA4BjF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAmB,CAAI;IAChD,8EAA8E;IAC9E,qEAAqE;IACrE,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7C,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC5B,qBAAqB;QACrB,OAAO,EAAmB,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAkB,CAAC;AACzF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAmB,CAAI,EAAE,CAAI;IAC1D,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { Type } from \"@sinclair/typebox\";\nimport structuredClone from \"@ungap/structured-clone\";\n\n/**\n * Subset of Map interface.\n */\nexport interface MapGetSet<K, V> {\n\tget(key: K): V | undefined;\n\tset(key: K, value: V): void;\n}\n\n/**\n * Make all transitive properties in T readonly\n */\nexport type RecursiveReadonly<T> = {\n\treadonly [P in keyof T]: RecursiveReadonly<T[P]>;\n};\n\n/**\n * Remove `readonly` from all fields.\n */\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] };\n\n/**\n * Make all field required and omits fields whose ony valid value would be `undefined`.\n * This is analogous to `Required<T>` except it tolerates 'optional undefined'.\n */\nexport type Populated<T> = {\n\t[P in keyof T as Exclude<P, T[P] extends undefined ? P : never>]-?: T[P];\n};\n\n/**\n * Casts a readonly object to a mutable one.\n * Better than casting to `Mutable<Foo>` because it doesn't risk casting a non-`Foo` to a `Mutable<Foo>`.\n * @param readonly - The object with readonly fields.\n * @returns The same object but with a type that makes all fields mutable.\n */\nexport function asMutable<T>(readonly: T): Mutable<T> {\n\treturn readonly as Mutable<T>;\n}\n\nexport const clone = structuredClone;\n\n/**\n */\nexport function fail(message: string): never {\n\tthrow new Error(message);\n}\n\n/**\n * Checks whether or not the given object is a `readonly` array.\n *\n * Note that this does NOT indicate if a given array should be treated as readonly.\n * This instead indicates if an object is an Array, and is typed to tolerate the readonly case.\n */\nexport function isReadonlyArray<T>(x: readonly T[] | unknown): x is readonly T[] {\n\t// `Array.isArray()` does not properly narrow `readonly` array types by itself,\n\t// so we wrap it in this type guard. This may become unnecessary if/when\n\t// https://github.com/microsoft/TypeScript/issues/17002 is resolved.\n\treturn Array.isArray(x);\n}\n\n/**\n * Creates and populates a new array.\n * @param size - The size of the array to be created.\n * @param filler - Callback for populating the array with a value for a given index\n */\nexport function makeArray<T>(size: number, filler: (index: number) => T): T[] {\n\tconst array = [];\n\tfor (let i = 0; i < size; ++i) {\n\t\tarray.push(filler(i));\n\t}\n\treturn array;\n}\n\n/**\n * Returns the last element of an array, or `undefined` if the array has no elements.\n * @param array - The array to get the last element from.\n * @remarks\n * If the type of the array has been narrowed by e.g. {@link hasSome | hasSome(array)} or {@link hasSingle | hasOne(array)} then the return type will be `T` rather than `T | undefined`.\n */\nexport function getLast<T>(array: readonly [T, ...T[]]): T;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined {\n\treturn array[array.length - 1];\n}\n\n/**\n * Returns true if and only if the given array has at least one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains at least one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSome<T>(array: T[]): array is [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is readonly [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is [T, ...T[]] {\n\treturn array.length > 0;\n}\n\n/**\n * Returns true if and only if the given array has exactly one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains exactly one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSingle<T>(array: T[]): array is [T];\nexport function hasSingle<T>(array: readonly T[]): array is readonly [T];\nexport function hasSingle<T>(array: readonly T[]): array is [T] {\n\treturn array.length === 1;\n}\n\n/**\n * Compares two sets using callbacks.\n * Early returns on first false comparison.\n *\n * @param a - One Set.\n * @param b - The other Set.\n * @param aExtra - Called for items in `a` but not `b`.\n * @param bExtra - Called for items in `b` but not `a`.\n * @param same - Called for items in `a` and `b`.\n * @returns false iff any of the call backs returned false.\n */\nexport function compareSets<T>({\n\ta,\n\tb,\n\taExtra,\n\tbExtra,\n\tsame,\n}: {\n\ta: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\tb: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\taExtra?: (t: T) => boolean;\n\tbExtra?: (t: T) => boolean;\n\tsame?: (t: T) => boolean;\n}): boolean {\n\tfor (const item of a.keys()) {\n\t\tif (!b.has(item)) {\n\t\t\tif (aExtra !== undefined) {\n\t\t\t\tif (!aExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif (same !== undefined && !same(item)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const item of b.keys()) {\n\t\tif (!a.has(item)) {\n\t\t\tif (bExtra !== undefined) {\n\t\t\t\tif (!bExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.\n * @param map - The map to query/update\n * @param key - The key to lookup in the map\n * @param defaultValue - a function which returns a default value. This is called and used to set an initial value for the given key in the map if none exists\n * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)\n */\nexport function getOrCreate<K, V>(\n\tmap: MapGetSet<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tlet value = map.get(key);\n\tif (value === undefined) {\n\t\tvalue = defaultValue(key);\n\t\tmap.set(key, value);\n\t}\n\treturn value;\n}\n\n/**\n * Utility for dictionaries whose values are lists.\n * Gets the list associated with the provided key, if it exists.\n * Otherwise, creates an entry with an empty list, and returns that list.\n */\nexport function getOrAddEmptyToMap<K, V>(map: MapGetSet<K, V[]>, key: K): V[] {\n\tlet collection = map.get(key);\n\tif (collection === undefined) {\n\t\tcollection = [];\n\t\tmap.set(key, collection);\n\t}\n\treturn collection;\n}\n\n/**\n * Map one iterable to another by transforming each element one at a time\n * @param iterable - the iterable to transform\n * @param map - the transformation function to run on each element of the iterable\n * @returns a new iterable of elements which have been transformed by the `map` function\n */\nexport function* mapIterable<T, U>(\n\titerable: Iterable<T>,\n\tmap: (t: T) => U,\n): IterableIterator<U> {\n\tfor (const t of iterable) {\n\t\tyield map(t);\n\t}\n}\n\n/**\n * Filter one iterable into another\n * @param iterable - the iterable to filter\n * @param filter - the predicate function to run on each element of the iterable\n * @returns a new iterable including only the elements that passed the filter predicate\n */\nexport function* filterIterable<T>(\n\titerable: Iterable<T>,\n\tfilter: (t: T) => boolean,\n): IterableIterator<T> {\n\tfor (const t of iterable) {\n\t\tif (filter(t)) {\n\t\t\tyield t;\n\t\t}\n\t}\n}\n\n/**\n * Finds the first element in the given iterable that satisfies a predicate.\n * @param iterable - The iterable to search for an eligible element\n * @param predicate - The predicate to run against each element\n * @returns The first element in the iterable that satisfies the predicate, or undefined if the iterable contains no such element\n */\nexport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\tfor (const t of iterable) {\n\t\tif (predicate(t)) {\n\t\t\treturn t;\n\t\t}\n\t}\n}\n\n/**\n * Counts the number of elements in the given iterable.\n * @param iterable - the iterable to enumerate\n * @returns the number of elements that were iterated after exhausting the iterable\n */\nexport function count(iterable: Iterable<unknown>): number {\n\tlet n = 0;\n\tfor (const _ of iterable) {\n\t\tn += 1;\n\t}\n\treturn n;\n}\n\n/**\n * Use for Json compatible data.\n *\n * @typeparam TExtra - Type permitted in addition to the normal JSON types.\n * Commonly used for to allow {@link @fluidframework/core-interfaces#IFluidHandle} within the otherwise JSON compatible content.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatible<TExtra = never> =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| JsonCompatible<TExtra>[]\n\t| JsonCompatibleObject<TExtra>\n\t| TExtra;\n\n/**\n * Use for Json object compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleObject<TExtra = never> = { [P in string]?: JsonCompatible<TExtra> };\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n */\nexport type JsonCompatibleReadOnly =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly JsonCompatibleReadOnly[]\n\t| JsonCompatibleReadOnlyObject;\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n */\nexport type JsonCompatibleReadOnlyObject = { readonly [P in string]?: JsonCompatibleReadOnly };\n\n/**\n * @remarks TODO: Audit usage of this type in schemas, evaluating whether it is necessary and performance\n * of alternatives.\n *\n * True \"arbitrary serializable data\" is probably fine, but some persisted types declarations might be better\n * expressed using composition of schemas for runtime validation, even if we don't think making the types\n * generic is worth the maintenance cost.\n */\nexport const JsonCompatibleReadOnlySchema = Type.Any();\n\n/**\n * Returns if a particular json compatible value is an object.\n * Does not include `null` or arrays.\n */\nexport function isJsonObject(\n\tvalue: JsonCompatibleReadOnly,\n): value is { readonly [P in string]?: JsonCompatibleReadOnly } {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Verifies that the supplied indices are valid within the supplied array.\n * @param startIndex - The starting index in the range. Must be in [0, length).\n * @param endIndex - The ending index in the range. Must be within (start, length].\n * @param array - The array the indices refer to\n */\nexport function assertValidRangeIndices(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n): void {\n\tassert(endIndex >= startIndex, 0x79c /* Range indices are malformed. */);\n\tassertValidIndex(startIndex, array, false);\n\tassertValidIndex(endIndex, array, true);\n}\n\nexport function assertValidIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tallowOnePastEnd: boolean = false,\n): void {\n\tassertNonNegativeSafeInteger(index);\n\tif (allowOnePastEnd) {\n\t\tassert(index <= array.length, 0x378 /* index must be less than or equal to length */);\n\t} else {\n\t\tassert(index < array.length, 0x379 /* index must be less than length */);\n\t}\n}\n\nexport function assertValidRange(\n\t{ start, end }: { start: number; end: number },\n\tarray: { readonly length: number },\n): void {\n\tassertNonNegativeSafeInteger(start);\n\tassertNonNegativeSafeInteger(end);\n\tassert(end <= array.length, 0x79d /* Range end must be less than or equal to length */);\n\tassert(start <= end, 0x79e /* Range start must be less than or equal to range start */);\n}\n\nexport function assertNonNegativeSafeInteger(index: number): void {\n\tassert(Number.isSafeInteger(index), 0x376 /* index must be an integer */);\n\tassert(index >= 0, 0x377 /* index must be non-negative */);\n}\n\n/**\n * Convert an object into a Map.\n *\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * This function helps these few cases get into using an actual map in as safe of was as is practical.\n */\nexport function objectToMap<MapKey extends string | number | symbol, MapValue>(\n\tobjectMap: Record<MapKey, MapValue>,\n): Map<MapKey, MapValue> {\n\tconst map = new Map<MapKey, MapValue>();\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tmap.set(key as MapKey, element);\n\t}\n\treturn map;\n}\n\n/**\n * Convert an object used as a map into a new object used like a map.\n *\n * @remarks\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * {@link objectToMap} helps these few cases get into using an actual map in as safe of a way as is practical.\n */\nexport function transformObjectMap<\n\tMapKey extends string | number | symbol,\n\tMapValue,\n\tNewMapValue,\n>(\n\tobjectMap: Record<MapKey, MapValue>,\n\ttransformer: (value: MapValue, key: MapKey) => NewMapValue,\n): Record<MapKey, MapValue> {\n\tconst output: Record<MapKey, MapValue> = Object.create(null);\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tObject.defineProperty(output, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: transformer(element, key as MapKey),\n\t\t});\n\t}\n\treturn output;\n}\n\n/**\n * Make an inverted copy of a map.\n *\n * @returns a map which can look up the keys from the values of the original map.\n */\nexport function invertMap<Key, Value>(input: Map<Key, Value>): Map<Value, Key> {\n\tconst result = new Map<Value, Key>(mapIterable(input, ([key, value]) => [value, key]));\n\tassert(\n\t\tresult.size === input.size,\n\t\t0x88a /* all values in a map must be unique to invert it */,\n\t);\n\treturn result;\n}\n\n/**\n * Returns the value from `set` if it contains exactly one item, otherwise `undefined`.\n */\nexport function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined {\n\tif (set === undefined) {\n\t\treturn undefined;\n\t}\n\tif (set.size !== 1) {\n\t\treturn undefined;\n\t}\n\tfor (const item of set) {\n\t\treturn item;\n\t}\n}\n\n/**\n * Type with a name describing what it is.\n * Typically used with values (like schema) that can be stored in a map, but in some representations have their name/key as a field.\n */\nexport interface Named<TName> {\n\treadonly name: TName;\n}\n\n/**\n * Order {@link Named} objects by their name.\n */\nexport function compareNamed(a: Named<string>, b: Named<string>): -1 | 0 | 1 {\n\tif (a.name < b.name) {\n\t\treturn -1;\n\t}\n\tif (a.name > b.name) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Placeholder for `Symbol.dispose`.\n * @privateRemarks\n * TODO: replace this with `Symbol.dispose` when it is available or make it a valid polyfill.\n */\nexport const disposeSymbol: unique symbol = Symbol(\"Symbol.dispose placeholder\");\n\n/**\n * An object with an explicit lifetime that can be ended.\n * @privateRemarks\n * Simpler alternative to core-utils/IDisposable for internal use in this package.\n * This avoids adding a named \"dispose\" method, and will eventually be replaced with\n * {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management| TypeScript's Disposable}.\n *\n * Once this is replaced with TypeScript's Disposable, core-utils/IDisposable can extend it, bringing the APIs into a reasonable alignment.\n */\nexport interface IDisposable {\n\t/**\n\t * Call to end the lifetime of this object.\n\t *\n\t * It is invalid to use this object after this,\n\t * except for operations which explicitly document they are valid after disposal.\n\t *\n\t * @remarks\n\t * May cleanup resources retained by this object.\n\t * Often includes un-registering from events and thus preventing other objects from retaining a reference to this indefinably.\n\t *\n\t * Usually the only operations allowed after disposal are querying if an object is already disposed,\n\t * but this can vary between implementations.\n\t */\n\t[disposeSymbol](): void;\n}\n\n/**\n * Capitalize a string.\n */\nexport function capitalize<S extends string>(s: S): Capitalize<S> {\n\t// To avoid splitting characters which are made of multiple UTF-16 code units,\n\t// use iteration instead of indexing to separate the first character.\n\tconst iterated = s[Symbol.iterator]().next();\n\tif (iterated.done === true) {\n\t\t// Empty string case.\n\t\treturn \"\" as Capitalize<S>;\n\t}\n\n\treturn (iterated.value.toUpperCase() + s.slice(iterated.value.length)) as Capitalize<S>;\n}\n\n/**\n * Compares strings lexically to form a strict partial ordering.\n */\nexport function compareStrings<T extends string>(a: T, b: T): number {\n\treturn a > b ? 1 : a === b ? 0 : -1;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/util/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,eAAe,MAAM,yBAAyB,CAAC;AA8BtD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAI,QAAW;IACvC,OAAO,QAAsB,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC;GACG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IACnC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,CAAyB;IA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AO,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;QAChC,GAAG;YACF,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;YACpB,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC;QACd,CAAC;QACD,YAAY,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,OAAO,GAAmC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { Type } from \"@sinclair/typebox\";\nimport structuredClone from \"@ungap/structured-clone\";\n\n/**\n * Subset of Map interface.\n */\nexport interface MapGetSet<K, V> {\n\tget(key: K): V | undefined;\n\tset(key: K, value: V): void;\n}\n\n/**\n * Make all transitive properties in T readonly\n */\nexport type RecursiveReadonly<T> = {\n\treadonly [P in keyof T]: RecursiveReadonly<T[P]>;\n};\n\n/**\n * Remove `readonly` from all fields.\n */\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] };\n\n/**\n * Make all field required and omits fields whose ony valid value would be `undefined`.\n * This is analogous to `Required<T>` except it tolerates 'optional undefined'.\n */\nexport type Populated<T> = {\n\t[P in keyof T as Exclude<P, T[P] extends undefined ? P : never>]-?: T[P];\n};\n\n/**\n * Casts a readonly object to a mutable one.\n * Better than casting to `Mutable<Foo>` because it doesn't risk casting a non-`Foo` to a `Mutable<Foo>`.\n * @param readonly - The object with readonly fields.\n * @returns The same object but with a type that makes all fields mutable.\n */\nexport function asMutable<T>(readonly: T): Mutable<T> {\n\treturn readonly as Mutable<T>;\n}\n\nexport const clone = structuredClone;\n\n/**\n */\nexport function fail(message: string): never {\n\tthrow new Error(message);\n}\n\n/**\n * Checks whether or not the given object is a `readonly` array.\n *\n * Note that this does NOT indicate if a given array should be treated as readonly.\n * This instead indicates if an object is an Array, and is typed to tolerate the readonly case.\n */\nexport function isReadonlyArray<T>(x: readonly T[] | unknown): x is readonly T[] {\n\t// `Array.isArray()` does not properly narrow `readonly` array types by itself,\n\t// so we wrap it in this type guard. This may become unnecessary if/when\n\t// https://github.com/microsoft/TypeScript/issues/17002 is resolved.\n\treturn Array.isArray(x);\n}\n\n/**\n * Creates and populates a new array.\n * @param size - The size of the array to be created.\n * @param filler - Callback for populating the array with a value for a given index\n */\nexport function makeArray<T>(size: number, filler: (index: number) => T): T[] {\n\tconst array = [];\n\tfor (let i = 0; i < size; ++i) {\n\t\tarray.push(filler(i));\n\t}\n\treturn array;\n}\n\n/**\n * Returns the last element of an array, or `undefined` if the array has no elements.\n * @param array - The array to get the last element from.\n * @remarks\n * If the type of the array has been narrowed by e.g. {@link hasSome | hasSome(array)} or {@link hasSingle | hasOne(array)} then the return type will be `T` rather than `T | undefined`.\n */\nexport function getLast<T>(array: readonly [T, ...T[]]): T;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined;\nexport function getLast<T>(array: { [index: number]: T; length: number }): T | undefined {\n\treturn array[array.length - 1];\n}\n\n/**\n * Returns true if and only if the given array has at least one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains at least one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSome<T>(array: T[]): array is [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is readonly [T, ...T[]];\nexport function hasSome<T>(array: readonly T[]): array is [T, ...T[]] {\n\treturn array.length > 0;\n}\n\n/**\n * Returns true if and only if the given array has exactly one element.\n * @param array - The array to check.\n * @remarks\n * If `array` contains exactly one element, its type will be narrowed and can benefit from improved typing from e.g. `array[0]` and {@link getLast | getLast(array)}.\n * This is especially useful when \"noUncheckedIndexedAccess\" is enabled in the TypeScript compiler options, since the return type of `array[0]` will be `T` rather than `T | undefined`.\n */\nexport function hasSingle<T>(array: T[]): array is [T];\nexport function hasSingle<T>(array: readonly T[]): array is readonly [T];\nexport function hasSingle<T>(array: readonly T[]): array is [T] {\n\treturn array.length === 1;\n}\n\n/**\n * Compares two sets using callbacks.\n * Early returns on first false comparison.\n *\n * @param a - One Set.\n * @param b - The other Set.\n * @param aExtra - Called for items in `a` but not `b`.\n * @param bExtra - Called for items in `b` but not `a`.\n * @param same - Called for items in `a` and `b`.\n * @returns false iff any of the call backs returned false.\n */\nexport function compareSets<T>({\n\ta,\n\tb,\n\taExtra,\n\tbExtra,\n\tsame,\n}: {\n\ta: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\tb: ReadonlySet<T> | ReadonlyMap<T, unknown>;\n\taExtra?: (t: T) => boolean;\n\tbExtra?: (t: T) => boolean;\n\tsame?: (t: T) => boolean;\n}): boolean {\n\tfor (const item of a.keys()) {\n\t\tif (!b.has(item)) {\n\t\t\tif (aExtra !== undefined) {\n\t\t\t\tif (!aExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif (same !== undefined && !same(item)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const item of b.keys()) {\n\t\tif (!a.has(item)) {\n\t\t\tif (bExtra !== undefined) {\n\t\t\t\tif (!bExtra(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.\n * @param map - The map to query/update\n * @param key - The key to lookup in the map\n * @param defaultValue - a function which returns a default value. This is called and used to set an initial value for the given key in the map if none exists\n * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)\n */\nexport function getOrCreate<K, V>(\n\tmap: MapGetSet<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tlet value = map.get(key);\n\tif (value === undefined) {\n\t\tvalue = defaultValue(key);\n\t\tmap.set(key, value);\n\t}\n\treturn value;\n}\n\n/**\n * Utility for dictionaries whose values are lists.\n * Gets the list associated with the provided key, if it exists.\n * Otherwise, creates an entry with an empty list, and returns that list.\n */\nexport function getOrAddEmptyToMap<K, V>(map: MapGetSet<K, V[]>, key: K): V[] {\n\tlet collection = map.get(key);\n\tif (collection === undefined) {\n\t\tcollection = [];\n\t\tmap.set(key, collection);\n\t}\n\treturn collection;\n}\n\n/**\n * Map one iterable to another by transforming each element one at a time\n * @param iterable - the iterable to transform\n * @param map - the transformation function to run on each element of the iterable\n * @returns a new iterable of elements which have been transformed by the `map` function\n */\nexport function* mapIterable<T, U>(\n\titerable: Iterable<T>,\n\tmap: (t: T) => U,\n): IterableIterator<U> {\n\tfor (const t of iterable) {\n\t\tyield map(t);\n\t}\n}\n\n/**\n * Filter one iterable into another\n * @param iterable - the iterable to filter\n * @param filter - the predicate function to run on each element of the iterable\n * @returns a new iterable including only the elements that passed the filter predicate\n */\nexport function* filterIterable<T>(\n\titerable: Iterable<T>,\n\tfilter: (t: T) => boolean,\n): IterableIterator<T> {\n\tfor (const t of iterable) {\n\t\tif (filter(t)) {\n\t\t\tyield t;\n\t\t}\n\t}\n}\n\n/**\n * Finds the first element in the given iterable that satisfies a predicate.\n * @param iterable - The iterable to search for an eligible element\n * @param predicate - The predicate to run against each element\n * @returns The first element in the iterable that satisfies the predicate, or undefined if the iterable contains no such element\n */\nexport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\tfor (const t of iterable) {\n\t\tif (predicate(t)) {\n\t\t\treturn t;\n\t\t}\n\t}\n}\n\n/**\n * Counts the number of elements in the given iterable.\n * @param iterable - the iterable to enumerate\n * @returns the number of elements that were iterated after exhausting the iterable\n */\nexport function count(iterable: Iterable<unknown>): number {\n\tlet n = 0;\n\tfor (const _ of iterable) {\n\t\tn += 1;\n\t}\n\treturn n;\n}\n\n/**\n * Use for Json compatible data.\n *\n * @typeparam TExtra - Type permitted in addition to the normal JSON types.\n * Commonly used for to allow {@link @fluidframework/core-interfaces#IFluidHandle} within the otherwise JSON compatible content.\n *\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatible<TExtra = never> =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| JsonCompatible<TExtra>[]\n\t| JsonCompatibleObject<TExtra>\n\t| TExtra;\n\n/**\n * Use for Json object compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n * @alpha\n */\nexport type JsonCompatibleObject<TExtra = never> = { [P in string]?: JsonCompatible<TExtra> };\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n */\nexport type JsonCompatibleReadOnly =\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly JsonCompatibleReadOnly[]\n\t| JsonCompatibleReadOnlyObject;\n\n/**\n * Use for readonly view of Json compatible data.\n * @remarks\n * This does not robustly forbid non json comparable data via type checking,\n * but instead mostly restricts access to it.\n */\nexport type JsonCompatibleReadOnlyObject = { readonly [P in string]?: JsonCompatibleReadOnly };\n\n/**\n * @remarks TODO: Audit usage of this type in schemas, evaluating whether it is necessary and performance\n * of alternatives.\n *\n * True \"arbitrary serializable data\" is probably fine, but some persisted types declarations might be better\n * expressed using composition of schemas for runtime validation, even if we don't think making the types\n * generic is worth the maintenance cost.\n */\nexport const JsonCompatibleReadOnlySchema = Type.Any();\n\n/**\n * Returns if a particular json compatible value is an object.\n * Does not include `null` or arrays.\n */\nexport function isJsonObject(\n\tvalue: JsonCompatibleReadOnly,\n): value is { readonly [P in string]?: JsonCompatibleReadOnly } {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Verifies that the supplied indices are valid within the supplied array.\n * @param startIndex - The starting index in the range. Must be in [0, length).\n * @param endIndex - The ending index in the range. Must be within (start, length].\n * @param array - The array the indices refer to\n */\nexport function assertValidRangeIndices(\n\tstartIndex: number,\n\tendIndex: number,\n\tarray: { readonly length: number },\n): void {\n\tassert(endIndex >= startIndex, 0x79c /* Range indices are malformed. */);\n\tassertValidIndex(startIndex, array, false);\n\tassertValidIndex(endIndex, array, true);\n}\n\nexport function assertValidIndex(\n\tindex: number,\n\tarray: { readonly length: number },\n\tallowOnePastEnd: boolean = false,\n): void {\n\tassertNonNegativeSafeInteger(index);\n\tif (allowOnePastEnd) {\n\t\tassert(index <= array.length, 0x378 /* index must be less than or equal to length */);\n\t} else {\n\t\tassert(index < array.length, 0x379 /* index must be less than length */);\n\t}\n}\n\nexport function assertValidRange(\n\t{ start, end }: { start: number; end: number },\n\tarray: { readonly length: number },\n): void {\n\tassertNonNegativeSafeInteger(start);\n\tassertNonNegativeSafeInteger(end);\n\tassert(end <= array.length, 0x79d /* Range end must be less than or equal to length */);\n\tassert(start <= end, 0x79e /* Range start must be less than or equal to range start */);\n}\n\nexport function assertNonNegativeSafeInteger(index: number): void {\n\tassert(Number.isSafeInteger(index), 0x376 /* index must be an integer */);\n\tassert(index >= 0, 0x377 /* index must be non-negative */);\n}\n\n/**\n * Convert an object into a Map.\n *\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * This function helps these few cases get into using an actual map in as safe of was as is practical.\n */\nexport function objectToMap<MapKey extends string | number | symbol, MapValue>(\n\tobjectMap: Record<MapKey, MapValue>,\n): Map<MapKey, MapValue> {\n\tconst map = new Map<MapKey, MapValue>();\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tmap.set(key as MapKey, element);\n\t}\n\treturn map;\n}\n\n/**\n * Convert an object used as a map into a new object used like a map.\n *\n * @remarks\n * This function must only be used with objects specifically intended to encode map like information.\n * The only time such objects should be used is for encoding maps as object literals to allow for developer ergonomics or JSON compatibility.\n * Even those two use-cases need to be carefully considered as using objects as maps can have a lot of issues\n * (including but not limited to unintended access to __proto__ and other non-owned keys).\n * {@link objectToMap} helps these few cases get into using an actual map in as safe of a way as is practical.\n */\nexport function transformObjectMap<\n\tMapKey extends string | number | symbol,\n\tMapValue,\n\tNewMapValue,\n>(\n\tobjectMap: Record<MapKey, MapValue>,\n\ttransformer: (value: MapValue, key: MapKey) => NewMapValue,\n): Record<MapKey, MapValue> {\n\tconst output: Record<MapKey, MapValue> = Object.create(null);\n\t// This function must only be used with objects specifically intended to encode map like information.\n\tfor (const key of Object.keys(objectMap)) {\n\t\tconst element = objectMap[key as MapKey];\n\t\tObject.defineProperty(output, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: transformer(element, key as MapKey),\n\t\t});\n\t}\n\treturn output;\n}\n\n/**\n * Make an inverted copy of a map.\n *\n * @returns a map which can look up the keys from the values of the original map.\n */\nexport function invertMap<Key, Value>(input: Map<Key, Value>): Map<Value, Key> {\n\tconst result = new Map<Value, Key>(mapIterable(input, ([key, value]) => [value, key]));\n\tassert(\n\t\tresult.size === input.size,\n\t\t0x88a /* all values in a map must be unique to invert it */,\n\t);\n\treturn result;\n}\n\n/**\n * Returns the value from `set` if it contains exactly one item, otherwise `undefined`.\n */\nexport function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined {\n\tif (set === undefined) {\n\t\treturn undefined;\n\t}\n\tif (set.size !== 1) {\n\t\treturn undefined;\n\t}\n\tfor (const item of set) {\n\t\treturn item;\n\t}\n}\n\n/**\n * Type with a name describing what it is.\n * Typically used with values (like schema) that can be stored in a map, but in some representations have their name/key as a field.\n */\nexport interface Named<TName> {\n\treadonly name: TName;\n}\n\n/**\n * Order {@link Named} objects by their name.\n */\nexport function compareNamed(a: Named<string>, b: Named<string>): -1 | 0 | 1 {\n\tif (a.name < b.name) {\n\t\treturn -1;\n\t}\n\tif (a.name > b.name) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Placeholder for `Symbol.dispose`.\n * @privateRemarks\n * TODO: replace this with `Symbol.dispose` when it is available or make it a valid polyfill.\n */\nexport const disposeSymbol: unique symbol = Symbol(\"Symbol.dispose placeholder\");\n\n/**\n * An object with an explicit lifetime that can be ended.\n * @privateRemarks\n * Simpler alternative to core-utils/IDisposable for internal use in this package.\n * This avoids adding a named \"dispose\" method, and will eventually be replaced with\n * {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management| TypeScript's Disposable}.\n *\n * Once this is replaced with TypeScript's Disposable, core-utils/IDisposable can extend it, bringing the APIs into a reasonable alignment.\n */\nexport interface IDisposable {\n\t/**\n\t * Call to end the lifetime of this object.\n\t *\n\t * It is invalid to use this object after this,\n\t * except for operations which explicitly document they are valid after disposal.\n\t *\n\t * @remarks\n\t * May cleanup resources retained by this object.\n\t * Often includes un-registering from events and thus preventing other objects from retaining a reference to this indefinably.\n\t *\n\t * Usually the only operations allowed after disposal are querying if an object is already disposed,\n\t * but this can vary between implementations.\n\t */\n\t[disposeSymbol](): void;\n}\n\n/**\n * Capitalize a string.\n */\nexport function capitalize<S extends string>(s: S): Capitalize<S> {\n\t// To avoid splitting characters which are made of multiple UTF-16 code units,\n\t// use iteration instead of indexing to separate the first character.\n\tconst iterated = s[Symbol.iterator]().next();\n\tif (iterated.done === true) {\n\t\t// Empty string case.\n\t\treturn \"\" as Capitalize<S>;\n\t}\n\n\treturn (iterated.value.toUpperCase() + s.slice(iterated.value.length)) as Capitalize<S>;\n}\n\n/**\n * Compares strings lexically to form a strict partial ordering.\n */\nexport function compareStrings<T extends string>(a: T, b: T): number {\n\treturn a > b ? 1 : a === b ? 0 : -1;\n}\n\n/**\n * Defines a property on an object that is lazily initialized and cached.\n * @remarks This is useful for properties that are expensive to compute and it is not guaranteed that they will be accessed.\n * This function initially defines a getter on the object, but after first read it replaces the getter with a value property.\n * @param obj - The object on which to define the property.\n * @param key - The key of the property to define.\n * @param get - The function (called either once or not at all) to compute the value of the property.\n * @returns `obj`, typed such that it has the new property.\n * This allows for the new property to be read off of `obj` in a type-safe manner after calling this function.\n */\nexport function defineLazyCachedProperty<\n\tT extends object,\n\tK extends string | number | symbol,\n\tV,\n>(obj: T, key: K, get: () => V): typeof obj & { [P in K]: V } {\n\tReflect.defineProperty(obj, key, {\n\t\tget() {\n\t\t\tconst value = get();\n\t\t\tReflect.defineProperty(obj, key, { value });\n\t\t\treturn value;\n\t\t},\n\t\tconfigurable: true,\n\t});\n\treturn obj as typeof obj & { [P in K]: V };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tree",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -89,17 +89,17 @@
89
89
  "temp-directory": "nyc/.nyc_output"
90
90
  },
91
91
  "dependencies": {
92
- "@fluid-internal/client-utils": "~2.11.0",
93
- "@fluidframework/container-runtime": "~2.11.0",
94
- "@fluidframework/core-interfaces": "~2.11.0",
95
- "@fluidframework/core-utils": "~2.11.0",
96
- "@fluidframework/datastore-definitions": "~2.11.0",
97
- "@fluidframework/driver-definitions": "~2.11.0",
98
- "@fluidframework/id-compressor": "~2.11.0",
99
- "@fluidframework/runtime-definitions": "~2.11.0",
100
- "@fluidframework/runtime-utils": "~2.11.0",
101
- "@fluidframework/shared-object-base": "~2.11.0",
102
- "@fluidframework/telemetry-utils": "~2.11.0",
92
+ "@fluid-internal/client-utils": "~2.12.0",
93
+ "@fluidframework/container-runtime": "~2.12.0",
94
+ "@fluidframework/core-interfaces": "~2.12.0",
95
+ "@fluidframework/core-utils": "~2.12.0",
96
+ "@fluidframework/datastore-definitions": "~2.12.0",
97
+ "@fluidframework/driver-definitions": "~2.12.0",
98
+ "@fluidframework/id-compressor": "~2.12.0",
99
+ "@fluidframework/runtime-definitions": "~2.12.0",
100
+ "@fluidframework/runtime-utils": "~2.12.0",
101
+ "@fluidframework/shared-object-base": "~2.12.0",
102
+ "@fluidframework/telemetry-utils": "~2.12.0",
103
103
  "@sinclair/typebox": "^0.32.29",
104
104
  "@tylerbu/sorted-btree-es6": "^1.8.0",
105
105
  "@types/ungap__structured-clone": "^1.2.0",
@@ -107,22 +107,22 @@
107
107
  "uuid": "^9.0.0"
108
108
  },
109
109
  "devDependencies": {
110
- "@arethetypeswrong/cli": "^0.16.4",
110
+ "@arethetypeswrong/cli": "^0.17.1",
111
111
  "@biomejs/biome": "~1.9.3",
112
- "@fluid-internal/mocha-test-setup": "~2.11.0",
113
- "@fluid-private/stochastic-test-utils": "~2.11.0",
114
- "@fluid-private/test-dds-utils": "~2.11.0",
115
- "@fluid-private/test-drivers": "~2.11.0",
112
+ "@fluid-internal/mocha-test-setup": "~2.12.0",
113
+ "@fluid-private/stochastic-test-utils": "~2.12.0",
114
+ "@fluid-private/test-dds-utils": "~2.12.0",
115
+ "@fluid-private/test-drivers": "~2.12.0",
116
116
  "@fluid-tools/benchmark": "^0.50.0",
117
117
  "@fluid-tools/build-cli": "^0.51.0",
118
118
  "@fluidframework/build-common": "^2.0.3",
119
119
  "@fluidframework/build-tools": "^0.51.0",
120
- "@fluidframework/container-definitions": "~2.11.0",
121
- "@fluidframework/container-loader": "~2.11.0",
120
+ "@fluidframework/container-definitions": "~2.12.0",
121
+ "@fluidframework/container-loader": "~2.12.0",
122
122
  "@fluidframework/eslint-config-fluid": "^5.6.0",
123
- "@fluidframework/test-runtime-utils": "~2.11.0",
124
- "@fluidframework/test-utils": "~2.11.0",
125
- "@fluidframework/tree-previous": "npm:@fluidframework/tree@2.10.0",
123
+ "@fluidframework/test-runtime-utils": "~2.12.0",
124
+ "@fluidframework/test-utils": "~2.12.0",
125
+ "@fluidframework/tree-previous": "npm:@fluidframework/tree@2.11.0",
126
126
  "@microsoft/api-extractor": "7.47.8",
127
127
  "@types/diff": "^3.5.1",
128
128
  "@types/easy-table": "^0.0.32",
package/src/core/index.ts CHANGED
@@ -99,6 +99,11 @@ export {
99
99
  type DeltaFieldChanges,
100
100
  type ExclusiveMapTree,
101
101
  deepCopyMapTree,
102
+ type TreeChunk,
103
+ dummyRoot,
104
+ cursorChunk,
105
+ tryGetChunk,
106
+ type ChunkedCursor,
102
107
  } from "./tree/index.js";
103
108
 
104
109
  export {
@@ -202,7 +207,6 @@ export {
202
207
  export {
203
208
  type Adapters,
204
209
  AdaptedViewSchema,
205
- Compatibility,
206
210
  type TreeAdapter,
207
211
  AllowedUpdateType,
208
212
  } from "./schema-view/index.js";
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { assert, oob } from "@fluidframework/core-utils/internal";
7
7
 
8
- import { hasSome, type Mutable } from "../../util/index.js";
8
+ import { defineLazyCachedProperty, hasSome, type Mutable } from "../../util/index.js";
9
9
 
10
10
  import {
11
11
  type ChangeRebaser,
@@ -312,26 +312,23 @@ export function rebaseBranch<TChange>(
312
312
  revInfos.unshift({ revision: rollback.revision, rollbackOf: rollback.rollbackOf });
313
313
  }
314
314
 
315
- let netChange: TChange | undefined;
316
- return {
317
- newSourceHead: newHead,
318
- get sourceChange(): TChange | undefined {
319
- if (netChange === undefined) {
320
- netChange = changeRebaser.compose(editsToCompose);
321
- }
322
- return netChange;
323
- },
324
- commits: {
325
- deletedSourceCommits,
326
- targetCommits,
327
- sourceCommits,
328
- },
329
- telemetryProperties: {
330
- sourceBranchLength,
331
- rebaseDistance: targetCommits.length,
332
- countDropped: sourceBranchLength - sourceSet.size,
315
+ return defineLazyCachedProperty(
316
+ {
317
+ newSourceHead: newHead,
318
+ commits: {
319
+ deletedSourceCommits,
320
+ targetCommits,
321
+ sourceCommits,
322
+ },
323
+ telemetryProperties: {
324
+ sourceBranchLength,
325
+ rebaseDistance: targetCommits.length,
326
+ countDropped: sourceBranchLength - sourceSet.size,
327
+ },
333
328
  },
334
- };
329
+ "sourceChange",
330
+ () => changeRebaser.compose(editsToCompose),
331
+ );
335
332
  }
336
333
 
337
334
  /**
@@ -14,7 +14,6 @@ export const version = 1 as const;
14
14
  * Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.
15
15
  *
16
16
  * Stable identifier, used when persisting data.
17
- * @internal
18
17
  */
19
18
  export type FieldKey = Brand<string, "tree.FieldKey">;
20
19
 
@@ -28,7 +27,6 @@ export const FieldKeySchema = brandedStringType<FieldKey>();
28
27
  * Also known as "Definition"
29
28
  *
30
29
  * Stable identifier, used when persisting data.
31
- * @internal
32
30
  */
33
31
  export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<
34
32
  TName,
@@ -40,7 +38,6 @@ export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<
40
38
  * Refers to an exact stable policy (ex: specific version of a policy),
41
39
  * for how to handle (ex: edit and merge edits to) fields marked with this kind.
42
40
  * Persisted in documents as part of stored schema.
43
- * @internal
44
41
  */
45
42
  export type FieldKindIdentifier = Brand<string, "tree.FieldKindIdentifier">;
46
43
  export const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();
@@ -17,7 +17,9 @@ import {
17
17
  import type { Multiplicity } from "./multiplicity.js";
18
18
 
19
19
  /**
20
- * Schema for what {@link TreeValue} is allowed on a Leaf node.
20
+ * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.
21
+ * @privateRemarks
22
+ * See also {@link TreeValue}.
21
23
  * @internal
22
24
  */
23
25
  export enum ValueSchema {
@@ -51,7 +53,6 @@ export enum ValueSchema {
51
53
  * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.
52
54
  *
53
55
  * Care would need to be taken to make sure this is sound for the schema updating mechanisms.
54
- * @internal
55
56
  */
56
57
  export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;
57
58
 
@@ -91,12 +92,21 @@ export interface SchemaPolicy {
91
92
  * If true, new content inserted into the tree should be validated against the stored schema.
92
93
  */
93
94
  readonly validateSchema: boolean;
95
+
96
+ /**
97
+ * Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)
98
+ * contains optional fields that are not known to the view schema.
99
+ *
100
+ * @privateRemarks
101
+ * Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places
102
+ * that need it (schema validation, view vs stored compatibility checks).
103
+ */
104
+ allowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;
94
105
  }
95
106
 
96
107
  /**
97
108
  * Schema for a field.
98
109
  * Object implementing this interface should never be modified.
99
- * @internal
100
110
  */
101
111
  export interface TreeFieldStoredSchema {
102
112
  readonly kind: FieldKindIdentifier;
@@ -136,7 +146,6 @@ export const identifierFieldKindIdentifier = "Identifier";
136
146
 
137
147
  /**
138
148
  * Opaque type erased handle to the encoded representation of the contents of a stored schema.
139
- * @internal
140
149
  */
141
150
  export interface ErasedTreeNodeSchemaDataFormat
142
151
  extends ErasedType<"TreeNodeSchemaDataFormat"> {}
@@ -154,7 +163,6 @@ export function toTreeNodeSchemaDataFormat(
154
163
  }
155
164
 
156
165
  /**
157
- * @internal
158
166
  */
159
167
  export abstract class TreeNodeStoredSchema {
160
168
  protected _typeCheck!: MakeNominal;
@@ -174,7 +182,6 @@ export abstract class TreeNodeStoredSchema {
174
182
  }
175
183
 
176
184
  /**
177
- * @internal
178
185
  */
179
186
  export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
180
187
  /**
@@ -214,7 +221,6 @@ export class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
214
221
  }
215
222
 
216
223
  /**
217
- * @internal
218
224
  */
219
225
  export class MapNodeStoredSchema extends TreeNodeStoredSchema {
220
226
  /**
@@ -241,7 +247,6 @@ export class MapNodeStoredSchema extends TreeNodeStoredSchema {
241
247
  }
242
248
 
243
249
  /**
244
- * @internal
245
250
  */
246
251
  export class LeafNodeStoredSchema extends TreeNodeStoredSchema {
247
252
  /**
@@ -330,7 +335,6 @@ export function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSch
330
335
  * @remarks
331
336
  * Note: the owner of this may modify it over time:
332
337
  * thus if needing to hand onto a specific version, make a copy.
333
- * @internal
334
338
  */
335
339
  export interface TreeStoredSchema extends StoredSchemaCollection {
336
340
  /**
@@ -345,7 +349,6 @@ export interface TreeStoredSchema extends StoredSchemaCollection {
345
349
  * @remarks
346
350
  * Note: the owner of this may modify it over time:
347
351
  * thus if needing to hang onto a specific version, make a copy.
348
- * @internal
349
352
  */
350
353
  export interface StoredSchemaCollection {
351
354
  /**
@@ -5,7 +5,6 @@
5
5
 
6
6
  export {
7
7
  type Adapters,
8
- Compatibility,
9
8
  type TreeAdapter,
10
9
  AdaptedViewSchema,
11
10
  AllowedUpdateType,
@@ -9,17 +9,6 @@ import type { TreeNodeSchemaIdentifier, TreeStoredSchema } from "../schema-store
9
9
  * APIs for applying `view schema` to documents.
10
10
  */
11
11
 
12
- /**
13
- * How compatible a particular view schema is for some operation on some specific document.
14
- */
15
- export enum Compatibility {
16
- Incompatible,
17
- // For write compatibility this can include compatible schema updates to stored schema.
18
- // TODO: separate schema updates from adapters.
19
- // RequiresAdapters,
20
- Compatible,
21
- }
22
-
23
12
  /**
24
13
  * What kinds of updates to stored schema to permit.
25
14
  *
@@ -5,14 +5,14 @@
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
 
8
+ import type { ReferenceCounted } from "../../util/index.js";
9
+ import type { FieldKey } from "../schema-stored/index.js";
10
+ import { rootFieldKey } from "./types.js";
8
11
  import {
9
12
  CursorLocationType,
10
- type FieldKey,
11
13
  type ITreeCursor,
12
14
  type ITreeCursorSynchronous,
13
- rootFieldKey,
14
- } from "../../core/index.js";
15
- import type { ReferenceCounted } from "../../util/index.js";
15
+ } from "./cursor.js";
16
16
 
17
17
  /**
18
18
  * Contiguous part of the tree which get stored together in some data format.
@@ -111,5 +111,13 @@ export {
111
111
  emptyDelta,
112
112
  } from "./deltaUtil.js";
113
113
 
114
+ export {
115
+ type TreeChunk,
116
+ dummyRoot,
117
+ cursorChunk,
118
+ tryGetChunk,
119
+ type ChunkedCursor,
120
+ } from "./chunk.js";
121
+
114
122
  export { DetachedFieldIndex } from "./detachedFieldIndex.js";
115
123
  export { type ForestRootId } from "./detachedFieldIndexTypes.js";
@@ -49,8 +49,6 @@ import type { NodeData } from "./types.js";
49
49
  * Only use this type when needed for json compatible maps,
50
50
  * but even in those cases consider lists of key value pairs for serialization and using `Map`
51
51
  * for runtime.
52
- *
53
- * @internal
54
52
  */
55
53
  export interface FieldMapObject<TChild> {
56
54
  [key: string]: TChild[];
@@ -59,14 +57,12 @@ export interface FieldMapObject<TChild> {
59
57
  /**
60
58
  * Json comparable tree node, generic over child type.
61
59
  * Json compatibility assumes `TChild` is also json compatible.
62
- * @internal
63
60
  */
64
61
  export interface GenericTreeNode<TChild> extends GenericFieldsNode<TChild>, NodeData {}
65
62
 
66
63
  /**
67
64
  * Json comparable field collection, generic over child type.
68
65
  * Json compatibility assumes `TChild` is also json compatible.
69
- * @internal
70
66
  */
71
67
  export interface GenericFieldsNode<TChild> {
72
68
  fields?: FieldMapObject<TChild>;
@@ -79,7 +75,6 @@ export interface GenericFieldsNode<TChild> {
79
75
  * {@link @fluidframework/shared-object-base#IFluidSerializer.stringify} must be used instead of `JSON.stringify`.
80
76
  *
81
77
  * JsonableTrees should not store empty fields.
82
- * @internal
83
78
  */
84
79
  export interface JsonableTree extends GenericTreeNode<JsonableTree> {}
85
80
 
@@ -33,7 +33,6 @@ export type TreeType = TreeNodeSchemaIdentifier;
33
33
  * This has to be a FieldKey since different nodes will have different TreeFieldStoredSchema for it.
34
34
  * This makes it prone to collisions and suggests
35
35
  * that this intention may be better conveyed by metadata on the ITreeSchema.
36
- * @internal
37
36
  */
38
37
  export const EmptyKey: FieldKey = brand("");
39
38
 
@@ -116,7 +115,6 @@ export interface FieldKind {
116
115
 
117
116
  /**
118
117
  * Value that may be stored on a leaf node.
119
- * @internal
120
118
  */
121
119
  export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
122
120
  {
@@ -131,7 +129,6 @@ export type TreeValue<TSchema extends ValueSchema = ValueSchema> = [
131
129
 
132
130
  /**
133
131
  * Value stored on a node.
134
- * @internal
135
132
  */
136
133
  export type Value = undefined | TreeValue;
137
134
 
@@ -141,8 +138,6 @@ export type Value = undefined | TreeValue;
141
138
  * @privateRemarks A forked version of this type is used in `persistedTreeTextFormat.ts`.
142
139
  * Changes to this type might necessitate changes to `EncodedNodeData` or codecs.
143
140
  * See persistedTreeTextFormat's module documentation for more details.
144
- *
145
- * @internal
146
141
  */
147
142
  export interface NodeData {
148
143
  /**
@@ -15,12 +15,14 @@ import {
15
15
  type TreeValue,
16
16
  type UpPath,
17
17
  type Value,
18
+ type ChunkedCursor,
19
+ type TreeChunk,
20
+ cursorChunk,
21
+ dummyRoot,
18
22
  } from "../../core/index.js";
19
23
  import { ReferenceCountedBase, fail } from "../../util/index.js";
20
24
  import { SynchronousCursor, prefixPath } from "../treeCursorUtils.js";
21
25
 
22
- import { type ChunkedCursor, type TreeChunk, cursorChunk, dummyRoot } from "./chunk.js";
23
-
24
26
  /**
25
27
  * General purpose one node chunk.
26
28
  */
@@ -21,12 +21,13 @@ import {
21
21
  mapCursorFields,
22
22
  Multiplicity,
23
23
  ValueSchema,
24
+ type TreeChunk,
25
+ tryGetChunk,
24
26
  } from "../../core/index.js";
25
27
  import { fail, getOrCreate } from "../../util/index.js";
26
28
  import type { FullSchemaPolicy } from "../modular-schema/index.js";
27
29
 
28
30
  import { BasicChunk } from "./basicChunk.js";
29
- import { type TreeChunk, tryGetChunk } from "./chunk.js";
30
31
  import { SequenceChunk } from "./sequenceChunk.js";
31
32
  import { type FieldShape, TreeShape, UniformChunk } from "./uniformChunk.js";
32
33
  import { isStableNodeKey } from "../node-key/index.js";
@@ -31,6 +31,8 @@ import {
31
31
  detachedFieldAsKey,
32
32
  mapCursorField,
33
33
  rootFieldKey,
34
+ type ChunkedCursor,
35
+ type TreeChunk,
34
36
  } from "../../core/index.js";
35
37
  import {
36
38
  assertValidRange,
@@ -42,7 +44,6 @@ import {
42
44
  } from "../../util/index.js";
43
45
 
44
46
  import { BasicChunk, BasicChunkCursor, type SiblingsOrKey } from "./basicChunk.js";
45
- import type { ChunkedCursor, TreeChunk } from "./chunk.js";
46
47
  import { type IChunker, basicChunkTree, chunkTree } from "./chunkTree.js";
47
48
  import type { IIdCompressor } from "@fluidframework/id-compressor";
48
49
 
@@ -5,10 +5,9 @@
5
5
 
6
6
  import { assert, oob } from "@fluidframework/core-utils/internal";
7
7
 
8
- import type { TreeValue } from "../../../core/index.js";
8
+ import type { TreeValue, TreeChunk } from "../../../core/index.js";
9
9
  import { assertValidIndex } from "../../../util/index.js";
10
10
  import { type FluidSerializableReadOnly, assertAllowedValue } from "../../valueUtilities.js";
11
- import type { TreeChunk } from "../chunk.js";
12
11
 
13
12
  /**
14
13
  * Utilities related to chunk encoding and decoding that do not depend on specific chunk types or formats.
@@ -6,10 +6,14 @@
6
6
  import { assert, unreachableCase, oob } from "@fluidframework/core-utils/internal";
7
7
 
8
8
  import { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
9
- import type { FieldKey, TreeNodeSchemaIdentifier, Value } from "../../../core/index.js";
9
+ import type {
10
+ FieldKey,
11
+ TreeNodeSchemaIdentifier,
12
+ Value,
13
+ TreeChunk,
14
+ } from "../../../core/index.js";
10
15
  import { assertValidIndex } from "../../../util/index.js";
11
16
  import { BasicChunk } from "../basicChunk.js";
12
- import type { TreeChunk } from "../chunk.js";
13
17
  import { emptyChunk } from "../emptyChunk.js";
14
18
  import { SequenceChunk } from "../sequenceChunk.js";
15
19
 
@@ -7,7 +7,7 @@ import { assert } from "@fluidframework/core-utils/internal";
7
7
 
8
8
  import type { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
9
9
  import type { BrandedType } from "../../../util/index.js";
10
- import type { TreeChunk } from "../chunk.js";
10
+ import type { TreeChunk } from "../../../core/index.js";
11
11
 
12
12
  import {
13
13
  type ChunkDecoder,
@@ -10,12 +10,14 @@ import {
10
10
  type FieldUpPath,
11
11
  type PathRootPrefix,
12
12
  type UpPath,
13
+ type ChunkedCursor,
14
+ type TreeChunk,
15
+ cursorChunk,
16
+ dummyRoot,
13
17
  } from "../../core/index.js";
14
18
  import { fail } from "../../util/index.js";
15
19
  import { prefixFieldPath } from "../treeCursorUtils.js";
16
20
 
17
- import { type ChunkedCursor, type TreeChunk, cursorChunk, dummyRoot } from "./chunk.js";
18
-
19
21
  /**
20
22
  * Chunk that is empty.
21
23
  *
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  export { uniformChunk, ChunkShape } from "./uniformChunk.js";
7
- export { type TreeChunk, dummyRoot } from "./chunk.js";
7
+ export { type TreeChunk, dummyRoot } from "../../core/index.js";
8
8
  export {
9
9
  chunkTree,
10
10
  defaultChunkPolicy,
@@ -6,7 +6,7 @@
6
6
  import { ReferenceCountedBase } from "../../util/index.js";
7
7
 
8
8
  import { BasicChunkCursor } from "./basicChunk.js";
9
- import { type ChunkedCursor, type TreeChunk, dummyRoot } from "./chunk.js";
9
+ import { type ChunkedCursor, type TreeChunk, dummyRoot } from "../../core/index.js";
10
10
 
11
11
  /**
12
12
  * General purpose multi-node sequence chunk.