@fluid-experimental/tree 0.59.2001 → 0.59.3000

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 (258) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.vscode/SharedTree.code-workspace +15 -0
  3. package/.vscode/settings.json +6 -0
  4. package/dist/ChangeCompression.js +9 -9
  5. package/dist/ChangeCompression.js.map +1 -1
  6. package/dist/ChangeTypes.d.ts +1 -6
  7. package/dist/ChangeTypes.d.ts.map +1 -1
  8. package/dist/ChangeTypes.js +5 -5
  9. package/dist/ChangeTypes.js.map +1 -1
  10. package/dist/Checkout.js +14 -14
  11. package/dist/Checkout.js.map +1 -1
  12. package/dist/Common.d.ts +21 -3
  13. package/dist/Common.d.ts.map +1 -1
  14. package/dist/Common.js +29 -4
  15. package/dist/Common.js.map +1 -1
  16. package/dist/EditLog.js +26 -25
  17. package/dist/EditLog.js.map +1 -1
  18. package/dist/EditUtilities.js +17 -17
  19. package/dist/EditUtilities.js.map +1 -1
  20. package/dist/Forest.js +31 -31
  21. package/dist/Forest.js.map +1 -1
  22. package/dist/HistoryEditFactory.js +9 -9
  23. package/dist/HistoryEditFactory.js.map +1 -1
  24. package/dist/IdConversion.js +9 -9
  25. package/dist/IdConversion.js.map +1 -1
  26. package/dist/Identifiers.d.ts +4 -0
  27. package/dist/Identifiers.d.ts.map +1 -1
  28. package/dist/Identifiers.js.map +1 -1
  29. package/dist/LogViewer.d.ts +1 -5
  30. package/dist/LogViewer.d.ts.map +1 -1
  31. package/dist/LogViewer.js +11 -19
  32. package/dist/LogViewer.js.map +1 -1
  33. package/dist/MergeHealth.js +2 -2
  34. package/dist/MergeHealth.js.map +1 -1
  35. package/dist/NodeIdUtilities.js +2 -2
  36. package/dist/NodeIdUtilities.js.map +1 -1
  37. package/dist/PayloadUtilities.js +1 -1
  38. package/dist/PayloadUtilities.js.map +1 -1
  39. package/dist/RevisionValueCache.d.ts +13 -10
  40. package/dist/RevisionValueCache.d.ts.map +1 -1
  41. package/dist/RevisionValueCache.js +14 -11
  42. package/dist/RevisionValueCache.js.map +1 -1
  43. package/dist/RevisionView.js +4 -4
  44. package/dist/RevisionView.js.map +1 -1
  45. package/dist/SerializationUtilities.js +4 -4
  46. package/dist/SerializationUtilities.js.map +1 -1
  47. package/dist/SharedTree.d.ts +93 -31
  48. package/dist/SharedTree.d.ts.map +1 -1
  49. package/dist/SharedTree.js +160 -131
  50. package/dist/SharedTree.js.map +1 -1
  51. package/dist/SharedTreeEncoder.d.ts +3 -3
  52. package/dist/SharedTreeEncoder.d.ts.map +1 -1
  53. package/dist/SharedTreeEncoder.js +36 -36
  54. package/dist/SharedTreeEncoder.js.map +1 -1
  55. package/dist/StringInterner.js +1 -1
  56. package/dist/StringInterner.js.map +1 -1
  57. package/dist/Summary.js +1 -1
  58. package/dist/Summary.js.map +1 -1
  59. package/dist/SummaryBackCompatibility.js +8 -8
  60. package/dist/SummaryBackCompatibility.js.map +1 -1
  61. package/dist/Transaction.js +1 -1
  62. package/dist/Transaction.js.map +1 -1
  63. package/dist/TransactionInternal.js +17 -17
  64. package/dist/TransactionInternal.js.map +1 -1
  65. package/dist/TreeCompressor.d.ts.map +1 -1
  66. package/dist/TreeCompressor.js +6 -8
  67. package/dist/TreeCompressor.js.map +1 -1
  68. package/dist/TreeNodeHandle.js +4 -4
  69. package/dist/TreeNodeHandle.js.map +1 -1
  70. package/dist/TreeView.js +7 -7
  71. package/dist/TreeView.js.map +1 -1
  72. package/dist/TreeViewUtilities.js +2 -2
  73. package/dist/TreeViewUtilities.js.map +1 -1
  74. package/dist/UndoRedoHandler.js +1 -1
  75. package/dist/UndoRedoHandler.js.map +1 -1
  76. package/dist/UuidUtilities.d.ts +30 -0
  77. package/dist/UuidUtilities.d.ts.map +1 -0
  78. package/dist/UuidUtilities.js +106 -0
  79. package/dist/UuidUtilities.js.map +1 -0
  80. package/dist/id-compressor/AppendOnlySortedMap.d.ts +52 -28
  81. package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  82. package/dist/id-compressor/AppendOnlySortedMap.js +167 -90
  83. package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
  84. package/dist/id-compressor/IdCompressor.d.ts +43 -42
  85. package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
  86. package/dist/id-compressor/IdCompressor.js +179 -177
  87. package/dist/id-compressor/IdCompressor.js.map +1 -1
  88. package/dist/id-compressor/IdRange.js +1 -1
  89. package/dist/id-compressor/IdRange.js.map +1 -1
  90. package/dist/id-compressor/NumericUuid.d.ts +6 -14
  91. package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
  92. package/dist/id-compressor/NumericUuid.js +15 -76
  93. package/dist/id-compressor/NumericUuid.js.map +1 -1
  94. package/dist/id-compressor/SessionIdNormalizer.d.ts +122 -0
  95. package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
  96. package/dist/id-compressor/SessionIdNormalizer.js +418 -0
  97. package/dist/id-compressor/SessionIdNormalizer.js.map +1 -0
  98. package/dist/id-compressor/persisted-types/0.0.1.d.ts +6 -13
  99. package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
  100. package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
  101. package/dist/index.d.ts +2 -2
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js.map +1 -1
  104. package/dist/persisted-types/0.1.1.d.ts +1 -6
  105. package/dist/persisted-types/0.1.1.d.ts.map +1 -1
  106. package/dist/persisted-types/0.1.1.js +3 -3
  107. package/dist/persisted-types/0.1.1.js.map +1 -1
  108. package/lib/ChangeTypes.d.ts +1 -6
  109. package/lib/ChangeTypes.d.ts.map +1 -1
  110. package/lib/Checkout.js.map +1 -1
  111. package/lib/Common.d.ts +21 -3
  112. package/lib/Common.d.ts.map +1 -1
  113. package/lib/Common.js +25 -3
  114. package/lib/Common.js.map +1 -1
  115. package/lib/EditLog.js +2 -1
  116. package/lib/EditLog.js.map +1 -1
  117. package/lib/EditUtilities.js.map +1 -1
  118. package/lib/Forest.js.map +1 -1
  119. package/lib/HistoryEditFactory.js.map +1 -1
  120. package/lib/Identifiers.d.ts +4 -0
  121. package/lib/Identifiers.d.ts.map +1 -1
  122. package/lib/Identifiers.js.map +1 -1
  123. package/lib/LogViewer.d.ts +1 -5
  124. package/lib/LogViewer.d.ts.map +1 -1
  125. package/lib/LogViewer.js +5 -13
  126. package/lib/LogViewer.js.map +1 -1
  127. package/lib/MergeHealth.js.map +1 -1
  128. package/lib/NodeIdUtilities.js.map +1 -1
  129. package/lib/RevisionValueCache.d.ts +13 -10
  130. package/lib/RevisionValueCache.d.ts.map +1 -1
  131. package/lib/RevisionValueCache.js +10 -7
  132. package/lib/RevisionValueCache.js.map +1 -1
  133. package/lib/RevisionView.js.map +1 -1
  134. package/lib/SharedTree.d.ts +93 -31
  135. package/lib/SharedTree.d.ts.map +1 -1
  136. package/lib/SharedTree.js +107 -78
  137. package/lib/SharedTree.js.map +1 -1
  138. package/lib/SharedTreeEncoder.d.ts +3 -3
  139. package/lib/SharedTreeEncoder.d.ts.map +1 -1
  140. package/lib/SharedTreeEncoder.js +4 -4
  141. package/lib/SharedTreeEncoder.js.map +1 -1
  142. package/lib/StringInterner.js.map +1 -1
  143. package/lib/Summary.js.map +1 -1
  144. package/lib/TreeCompressor.d.ts.map +1 -1
  145. package/lib/TreeCompressor.js +1 -3
  146. package/lib/TreeCompressor.js.map +1 -1
  147. package/lib/TreeNodeHandle.js.map +1 -1
  148. package/lib/TreeView.js.map +1 -1
  149. package/lib/TreeViewUtilities.js.map +1 -1
  150. package/lib/UuidUtilities.d.ts +30 -0
  151. package/lib/UuidUtilities.d.ts.map +1 -0
  152. package/lib/UuidUtilities.js +98 -0
  153. package/lib/UuidUtilities.js.map +1 -0
  154. package/lib/id-compressor/AppendOnlySortedMap.d.ts +52 -28
  155. package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  156. package/lib/id-compressor/AppendOnlySortedMap.js +165 -88
  157. package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
  158. package/lib/id-compressor/IdCompressor.d.ts +43 -42
  159. package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
  160. package/lib/id-compressor/IdCompressor.js +97 -95
  161. package/lib/id-compressor/IdCompressor.js.map +1 -1
  162. package/lib/id-compressor/NumericUuid.d.ts +6 -14
  163. package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
  164. package/lib/id-compressor/NumericUuid.js +11 -70
  165. package/lib/id-compressor/NumericUuid.js.map +1 -1
  166. package/lib/id-compressor/SessionIdNormalizer.d.ts +122 -0
  167. package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
  168. package/lib/id-compressor/SessionIdNormalizer.js +414 -0
  169. package/lib/id-compressor/SessionIdNormalizer.js.map +1 -0
  170. package/lib/id-compressor/persisted-types/0.0.1.d.ts +6 -13
  171. package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
  172. package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -1
  173. package/lib/index.d.ts +2 -2
  174. package/lib/index.d.ts.map +1 -1
  175. package/lib/index.js.map +1 -1
  176. package/lib/persisted-types/0.1.1.d.ts +1 -6
  177. package/lib/persisted-types/0.1.1.d.ts.map +1 -1
  178. package/lib/persisted-types/0.1.1.js.map +1 -1
  179. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +6 -0
  180. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +1 -0
  181. package/lib/test/AppendOnlySortedMap.perf.tests.js +49 -0
  182. package/lib/test/AppendOnlySortedMap.perf.tests.js.map +1 -0
  183. package/lib/test/AppendOnlySortedMap.tests.js +56 -14
  184. package/lib/test/AppendOnlySortedMap.tests.js.map +1 -1
  185. package/lib/test/Checkout.tests.js +2 -2
  186. package/lib/test/Checkout.tests.js.map +1 -1
  187. package/lib/test/Forest.tests.js.map +1 -1
  188. package/lib/test/IdCompressor.perf.tests.js +8 -2
  189. package/lib/test/IdCompressor.perf.tests.js.map +1 -1
  190. package/lib/test/IdCompressor.tests.js +75 -24
  191. package/lib/test/IdCompressor.tests.js.map +1 -1
  192. package/lib/test/LogViewer.tests.js +3 -5
  193. package/lib/test/LogViewer.tests.js.map +1 -1
  194. package/lib/test/NumericUuid.perf.tests.js +4 -4
  195. package/lib/test/NumericUuid.perf.tests.js.map +1 -1
  196. package/lib/test/NumericUuid.tests.js +5 -4
  197. package/lib/test/NumericUuid.tests.js.map +1 -1
  198. package/lib/test/RevisionValueCache.tests.js.map +1 -1
  199. package/lib/test/RevisionView.tests.js.map +1 -1
  200. package/lib/test/SessionIdNormalizer.tests.d.ts +6 -0
  201. package/lib/test/SessionIdNormalizer.tests.d.ts.map +1 -0
  202. package/lib/test/SessionIdNormalizer.tests.js +299 -0
  203. package/lib/test/SessionIdNormalizer.tests.js.map +1 -0
  204. package/lib/test/Summary.tests.js +1 -1
  205. package/lib/test/Summary.tests.js.map +1 -1
  206. package/lib/test/TreeCompression.tests.js +1 -1
  207. package/lib/test/TreeCompression.tests.js.map +1 -1
  208. package/lib/test/Virtualization.tests.js +1 -1
  209. package/lib/test/Virtualization.tests.js.map +1 -1
  210. package/lib/test/fuzz/Generators.d.ts +3 -14
  211. package/lib/test/fuzz/Generators.d.ts.map +1 -1
  212. package/lib/test/fuzz/Generators.js +60 -151
  213. package/lib/test/fuzz/Generators.js.map +1 -1
  214. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +10 -7
  215. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -1
  216. package/lib/test/fuzz/SharedTreeFuzzTests.js +94 -104
  217. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
  218. package/lib/test/fuzz/Types.d.ts +2 -9
  219. package/lib/test/fuzz/Types.d.ts.map +1 -1
  220. package/lib/test/fuzz/Types.js +1 -1
  221. package/lib/test/fuzz/Types.js.map +1 -1
  222. package/lib/test/utilities/IdCompressorTestUtilities.d.ts +57 -11
  223. package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -1
  224. package/lib/test/utilities/IdCompressorTestUtilities.js +112 -98
  225. package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -1
  226. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -1
  227. package/lib/test/utilities/PendingLocalStateTests.js +2 -1
  228. package/lib/test/utilities/PendingLocalStateTests.js.map +1 -1
  229. package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
  230. package/lib/test/utilities/SharedTreeTests.js +30 -1
  231. package/lib/test/utilities/SharedTreeTests.js.map +1 -1
  232. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -1
  233. package/lib/test/utilities/SharedTreeVersioningTests.js +20 -0
  234. package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
  235. package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -1
  236. package/lib/test/utilities/SummaryLoadPerfTests.js +6 -3
  237. package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -1
  238. package/lib/test/utilities/TestNode.js.map +1 -1
  239. package/lib/test/utilities/TestUtilities.d.ts +9 -1
  240. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  241. package/lib/test/utilities/TestUtilities.js +27 -13
  242. package/lib/test/utilities/TestUtilities.js.map +1 -1
  243. package/package.json +19 -17
  244. package/src/Common.ts +42 -4
  245. package/src/EditLog.ts +1 -1
  246. package/src/Identifiers.ts +5 -0
  247. package/src/LogViewer.ts +4 -20
  248. package/src/RevisionValueCache.ts +11 -8
  249. package/src/SharedTree.ts +222 -75
  250. package/src/SharedTreeEncoder.ts +17 -11
  251. package/src/TreeCompressor.ts +2 -4
  252. package/src/UuidUtilities.ts +123 -0
  253. package/src/id-compressor/AppendOnlySortedMap.ts +183 -94
  254. package/src/id-compressor/IdCompressor.ts +144 -132
  255. package/src/id-compressor/NumericUuid.ts +11 -80
  256. package/src/id-compressor/SessionIdNormalizer.ts +497 -0
  257. package/src/id-compressor/persisted-types/0.0.1.ts +12 -15
  258. package/src/index.ts +5 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH,cAAc;AAEd,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mCAAiE;AAAjD,gGAAA,MAAM,OAAA;AACtB,mCAAmF;AAA1E,sHAAA,4BAA4B,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAiBhE,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAI7B,uCAA4F;AAAnF,oGAAA,QAAQ,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAmB,gHAAA,oBAAoB,OAAA;AACvE,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uDAAqC;AACrC,gDAA8B;AAC9B,sDAAoC;AAEpC,qDAyC2B;AAxC1B,uGAAA,IAAI,OAAA;AACJ,6GAAA,UAAU,OAAA;AAIV,mHAAA,gBAAgB,OAAA;AAEhB,iHAAA,cAAc,OAAA;AAqBd,qHAAA,kBAAkB,OAAA;AAElB,8GAAA,WAAW,OAAA;AAEX,sHAAA,mBAAmB,OAAA;AACnB,sHAAA,mBAAmB,OAAA;AAQpB,2CASsB;AARrB,+GAAA,iBAAiB,OAAA;AACjB,wGAAA,UAAU,OAAA;AAQX,+CAA6B;AAC7B,iDAQyB;AAPxB,yGAAA,QAAQ,OAAA;AACR,kIAAA,iCAAiC,OAAA;AAGjC,sHAAA,qBAAqB,OAAA;AAErB,0HAAA,yBAAyB,OAAA;AAE1B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,6DAa+B;AAZ9B,0HAAA,mBAAmB,OAAA;AACnB,yHAAA,kBAAkB,OAAA;AAYnB,uCASoB;AALnB,oGAAA,QAAQ,OAAA;AAMT,+CAA+D;AAAtD,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAEtC,6CAAiF;AAAxE,0GAAA,WAAW,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAEtC;;GAEG;AACH,+DAIgC;AAH/B,wEAAwE;AACxE,oIAAA,sCAAsC,OAAgC;AACtE,8IAAA,sCAAsC,OAAA;AAGvC,gDAA8B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tInternalizedChange,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction, TransactionEvent, TransactionEvents } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH,cAAc;AAEd,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mCAAiE;AAAjD,gGAAA,MAAM,OAAA;AACtB,mCAAmF;AAA1E,sHAAA,4BAA4B,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAkBhE,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAI7B,uCAA4F;AAAnF,oGAAA,QAAQ,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAmB,gHAAA,oBAAoB,OAAA;AACvE,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uDAAqC;AACrC,gDAA8B;AAC9B,sDAAoC;AAEpC,qDAyC2B;AAxC1B,uGAAA,IAAI,OAAA;AACJ,6GAAA,UAAU,OAAA;AAIV,mHAAA,gBAAgB,OAAA;AAEhB,iHAAA,cAAc,OAAA;AAqBd,qHAAA,kBAAkB,OAAA;AAElB,8GAAA,WAAW,OAAA;AAEX,sHAAA,mBAAmB,OAAA;AACnB,sHAAA,mBAAmB,OAAA;AAQpB,2CAasB;AARrB,+GAAA,iBAAiB,OAAA;AACjB,wGAAA,UAAU,OAAA;AAQX,+CAA6B;AAC7B,iDAQyB;AAPxB,yGAAA,QAAQ,OAAA;AACR,kIAAA,iCAAiC,OAAA;AAGjC,sHAAA,qBAAqB,OAAA;AAErB,0HAAA,yBAAyB,OAAA;AAE1B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,6DAa+B;AAZ9B,0HAAA,mBAAmB,OAAA;AACnB,yHAAA,kBAAkB,OAAA;AAYnB,uCASoB;AALnB,oGAAA,QAAQ,OAAA;AAMT,+CAA+D;AAAtD,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAEtC,6CAAiF;AAAxE,0GAAA,WAAW,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAEtC;;GAEG;AACH,+DAIgC;AAH/B,wEAAwE;AACxE,oIAAA,sCAAsC,OAAgC;AACtE,8IAAA,sCAAsC,OAAA;AAGvC,gDAA8B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n\tAttributionId,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tInternalizedChange,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeArgs,\n\tSharedTreeOptions,\n\tSharedTreeOptions_0_0_2,\n\tSharedTreeOptions_0_1_1,\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction, TransactionEvent, TransactionEvents } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
@@ -208,12 +208,7 @@ export declare const ChangeInternal: {
208
208
  detach: (source: StableRangeInternal, destination?: DetachedSequenceId | undefined) => DetachInternal;
209
209
  setPayload: (nodeToModify: NodeData<NodeId> | NodeId, payload: Payload) => SetValueInternal;
210
210
  clearPayload: (nodeToModify: NodeData<NodeId> | NodeId) => SetValueInternal;
211
- constraint: (toConstrain: StableRangeInternal, effect: ConstraintEffect, identityHash?: UuidString | undefined, length?: number | undefined, contentHash?: UuidString | undefined, parentNode?: (number & {
212
- readonly LocalCompressedId: "6fccb42f-e2a4-4243-bd29-f13d12b9c6d1";
213
- } & import("../Identifiers").SessionUnique & import("../Identifiers").NodeIdBrand) | (number & {
214
- readonly FinalCompressedId: "5d83d1e2-98b7-4e4e-a889-54c855cfa73d";
215
- readonly OpNormalized: "9209432d-a959-4df7-b2ad-767ead4dbcae";
216
- } & import("../Identifiers").SessionUnique & import("../Identifiers").NodeIdBrand) | undefined, label?: TraitLabel | undefined) => ConstraintInternal;
211
+ constraint: (toConstrain: StableRangeInternal, effect: ConstraintEffect, identityHash?: UuidString | undefined, length?: number | undefined, contentHash?: UuidString | undefined, parentNode?: NodeId | undefined, label?: TraitLabel | undefined) => ConstraintInternal;
217
212
  /** {@inheritdoc (Change:variable).delete } */
218
213
  delete: (stableRange: StableRangeInternal) => ChangeInternal;
219
214
  /** {@inheritdoc (Change:variable).insertTree } */
@@ -1 +1 @@
1
- {"version":3,"file":"0.1.1.d.ts","sourceRoot":"","sources":["../../src/persisted-types/0.1.1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA8B,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EACX,eAAe,EACf,mCAAmC,EACnC,wCAAwC,EACxC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACX,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,IAAI,EACJ,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAElB,yBAAyB,EACzB,2BAA2B,EAC3B,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,2BAA2B,EAAE,QAAQ,CAAC;IACzF,QAAQ,CAAC,MAAM,EAAE,MA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BAAkB,GAAG,kBAAkB,GAAG,cAAc,CAAC;AAEvG,MAAM,WAAW,gBAAiB,SAAQ,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;IACxE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IACrC,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7D,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;IACvC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AAED,sFAAsF;AAEtF,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,2CAA2C;AAE3C,eAAO,MAAM,cAAc,WAAsD,CAAC"}
@@ -62,7 +62,7 @@ exports.ChangeInternal = {
62
62
  /** {@inheritdoc (Change:variable).move } */
63
63
  move: (source, destination) => {
64
64
  const detach = exports.ChangeInternal.detach(source, 0);
65
- return [detach, exports.ChangeInternal.insert(Common_1.assertNotUndefined(detach.destination), destination)];
65
+ return [detach, exports.ChangeInternal.insert((0, Common_1.assertNotUndefined)(detach.destination), destination)];
66
66
  },
67
67
  };
68
68
  /**
@@ -115,8 +115,8 @@ exports.StableRangeInternal = {
115
115
  to: (end) => {
116
116
  if (start.referenceTrait && end.referenceTrait) {
117
117
  const message = 'StableRange must be constructed with endpoints from the same trait';
118
- Common_1.assert(start.referenceTrait.parent === end.referenceTrait.parent, message);
119
- Common_1.assert(start.referenceTrait.label === end.referenceTrait.label, message);
118
+ (0, Common_1.assert)(start.referenceTrait.parent === end.referenceTrait.parent, message);
119
+ (0, Common_1.assert)(start.referenceTrait.label === end.referenceTrait.label, message);
120
120
  }
121
121
  return { start, end };
122
122
  },
@@ -1 +1 @@
1
- {"version":3,"file":"0.1.1.js","sourceRoot":"","sources":["../../src/persisted-types/0.1.1.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,sCAAyE;AAmBzE,oCAuBiB;AAkIjB;;GAEG;AACU,QAAA,aAAa,GAAG,GAAG,CAAC;AAgGjC,uGAAuG;AACvG;;GAEG;AACU,QAAA,cAAc,GAAG;IAC7B,KAAK,EAAE,CAAC,MAA2C,EAAE,WAA+B,EAAiB,EAAE,CAAC,CAAC;QACxG,WAAW;QACX,MAAM;QACN,IAAI,EAAE,2BAAkB,CAAC,KAAK;KAC9B,CAAC;IAEF,MAAM,EAAE,CAAC,MAA0B,EAAE,WAAgC,EAAkB,EAAE,CAAC,CAAC;QAC1F,WAAW;QACX,MAAM;QACN,IAAI,EAAE,2BAAkB,CAAC,MAAM;KAC/B,CAAC;IAEF,MAAM,EAAE,CAAC,MAA2B,EAAE,WAAgC,EAAkB,EAAE,CAAC,CAAC;QAC3F,WAAW;QACX,MAAM;QACN,IAAI,EAAE,2BAAkB,CAAC,MAAM;KAC/B,CAAC;IAEF,UAAU,EAAE,CAAC,YAAuC,EAAE,OAAgB,EAAoB,EAAE,CAAC,CAAC;QAC7F,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC;QACrC,OAAO;QACP,IAAI,EAAE,2BAAkB,CAAC,QAAQ;KACjC,CAAC;IAEF,YAAY,EAAE,CAAC,YAAuC,EAAoB,EAAE,CAAC,CAAC;QAC7E,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC;QACrC,sFAAsF;QACtF,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,2BAAkB,CAAC,QAAQ;KACjC,CAAC;IAEF,UAAU,EAAE,CACX,WAAgC,EAChC,MAAwB,EACxB,YAAyB,EACzB,MAAe,EACf,WAAwB,EACxB,UAAmB,EACnB,KAAkB,EACG,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A+B;AAClB,QAAA,eAAe,GAAG,EAAE,CAAC;AAElC,2CAA2C;AAC3C,8BAA8B;AACjB,QAAA,cAAc,GAAG,sCAAmD,CAAC;AAElF,+EAA+E;AAC/E,SAAS,SAAS,CAAM,IAAyB;;IAChD,aAAQ,IAAsB,CAAC,UAAU,mCAAK,IAAY,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert, assertNotUndefined, ReplaceRecursive } from '../Common';\n// These are re-exported from a persisted-types file.\nimport type {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from '../id-compressor';\nimport type {\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tFinalNodeId,\n\tInternedStringId,\n\tNodeId,\n\tOpSpaceNodeId,\n\tSessionId,\n\tTraitLabel,\n\tUuidString,\n} from '../Identifiers';\nimport {\n\tBuildInternal_0_0_2,\n\tChangeTypeInternal,\n\tConstraintEffect,\n\tConstraintInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tEdit,\n\tEditWithoutId,\n\tInsertInternal_0_0_2,\n\tNodeData,\n\tPayload,\n\tSetValueInternal_0_0_2,\n\tSharedTreeNoOp,\n\tSharedTreeOpType,\n\tSharedTreeSummaryBase,\n\tSharedTreeUpdateOp,\n\tSide,\n\tStablePlaceInternal_0_0_2,\n\tTraitLocationInternal_0_0_2,\n\tTreeNode,\n\tTreeNodeSequence,\n\tVersionedOp,\n\tWriteFormat,\n} from './0.0.2';\n\n/**\n * Specifies the location of a trait (a labeled sequence of nodes) within the tree.\n * @public\n */\nexport interface TraitLocationInternal extends Omit<TraitLocationInternal_0_0_2, 'parent'> {\n\treadonly parent: NodeId;\n}\n\n/**\n * Alternating list of label then children list under that label.\n * The label may be interned, and children are {@link CompressedPlaceholderTree}.\n */\nexport type CompressedTraits<TId extends OpSpaceNodeId, TPlaceholder extends number | never> = (\n\t| InternedStringId\n\t| TraitLabel\n\t| (CompressedPlaceholderTree<TId, TPlaceholder> | TPlaceholder)[]\n)[];\n\n/**\n * A TreeNode that has been compressed into the following array format:\n * [identifier, definition, traits, payload],\n * where traits is also an array of [label, [trait], label, [trait], ...].\n * Payload is omitted if empty, and traits will be an empty subarray if no traits exist but a payload exists.\n * If both traits and payload does not exist, then both are omitted.\n * All trait labels and node definitions may also be string interned.\n * @internal\n */\nexport type CompressedPlaceholderTree<TId extends OpSpaceNodeId, TPlaceholder extends number | never> =\n\t| TPlaceholder\n\t| [InternedStringId | Definition] // The node Definition's interned string ID\n\t| [InternedStringId | Definition, TId]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\tTId,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ];\n\n/**\n * JSON-compatible Node type. Objects of this type will be persisted in internal change objects (under Edits) in the SharedTree history.\n * @public\n */\nexport type ChangeNode = TreeNode<ChangeNode, NodeId>;\n\n/**\n * A ChangeNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedChangeNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, never>;\n\n/**\n * The contents of a SharedTree summary for write format 0.1.1.\n * Contains the current tree in a compressed format,\n * the edits needed to get from `initialTree` to the current tree,\n * and the interned strings that can be used to retrieve the interned summary.\n */\nexport interface SharedTreeSummary extends SharedTreeSummaryBase {\n\treadonly version: WriteFormat.v0_1_1;\n\n\treadonly currentTree?: CompressedChangeNode<FinalNodeId>;\n\n\t/**\n\t * Information that can populate an edit log.\n\t */\n\treadonly editHistory: EditLogSummary<CompressedChangeInternal<FinalNodeId>, FluidEditHandle>;\n\n\t/**\n\t * List of interned strings.\n\t * In 0.1.1, definitions and trait labels are interned deterministically on sequenced ops,\n\t * and each client maintains a string interner whose lifetime is tied to the SharedTree.\n\t */\n\treadonly internedStrings: readonly string[];\n\n\t/**\n\t * Information about all IDs compressed in the summary\n\t */\n\treadonly idCompressor: SerializedIdCompressorWithNoSession | SerializedIdCompressorWithOngoingSession;\n}\n\n/**\n * Information used to populate an edit log.\n * In 0.1.1, this is a persisted type only for `EditLogSummary<CompressedChangeInternal, FluidEditHandle>`,\n * where calling `FluidEditHandle.get` returns an array buffer of compressed `editChunk` contents.\n * The type is parameterized to avoid nearly identical type definitions for uncompressed forms of the edit\n * log, and abstracting away the fact that handle fetching needs to invoke decompression.\n * @public\n */\nexport interface EditLogSummary<TChange, THandle> {\n\t/**\n\t * A of list of serialized chunks and their corresponding keys.\n\t * Start revision is the index of the first edit in the chunk in relation to the edit log.\n\t */\n\treadonly editChunks: readonly {\n\t\treadonly startRevision: number;\n\t\t/**\n\t\t * Either a chunk of edits or a handle that can be used to load that chunk.\n\t\t */\n\t\treadonly chunk: THandle | readonly EditWithoutId<TChange>[];\n\t}[];\n\n\t/**\n\t * A list of edits IDs for all sequenced edits.\n\t */\n\treadonly editIds: readonly EditId[];\n}\n\n/**\n * FluidEditHandles are used to load edit chunks stored outside of the EditLog.\n * Can be satisfied by IFluidHandle<ArrayBufferLike>.\n * Note that though this is in `PersistedTypes`, it isn't directly serializable (e.g. `get` is a function).\n * Its serialization relies on being encoded via an IFluidSerializer.\n * @public\n */\nexport interface FluidEditHandle {\n\treadonly get: () => Promise<ArrayBuffer>;\n\treadonly absolutePath: string;\n}\n\n// Future write formats should make this a union type and append to it (e.g. `EditChunkContents_0_1_1 | EditChunkContents_2_0_0`).\nexport type EditChunkContents = EditChunkContents_0_1_1;\n\nexport interface EditChunkContents_0_1_1 {\n\tversion: WriteFormat.v0_1_1;\n\tedits: readonly EditWithoutId<CompressedChangeInternal<FinalNodeId>>[];\n}\n\n/**\n * Edits per edit chunk. This value is in persisted types because it requires consensus to change.\n */\nexport const editsPerChunk = 100;\n\n/**\n * Compressed change format type.\n * Encodes the same information as a {@link ChangeInternal}, but uses a more compact object format for `build` changes.\n */\nexport type CompressedChangeInternal<TId extends OpSpaceNodeId> =\n\t| ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, TId>\n\t| CompressedBuildInternal<TId>;\n\n/**\n * A compressed version of {@link BuildInternal} where the source is a sequence of compressed nodes.\n */\nexport interface CompressedBuildInternal<TId extends OpSpaceNodeId> {\n\t/** {@inheritdoc Build.destination } */\n\treadonly destination: DetachedSequenceId;\n\t/** A sequence of nodes to build in some compressed format. */\n\treadonly source: TreeNodeSequence<CompressedBuildNode<TId>>;\n\t/** {@inheritdoc Build.\"type\" } */\n\treadonly type: typeof ChangeTypeInternal.CompressedBuild;\n}\n\n/**\n * A BuildNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedBuildNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, DetachedSequenceId>;\n\n// TODO: `ChangeInternal`s should be assignable to this type without casting; this will require some test refactoring.\n/**\n * This type should be used as an opaque handle in the public API for `ChangeInternal` objects.\n * This is useful for supporting public APIs which involve working with a tree's edit history,\n * which will involve changes that have already been internalized.\n * @public\n */\nexport interface InternalizedChange {\n\tInternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3';\n}\n\n/**\n * {@inheritdoc (Change:type)}\n * @public\n */\nexport type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal;\n\n/**\n * {@inheritdoc BuildNode}\n * @public\n */\nexport type BuildNodeInternal = TreeNode<BuildNodeInternal, NodeId> | DetachedSequenceId;\n\n/**\n * {@inheritdoc Build}\n * @public\n */\nexport interface BuildInternal extends Omit<BuildInternal_0_0_2, 'source'> {\n\treadonly source: TreeNodeSequence<BuildNodeInternal>;\n}\n\n/**\n * {@inheritdoc (Insert:interface)}\n * @public\n */\nexport interface InsertInternal extends Omit<InsertInternal_0_0_2, 'destination'> {\n\t/** {@inheritdoc (Insert:interface).destination } */\n\treadonly destination: StablePlaceInternal;\n}\n\n/**\n * {@inheritdoc Detach}\n * @public\n */\nexport interface DetachInternal extends Omit<DetachInternal_0_0_2, 'source'> {\n\t/** {@inheritdoc Detach.source } */\n\treadonly source: StableRangeInternal;\n}\n\n/**\n * {@inheritdoc SetValue}\n * @public\n */\nexport interface SetValueInternal extends Omit<SetValueInternal_0_0_2, 'nodeToModify'> {\n\t/** {@inheritdoc SetValue.nodeToModify } */\n\treadonly nodeToModify: NodeId;\n}\n\n/**\n * {@inheritdoc Constraint}\n * @public\n */\nexport interface ConstraintInternal extends Omit<ConstraintInternal_0_0_2, 'toConstrain' | 'parentNode'> {\n\t/** {@inheritdoc Constraint.toConstrain } */\n\treadonly toConstrain: StableRangeInternal;\n\t/** {@inheritdoc Constraint.parentNode } */\n\treadonly parentNode?: NodeId;\n}\n\n// Note: Documentation of this constant is merged with documentation of the `ChangeInternal` interface.\n/**\n * @public\n */\nexport const ChangeInternal = {\n\tbuild: (source: TreeNodeSequence<BuildNodeInternal>, destination: DetachedSequenceId): BuildInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Build,\n\t}),\n\n\tinsert: (source: DetachedSequenceId, destination: StablePlaceInternal): InsertInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Insert,\n\t}),\n\n\tdetach: (source: StableRangeInternal, destination?: DetachedSequenceId): DetachInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Detach,\n\t}),\n\n\tsetPayload: (nodeToModify: NodeData<NodeId> | NodeId, payload: Payload): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\tpayload,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tclearPayload: (nodeToModify: NodeData<NodeId> | NodeId): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface above.)\n\t\tpayload: null,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tconstraint: (\n\t\ttoConstrain: StableRangeInternal,\n\t\teffect: ConstraintEffect,\n\t\tidentityHash?: UuidString,\n\t\tlength?: number,\n\t\tcontentHash?: UuidString,\n\t\tparentNode?: NodeId,\n\t\tlabel?: TraitLabel\n\t): ConstraintInternal => ({\n\t\ttoConstrain,\n\t\teffect,\n\t\tidentityHash,\n\t\tlength,\n\t\tcontentHash,\n\t\tparentNode,\n\t\tlabel,\n\t\ttype: ChangeTypeInternal.Constraint,\n\t}),\n\n\t/** {@inheritdoc (Change:variable).delete } */\n\tdelete: (stableRange: StableRangeInternal): ChangeInternal => ChangeInternal.detach(stableRange),\n\n\t/** {@inheritdoc (Change:variable).insertTree } */\n\tinsertTree: (nodes: TreeNodeSequence<BuildNodeInternal>, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst build = ChangeInternal.build(nodes, 0 as DetachedSequenceId);\n\t\treturn [build, ChangeInternal.insert(build.destination, destination)];\n\t},\n\n\t/** {@inheritdoc (Change:variable).move } */\n\tmove: (source: StableRangeInternal, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst detach = ChangeInternal.detach(source, 0 as DetachedSequenceId);\n\t\treturn [detach, ChangeInternal.insert(assertNotUndefined(detach.destination), destination)];\n\t},\n};\n\n/**\n * {@inheritdoc (StablePlace:interface) }\n * @public\n */\nexport interface StablePlaceInternal extends Omit<StablePlaceInternal_0_0_2, 'referenceSibling' | 'referenceTrait'> {\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceSibling }\n\t */\n\treadonly referenceSibling?: NodeId;\n\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceTrait }\n\t */\n\treadonly referenceTrait?: TraitLocationInternal;\n}\n\n/**\n * {@inheritdoc (StableRange:interface) }\n * @public\n */\nexport interface StableRangeInternal {\n\t/** {@inheritdoc (StableRange:interface).start } */\n\treadonly start: StablePlaceInternal;\n\t/** {@inheritdoc (StableRange:interface).end } */\n\treadonly end: StablePlaceInternal;\n}\n\n/**\n * The remainder of this file consists of factory methods duplicated with those for StableRange/StablePlace and are maintained while\n * the new persisted version of SharedTree ops/summaries is rolled out.\n */\n\n/**\n * @public\n */\nexport const StablePlaceInternal = {\n\t/**\n\t * @returns The location directly before `node`.\n\t */\n\tbefore: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location directly after `node`.\n\t */\n\tafter: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location at the start of `trait`.\n\t */\n\tatStartOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceTrait: trait,\n\t}),\n\t/**\n\t * @returns The location at the end of `trait`.\n\t */\n\tatEndOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceTrait: trait,\n\t}),\n};\n\n/**\n * @public\n */\nexport const StableRangeInternal = {\n\t/**\n\t * Factory for producing a `StableRange` from a start `StablePlace` to an end `StablePlace`.\n\t * @example\n\t * StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode))\n\t */\n\tfrom: (start: StablePlaceInternal): { to: (end: StablePlaceInternal) => StableRangeInternal } => ({\n\t\tto: (end: StablePlaceInternal): StableRangeInternal => {\n\t\t\tif (start.referenceTrait && end.referenceTrait) {\n\t\t\t\tconst message = 'StableRange must be constructed with endpoints from the same trait';\n\t\t\t\tassert(start.referenceTrait.parent === end.referenceTrait.parent, message);\n\t\t\t\tassert(start.referenceTrait.label === end.referenceTrait.label, message);\n\t\t\t}\n\t\t\treturn { start, end };\n\t\t},\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains only the provided `node`.\n\t * Both the start and end `StablePlace` objects used to anchor this `StableRange` are in terms of the passed in node.\n\t */\n\tonly: (node: NodeData<NodeId> | NodeId): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.before(node),\n\t\tend: StablePlaceInternal.after(node),\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains everything in the trait.\n\t * This is anchored using the provided `trait`, and is independent of the actual contents of the trait:\n\t * it does not use sibling anchoring.\n\t */\n\tall: (trait: TraitLocationInternal): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.atStartOf(trait),\n\t\tend: StablePlaceInternal.atEndOf(trait),\n\t}),\n};\n\n/**\n * Discriminated union of valid 0.0.1 SharedTree op types.\n */\nexport type SharedTreeOp = SharedTreeEditOp | SharedTreeHandleOp | SharedTreeUpdateOp | SharedTreeNoOp;\n\nexport interface SharedTreeEditOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Edit;\n\t/** The collection of changes to apply. */\n\treadonly edit: Edit<CompressedChangeInternal<OpSpaceNodeId>>;\n\t/** Contains all the IDs generated by the originating client since the last sent op */\n\treadonly idRange: IdCreationRange;\n}\n\n/**\n * A SharedTree op that includes edit handle information.\n * The handle corresponds to an edit chunk in the edit log.\n */\nexport interface SharedTreeHandleOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Handle;\n\t/** The serialized handle to an uploaded edit chunk. */\n\treadonly editHandle: string;\n\t/** The index of the first edit in the chunk that corresponds to the handle. */\n\treadonly startRevision: number;\n}\n\n/** The number of IDs that a SharedTree reserves for current or future internal use */\n// This value must never change\nexport const reservedIdCount = 10;\n\n/** The SessionID of the Upgrade Session */\n// This UUID must never change\nexport const ghostSessionId = '79590933-1c70-4fda-817a-adab57c20318' as SessionId;\n\n/** Accepts either a node or a node's identifier, and returns the identifier */\nfunction getNodeId<TId>(node: TId | NodeData<TId>): TId {\n\treturn (node as NodeData<TId>).identifier ?? (node as TId);\n}\n"]}
1
+ {"version":3,"file":"0.1.1.js","sourceRoot":"","sources":["../../src/persisted-types/0.1.1.ts"],"names":[],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AM,IAAyB;;IAChD,OAAO,MAAC,IAAsB,CAAC,UAAU,mCAAK,IAAY,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert, assertNotUndefined, ReplaceRecursive } from '../Common';\n// These are re-exported from a persisted-types file.\nimport type {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from '../id-compressor';\nimport type {\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tFinalNodeId,\n\tInternedStringId,\n\tNodeId,\n\tOpSpaceNodeId,\n\tSessionId,\n\tTraitLabel,\n\tUuidString,\n} from '../Identifiers';\nimport {\n\tBuildInternal_0_0_2,\n\tChangeTypeInternal,\n\tConstraintEffect,\n\tConstraintInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tEdit,\n\tEditWithoutId,\n\tInsertInternal_0_0_2,\n\tNodeData,\n\tPayload,\n\tSetValueInternal_0_0_2,\n\tSharedTreeNoOp,\n\tSharedTreeOpType,\n\tSharedTreeSummaryBase,\n\tSharedTreeUpdateOp,\n\tSide,\n\tStablePlaceInternal_0_0_2,\n\tTraitLocationInternal_0_0_2,\n\tTreeNode,\n\tTreeNodeSequence,\n\tVersionedOp,\n\tWriteFormat,\n} from './0.0.2';\n\n/**\n * Specifies the location of a trait (a labeled sequence of nodes) within the tree.\n * @public\n */\nexport interface TraitLocationInternal extends Omit<TraitLocationInternal_0_0_2, 'parent'> {\n\treadonly parent: NodeId;\n}\n\n/**\n * Alternating list of label then children list under that label.\n * The label may be interned, and children are {@link CompressedPlaceholderTree}.\n */\nexport type CompressedTraits<TId extends OpSpaceNodeId, TPlaceholder extends number | never> = (\n\t| InternedStringId\n\t| TraitLabel\n\t| (CompressedPlaceholderTree<TId, TPlaceholder> | TPlaceholder)[]\n)[];\n\n/**\n * A TreeNode that has been compressed into the following array format:\n * [identifier, definition, traits, payload],\n * where traits is also an array of [label, [trait], label, [trait], ...].\n * Payload is omitted if empty, and traits will be an empty subarray if no traits exist but a payload exists.\n * If both traits and payload does not exist, then both are omitted.\n * All trait labels and node definitions may also be string interned.\n * @internal\n */\nexport type CompressedPlaceholderTree<TId extends OpSpaceNodeId, TPlaceholder extends number | never> =\n\t| TPlaceholder\n\t| [InternedStringId | Definition] // The node Definition's interned string ID\n\t| [InternedStringId | Definition, TId]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\tTId,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ];\n\n/**\n * JSON-compatible Node type. Objects of this type will be persisted in internal change objects (under Edits) in the SharedTree history.\n * @public\n */\nexport type ChangeNode = TreeNode<ChangeNode, NodeId>;\n\n/**\n * A ChangeNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedChangeNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, never>;\n\n/**\n * The contents of a SharedTree summary for write format 0.1.1.\n * Contains the current tree in a compressed format,\n * the edits needed to get from `initialTree` to the current tree,\n * and the interned strings that can be used to retrieve the interned summary.\n */\nexport interface SharedTreeSummary extends SharedTreeSummaryBase {\n\treadonly version: WriteFormat.v0_1_1;\n\n\treadonly currentTree?: CompressedChangeNode<FinalNodeId>;\n\n\t/**\n\t * Information that can populate an edit log.\n\t */\n\treadonly editHistory: EditLogSummary<CompressedChangeInternal<FinalNodeId>, FluidEditHandle>;\n\n\t/**\n\t * List of interned strings.\n\t * In 0.1.1, definitions and trait labels are interned deterministically on sequenced ops,\n\t * and each client maintains a string interner whose lifetime is tied to the SharedTree.\n\t */\n\treadonly internedStrings: readonly string[];\n\n\t/**\n\t * Information about all IDs compressed in the summary\n\t */\n\treadonly idCompressor: SerializedIdCompressorWithNoSession | SerializedIdCompressorWithOngoingSession;\n}\n\n/**\n * Information used to populate an edit log.\n * In 0.1.1, this is a persisted type only for `EditLogSummary<CompressedChangeInternal, FluidEditHandle>`,\n * where calling `FluidEditHandle.get` returns an array buffer of compressed `editChunk` contents.\n * The type is parameterized to avoid nearly identical type definitions for uncompressed forms of the edit\n * log, and abstracting away the fact that handle fetching needs to invoke decompression.\n * @public\n */\nexport interface EditLogSummary<TChange, THandle> {\n\t/**\n\t * A of list of serialized chunks and their corresponding keys.\n\t * Start revision is the index of the first edit in the chunk in relation to the edit log.\n\t */\n\treadonly editChunks: readonly {\n\t\treadonly startRevision: number;\n\t\t/**\n\t\t * Either a chunk of edits or a handle that can be used to load that chunk.\n\t\t */\n\t\treadonly chunk: THandle | readonly EditWithoutId<TChange>[];\n\t}[];\n\n\t/**\n\t * A list of edits IDs for all sequenced edits.\n\t */\n\treadonly editIds: readonly EditId[];\n}\n\n/**\n * FluidEditHandles are used to load edit chunks stored outside of the EditLog.\n * Can be satisfied by IFluidHandle<ArrayBufferLike>.\n * Note that though this is in `PersistedTypes`, it isn't directly serializable (e.g. `get` is a function).\n * Its serialization relies on being encoded via an IFluidSerializer.\n * @public\n */\nexport interface FluidEditHandle {\n\treadonly get: () => Promise<ArrayBuffer>;\n\treadonly absolutePath: string;\n}\n\n// Future write formats should make this a union type and append to it (e.g. `EditChunkContents_0_1_1 | EditChunkContents_2_0_0`).\nexport type EditChunkContents = EditChunkContents_0_1_1;\n\nexport interface EditChunkContents_0_1_1 {\n\tversion: WriteFormat.v0_1_1;\n\tedits: readonly EditWithoutId<CompressedChangeInternal<FinalNodeId>>[];\n}\n\n/**\n * Edits per edit chunk. This value is in persisted types because it requires consensus to change.\n */\nexport const editsPerChunk = 100;\n\n/**\n * Compressed change format type.\n * Encodes the same information as a {@link ChangeInternal}, but uses a more compact object format for `build` changes.\n */\nexport type CompressedChangeInternal<TId extends OpSpaceNodeId> =\n\t| ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, TId>\n\t| CompressedBuildInternal<TId>;\n\n/**\n * A compressed version of {@link BuildInternal} where the source is a sequence of compressed nodes.\n */\nexport interface CompressedBuildInternal<TId extends OpSpaceNodeId> {\n\t/** {@inheritdoc Build.destination } */\n\treadonly destination: DetachedSequenceId;\n\t/** A sequence of nodes to build in some compressed format. */\n\treadonly source: TreeNodeSequence<CompressedBuildNode<TId>>;\n\t/** {@inheritdoc Build.\"type\" } */\n\treadonly type: typeof ChangeTypeInternal.CompressedBuild;\n}\n\n/**\n * A BuildNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedBuildNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, DetachedSequenceId>;\n\n// TODO: `ChangeInternal`s should be assignable to this type without casting; this will require some test refactoring.\n/**\n * This type should be used as an opaque handle in the public API for `ChangeInternal` objects.\n * This is useful for supporting public APIs which involve working with a tree's edit history,\n * which will involve changes that have already been internalized.\n * @public\n */\nexport interface InternalizedChange {\n\tInternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3';\n}\n\n/**\n * {@inheritdoc (Change:type)}\n * @public\n */\nexport type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal;\n\n/**\n * {@inheritdoc BuildNode}\n * @public\n */\nexport type BuildNodeInternal = TreeNode<BuildNodeInternal, NodeId> | DetachedSequenceId;\n\n/**\n * {@inheritdoc Build}\n * @public\n */\nexport interface BuildInternal extends Omit<BuildInternal_0_0_2, 'source'> {\n\treadonly source: TreeNodeSequence<BuildNodeInternal>;\n}\n\n/**\n * {@inheritdoc (Insert:interface)}\n * @public\n */\nexport interface InsertInternal extends Omit<InsertInternal_0_0_2, 'destination'> {\n\t/** {@inheritdoc (Insert:interface).destination } */\n\treadonly destination: StablePlaceInternal;\n}\n\n/**\n * {@inheritdoc Detach}\n * @public\n */\nexport interface DetachInternal extends Omit<DetachInternal_0_0_2, 'source'> {\n\t/** {@inheritdoc Detach.source } */\n\treadonly source: StableRangeInternal;\n}\n\n/**\n * {@inheritdoc SetValue}\n * @public\n */\nexport interface SetValueInternal extends Omit<SetValueInternal_0_0_2, 'nodeToModify'> {\n\t/** {@inheritdoc SetValue.nodeToModify } */\n\treadonly nodeToModify: NodeId;\n}\n\n/**\n * {@inheritdoc Constraint}\n * @public\n */\nexport interface ConstraintInternal extends Omit<ConstraintInternal_0_0_2, 'toConstrain' | 'parentNode'> {\n\t/** {@inheritdoc Constraint.toConstrain } */\n\treadonly toConstrain: StableRangeInternal;\n\t/** {@inheritdoc Constraint.parentNode } */\n\treadonly parentNode?: NodeId;\n}\n\n// Note: Documentation of this constant is merged with documentation of the `ChangeInternal` interface.\n/**\n * @public\n */\nexport const ChangeInternal = {\n\tbuild: (source: TreeNodeSequence<BuildNodeInternal>, destination: DetachedSequenceId): BuildInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Build,\n\t}),\n\n\tinsert: (source: DetachedSequenceId, destination: StablePlaceInternal): InsertInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Insert,\n\t}),\n\n\tdetach: (source: StableRangeInternal, destination?: DetachedSequenceId): DetachInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Detach,\n\t}),\n\n\tsetPayload: (nodeToModify: NodeData<NodeId> | NodeId, payload: Payload): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\tpayload,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tclearPayload: (nodeToModify: NodeData<NodeId> | NodeId): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface above.)\n\t\tpayload: null,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tconstraint: (\n\t\ttoConstrain: StableRangeInternal,\n\t\teffect: ConstraintEffect,\n\t\tidentityHash?: UuidString,\n\t\tlength?: number,\n\t\tcontentHash?: UuidString,\n\t\tparentNode?: NodeId,\n\t\tlabel?: TraitLabel\n\t): ConstraintInternal => ({\n\t\ttoConstrain,\n\t\teffect,\n\t\tidentityHash,\n\t\tlength,\n\t\tcontentHash,\n\t\tparentNode,\n\t\tlabel,\n\t\ttype: ChangeTypeInternal.Constraint,\n\t}),\n\n\t/** {@inheritdoc (Change:variable).delete } */\n\tdelete: (stableRange: StableRangeInternal): ChangeInternal => ChangeInternal.detach(stableRange),\n\n\t/** {@inheritdoc (Change:variable).insertTree } */\n\tinsertTree: (nodes: TreeNodeSequence<BuildNodeInternal>, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst build = ChangeInternal.build(nodes, 0 as DetachedSequenceId);\n\t\treturn [build, ChangeInternal.insert(build.destination, destination)];\n\t},\n\n\t/** {@inheritdoc (Change:variable).move } */\n\tmove: (source: StableRangeInternal, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst detach = ChangeInternal.detach(source, 0 as DetachedSequenceId);\n\t\treturn [detach, ChangeInternal.insert(assertNotUndefined(detach.destination), destination)];\n\t},\n};\n\n/**\n * {@inheritdoc (StablePlace:interface) }\n * @public\n */\nexport interface StablePlaceInternal extends Omit<StablePlaceInternal_0_0_2, 'referenceSibling' | 'referenceTrait'> {\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceSibling }\n\t */\n\treadonly referenceSibling?: NodeId;\n\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceTrait }\n\t */\n\treadonly referenceTrait?: TraitLocationInternal;\n}\n\n/**\n * {@inheritdoc (StableRange:interface) }\n * @public\n */\nexport interface StableRangeInternal {\n\t/** {@inheritdoc (StableRange:interface).start } */\n\treadonly start: StablePlaceInternal;\n\t/** {@inheritdoc (StableRange:interface).end } */\n\treadonly end: StablePlaceInternal;\n}\n\n/**\n * The remainder of this file consists of factory methods duplicated with those for StableRange/StablePlace and are maintained while\n * the new persisted version of SharedTree ops/summaries is rolled out.\n */\n\n/**\n * @public\n */\nexport const StablePlaceInternal = {\n\t/**\n\t * @returns The location directly before `node`.\n\t */\n\tbefore: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location directly after `node`.\n\t */\n\tafter: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location at the start of `trait`.\n\t */\n\tatStartOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceTrait: trait,\n\t}),\n\t/**\n\t * @returns The location at the end of `trait`.\n\t */\n\tatEndOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceTrait: trait,\n\t}),\n};\n\n/**\n * @public\n */\nexport const StableRangeInternal = {\n\t/**\n\t * Factory for producing a `StableRange` from a start `StablePlace` to an end `StablePlace`.\n\t * @example\n\t * StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode))\n\t */\n\tfrom: (start: StablePlaceInternal): { to: (end: StablePlaceInternal) => StableRangeInternal } => ({\n\t\tto: (end: StablePlaceInternal): StableRangeInternal => {\n\t\t\tif (start.referenceTrait && end.referenceTrait) {\n\t\t\t\tconst message = 'StableRange must be constructed with endpoints from the same trait';\n\t\t\t\tassert(start.referenceTrait.parent === end.referenceTrait.parent, message);\n\t\t\t\tassert(start.referenceTrait.label === end.referenceTrait.label, message);\n\t\t\t}\n\t\t\treturn { start, end };\n\t\t},\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains only the provided `node`.\n\t * Both the start and end `StablePlace` objects used to anchor this `StableRange` are in terms of the passed in node.\n\t */\n\tonly: (node: NodeData<NodeId> | NodeId): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.before(node),\n\t\tend: StablePlaceInternal.after(node),\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains everything in the trait.\n\t * This is anchored using the provided `trait`, and is independent of the actual contents of the trait:\n\t * it does not use sibling anchoring.\n\t */\n\tall: (trait: TraitLocationInternal): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.atStartOf(trait),\n\t\tend: StablePlaceInternal.atEndOf(trait),\n\t}),\n};\n\n/**\n * Discriminated union of valid 0.0.1 SharedTree op types.\n */\nexport type SharedTreeOp = SharedTreeEditOp | SharedTreeHandleOp | SharedTreeUpdateOp | SharedTreeNoOp;\n\nexport interface SharedTreeEditOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Edit;\n\t/** The collection of changes to apply. */\n\treadonly edit: Edit<CompressedChangeInternal<OpSpaceNodeId>>;\n\t/** Contains all the IDs generated by the originating client since the last sent op */\n\treadonly idRange: IdCreationRange;\n}\n\n/**\n * A SharedTree op that includes edit handle information.\n * The handle corresponds to an edit chunk in the edit log.\n */\nexport interface SharedTreeHandleOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Handle;\n\t/** The serialized handle to an uploaded edit chunk. */\n\treadonly editHandle: string;\n\t/** The index of the first edit in the chunk that corresponds to the handle. */\n\treadonly startRevision: number;\n}\n\n/** The number of IDs that a SharedTree reserves for current or future internal use */\n// This value must never change\nexport const reservedIdCount = 10;\n\n/** The SessionID of the Upgrade Session */\n// This UUID must never change\nexport const ghostSessionId = '79590933-1c70-4fda-817a-adab57c20318' as SessionId;\n\n/** Accepts either a node or a node's identifier, and returns the identifier */\nfunction getNodeId<TId>(node: TId | NodeData<TId>): TId {\n\treturn (node as NodeData<TId>).identifier ?? (node as TId);\n}\n"]}
@@ -167,12 +167,7 @@ export declare const Change: {
167
167
  detach: (source: StableRange, destination?: number | undefined) => Detach;
168
168
  setPayload: (nodeToModify: NodeId, payload: Payload) => SetValue;
169
169
  clearPayload: (nodeToModify: NodeId) => SetValue;
170
- constraint: (toConstrain: StableRange, effect: ConstraintEffect, identityHash?: UuidString | undefined, length?: number | undefined, contentHash?: UuidString | undefined, parentNode?: (number & {
171
- readonly LocalCompressedId: "6fccb42f-e2a4-4243-bd29-f13d12b9c6d1";
172
- } & import("./Identifiers").SessionUnique & import("./Identifiers").NodeIdBrand) | (number & {
173
- readonly FinalCompressedId: "5d83d1e2-98b7-4e4e-a889-54c855cfa73d";
174
- readonly OpNormalized: "9209432d-a959-4df7-b2ad-767ead4dbcae";
175
- } & import("./Identifiers").SessionUnique & import("./Identifiers").NodeIdBrand) | undefined, label?: TraitLabel | undefined) => Constraint;
170
+ constraint: (toConstrain: StableRange, effect: ConstraintEffect, identityHash?: UuidString | undefined, length?: number | undefined, contentHash?: UuidString | undefined, parentNode?: NodeId | undefined, label?: TraitLabel | undefined) => Constraint;
176
171
  /** Helpers for making high-level composite operations */
177
172
  /**
178
173
  * @returns a change that deletes the supplied part of the tree.
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeTypes.d.ts","sourceRoot":"","sources":["../src/ChangeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;KACtE,CAAC;CACF;AAED;;;GAGG;AACH,oBAAY,UAAU;IACrB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,KAAK,IAAA;IACL,QAAQ,IAAA;IACR,UAAU,IAAA;CACV;AAED;;;;;;;GAOG;AACH,oBAAY,MAAM,GAAG,MA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;QAErB,6BAA6B;QAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACzE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';\nimport { IDisposable, IErrorEvent } from '@fluidframework/common-definitions';\nimport { assert } from './Common';\nimport { EditId } from './Identifiers';\nimport { CachingLogViewer } from './LogViewer';\nimport { TreeView } from './TreeView';\nimport { RevisionView } from './RevisionView';\nimport { EditCommittedHandler, SharedTree } from './SharedTree';\nimport { GenericTransaction, TransactionInternal, ValidEditingResult } from './TransactionInternal';\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types';\nimport { SharedTreeEvent } from './EventTypes';\nimport { newEditId } from './EditUtilities';\nimport { Change } from './ChangeTypes';\n\n/**\n * An event emitted by a `Checkout` to indicate a state change. See {@link ICheckoutEvents} for event argument information.\n * @public\n */\nexport enum CheckoutEvent {\n\t/**\n\t * `currentView` has changed.\n\t * Passed a before and after TreeView.\n\t */\n\tViewChange = 'viewChange',\n}\n\n/**\n * Events which may be emitted by `Checkout`. See {@link CheckoutEvent} for documentation of event semantics.\n */\nexport interface ICheckoutEvents extends IErrorEvent {\n\t(event: 'viewChange', listener: (before: TreeView, after: TreeView) => void);\n}\n\n/**\n * The result of validation of an Edit.\n * @public\n */\nexport enum EditValidationResult {\n\t/**\n\t * The edit contained one or more malformed changes (e.g. was missing required fields such as `id`),\n\t * or contained a sequence of changes that could not possibly be applied sequentially without error\n\t * (e.g. an edit which tries to insert the same detached node twice).\n\t */\n\tMalformed,\n\t/**\n\t * The edit is well-formed but cannot be applied to the current view, generally because concurrent changes\n\t * caused one or more merge conflicts.\n\t * For example, the edit refers to the `StablePlace` after node `C`, but `C` has since been deleted.\n\t */\n\tInvalid,\n\t/**\n\t * The edit is well-formed and can be applied to the current view.\n\t */\n\tValid,\n}\n\n/**\n * A mutable Checkout of a SharedTree, allowing viewing and interactive transactional editing.\n * Provides {@link https://en.wikipedia.org/wiki/Snapshot_isolation | snapshot-isolation} while editing.\n *\n * A Checkout always shows a consistent sequence of versions of the SharedTree, but it may skip intermediate versions, and may fall behind.\n * In this case consistent means the sequence of versions could occur with fully synchronous shared tree access,\n * though the timing of sequenced edits arriving to the Checkout may be later than they actually arrive in the SharedTree.\n * Specifically no sequenced edits will arrive during an ongoing edit (to implement snapshot isolation):\n * they will be applied asynchronously some time after the ongoing edit is ended.\n *\n * Events emitted by `Checkout` are documented in {@link CheckoutEvent}.\n * Exceptions thrown during event handling will be emitted as error events, which are automatically surfaced as error events on the\n * `SharedTree` used at construction time.\n * @public\n */\nexport abstract class Checkout extends EventEmitterWithErrorHandling<ICheckoutEvents> implements IDisposable {\n\t/**\n\t * The view of the latest committed revision.\n\t * Does not include changes from any open edits.\n\t *\n\t * When this changes, emitChange must be called.\n\t */\n\tprotected abstract get latestCommittedView(): RevisionView;\n\n\t/**\n\t * The last view for which invalidation was sent.\n\t * Updated by emitChange.\n\t */\n\tprivate previousView: TreeView;\n\n\t/**\n\t * A handler for 'committedEdit' SharedTreeEvent\n\t */\n\tprivate readonly editCommittedHandler: EditCommittedHandler;\n\n\t/**\n\t * The shared tree this checkout views/edits.\n\t */\n\tpublic readonly tree: SharedTree;\n\n\t/**\n\t * `tree`'s log viewer as a CachingLogViewer if it is one, otherwise undefined.\n\t * Used for optimizations if provided.\n\t */\n\tprivate readonly cachingLogViewer?: CachingLogViewer;\n\n\t/**\n\t * Holds the state required to manage the currently open edit.\n\t * Undefined if there is currently not an open edit.\n\t *\n\t * Since `currentView` exposes the the intermediate state from this edit,\n\t * operations that modify `currentEdit.view` must call `emitChange` to handle invalidation.\n\t */\n\tprivate currentEdit?: GenericTransaction;\n\n\tpublic disposed: boolean = false;\n\n\tprotected constructor(tree: SharedTree, currentView: RevisionView, onEditCommitted: EditCommittedHandler) {\n\t\tsuper((_event, error: unknown) => {\n\t\t\tthis.tree.emit('error', error);\n\t\t});\n\t\tthis.tree = tree;\n\t\tif (tree.logViewer instanceof CachingLogViewer) {\n\t\t\tthis.cachingLogViewer = tree.logViewer;\n\t\t}\n\t\tthis.previousView = currentView;\n\t\tthis.editCommittedHandler = onEditCommitted;\n\n\t\t// If there is an ongoing edit, emitChange will no-op, which is fine.\n\t\tthis.tree.on(SharedTreeEvent.EditCommitted, this.editCommittedHandler);\n\t}\n\n\t/**\n\t * @returns the current view of the tree, including the result of changes applied so far during an edit.\n\t * Note that any external edits (from other clients) will not added to view while there is a `currentEdit`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.currentEdit?.view ?? this.latestCommittedView;\n\t}\n\n\t/**\n\t * @returns true iff there is an open edit.\n\t * @internal\n\t */\n\tpublic hasOpenEdit(): boolean {\n\t\treturn this.currentEdit !== undefined;\n\t}\n\n\t/**\n\t * Opens a new edit operation.\n\t * Changes accumulate in the edit via calls to `applyChanges()`.\n\t */\n\tpublic openEdit(): void {\n\t\tassert(this.currentEdit === undefined, 'An edit is already open.');\n\t\tthis.currentEdit = TransactionInternal.factory(this.latestCommittedView);\n\t}\n\n\t/**\n\t * Ends the ongoing edit operation and commits it to the history.\n\t *\n\t * Malformed edits are considered an error, and will assert:\n\t * All named detached sequences must have been used or theEdit is malformed.\n\t *\n\t * @returns the `id` of the committed edit\n\t */\n\tpublic closeEdit(): EditId {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\tthis.currentEdit = undefined;\n\t\tconst editingResult = currentEdit.close();\n\t\tassert(editingResult.status === EditStatus.Applied, 'Locally constructed edits must be well-formed and valid');\n\n\t\tconst id: EditId = newEditId();\n\n\t\tthis.handleNewEdit(id, editingResult);\n\t\treturn id;\n\t}\n\n\t/**\n\t * Inform the Checkout that a particular edit is know to have a specific result when applied to a particular TreeView.\n\t * This may be used as a caching hint to avoid recomputation.\n\t */\n\tprotected hintKnownEditingResult(edit: Edit<ChangeInternal>, result: ValidEditingResult): void {\n\t\t// As an optimization, inform logViewer of this editing result so it can reuse it if applied to the same before revision.\n\t\tthis.cachingLogViewer?.setKnownEditingResult(edit, result);\n\t}\n\n\t/**\n\t * Take any needed action between when an edit is completed.\n\t * Usually this will include submitting it to a SharedTree.\n\t *\n\t * Override this to customize.\n\t */\n\tprotected handleNewEdit(id: EditId, result: ValidEditingResult): void {\n\t\tconst edit: Edit<ChangeInternal> = { id, changes: result.changes };\n\n\t\tthis.hintKnownEditingResult(edit, result);\n\n\t\t// Since external edits could have been applied while currentEdit was pending,\n\t\t// do not use the produced view: just go to the newest revision\n\t\t// (which processLocalEdit will do, including invalidation).\n\t\tthis.tree.applyEditInternal(edit);\n\t}\n\n\t/**\n\t * Applies the supplied changes to the tree and emits a change event.\n\t * Must be called during an ongoing edit (see `openEdit()`/`closeEdit()`).\n\t * `changes` must be well-formed and valid: it is an error if they do not apply cleanly.\n\t */\n\tpublic applyChanges(...changes: Change[]): void {\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\tassert(status === EditStatus.Applied, 'Locally constructed edits must be well-formed and valid.');\n\t\tthis.emitChange();\n\t}\n\n\t/**\n\t * Applies the supplied changes to the tree and emits a change event.\n\t * Must be called during an ongoing edit (see `openEdit()`/`closeEdit()`).\n\t * `changes` must be well-formed and valid: it is an error if they do not apply cleanly.\n\t */\n\tprotected tryApplyChangesInternal(...changes: ChangeInternal[]): EditStatus {\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes);\n\t\tif (status === EditStatus.Applied) {\n\t\t\tthis.emitChange();\n\t\t}\n\t\treturn status;\n\t}\n\n\t/**\n\t * Convenience helper for applying an edit containing the given changes.\n\t * Opens an edit, applies the given changes, and closes the edit. See (`openEdit()`/`applyChanges()`/`closeEdit()`).\n\t */\n\tpublic applyEdit(...changes: Change[]): EditId {\n\t\tthis.openEdit();\n\t\tthis.applyChanges(...changes);\n\t\treturn this.closeEdit();\n\t}\n\n\t/**\n\t * Apply an edit, if valid, otherwise does nothing (the edit is not added to the history).\n\t * If the edit applied, its changes will be immediately visible on this checkout, though it still may end up invalid once sequenced due to concurrent edits.\n\t * @returns The EditId if the edit was valid and thus applied, and undefined if it was invalid and thus not applied.\n\t */\n\tpublic tryApplyEdit(...changes: Change[]): EditId | undefined {\n\t\tthis.openEdit();\n\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\tif (status === EditStatus.Applied) {\n\t\t\tthis.emitChange();\n\t\t\treturn this.closeEdit();\n\t\t}\n\n\t\tthis.abortEdit();\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Rebases the ongoing edit to the latest revision loaded by this 'Checkout'.\n\t * If the rebase succeeds (none of the changes in the ongoing edit became invalid), the ongoing edit will remain open and the current\n\t * view will reflect those changes.\n\t *\n\t * If the rebase fails (changes become invalid), the ongoing edit will be aborted and\n\t * currentView will return to showing the newest committed revision as it always does when there is no ongoing edit.\n\t *\n\t * Must only be called during an open edit.\n\t * @returns - the result of the rebase.\n\t */\n\tpublic rebaseCurrentEdit(): EditValidationResult.Valid | EditValidationResult.Invalid {\n\t\tassert(this.currentEdit !== undefined, 'An edit is not open.');\n\t\tassert(this.currentEdit.status === EditStatus.Applied, 'Local edits should always be valid.');\n\t\t// When closed, the result might indicate Malformed due to unused detached entities.\n\t\t// This is not an error, as the edit was still open and can still use those entities.\n\t\tconst priorResults = this.currentEdit.close();\n\t\tconst rebasedEdit = TransactionInternal.factory(this.latestCommittedView).applyChanges(priorResults.changes);\n\t\tassert(\n\t\t\trebasedEdit.status !== EditStatus.Malformed,\n\t\t\t'Malformed changes should have been caught on original application.'\n\t\t);\n\t\tlet status: EditValidationResult.Valid | EditValidationResult.Invalid;\n\t\tif (rebasedEdit.status === EditStatus.Invalid) {\n\t\t\tstatus = EditValidationResult.Invalid;\n\t\t\tthis.currentEdit = undefined;\n\t\t} else {\n\t\t\tstatus = EditValidationResult.Valid;\n\t\t\tthis.currentEdit = rebasedEdit;\n\t\t}\n\t\tthis.emitChange();\n\t\treturn status;\n\t}\n\n\t/**\n\t * Ends the ongoing edit operation without committing it to the history.\n\t * Can only be called if an edit is open.\n\t */\n\tpublic abortEdit(): void {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\tthis.currentEdit = undefined;\n\t\tthis.emitChange();\n\t}\n\n\t/**\n\t * @returns the {@link EditStatus} of the current edit.\n\t * Has no side effects.\n\t * Can only be called if an edit is open.\n\t */\n\tpublic getEditStatus(): EditStatus {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\t// TODO: could this ever be anything other than 'Applied'\n\t\t// TODO: shouldn't this be an EditValidationResult since 'Applied' does not indicate the edit has been applied?\n\t\treturn currentEdit.status;\n\t}\n\n\t/**\n\t * Reverts a collection of edits.\n\t * @param editIds - the edits to revert\n\t */\n\tpublic revert(editId: EditId): void {\n\t\tassert(this.currentEdit !== undefined);\n\t\tconst index = this.tree.edits.getIndexOfId(editId);\n\t\tconst edit = this.tree.edits.getEditInSessionAtIndex(index);\n\t\tconst before = this.tree.logViewer.getRevisionViewInSession(index);\n\t\tconst changes = this.tree.revertChanges(edit.changes, before);\n\t\tif (changes !== undefined) {\n\t\t\tthis.tryApplyChangesInternal(...changes);\n\t\t}\n\t}\n\n\t/**\n\t * Send invalidation message for all changes since last call to emitChange.\n\t * This must be called every time `currentView` could have changed.\n\t * It is ok to make excessive calls to this: change notifications will be cheaply de-duplicated.\n\t */\n\tprotected emitChange(): void {\n\t\tconst current = this.currentView;\n\t\tconst previous = this.previousView;\n\t\tif (!previous.hasEqualForest(current, true)) {\n\t\t\t// Set previousView before calling emit to make reentrant case work (where the event handler causes an edit).\n\t\t\tthis.previousView = current;\n\t\t\tthis.emit(CheckoutEvent.ViewChange, previous, current);\n\t\t}\n\t}\n\n\t/**\n\t * @returns a Promise which completes after all currently known edits are available in this checkout.\n\t */\n\tpublic abstract waitForPendingUpdates(): Promise<void>;\n\n\t/**\n\t * @returns a Promise which completes after edits that were closed on this checkout (before calling this) have been\n\t * submitted to Fluid. This does NOT wait for the Fluid service to ack them\n\t */\n\tpublic abstract waitForEditsToSubmit(): Promise<void>;\n\n\t/**\n\t * release all unmanaged resources\n\t * e.g. unregister event listeners\n\t */\n\tpublic dispose(error?: Error): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\n\t\t// remove registered listener\n\t\tthis.tree.off(SharedTreeEvent.EditCommitted, this.editCommittedHandler);\n\t}\n}\n"]}
1
+ {"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../src/Checkout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,OAAO,EAAsB,mBAAmB,EAAsB,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;GAGG;AACH,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACxB;;;OAGG;IACH,0CAAyB,CAAA;AAC1B,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AASD;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAiBX;AAjBD,WAAY,oBAAoB;IAC/B;;;;OAIG;IACH,yEAAS,C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C;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';\nimport { IDisposable, IErrorEvent } from '@fluidframework/common-definitions';\nimport { assert } from './Common';\nimport { EditId } from './Identifiers';\nimport { CachingLogViewer } from './LogViewer';\nimport { TreeView } from './TreeView';\nimport { RevisionView } from './RevisionView';\nimport { EditCommittedHandler, SharedTree } from './SharedTree';\nimport { GenericTransaction, TransactionInternal, ValidEditingResult } from './TransactionInternal';\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types';\nimport { SharedTreeEvent } from './EventTypes';\nimport { newEditId } from './EditUtilities';\nimport { Change } from './ChangeTypes';\n\n/**\n * An event emitted by a `Checkout` to indicate a state change. See {@link ICheckoutEvents} for event argument information.\n * @public\n */\nexport enum CheckoutEvent {\n\t/**\n\t * `currentView` has changed.\n\t * Passed a before and after TreeView.\n\t */\n\tViewChange = 'viewChange',\n}\n\n/**\n * Events which may be emitted by `Checkout`. See {@link CheckoutEvent} for documentation of event semantics.\n */\nexport interface ICheckoutEvents extends IErrorEvent {\n\t(event: 'viewChange', listener: (before: TreeView, after: TreeView) => void);\n}\n\n/**\n * The result of validation of an Edit.\n * @public\n */\nexport enum EditValidationResult {\n\t/**\n\t * The edit contained one or more malformed changes (e.g. was missing required fields such as `id`),\n\t * or contained a sequence of changes that could not possibly be applied sequentially without error\n\t * (e.g. an edit which tries to insert the same detached node twice).\n\t */\n\tMalformed,\n\t/**\n\t * The edit is well-formed but cannot be applied to the current view, generally because concurrent changes\n\t * caused one or more merge conflicts.\n\t * For example, the edit refers to the `StablePlace` after node `C`, but `C` has since been deleted.\n\t */\n\tInvalid,\n\t/**\n\t * The edit is well-formed and can be applied to the current view.\n\t */\n\tValid,\n}\n\n/**\n * A mutable Checkout of a SharedTree, allowing viewing and interactive transactional editing.\n * Provides {@link https://en.wikipedia.org/wiki/Snapshot_isolation | snapshot-isolation} while editing.\n *\n * A Checkout always shows a consistent sequence of versions of the SharedTree, but it may skip intermediate versions, and may fall behind.\n * In this case consistent means the sequence of versions could occur with fully synchronous shared tree access,\n * though the timing of sequenced edits arriving to the Checkout may be later than they actually arrive in the SharedTree.\n * Specifically no sequenced edits will arrive during an ongoing edit (to implement snapshot isolation):\n * they will be applied asynchronously some time after the ongoing edit is ended.\n *\n * Events emitted by `Checkout` are documented in {@link CheckoutEvent}.\n * Exceptions thrown during event handling will be emitted as error events, which are automatically surfaced as error events on the\n * `SharedTree` used at construction time.\n * @public\n */\nexport abstract class Checkout extends EventEmitterWithErrorHandling<ICheckoutEvents> implements IDisposable {\n\t/**\n\t * The view of the latest committed revision.\n\t * Does not include changes from any open edits.\n\t *\n\t * When this changes, emitChange must be called.\n\t */\n\tprotected abstract get latestCommittedView(): RevisionView;\n\n\t/**\n\t * The last view for which invalidation was sent.\n\t * Updated by emitChange.\n\t */\n\tprivate previousView: TreeView;\n\n\t/**\n\t * A handler for 'committedEdit' SharedTreeEvent\n\t */\n\tprivate readonly editCommittedHandler: EditCommittedHandler;\n\n\t/**\n\t * The shared tree this checkout views/edits.\n\t */\n\tpublic readonly tree: SharedTree;\n\n\t/**\n\t * `tree`'s log viewer as a CachingLogViewer if it is one, otherwise undefined.\n\t * Used for optimizations if provided.\n\t */\n\tprivate readonly cachingLogViewer?: CachingLogViewer;\n\n\t/**\n\t * Holds the state required to manage the currently open edit.\n\t * Undefined if there is currently not an open edit.\n\t *\n\t * Since `currentView` exposes the the intermediate state from this edit,\n\t * operations that modify `currentEdit.view` must call `emitChange` to handle invalidation.\n\t */\n\tprivate currentEdit?: GenericTransaction;\n\n\tpublic disposed: boolean = false;\n\n\tprotected constructor(tree: SharedTree, currentView: RevisionView, onEditCommitted: EditCommittedHandler) {\n\t\tsuper((_event, error: unknown) => {\n\t\t\tthis.tree.emit('error', error);\n\t\t});\n\t\tthis.tree = tree;\n\t\tif (tree.logViewer instanceof CachingLogViewer) {\n\t\t\tthis.cachingLogViewer = tree.logViewer;\n\t\t}\n\t\tthis.previousView = currentView;\n\t\tthis.editCommittedHandler = onEditCommitted;\n\n\t\t// If there is an ongoing edit, emitChange will no-op, which is fine.\n\t\tthis.tree.on(SharedTreeEvent.EditCommitted, this.editCommittedHandler);\n\t}\n\n\t/**\n\t * @returns the current view of the tree, including the result of changes applied so far during an edit.\n\t * Note that any external edits (from other clients) will not added to view while there is a `currentEdit`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.currentEdit?.view ?? this.latestCommittedView;\n\t}\n\n\t/**\n\t * @returns true iff there is an open edit.\n\t * @internal\n\t */\n\tpublic hasOpenEdit(): boolean {\n\t\treturn this.currentEdit !== undefined;\n\t}\n\n\t/**\n\t * Opens a new edit operation.\n\t * Changes accumulate in the edit via calls to `applyChanges()`.\n\t */\n\tpublic openEdit(): void {\n\t\tassert(this.currentEdit === undefined, 'An edit is already open.');\n\t\tthis.currentEdit = TransactionInternal.factory(this.latestCommittedView);\n\t}\n\n\t/**\n\t * Ends the ongoing edit operation and commits it to the history.\n\t *\n\t * Malformed edits are considered an error, and will assert:\n\t * All named detached sequences must have been used or theEdit is malformed.\n\t *\n\t * @returns the `id` of the committed edit\n\t */\n\tpublic closeEdit(): EditId {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\tthis.currentEdit = undefined;\n\t\tconst editingResult = currentEdit.close();\n\t\tassert(editingResult.status === EditStatus.Applied, 'Locally constructed edits must be well-formed and valid');\n\n\t\tconst id: EditId = newEditId();\n\n\t\tthis.handleNewEdit(id, editingResult);\n\t\treturn id;\n\t}\n\n\t/**\n\t * Inform the Checkout that a particular edit is know to have a specific result when applied to a particular TreeView.\n\t * This may be used as a caching hint to avoid recomputation.\n\t */\n\tprotected hintKnownEditingResult(edit: Edit<ChangeInternal>, result: ValidEditingResult): void {\n\t\t// As an optimization, inform logViewer of this editing result so it can reuse it if applied to the same before revision.\n\t\tthis.cachingLogViewer?.setKnownEditingResult(edit, result);\n\t}\n\n\t/**\n\t * Take any needed action between when an edit is completed.\n\t * Usually this will include submitting it to a SharedTree.\n\t *\n\t * Override this to customize.\n\t */\n\tprotected handleNewEdit(id: EditId, result: ValidEditingResult): void {\n\t\tconst edit: Edit<ChangeInternal> = { id, changes: result.changes };\n\n\t\tthis.hintKnownEditingResult(edit, result);\n\n\t\t// Since external edits could have been applied while currentEdit was pending,\n\t\t// do not use the produced view: just go to the newest revision\n\t\t// (which processLocalEdit will do, including invalidation).\n\t\tthis.tree.applyEditInternal(edit);\n\t}\n\n\t/**\n\t * Applies the supplied changes to the tree and emits a change event.\n\t * Must be called during an ongoing edit (see `openEdit()`/`closeEdit()`).\n\t * `changes` must be well-formed and valid: it is an error if they do not apply cleanly.\n\t */\n\tpublic applyChanges(...changes: Change[]): void {\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\tassert(status === EditStatus.Applied, 'Locally constructed edits must be well-formed and valid.');\n\t\tthis.emitChange();\n\t}\n\n\t/**\n\t * Applies the supplied changes to the tree and emits a change event.\n\t * Must be called during an ongoing edit (see `openEdit()`/`closeEdit()`).\n\t * `changes` must be well-formed and valid: it is an error if they do not apply cleanly.\n\t */\n\tprotected tryApplyChangesInternal(...changes: ChangeInternal[]): EditStatus {\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes);\n\t\tif (status === EditStatus.Applied) {\n\t\t\tthis.emitChange();\n\t\t}\n\t\treturn status;\n\t}\n\n\t/**\n\t * Convenience helper for applying an edit containing the given changes.\n\t * Opens an edit, applies the given changes, and closes the edit. See (`openEdit()`/`applyChanges()`/`closeEdit()`).\n\t */\n\tpublic applyEdit(...changes: Change[]): EditId {\n\t\tthis.openEdit();\n\t\tthis.applyChanges(...changes);\n\t\treturn this.closeEdit();\n\t}\n\n\t/**\n\t * Apply an edit, if valid, otherwise does nothing (the edit is not added to the history).\n\t * If the edit applied, its changes will be immediately visible on this checkout, though it still may end up invalid once sequenced due to concurrent edits.\n\t * @returns The EditId if the edit was valid and thus applied, and undefined if it was invalid and thus not applied.\n\t */\n\tpublic tryApplyEdit(...changes: Change[]): EditId | undefined {\n\t\tthis.openEdit();\n\n\t\tassert(this.currentEdit, 'Changes must be applied as part of an ongoing edit.');\n\t\tconst { status } = this.currentEdit.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\tif (status === EditStatus.Applied) {\n\t\t\tthis.emitChange();\n\t\t\treturn this.closeEdit();\n\t\t}\n\n\t\tthis.abortEdit();\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Rebases the ongoing edit to the latest revision loaded by this 'Checkout'.\n\t * If the rebase succeeds (none of the changes in the ongoing edit became invalid), the ongoing edit will remain open and the current\n\t * view will reflect those changes.\n\t *\n\t * If the rebase fails (changes become invalid), the ongoing edit will be aborted and\n\t * currentView will return to showing the newest committed revision as it always does when there is no ongoing edit.\n\t *\n\t * Must only be called during an open edit.\n\t * @returns - the result of the rebase.\n\t */\n\tpublic rebaseCurrentEdit(): EditValidationResult.Valid | EditValidationResult.Invalid {\n\t\tassert(this.currentEdit !== undefined, 'An edit is not open.');\n\t\tassert(this.currentEdit.status === EditStatus.Applied, 'Local edits should always be valid.');\n\t\t// When closed, the result might indicate Malformed due to unused detached entities.\n\t\t// This is not an error, as the edit was still open and can still use those entities.\n\t\tconst priorResults = this.currentEdit.close();\n\t\tconst rebasedEdit = TransactionInternal.factory(this.latestCommittedView).applyChanges(priorResults.changes);\n\t\tassert(\n\t\t\trebasedEdit.status !== EditStatus.Malformed,\n\t\t\t'Malformed changes should have been caught on original application.'\n\t\t);\n\t\tlet status: EditValidationResult.Valid | EditValidationResult.Invalid;\n\t\tif (rebasedEdit.status === EditStatus.Invalid) {\n\t\t\tstatus = EditValidationResult.Invalid;\n\t\t\tthis.currentEdit = undefined;\n\t\t} else {\n\t\t\tstatus = EditValidationResult.Valid;\n\t\t\tthis.currentEdit = rebasedEdit;\n\t\t}\n\t\tthis.emitChange();\n\t\treturn status;\n\t}\n\n\t/**\n\t * Ends the ongoing edit operation without committing it to the history.\n\t * Can only be called if an edit is open.\n\t */\n\tpublic abortEdit(): void {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\tthis.currentEdit = undefined;\n\t\tthis.emitChange();\n\t}\n\n\t/**\n\t * @returns the {@link EditStatus} of the current edit.\n\t * Has no side effects.\n\t * Can only be called if an edit is open.\n\t */\n\tpublic getEditStatus(): EditStatus {\n\t\tconst { currentEdit } = this;\n\t\tassert(currentEdit !== undefined, 'An edit is not open.');\n\t\t// TODO: could this ever be anything other than 'Applied'\n\t\t// TODO: shouldn't this be an EditValidationResult since 'Applied' does not indicate the edit has been applied?\n\t\treturn currentEdit.status;\n\t}\n\n\t/**\n\t * Reverts a collection of edits.\n\t * @param editIds - the edits to revert\n\t */\n\tpublic revert(editId: EditId): void {\n\t\tassert(this.currentEdit !== undefined);\n\t\tconst index = this.tree.edits.getIndexOfId(editId);\n\t\tconst edit = this.tree.edits.getEditInSessionAtIndex(index);\n\t\tconst before = this.tree.logViewer.getRevisionViewInSession(index);\n\t\tconst changes = this.tree.revertChanges(edit.changes, before);\n\t\tif (changes !== undefined) {\n\t\t\tthis.tryApplyChangesInternal(...changes);\n\t\t}\n\t}\n\n\t/**\n\t * Send invalidation message for all changes since last call to emitChange.\n\t * This must be called every time `currentView` could have changed.\n\t * It is ok to make excessive calls to this: change notifications will be cheaply de-duplicated.\n\t */\n\tprotected emitChange(): void {\n\t\tconst current = this.currentView;\n\t\tconst previous = this.previousView;\n\t\tif (!previous.hasEqualForest(current, true)) {\n\t\t\t// Set previousView before calling emit to make reentrant case work (where the event handler causes an edit).\n\t\t\tthis.previousView = current;\n\t\t\tthis.emit(CheckoutEvent.ViewChange, previous, current);\n\t\t}\n\t}\n\n\t/**\n\t * @returns a Promise which completes after all currently known edits are available in this checkout.\n\t */\n\tpublic abstract waitForPendingUpdates(): Promise<void>;\n\n\t/**\n\t * @returns a Promise which completes after edits that were closed on this checkout (before calling this) have been\n\t * submitted to Fluid. This does NOT wait for the Fluid service to ack them\n\t */\n\tpublic abstract waitForEditsToSubmit(): Promise<void>;\n\n\t/**\n\t * release all unmanaged resources\n\t * e.g. unregister event listeners\n\t */\n\tpublic dispose(error?: Error): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\n\t\t// remove registered listener\n\t\tthis.tree.off(SharedTreeEvent.EditCommitted, this.editCommittedHandler);\n\t}\n}\n"]}
package/lib/Common.d.ts CHANGED
@@ -25,11 +25,17 @@ export interface SharedTreeTelemetryProperties extends ITelemetryProperties {
25
25
  */
26
26
  export declare function isSharedTreeEvent(event: ITelemetryBaseEvent): boolean;
27
27
  /**
28
- * Compares finite numbers to form a strict partial ordering.
28
+ * A numeric comparator used for sorting in ascending order.
29
29
  *
30
30
  * Handles +/-0 like Map: -0 is equal to +0.
31
31
  */
32
32
  export declare function compareFiniteNumbers<T extends number>(a: T, b: T): number;
33
+ /**
34
+ * A numeric comparator used for sorting in descending order.
35
+ *
36
+ * Handles +/-0 like Map: -0 is equal to +0.
37
+ */
38
+ export declare function compareFiniteNumbersReversed<T extends number>(a: T, b: T): number;
33
39
  /**
34
40
  * Compares strings lexically to form a strict partial ordering.
35
41
  */
@@ -143,10 +149,10 @@ export declare function compareMaps<K, V>(mapA: ReadonlyMap<K, V>, mapB: Readonl
143
149
  * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.
144
150
  * @param map - the map to query/update
145
151
  * @param key - the key to lookup in the map
146
- * @param defaultValue - a function which returns a default value. This is called and used to set an initial value in the map if none exists
152
+ * @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
147
153
  * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)
148
154
  */
149
- export declare function getOrCreate<K, V>(map: Map<K, V>, key: K, defaultValue: () => V): V;
155
+ export declare function getOrCreate<K, V>(map: Map<K, V>, key: K, defaultValue: (key: K) => V): V;
150
156
  /**
151
157
  * Function which does nothing (no-ops).
152
158
  */
@@ -272,5 +278,17 @@ declare type Primitive = string | number | bigint | boolean | null | symbol | un
272
278
  export declare type ReplaceRecursive<T, TReplace, TWith> = T extends TReplace ? TWith : T extends Primitive ? T : {
273
279
  [P in keyof T]: ReplaceRecursive<T[P], TReplace, TWith>;
274
280
  };
281
+ /** A union type of the first `N` positive integers */
282
+ export declare type TakeWholeNumbers<N extends number, A extends never[] = []> = N extends A['length'] ? never : A['length'] | TakeWholeNumbers<N, [never, ...A]>;
283
+ /** Returns a tuple type with exactly `Length` elements of type `T` */
284
+ export declare type ArrayOfLength<T, Length extends number, A extends T[] = []> = Length extends A['length'] ? A : ArrayOfLength<T, Length, [T, ...A]>;
285
+ /**
286
+ * Fails if `array` does not have exactly `length` elements
287
+ */
288
+ export declare function hasExactlyLength<T, Len extends TakeWholeNumbers<16>>(array: readonly T[], length: Len): array is ArrayOfLength<T, Len>;
289
+ /**
290
+ * Fails if `array` does not have at least `length` elements
291
+ */
292
+ export declare function hasLength<T, Len extends TakeWholeNumbers<16>>(array: readonly T[], length: Len): array is [...ArrayOfLength<T, Len>, ...T[]];
275
293
  export {};
276
294
  //# sourceMappingURL=Common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.d.ts","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,KAAK,MAAM,cAAc,CAAC;AAIjC;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;IAC1E,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC;CACj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MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,SAAS,gBAAgB,CAAC,EAAE,CAAC,EACnE,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,GAAG,GACT,KAAK,IAAI,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAEhC;AACD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,SAAS,gBAAgB,CAAC,EAAE,CAAC,EAC5D,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,GAAG,GACT,KAAK,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAE7C"}
package/lib/Common.js CHANGED
@@ -33,13 +33,21 @@ class SharedTreeAssertionError extends Error {
33
33
  }
34
34
  }
35
35
  /**
36
- * Compares finite numbers to form a strict partial ordering.
36
+ * A numeric comparator used for sorting in ascending order.
37
37
  *
38
38
  * Handles +/-0 like Map: -0 is equal to +0.
39
39
  */
40
40
  export function compareFiniteNumbers(a, b) {
41
41
  return a - b;
42
42
  }
43
+ /**
44
+ * A numeric comparator used for sorting in descending order.
45
+ *
46
+ * Handles +/-0 like Map: -0 is equal to +0.
47
+ */
48
+ export function compareFiniteNumbersReversed(a, b) {
49
+ return b - a;
50
+ }
43
51
  /**
44
52
  * Compares strings lexically to form a strict partial ordering.
45
53
  */
@@ -259,13 +267,13 @@ export function compareMaps(mapA, mapB, elementComparator = Object.is) {
259
267
  * Retrieve a value from a map with the given key, or create a new entry if the key is not in the map.
260
268
  * @param map - the map to query/update
261
269
  * @param key - the key to lookup in the map
262
- * @param defaultValue - a function which returns a default value. This is called and used to set an initial value in the map if none exists
270
+ * @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
263
271
  * @returns either the existing value for the given key, or the newly-created value (the result of `defaultValue`)
264
272
  */
265
273
  export function getOrCreate(map, key, defaultValue) {
266
274
  let value = map.get(key);
267
275
  if (value === undefined) {
268
- value = defaultValue();
276
+ value = defaultValue(key);
269
277
  map.set(key, value);
270
278
  }
271
279
  return value;
@@ -302,6 +310,7 @@ export function setPropertyIfDefined(value, destination, property) {
302
310
  }
303
311
  }
304
312
  /**
313
+ * ```
305
314
  * function (thing: ObjectWithMaybeFoo) {
306
315
  * const x: MyActualType = {
307
316
  * bar: 3
@@ -310,6 +319,7 @@ export function setPropertyIfDefined(value, destination, property) {
310
319
  *
311
320
  * copyPropertyIfDefined(thing, x, 'foo');
312
321
  * }
322
+ * ```
313
323
  * @returns
314
324
  */
315
325
  function breakOnDifference() {
@@ -396,4 +406,16 @@ export var Result;
396
406
  ResultType[ResultType["Error"] = 1] = "Error";
397
407
  })(ResultType = Result.ResultType || (Result.ResultType = {}));
398
408
  })(Result || (Result = {}));
409
+ /**
410
+ * Fails if `array` does not have exactly `length` elements
411
+ */
412
+ export function hasExactlyLength(array, length) {
413
+ return array.length === length;
414
+ }
415
+ /**
416
+ * Fails if `array` does not have at least `length` elements
417
+ */
418
+ export function hasLength(array, length) {
419
+ return array.length >= length;
420
+ }
399
421
  //# sourceMappingURL=Common.js.map