@fluid-experimental/tree 0.58.2000 → 0.58.3000-61081
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.
- package/README.md +9 -9
- package/dist/ChangeCompression.d.ts +39 -0
- package/dist/ChangeCompression.d.ts.map +1 -0
- package/dist/ChangeCompression.js +117 -0
- package/dist/ChangeCompression.js.map +1 -0
- package/{lib/default-edits/PersistedTypes.d.ts → dist/ChangeTypes.d.ts} +58 -100
- package/dist/ChangeTypes.d.ts.map +1 -0
- package/dist/{default-edits/PersistedTypes.js → ChangeTypes.js} +21 -76
- package/dist/ChangeTypes.js.map +1 -0
- package/dist/Checkout.d.ts +39 -27
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +59 -31
- package/dist/Checkout.js.map +1 -1
- package/dist/Common.d.ts +175 -38
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +240 -103
- package/dist/Common.js.map +1 -1
- package/dist/EagerCheckout.d.ts +24 -0
- package/dist/EagerCheckout.d.ts.map +1 -0
- package/dist/{BasicCheckout.js → EagerCheckout.js} +9 -6
- package/dist/EagerCheckout.js.map +1 -0
- package/dist/EditLog.d.ts +77 -63
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +85 -48
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +168 -0
- package/dist/EditUtilities.d.ts.map +1 -0
- package/dist/EditUtilities.js +373 -0
- package/dist/EditUtilities.js.map +1 -0
- package/dist/EventTypes.d.ts +73 -0
- package/dist/EventTypes.d.ts.map +1 -0
- package/dist/EventTypes.js +78 -0
- package/dist/EventTypes.js.map +1 -0
- package/dist/Forest.d.ts +29 -7
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +60 -36
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +20 -0
- package/dist/HistoryEditFactory.d.ts.map +1 -0
- package/dist/HistoryEditFactory.js +226 -0
- package/dist/HistoryEditFactory.js.map +1 -0
- package/dist/IdConversion.d.ts +12 -0
- package/dist/IdConversion.d.ts.map +1 -0
- package/dist/IdConversion.js +98 -0
- package/dist/IdConversion.js.map +1 -0
- package/dist/Identifiers.d.ts +89 -2
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js +10 -0
- package/dist/Identifiers.js.map +1 -1
- package/dist/InitialTree.d.ts +2 -2
- package/dist/InitialTree.d.ts.map +1 -1
- package/dist/InitialTree.js +2 -1
- package/dist/InitialTree.js.map +1 -1
- package/dist/LazyCheckout.d.ts +28 -0
- package/dist/LazyCheckout.d.ts.map +1 -0
- package/dist/LazyCheckout.js +44 -0
- package/dist/LazyCheckout.js.map +1 -0
- package/dist/LogViewer.d.ts +130 -85
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +110 -85
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts +221 -0
- package/dist/MergeHealth.d.ts.map +1 -0
- package/dist/MergeHealth.js +263 -0
- package/dist/MergeHealth.js.map +1 -0
- package/dist/NodeIdUtilities.d.ts +90 -0
- package/dist/NodeIdUtilities.d.ts.map +1 -0
- package/dist/NodeIdUtilities.js +60 -0
- package/dist/NodeIdUtilities.js.map +1 -0
- package/dist/PayloadUtilities.d.ts +42 -0
- package/dist/PayloadUtilities.d.ts.map +1 -0
- package/dist/PayloadUtilities.js +114 -0
- package/dist/PayloadUtilities.js.map +1 -0
- package/dist/ReconciliationPath.d.ts +18 -13
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts +11 -2
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -3
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +83 -0
- package/dist/RevisionView.d.ts.map +1 -0
- package/dist/RevisionView.js +182 -0
- package/dist/RevisionView.js.map +1 -0
- package/dist/SerializationUtilities.d.ts +36 -0
- package/dist/SerializationUtilities.d.ts.map +1 -0
- package/dist/SerializationUtilities.js +102 -0
- package/dist/SerializationUtilities.js.map +1 -0
- package/dist/SharedTree.d.ts +400 -0
- package/dist/SharedTree.d.ts.map +1 -0
- package/dist/SharedTree.js +1064 -0
- package/dist/SharedTree.js.map +1 -0
- package/dist/SharedTreeEncoder.d.ts +102 -0
- package/dist/SharedTreeEncoder.d.ts.map +1 -0
- package/dist/SharedTreeEncoder.js +313 -0
- package/dist/SharedTreeEncoder.js.map +1 -0
- package/dist/StringInterner.d.ts +46 -0
- package/dist/StringInterner.d.ts.map +1 -0
- package/dist/StringInterner.js +61 -0
- package/dist/StringInterner.js.map +1 -0
- package/dist/Summary.d.ts +40 -0
- package/dist/Summary.d.ts.map +1 -0
- package/dist/Summary.js +23 -0
- package/dist/Summary.js.map +1 -0
- package/dist/SummaryBackCompatibility.d.ts +22 -22
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js +30 -33
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +31 -0
- package/dist/SummaryTestUtilities.d.ts.map +1 -0
- package/dist/SummaryTestUtilities.js +37 -0
- package/dist/SummaryTestUtilities.js.map +1 -0
- package/dist/Transaction.d.ts +53 -0
- package/dist/Transaction.d.ts.map +1 -0
- package/dist/Transaction.js +76 -0
- package/dist/Transaction.js.map +1 -0
- package/dist/TransactionInternal.d.ts +543 -0
- package/dist/TransactionInternal.d.ts.map +1 -0
- package/dist/TransactionInternal.js +622 -0
- package/dist/TransactionInternal.js.map +1 -0
- package/dist/TreeCompressor.d.ts +37 -0
- package/dist/TreeCompressor.d.ts.map +1 -0
- package/dist/TreeCompressor.js +132 -0
- package/dist/TreeCompressor.js.map +1 -0
- package/dist/TreeNodeHandle.d.ts +12 -18
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js +13 -23
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +166 -0
- package/dist/TreeView.d.ts.map +1 -0
- package/dist/TreeView.js +217 -0
- package/dist/TreeView.js.map +1 -0
- package/dist/TreeViewUtilities.d.ts +21 -0
- package/dist/TreeViewUtilities.d.ts.map +1 -0
- package/dist/TreeViewUtilities.js +77 -0
- package/dist/TreeViewUtilities.js.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/dist/UndoRedoHandler.d.ts.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +5 -9
- package/dist/UndoRedoHandler.js.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.js +283 -0
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/dist/id-compressor/IdCompressor.d.ts +389 -0
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -0
- package/dist/id-compressor/IdCompressor.js +1353 -0
- package/dist/id-compressor/IdCompressor.js.map +1 -0
- package/dist/id-compressor/IdRange.d.ts +11 -0
- package/dist/id-compressor/IdRange.d.ts.map +1 -0
- package/dist/id-compressor/IdRange.js +29 -0
- package/dist/id-compressor/IdRange.js.map +1 -0
- package/dist/id-compressor/NumericUuid.d.ts +63 -0
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -0
- package/dist/id-compressor/NumericUuid.js +377 -0
- package/dist/id-compressor/NumericUuid.js.map +1 -0
- package/dist/id-compressor/index.d.ts +12 -0
- package/dist/id-compressor/index.d.ts.map +1 -0
- package/dist/id-compressor/index.js +26 -0
- package/dist/id-compressor/index.js.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.js +7 -0
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/dist/id-compressor/persisted-types/index.d.ts +6 -0
- package/dist/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/index.js +18 -0
- package/dist/id-compressor/persisted-types/index.js.map +1 -0
- package/dist/index.d.ts +29 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +385 -0
- package/dist/persisted-types/0.0.2.d.ts.map +1 -0
- package/dist/persisted-types/0.0.2.js +113 -0
- package/dist/persisted-types/0.0.2.js.map +1 -0
- package/dist/persisted-types/0.1.1.d.ts +314 -0
- package/dist/persisted-types/0.1.1.d.ts.map +1 -0
- package/dist/persisted-types/0.1.1.js +153 -0
- package/dist/persisted-types/0.1.1.js.map +1 -0
- package/dist/persisted-types/index.d.ts +7 -0
- package/dist/persisted-types/index.d.ts.map +1 -0
- package/dist/persisted-types/index.js +20 -0
- package/dist/persisted-types/index.js.map +1 -0
- package/docs/0-1-1-Compression.md +228 -0
- package/docs/Breaking-Change-Migration.md +52 -0
- package/docs/Compression.md +2 -2
- package/docs/Telemetry.md +43 -0
- package/lib/ChangeCompression.d.ts +39 -0
- package/lib/ChangeCompression.d.ts.map +1 -0
- package/lib/ChangeCompression.js +111 -0
- package/lib/ChangeCompression.js.map +1 -0
- package/{dist/default-edits/PersistedTypes.d.ts → lib/ChangeTypes.d.ts} +58 -100
- package/lib/ChangeTypes.d.ts.map +1 -0
- package/lib/{default-edits/PersistedTypes.js → ChangeTypes.js} +15 -68
- package/lib/ChangeTypes.js.map +1 -0
- package/lib/Checkout.d.ts +39 -27
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +51 -23
- package/lib/Checkout.js.map +1 -1
- package/lib/Common.d.ts +175 -38
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +226 -101
- package/lib/Common.js.map +1 -1
- package/lib/EagerCheckout.d.ts +24 -0
- package/lib/EagerCheckout.d.ts.map +1 -0
- package/lib/{BasicCheckout.js → EagerCheckout.js} +7 -4
- package/lib/EagerCheckout.js.map +1 -0
- package/lib/EditLog.d.ts +77 -63
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +83 -47
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +168 -0
- package/lib/EditUtilities.d.ts.map +1 -0
- package/lib/EditUtilities.js +353 -0
- package/lib/EditUtilities.js.map +1 -0
- package/lib/EventTypes.d.ts +73 -0
- package/lib/EventTypes.d.ts.map +1 -0
- package/lib/EventTypes.js +75 -0
- package/lib/EventTypes.js.map +1 -0
- package/lib/Forest.d.ts +29 -7
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +58 -35
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +20 -0
- package/lib/HistoryEditFactory.d.ts.map +1 -0
- package/lib/{default-edits/HistoryEditFactory.js → HistoryEditFactory.js} +78 -39
- package/lib/HistoryEditFactory.js.map +1 -0
- package/lib/IdConversion.d.ts +12 -0
- package/lib/IdConversion.d.ts.map +1 -0
- package/lib/IdConversion.js +91 -0
- package/lib/IdConversion.js.map +1 -0
- package/lib/Identifiers.d.ts +89 -2
- package/lib/Identifiers.d.ts.map +1 -1
- package/lib/Identifiers.js +8 -1
- package/lib/Identifiers.js.map +1 -1
- package/lib/InitialTree.d.ts +2 -2
- package/lib/InitialTree.d.ts.map +1 -1
- package/lib/InitialTree.js +2 -1
- package/lib/InitialTree.js.map +1 -1
- package/lib/LazyCheckout.d.ts +28 -0
- package/lib/LazyCheckout.d.ts.map +1 -0
- package/lib/LazyCheckout.js +40 -0
- package/lib/LazyCheckout.js.map +1 -0
- package/lib/LogViewer.d.ts +130 -85
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +102 -77
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts +221 -0
- package/lib/MergeHealth.d.ts.map +1 -0
- package/lib/MergeHealth.js +258 -0
- package/lib/MergeHealth.js.map +1 -0
- package/lib/NodeIdUtilities.d.ts +90 -0
- package/lib/NodeIdUtilities.d.ts.map +1 -0
- package/lib/NodeIdUtilities.js +53 -0
- package/lib/NodeIdUtilities.js.map +1 -0
- package/lib/PayloadUtilities.d.ts +42 -0
- package/lib/PayloadUtilities.d.ts.map +1 -0
- package/lib/PayloadUtilities.js +110 -0
- package/lib/PayloadUtilities.js.map +1 -0
- package/lib/ReconciliationPath.d.ts +18 -13
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts +11 -2
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -3
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +83 -0
- package/lib/RevisionView.d.ts.map +1 -0
- package/lib/RevisionView.js +175 -0
- package/lib/RevisionView.js.map +1 -0
- package/lib/SerializationUtilities.d.ts +36 -0
- package/lib/SerializationUtilities.d.ts.map +1 -0
- package/lib/SerializationUtilities.js +95 -0
- package/lib/SerializationUtilities.js.map +1 -0
- package/lib/SharedTree.d.ts +400 -0
- package/lib/SharedTree.d.ts.map +1 -0
- package/lib/SharedTree.js +1059 -0
- package/lib/SharedTree.js.map +1 -0
- package/lib/SharedTreeEncoder.d.ts +102 -0
- package/lib/SharedTreeEncoder.d.ts.map +1 -0
- package/lib/SharedTreeEncoder.js +308 -0
- package/lib/SharedTreeEncoder.js.map +1 -0
- package/lib/StringInterner.d.ts +46 -0
- package/lib/StringInterner.d.ts.map +1 -0
- package/lib/StringInterner.js +57 -0
- package/lib/StringInterner.js.map +1 -0
- package/lib/Summary.d.ts +40 -0
- package/lib/Summary.d.ts.map +1 -0
- package/lib/Summary.js +19 -0
- package/lib/Summary.js.map +1 -0
- package/lib/SummaryBackCompatibility.d.ts +22 -22
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js +29 -32
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +31 -0
- package/lib/SummaryTestUtilities.d.ts.map +1 -0
- package/lib/SummaryTestUtilities.js +32 -0
- package/lib/SummaryTestUtilities.js.map +1 -0
- package/lib/Transaction.d.ts +53 -0
- package/lib/Transaction.d.ts.map +1 -0
- package/lib/Transaction.js +72 -0
- package/lib/Transaction.js.map +1 -0
- package/lib/TransactionInternal.d.ts +543 -0
- package/lib/TransactionInternal.d.ts.map +1 -0
- package/lib/TransactionInternal.js +618 -0
- package/lib/TransactionInternal.js.map +1 -0
- package/lib/TreeCompressor.d.ts +37 -0
- package/lib/TreeCompressor.d.ts.map +1 -0
- package/lib/TreeCompressor.js +128 -0
- package/lib/TreeCompressor.js.map +1 -0
- package/lib/TreeNodeHandle.d.ts +12 -18
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js +14 -24
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +166 -0
- package/lib/TreeView.d.ts.map +1 -0
- package/lib/TreeView.js +213 -0
- package/lib/TreeView.js.map +1 -0
- package/lib/TreeViewUtilities.d.ts +21 -0
- package/lib/TreeViewUtilities.d.ts.map +1 -0
- package/lib/TreeViewUtilities.js +71 -0
- package/lib/TreeViewUtilities.js.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/lib/UndoRedoHandler.d.ts.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +3 -7
- package/lib/UndoRedoHandler.js.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.js +278 -0
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/lib/id-compressor/IdCompressor.d.ts +389 -0
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -0
- package/lib/id-compressor/IdCompressor.js +1343 -0
- package/lib/id-compressor/IdCompressor.js.map +1 -0
- package/lib/id-compressor/IdRange.d.ts +11 -0
- package/lib/id-compressor/IdRange.d.ts.map +1 -0
- package/lib/id-compressor/IdRange.js +25 -0
- package/lib/id-compressor/IdRange.js.map +1 -0
- package/lib/id-compressor/NumericUuid.d.ts +63 -0
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -0
- package/lib/id-compressor/NumericUuid.js +365 -0
- package/lib/id-compressor/NumericUuid.js.map +1 -0
- package/lib/id-compressor/index.d.ts +12 -0
- package/lib/id-compressor/index.d.ts.map +1 -0
- package/lib/id-compressor/index.js +12 -0
- package/lib/id-compressor/index.js.map +1 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/lib/{test/Snapshot.tests.d.ts → id-compressor/persisted-types/0.0.1.js} +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/lib/id-compressor/persisted-types/index.d.ts +6 -0
- package/lib/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/lib/id-compressor/persisted-types/index.js +6 -0
- package/lib/id-compressor/persisted-types/index.js.map +1 -0
- package/lib/index.d.ts +29 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +23 -6
- package/lib/index.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +385 -0
- package/lib/persisted-types/0.0.2.d.ts.map +1 -0
- package/lib/persisted-types/0.0.2.js +110 -0
- package/lib/persisted-types/0.0.2.js.map +1 -0
- package/lib/persisted-types/0.1.1.d.ts +314 -0
- package/lib/persisted-types/0.1.1.d.ts.map +1 -0
- package/lib/persisted-types/0.1.1.js +150 -0
- package/lib/persisted-types/0.1.1.js.map +1 -0
- package/lib/persisted-types/index.d.ts +7 -0
- package/lib/persisted-types/index.d.ts.map +1 -0
- package/lib/persisted-types/index.js +8 -0
- package/lib/persisted-types/index.js.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts +6 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.js +169 -0
- package/lib/test/AppendOnlySortedMap.tests.js.map +1 -0
- package/lib/test/{SnapshotUtilities.tests.d.ts → ChangeCompression.tests.d.ts} +1 -1
- package/lib/test/ChangeCompression.tests.d.ts.map +1 -0
- package/lib/test/ChangeCompression.tests.js +145 -0
- package/lib/test/ChangeCompression.tests.js.map +1 -0
- package/lib/test/Checkout.tests.d.ts +2 -3
- package/lib/test/Checkout.tests.d.ts.map +1 -1
- package/lib/test/Checkout.tests.js +126 -69
- package/lib/test/Checkout.tests.js.map +1 -1
- package/lib/test/Common.tests.js +60 -2
- package/lib/test/Common.tests.js.map +1 -1
- package/lib/test/{BasicCheckout.tests.d.ts → EagerCheckout.tests.d.ts} +1 -1
- package/lib/test/EagerCheckout.tests.d.ts.map +1 -0
- package/lib/test/EagerCheckout.tests.js +20 -0
- package/lib/test/EagerCheckout.tests.js.map +1 -0
- package/lib/test/Edit.tests.js +22 -14
- package/lib/test/Edit.tests.js.map +1 -1
- package/lib/test/{Anchors.glassBox.tests.d.ts → EditLog.perf.tests.d.ts} +1 -1
- package/lib/test/EditLog.perf.tests.d.ts.map +1 -0
- package/lib/test/EditLog.perf.tests.js +30 -0
- package/lib/test/EditLog.perf.tests.js.map +1 -0
- package/lib/test/EditLog.tests.js +10 -6
- package/lib/test/EditLog.tests.js.map +1 -1
- package/lib/test/EditUtilities.tests.d.ts +6 -0
- package/lib/test/EditUtilities.tests.d.ts.map +1 -0
- package/lib/test/EditUtilities.tests.js +503 -0
- package/lib/test/EditUtilities.tests.js.map +1 -0
- package/lib/test/Forest.perf.tests.d.ts +6 -0
- package/lib/test/Forest.perf.tests.d.ts.map +1 -0
- package/lib/test/Forest.perf.tests.js +133 -0
- package/lib/test/Forest.perf.tests.js.map +1 -0
- package/lib/test/Forest.tests.js +54 -27
- package/lib/test/Forest.tests.js.map +1 -1
- package/lib/test/GenericTransaction.tests.js +12 -3
- package/lib/test/GenericTransaction.tests.js.map +1 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +6 -0
- package/lib/test/HistoryEditFactory.tests.d.ts.map +1 -0
- package/lib/test/HistoryEditFactory.tests.js +90 -0
- package/lib/test/HistoryEditFactory.tests.js.map +1 -0
- package/lib/test/IdCompressor.perf.tests.d.ts +6 -0
- package/lib/test/IdCompressor.perf.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.perf.tests.js +304 -0
- package/lib/test/IdCompressor.perf.tests.js.map +1 -0
- package/lib/test/IdCompressor.tests.d.ts +6 -0
- package/lib/test/IdCompressor.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.tests.js +1075 -0
- package/lib/test/IdCompressor.tests.js.map +1 -0
- package/lib/test/IdConversion.tests.d.ts +6 -0
- package/lib/test/IdConversion.tests.d.ts.map +1 -0
- package/lib/test/IdConversion.tests.js +36 -0
- package/lib/test/IdConversion.tests.js.map +1 -0
- package/lib/test/LazyCheckout.tests.d.ts +6 -0
- package/lib/test/LazyCheckout.tests.d.ts.map +1 -0
- package/lib/test/LazyCheckout.tests.js +22 -0
- package/lib/test/LazyCheckout.tests.js.map +1 -0
- package/lib/test/LogViewer.tests.js +269 -187
- package/lib/test/LogViewer.tests.js.map +1 -1
- package/lib/test/{SharedTreeWithAnchors.tests.d.ts → MergeHealthTelemetryHeartbeat.tests.d.ts} +1 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +1 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +342 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +1 -0
- package/lib/test/NumericUuid.perf.tests.d.ts +6 -0
- package/lib/test/NumericUuid.perf.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.perf.tests.js +68 -0
- package/lib/test/NumericUuid.perf.tests.js.map +1 -0
- package/lib/test/NumericUuid.tests.d.ts +6 -0
- package/lib/test/NumericUuid.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.tests.js +191 -0
- package/lib/test/NumericUuid.tests.js.map +1 -0
- package/lib/test/RevisionView.tests.d.ts +6 -0
- package/lib/test/RevisionView.tests.d.ts.map +1 -0
- package/lib/test/RevisionView.tests.js +133 -0
- package/lib/test/RevisionView.tests.js.map +1 -0
- package/lib/test/SharedTree.perf.tests.d.ts +6 -0
- package/lib/test/SharedTree.perf.tests.d.ts.map +1 -0
- package/lib/test/SharedTree.perf.tests.js +39 -0
- package/lib/test/SharedTree.perf.tests.js.map +1 -0
- package/lib/test/SharedTree.tests.js +15 -3
- package/lib/test/SharedTree.tests.js.map +1 -1
- package/lib/test/StringInterner.tests.d.ts +6 -0
- package/lib/test/StringInterner.tests.d.ts.map +1 -0
- package/lib/test/StringInterner.tests.js +71 -0
- package/lib/test/StringInterner.tests.js.map +1 -0
- package/lib/test/Summary.tests.d.ts +8 -0
- package/lib/test/Summary.tests.d.ts.map +1 -0
- package/lib/test/Summary.tests.js +407 -0
- package/lib/test/Summary.tests.js.map +1 -0
- package/lib/test/Transaction.tests.js +76 -330
- package/lib/test/Transaction.tests.js.map +1 -1
- package/lib/test/TransactionInternal.tests.d.ts +6 -0
- package/lib/test/TransactionInternal.tests.d.ts.map +1 -0
- package/lib/test/TransactionInternal.tests.js +568 -0
- package/lib/test/TransactionInternal.tests.js.map +1 -0
- package/lib/test/TreeCompression.tests.d.ts +6 -0
- package/lib/test/TreeCompression.tests.d.ts.map +1 -0
- package/lib/test/TreeCompression.tests.js +292 -0
- package/lib/test/TreeCompression.tests.js.map +1 -0
- package/lib/test/TreeView.tests.d.ts +6 -0
- package/lib/test/TreeView.tests.d.ts.map +1 -0
- package/lib/test/TreeView.tests.js +147 -0
- package/lib/test/TreeView.tests.js.map +1 -0
- package/lib/test/UndoRedoHandler.tests.js +2 -2
- package/lib/test/UndoRedoHandler.tests.js.map +1 -1
- package/lib/test/Virtualization.tests.js +147 -62
- package/lib/test/Virtualization.tests.js.map +1 -1
- package/lib/test/fuzz/Generators.d.ts +19 -0
- package/lib/test/fuzz/Generators.d.ts.map +1 -0
- package/lib/test/fuzz/Generators.js +420 -0
- package/lib/test/fuzz/Generators.js.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +20 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js +200 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -0
- package/lib/test/fuzz/Types.d.ts +133 -0
- package/lib/test/fuzz/Types.d.ts.map +1 -0
- package/lib/test/{GenericTransactionWithAnchors.tests.d.ts → fuzz/Types.js} +2 -2
- package/lib/test/fuzz/Types.js.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +180 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js +528 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -0
- package/lib/test/utilities/MockTransaction.d.ts +26 -7
- package/lib/test/utilities/MockTransaction.d.ts.map +1 -1
- package/lib/test/utilities/MockTransaction.js +40 -11
- package/lib/test/utilities/MockTransaction.js.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +12 -0
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -0
- package/lib/test/utilities/PendingLocalStateTests.js +105 -0
- package/lib/test/utilities/PendingLocalStateTests.js.map +1 -0
- package/lib/test/utilities/SharedTreeTests.d.ts +3 -4
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +696 -439
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +11 -0
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js +345 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +10 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js +102 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -0
- package/lib/test/utilities/SummarySizeTests.d.ts +11 -0
- package/lib/test/utilities/SummarySizeTests.d.ts.map +1 -0
- package/lib/test/utilities/SummarySizeTests.js +158 -0
- package/lib/test/utilities/SummarySizeTests.js.map +1 -0
- package/lib/test/utilities/TestCommon.d.ts +9 -0
- package/lib/test/utilities/TestCommon.d.ts.map +1 -0
- package/lib/test/utilities/TestCommon.js +13 -0
- package/lib/test/utilities/TestCommon.js.map +1 -0
- package/lib/test/utilities/TestNode.d.ts +140 -0
- package/lib/test/utilities/TestNode.d.ts.map +1 -0
- package/lib/test/utilities/TestNode.js +292 -0
- package/lib/test/utilities/TestNode.js.map +1 -0
- package/lib/test/utilities/TestUtilities.d.ts +84 -70
- package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/TestUtilities.js +218 -143
- package/lib/test/utilities/TestUtilities.js.map +1 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +4 -5
- package/lib/test/utilities/UndoRedoTests.d.ts.map +1 -1
- package/lib/test/utilities/UndoRedoTests.js +138 -149
- package/lib/test/utilities/UndoRedoTests.js.map +1 -1
- package/package.json +19 -14
- package/src/ChangeCompression.ts +159 -0
- package/src/{default-edits/PersistedTypes.ts → ChangeTypes.ts} +62 -120
- package/src/Checkout.ts +81 -52
- package/src/Common.ts +317 -117
- package/src/EagerCheckout.ts +38 -0
- package/src/EditLog.ts +153 -100
- package/src/EditUtilities.ts +559 -0
- package/src/EventTypes.ts +74 -0
- package/src/Forest.ts +81 -73
- package/src/{default-edits/HistoryEditFactory.ts → HistoryEditFactory.ts} +103 -53
- package/src/IdConversion.ts +125 -0
- package/src/Identifiers.ts +101 -1
- package/src/InitialTree.ts +5 -4
- package/src/LazyCheckout.ts +51 -0
- package/src/LogViewer.ts +242 -166
- package/src/MergeHealth.ts +447 -0
- package/src/NodeIdUtilities.ts +141 -0
- package/src/PayloadUtilities.ts +124 -0
- package/src/ReconciliationPath.ts +18 -13
- package/src/RevisionValueCache.ts +14 -5
- package/src/RevisionView.ts +252 -0
- package/src/SerializationUtilities.ts +130 -0
- package/src/SharedTree.ts +1448 -0
- package/src/SharedTreeEncoder.ts +493 -0
- package/src/StringInterner.ts +72 -0
- package/src/Summary.ts +48 -0
- package/src/SummaryBackCompatibility.ts +47 -57
- package/src/SummaryTestUtilities.ts +54 -0
- package/src/Transaction.ts +94 -0
- package/src/TransactionInternal.ts +1088 -0
- package/src/TreeCompressor.ts +222 -0
- package/src/TreeNodeHandle.ts +19 -32
- package/src/TreeView.ts +321 -0
- package/src/TreeViewUtilities.ts +77 -0
- package/src/{default-edits/UndoRedoHandler.ts → UndoRedoHandler.ts} +8 -13
- package/src/id-compressor/AppendOnlySortedMap.ts +325 -0
- package/src/id-compressor/IdCompressor.md +3 -0
- package/src/id-compressor/IdCompressor.ts +1848 -0
- package/src/id-compressor/IdRange.ts +33 -0
- package/src/id-compressor/NumericUuid.ts +414 -0
- package/src/id-compressor/index.ts +13 -0
- package/src/id-compressor/persisted-types/0.0.1.ts +179 -0
- package/src/id-compressor/persisted-types/README.md +3 -0
- package/src/id-compressor/persisted-types/index.ts +6 -0
- package/src/index.ts +119 -59
- package/src/persisted-types/0.0.2.ts +442 -0
- package/src/persisted-types/0.1.1.ts +476 -0
- package/src/persisted-types/README.md +22 -0
- package/src/persisted-types/index.ts +9 -0
- package/.mocharc.js +0 -41
- package/api/tree.api.md +0 -729
- package/dist/BasicCheckout.d.ts +0 -23
- package/dist/BasicCheckout.d.ts.map +0 -1
- package/dist/BasicCheckout.js.map +0 -1
- package/dist/Snapshot.d.ts +0 -198
- package/dist/Snapshot.d.ts.map +0 -1
- package/dist/Snapshot.js +0 -267
- package/dist/Snapshot.js.map +0 -1
- package/dist/SnapshotUtilities.d.ts +0 -29
- package/dist/SnapshotUtilities.d.ts.map +0 -1
- package/dist/SnapshotUtilities.js +0 -73
- package/dist/SnapshotUtilities.js.map +0 -1
- package/dist/anchored-edits/AnchorResolution.d.ts +0 -144
- package/dist/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/dist/anchored-edits/AnchorResolution.js +0 -162
- package/dist/anchored-edits/AnchorResolution.js.map +0 -1
- package/dist/anchored-edits/Factory.d.ts +0 -56
- package/dist/anchored-edits/Factory.d.ts.map +0 -1
- package/dist/anchored-edits/Factory.js +0 -79
- package/dist/anchored-edits/Factory.js.map +0 -1
- package/dist/anchored-edits/PersistedTypes.d.ts +0 -245
- package/dist/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/anchored-edits/PersistedTypes.js +0 -131
- package/dist/anchored-edits/PersistedTypes.js.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.js +0 -115
- package/dist/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/dist/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.js +0 -36
- package/dist/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/dist/anchored-edits/index.d.ts +0 -10
- package/dist/anchored-edits/index.d.ts.map +0 -1
- package/dist/anchored-edits/index.js +0 -34
- package/dist/anchored-edits/index.js.map +0 -1
- package/dist/default-edits/EditUtilities.d.ts +0 -57
- package/dist/default-edits/EditUtilities.d.ts.map +0 -1
- package/dist/default-edits/EditUtilities.js +0 -192
- package/dist/default-edits/EditUtilities.js.map +0 -1
- package/dist/default-edits/Factory.d.ts +0 -56
- package/dist/default-edits/Factory.d.ts.map +0 -1
- package/dist/default-edits/Factory.js +0 -79
- package/dist/default-edits/Factory.js.map +0 -1
- package/dist/default-edits/HistoryEditFactory.d.ts +0 -19
- package/dist/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/dist/default-edits/HistoryEditFactory.js +0 -187
- package/dist/default-edits/HistoryEditFactory.js.map +0 -1
- package/dist/default-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/default-edits/PersistedTypes.js.map +0 -1
- package/dist/default-edits/SharedTree.d.ts +0 -111
- package/dist/default-edits/SharedTree.d.ts.map +0 -1
- package/dist/default-edits/SharedTree.js +0 -124
- package/dist/default-edits/SharedTree.js.map +0 -1
- package/dist/default-edits/Summary.d.ts +0 -15
- package/dist/default-edits/Summary.d.ts.map +0 -1
- package/dist/default-edits/Summary.js +0 -35
- package/dist/default-edits/Summary.js.map +0 -1
- package/dist/default-edits/Transaction.d.ts +0 -41
- package/dist/default-edits/Transaction.d.ts.map +0 -1
- package/dist/default-edits/Transaction.js +0 -225
- package/dist/default-edits/Transaction.js.map +0 -1
- package/dist/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/dist/default-edits/UndoRedoHandler.js.map +0 -1
- package/dist/default-edits/index.d.ts +0 -13
- package/dist/default-edits/index.d.ts.map +0 -1
- package/dist/default-edits/index.js +0 -41
- package/dist/default-edits/index.js.map +0 -1
- package/dist/generic/GenericEditUtilities.d.ts +0 -26
- package/dist/generic/GenericEditUtilities.d.ts.map +0 -1
- package/dist/generic/GenericEditUtilities.js +0 -45
- package/dist/generic/GenericEditUtilities.js.map +0 -1
- package/dist/generic/GenericSharedTree.d.ts +0 -221
- package/dist/generic/GenericSharedTree.d.ts.map +0 -1
- package/dist/generic/GenericSharedTree.js +0 -447
- package/dist/generic/GenericSharedTree.js.map +0 -1
- package/dist/generic/GenericTransaction.d.ts +0 -87
- package/dist/generic/GenericTransaction.d.ts.map +0 -1
- package/dist/generic/GenericTransaction.js +0 -144
- package/dist/generic/GenericTransaction.js.map +0 -1
- package/dist/generic/PersistedTypes.d.ts +0 -194
- package/dist/generic/PersistedTypes.d.ts.map +0 -1
- package/dist/generic/PersistedTypes.js +0 -42
- package/dist/generic/PersistedTypes.js.map +0 -1
- package/dist/generic/Summary.d.ts +0 -63
- package/dist/generic/Summary.d.ts.map +0 -1
- package/dist/generic/Summary.js +0 -64
- package/dist/generic/Summary.js.map +0 -1
- package/dist/generic/index.d.ts +0 -10
- package/dist/generic/index.d.ts.map +0 -1
- package/dist/generic/index.js +0 -26
- package/dist/generic/index.js.map +0 -1
- package/lib/BasicCheckout.d.ts +0 -23
- package/lib/BasicCheckout.d.ts.map +0 -1
- package/lib/BasicCheckout.js.map +0 -1
- package/lib/Snapshot.d.ts +0 -198
- package/lib/Snapshot.d.ts.map +0 -1
- package/lib/Snapshot.js +0 -263
- package/lib/Snapshot.js.map +0 -1
- package/lib/SnapshotUtilities.d.ts +0 -29
- package/lib/SnapshotUtilities.d.ts.map +0 -1
- package/lib/SnapshotUtilities.js +0 -67
- package/lib/SnapshotUtilities.js.map +0 -1
- package/lib/anchored-edits/AnchorResolution.d.ts +0 -144
- package/lib/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/lib/anchored-edits/AnchorResolution.js +0 -152
- package/lib/anchored-edits/AnchorResolution.js.map +0 -1
- package/lib/anchored-edits/Factory.d.ts +0 -56
- package/lib/anchored-edits/Factory.d.ts.map +0 -1
- package/lib/anchored-edits/Factory.js +0 -74
- package/lib/anchored-edits/Factory.js.map +0 -1
- package/lib/anchored-edits/PersistedTypes.d.ts +0 -245
- package/lib/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/anchored-edits/PersistedTypes.js +0 -128
- package/lib/anchored-edits/PersistedTypes.js.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.js +0 -110
- package/lib/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/lib/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.js +0 -32
- package/lib/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/lib/anchored-edits/index.d.ts +0 -10
- package/lib/anchored-edits/index.d.ts.map +0 -1
- package/lib/anchored-edits/index.js +0 -11
- package/lib/anchored-edits/index.js.map +0 -1
- package/lib/default-edits/EditUtilities.d.ts +0 -57
- package/lib/default-edits/EditUtilities.d.ts.map +0 -1
- package/lib/default-edits/EditUtilities.js +0 -181
- package/lib/default-edits/EditUtilities.js.map +0 -1
- package/lib/default-edits/Factory.d.ts +0 -56
- package/lib/default-edits/Factory.d.ts.map +0 -1
- package/lib/default-edits/Factory.js +0 -74
- package/lib/default-edits/Factory.js.map +0 -1
- package/lib/default-edits/HistoryEditFactory.d.ts +0 -19
- package/lib/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/lib/default-edits/HistoryEditFactory.js.map +0 -1
- package/lib/default-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/default-edits/PersistedTypes.js.map +0 -1
- package/lib/default-edits/SharedTree.d.ts +0 -111
- package/lib/default-edits/SharedTree.d.ts.map +0 -1
- package/lib/default-edits/SharedTree.js +0 -100
- package/lib/default-edits/SharedTree.js.map +0 -1
- package/lib/default-edits/Summary.d.ts +0 -15
- package/lib/default-edits/Summary.d.ts.map +0 -1
- package/lib/default-edits/Summary.js +0 -31
- package/lib/default-edits/Summary.js.map +0 -1
- package/lib/default-edits/Transaction.d.ts +0 -41
- package/lib/default-edits/Transaction.d.ts.map +0 -1
- package/lib/default-edits/Transaction.js +0 -221
- package/lib/default-edits/Transaction.js.map +0 -1
- package/lib/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/lib/default-edits/UndoRedoHandler.js.map +0 -1
- package/lib/default-edits/index.d.ts +0 -13
- package/lib/default-edits/index.d.ts.map +0 -1
- package/lib/default-edits/index.js +0 -14
- package/lib/default-edits/index.js.map +0 -1
- package/lib/generic/GenericEditUtilities.d.ts +0 -26
- package/lib/generic/GenericEditUtilities.d.ts.map +0 -1
- package/lib/generic/GenericEditUtilities.js +0 -38
- package/lib/generic/GenericEditUtilities.js.map +0 -1
- package/lib/generic/GenericSharedTree.d.ts +0 -221
- package/lib/generic/GenericSharedTree.d.ts.map +0 -1
- package/lib/generic/GenericSharedTree.js +0 -443
- package/lib/generic/GenericSharedTree.js.map +0 -1
- package/lib/generic/GenericTransaction.d.ts +0 -87
- package/lib/generic/GenericTransaction.d.ts.map +0 -1
- package/lib/generic/GenericTransaction.js +0 -140
- package/lib/generic/GenericTransaction.js.map +0 -1
- package/lib/generic/PersistedTypes.d.ts +0 -194
- package/lib/generic/PersistedTypes.d.ts.map +0 -1
- package/lib/generic/PersistedTypes.js +0 -39
- package/lib/generic/PersistedTypes.js.map +0 -1
- package/lib/generic/Summary.d.ts +0 -63
- package/lib/generic/Summary.d.ts.map +0 -1
- package/lib/generic/Summary.js +0 -58
- package/lib/generic/Summary.js.map +0 -1
- package/lib/generic/index.d.ts +0 -10
- package/lib/generic/index.d.ts.map +0 -1
- package/lib/generic/index.js +0 -11
- package/lib/generic/index.js.map +0 -1
- package/lib/test/Anchors.glassBox.tests.d.ts.map +0 -1
- package/lib/test/Anchors.glassBox.tests.js +0 -410
- package/lib/test/Anchors.glassBox.tests.js.map +0 -1
- package/lib/test/BasicCheckout.tests.d.ts.map +0 -1
- package/lib/test/BasicCheckout.tests.js +0 -8
- package/lib/test/BasicCheckout.tests.js.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.js +0 -25
- package/lib/test/GenericTransactionWithAnchors.tests.js.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.js +0 -420
- package/lib/test/SharedTreeWithAnchors.tests.js.map +0 -1
- package/lib/test/Snapshot.tests.d.ts.map +0 -1
- package/lib/test/Snapshot.tests.js +0 -96
- package/lib/test/Snapshot.tests.js.map +0 -1
- package/lib/test/SnapshotUtilities.tests.d.ts.map +0 -1
- package/lib/test/SnapshotUtilities.tests.js +0 -168
- package/lib/test/SnapshotUtilities.tests.js.map +0 -1
- package/lib/test/undoRedoStackManager.d.ts +0 -26
- package/lib/test/undoRedoStackManager.d.ts.map +0 -1
- package/lib/test/undoRedoStackManager.js +0 -176
- package/lib/test/undoRedoStackManager.js.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts +0 -13
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js +0 -154
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js.map +0 -1
- package/src/BasicCheckout.ts +0 -34
- package/src/Snapshot.ts +0 -363
- package/src/SnapshotUtilities.ts +0 -88
- package/src/anchored-edits/AnchorResolution.ts +0 -442
- package/src/anchored-edits/Factory.ts +0 -94
- package/src/anchored-edits/PersistedTypes.ts +0 -310
- package/src/anchored-edits/SharedTreeWithAnchors.ts +0 -200
- package/src/anchored-edits/TransactionWithAnchors.ts +0 -39
- package/src/anchored-edits/index.ts +0 -21
- package/src/default-edits/EditUtilities.ts +0 -220
- package/src/default-edits/Factory.ts +0 -94
- package/src/default-edits/SharedTree.ts +0 -174
- package/src/default-edits/Summary.ts +0 -44
- package/src/default-edits/Transaction.ts +0 -262
- package/src/default-edits/index.ts +0 -29
- package/src/generic/GenericEditUtilities.ts +0 -46
- package/src/generic/GenericSharedTree.ts +0 -593
- package/src/generic/GenericTransaction.ts +0 -194
- package/src/generic/PersistedTypes.ts +0 -221
- package/src/generic/Summary.ts +0 -113
- package/src/generic/index.ts +0 -41
package/src/EditLog.ts
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import BTree from 'sorted-btree';
|
|
7
|
-
import {
|
|
8
|
-
import { ITelemetryLogger } from '@fluidframework/common-definitions';
|
|
9
|
-
import { assert, assertNotUndefined, compareArrays, fail } from './Common';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { TypedEventEmitter } from '@fluidframework/common-utils';
|
|
8
|
+
import type { IEvent, ITelemetryLogger } from '@fluidframework/common-definitions';
|
|
9
|
+
import { assert, assertNotUndefined, compareArrays, compareFiniteNumbers, fail } from './Common';
|
|
10
|
+
import type { EditId } from './Identifiers';
|
|
11
|
+
import type { StringInterner } from './StringInterner';
|
|
12
|
+
import { Edit, EditLogSummary, editsPerChunk, EditWithoutId, FluidEditHandle } from './persisted-types';
|
|
13
|
+
import { SharedTreeDiagnosticEvent } from './EventTypes';
|
|
14
|
+
import type { ChangeCompressor } from './ChangeCompression';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* An ordered set of Edits associated with a SharedTree.
|
|
@@ -19,7 +21,7 @@ import { compareFiniteNumbers } from './SnapshotUtilities';
|
|
|
19
21
|
* @public
|
|
20
22
|
* @sealed
|
|
21
23
|
*/
|
|
22
|
-
export interface OrderedEditSet<TChange> {
|
|
24
|
+
export interface OrderedEditSet<TChange = unknown> {
|
|
23
25
|
/**
|
|
24
26
|
* The length of this `OrderedEditSet`.
|
|
25
27
|
*/
|
|
@@ -59,40 +61,6 @@ export interface OrderedEditSet<TChange> {
|
|
|
59
61
|
* @returns the Edit associated with the EditId or undefined if there is no such edit in the set.
|
|
60
62
|
*/
|
|
61
63
|
tryGetEdit(editId: EditId): Promise<Edit<TChange> | undefined>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @param useHandles - By default, false. If true, returns handles instead of edit chunks where possible.
|
|
65
|
-
* TODO:#49901: This parameter is used for testing and should be removed once format version 0.1.0 is written.
|
|
66
|
-
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
getEditLogSummary(useHandles?: boolean): EditLogSummary<TChange>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Information used to populate an edit log.
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
export interface EditLogSummary<TChange> {
|
|
77
|
-
/**
|
|
78
|
-
* A of list of serialized chunks and their corresponding keys.
|
|
79
|
-
* Start revision is the index of the first edit in the chunk in relation to the edit log.
|
|
80
|
-
*/
|
|
81
|
-
readonly editChunks: readonly { readonly startRevision: number; readonly chunk: EditChunkOrHandle<TChange> }[];
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* A list of edits IDs for all sequenced edits.
|
|
85
|
-
*/
|
|
86
|
-
readonly editIds: readonly EditId[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* EditHandles are used to load edit chunks stored outside of the EditLog.
|
|
91
|
-
* Can be satisfied by IFluidHandle<ArrayBufferLike>.
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
export interface EditHandle {
|
|
95
|
-
readonly get: () => Promise<ArrayBufferLike>;
|
|
96
64
|
}
|
|
97
65
|
|
|
98
66
|
/**
|
|
@@ -141,26 +109,45 @@ export interface LocalOrderedEditId {
|
|
|
141
109
|
readonly localSequence: number;
|
|
142
110
|
}
|
|
143
111
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Metadata for an edit.
|
|
114
|
+
*/
|
|
115
|
+
export type OrderedEditId = SequencedOrderedEditId | LocalOrderedEditId;
|
|
148
116
|
|
|
149
117
|
/**
|
|
150
|
-
*
|
|
118
|
+
* Compressor+interner pair used for encoding an {@link EditLog} into a summary.
|
|
151
119
|
* @internal
|
|
152
120
|
*/
|
|
153
|
-
export
|
|
121
|
+
export interface EditLogEncoder {
|
|
122
|
+
compressor: ChangeCompressor;
|
|
123
|
+
interner: StringInterner;
|
|
124
|
+
}
|
|
154
125
|
|
|
155
126
|
/**
|
|
156
|
-
*
|
|
127
|
+
* A sequence of edits that may or may not need to be downloaded into the EditLog from an external service
|
|
157
128
|
*/
|
|
158
|
-
export
|
|
129
|
+
export interface EditChunk<TChange> {
|
|
130
|
+
handle?: EditHandle<TChange>;
|
|
131
|
+
edits?: EditWithoutId<TChange>[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* EditHandles are used to load edit chunks stored outside of the EditLog.
|
|
136
|
+
* This is typically implemented by a wrapper around an IFluidHandle<ArrayBufferLike>.
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export interface EditHandle<TChange> {
|
|
140
|
+
readonly get: () => Promise<EditWithoutId<TChange>[]>;
|
|
141
|
+
readonly baseHandle: FluidEditHandle;
|
|
142
|
+
}
|
|
159
143
|
|
|
160
144
|
/**
|
|
161
145
|
* Returns an object that separates an Edit into two fields, id and editWithoutId.
|
|
162
146
|
*/
|
|
163
|
-
export function separateEditAndId<TChange>(edit: Edit<TChange>): {
|
|
147
|
+
export function separateEditAndId<TChange>(edit: Edit<TChange>): {
|
|
148
|
+
id: EditId;
|
|
149
|
+
editWithoutId: EditWithoutId<TChange>;
|
|
150
|
+
} {
|
|
164
151
|
const editWithoutId = { ...edit, id: undefined };
|
|
165
152
|
delete editWithoutId.id;
|
|
166
153
|
return { id: edit.id, editWithoutId };
|
|
@@ -170,6 +157,23 @@ function joinEditAndId<TChange>(id: EditId, edit: EditWithoutId<TChange>): Edit<
|
|
|
170
157
|
return { id, ...edit };
|
|
171
158
|
}
|
|
172
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @param summary - The edit log summary to parse.
|
|
162
|
+
* @returns the number of handles saved to the provided edit log summary.
|
|
163
|
+
*/
|
|
164
|
+
export function getNumberOfHandlesFromEditLogSummary(summary: EditLogSummary<unknown, unknown>): number {
|
|
165
|
+
const { editChunks } = summary;
|
|
166
|
+
|
|
167
|
+
let numberOfHandles = 0;
|
|
168
|
+
editChunks.forEach(({ chunk }) => {
|
|
169
|
+
if (!Array.isArray(chunk)) {
|
|
170
|
+
numberOfHandles++;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
return numberOfHandles;
|
|
175
|
+
}
|
|
176
|
+
|
|
173
177
|
/**
|
|
174
178
|
* The number of blobs to be loaded in memory at any time.
|
|
175
179
|
* TODO:#49901: Change cache size once the virtualized history summary format is being written.
|
|
@@ -184,6 +188,14 @@ const loadedChunkCacheSize = Number.POSITIVE_INFINITY;
|
|
|
184
188
|
*/
|
|
185
189
|
export type EditAddedHandler<TChange> = (edit: Edit<TChange>, isLocal: boolean, wasLocal: boolean) => void;
|
|
186
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Events which may be emitted by `EditLog`.
|
|
193
|
+
* @public
|
|
194
|
+
*/
|
|
195
|
+
export interface IEditLogEvents extends IEvent {
|
|
196
|
+
(event: 'unexpectedHistoryChunk', listener: () => void);
|
|
197
|
+
}
|
|
198
|
+
|
|
187
199
|
/**
|
|
188
200
|
* The edit history log for SharedTree.
|
|
189
201
|
* Contains only completed edits (no in-progress edits).
|
|
@@ -191,20 +203,19 @@ export type EditAddedHandler<TChange> = (edit: Edit<TChange>, isLocal: boolean,
|
|
|
191
203
|
* May not contain more than one edit with the same ID.
|
|
192
204
|
* @sealed
|
|
193
205
|
*/
|
|
194
|
-
export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
206
|
+
export class EditLog<TChange = unknown> extends TypedEventEmitter<IEditLogEvents> implements OrderedEditSet<TChange> {
|
|
195
207
|
private localEditSequence = 0;
|
|
196
208
|
private _minSequenceNumber = 0;
|
|
197
209
|
|
|
198
210
|
private readonly sequencedEditIds: EditId[];
|
|
199
211
|
private readonly editChunks: BTree<number, EditChunk<TChange>>;
|
|
200
212
|
private readonly localEdits: Edit<TChange>[] = [];
|
|
201
|
-
|
|
202
213
|
private readonly loadedChunkCache: number[] = [];
|
|
203
214
|
private readonly indexOfFirstEditInSession: number;
|
|
204
215
|
private readonly maximumEvictableIndex: number;
|
|
205
216
|
|
|
206
217
|
private readonly allEditIds: Map<EditId, OrderedEditId> = new Map();
|
|
207
|
-
private readonly
|
|
218
|
+
private readonly _editAddedHandlers: Set<EditAddedHandler<TChange>> = new Set();
|
|
208
219
|
|
|
209
220
|
private readonly logger?: ITelemetryLogger;
|
|
210
221
|
|
|
@@ -233,34 +244,35 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
233
244
|
* @param logger - An optional logger to record telemetry/errors
|
|
234
245
|
*/
|
|
235
246
|
public constructor(
|
|
236
|
-
summary: EditLogSummary<TChange
|
|
247
|
+
summary: EditLogSummary<TChange, EditHandle<TChange>> = { editIds: [], editChunks: [] },
|
|
237
248
|
logger?: ITelemetryLogger,
|
|
238
|
-
|
|
249
|
+
editAddedHandlers: readonly EditAddedHandler<TChange>[] = [],
|
|
250
|
+
indexOfFirstEditInSession = summary.editIds.length
|
|
239
251
|
) {
|
|
252
|
+
super();
|
|
240
253
|
const { editChunks, editIds } = summary;
|
|
241
254
|
this.logger = logger;
|
|
242
255
|
this.editsPerChunk = editsPerChunk;
|
|
243
256
|
|
|
257
|
+
for (const handler of editAddedHandlers) {
|
|
258
|
+
this.registerEditAddedHandler(handler);
|
|
259
|
+
}
|
|
260
|
+
|
|
244
261
|
this.editChunks = new BTree<number, EditChunk<TChange>>(undefined, compareFiniteNumbers);
|
|
245
262
|
|
|
246
263
|
editChunks.forEach((editChunkOrHandle) => {
|
|
247
264
|
const { startRevision, chunk } = editChunkOrHandle;
|
|
248
265
|
|
|
249
|
-
if (
|
|
250
|
-
this.editChunks.set(startRevision, {
|
|
266
|
+
if (isEditHandle(chunk)) {
|
|
267
|
+
this.editChunks.set(startRevision, { handle: chunk });
|
|
251
268
|
} else {
|
|
252
|
-
this.editChunks.set(startRevision, {
|
|
253
|
-
// This typecast should not be required,
|
|
254
|
-
// however typescript fails to infer types correctly in the case of readonly arrays guarded by Array.isArray
|
|
255
|
-
// See https://github.com/microsoft/TypeScript/issues/17002
|
|
256
|
-
handle: chunk as EditHandle,
|
|
257
|
-
});
|
|
269
|
+
this.editChunks.set(startRevision, { edits: chunk as EditWithoutId<TChange>[] });
|
|
258
270
|
}
|
|
259
271
|
});
|
|
260
272
|
|
|
261
273
|
this.sequencedEditIds = editIds.slice();
|
|
262
274
|
|
|
263
|
-
this.indexOfFirstEditInSession =
|
|
275
|
+
this.indexOfFirstEditInSession = indexOfFirstEditInSession;
|
|
264
276
|
this.maximumEvictableIndex = this.indexOfFirstEditInSession - 1;
|
|
265
277
|
|
|
266
278
|
this.sequencedEditIds.forEach((id, index) => {
|
|
@@ -272,13 +284,22 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
272
284
|
|
|
273
285
|
/**
|
|
274
286
|
* Registers a handler for when an edit is added to this `EditLog`.
|
|
287
|
+
* @returns A callback which can be invoked to unregister this handler.
|
|
288
|
+
*/
|
|
289
|
+
public registerEditAddedHandler(handler: EditAddedHandler<TChange>): () => void {
|
|
290
|
+
this._editAddedHandlers.add(handler);
|
|
291
|
+
return () => this._editAddedHandlers.delete(handler);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @returns the `EditAddedHandler`s registered on this `EditLog`.
|
|
275
296
|
*/
|
|
276
|
-
public
|
|
277
|
-
this.
|
|
297
|
+
public get editAddedHandlers(): readonly EditAddedHandler<TChange>[] {
|
|
298
|
+
return Array.from(this._editAddedHandlers);
|
|
278
299
|
}
|
|
279
300
|
|
|
280
301
|
/**
|
|
281
|
-
* {@inheritDoc
|
|
302
|
+
* {@inheritDoc OrderedEditSet.length}
|
|
282
303
|
*/
|
|
283
304
|
public get length(): number {
|
|
284
305
|
return this.numberOfSequencedEdits + this.numberOfLocalEdits;
|
|
@@ -299,7 +320,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
299
320
|
}
|
|
300
321
|
|
|
301
322
|
/**
|
|
302
|
-
* {@inheritDoc
|
|
323
|
+
* {@inheritDoc OrderedEditSet.editIds}
|
|
303
324
|
*/
|
|
304
325
|
public get editIds(): EditId[] {
|
|
305
326
|
return this.sequencedEditIds.concat(this.localEdits.map(({ id }) => id));
|
|
@@ -314,14 +335,14 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
314
335
|
}
|
|
315
336
|
|
|
316
337
|
/**
|
|
317
|
-
* @returns true iff the revision is a
|
|
338
|
+
* @returns true iff the revision is a sequenced revision (not local).
|
|
318
339
|
*/
|
|
319
340
|
public isSequencedRevision(revision: number): boolean {
|
|
320
341
|
return revision <= this.sequencedEditIds.length;
|
|
321
342
|
}
|
|
322
343
|
|
|
323
344
|
/**
|
|
324
|
-
* {@inheritDoc
|
|
345
|
+
* {@inheritDoc OrderedEditSet.tryGetIndexOfId}
|
|
325
346
|
*/
|
|
326
347
|
public tryGetIndexOfId(editId: EditId): number | undefined {
|
|
327
348
|
const orderedEdit = this.allEditIds.get(editId);
|
|
@@ -345,14 +366,14 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
345
366
|
}
|
|
346
367
|
|
|
347
368
|
/**
|
|
348
|
-
* {@inheritDoc
|
|
369
|
+
* {@inheritDoc OrderedEditSet.getIndexOfId}
|
|
349
370
|
*/
|
|
350
371
|
public getIndexOfId(editId: EditId): number {
|
|
351
372
|
return this.tryGetIndexOfId(editId) ?? fail('edit not found');
|
|
352
373
|
}
|
|
353
374
|
|
|
354
375
|
/**
|
|
355
|
-
* {@inheritDoc
|
|
376
|
+
* {@inheritDoc OrderedEditSet.getIdAtIndex}
|
|
356
377
|
*/
|
|
357
378
|
public getIdAtIndex(index: number): EditId {
|
|
358
379
|
if (this.numberOfSequencedEdits <= index) {
|
|
@@ -363,17 +384,16 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
363
384
|
}
|
|
364
385
|
|
|
365
386
|
/**
|
|
366
|
-
* {@inheritDoc
|
|
387
|
+
* {@inheritDoc OrderedEditSet.getEditAtIndex}
|
|
367
388
|
*/
|
|
368
389
|
public async getEditAtIndex(index: number): Promise<Edit<TChange>> {
|
|
369
390
|
if (index < this.numberOfSequencedEdits) {
|
|
370
|
-
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.
|
|
391
|
+
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
371
392
|
const { handle, edits } = editChunk;
|
|
372
393
|
|
|
373
394
|
if (edits === undefined) {
|
|
374
395
|
assert(handle !== undefined, 'An edit chunk should include at least a handle or edits.');
|
|
375
|
-
const edits =
|
|
376
|
-
.edits as EditWithoutId<TChange>[];
|
|
396
|
+
const edits = await handle.get();
|
|
377
397
|
|
|
378
398
|
// Make sure the loaded edit chunk is the correct size. If a higher starting revison is set, the length is the difference of both.
|
|
379
399
|
// Otherwise, it means that there are no sequenced edits in memory so the length is the difference of the number of
|
|
@@ -396,7 +416,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
396
416
|
}
|
|
397
417
|
|
|
398
418
|
/**
|
|
399
|
-
* {@inheritDoc
|
|
419
|
+
* {@inheritDoc OrderedEditSet.getEditInSessionAtIndex}
|
|
400
420
|
*/
|
|
401
421
|
public getEditInSessionAtIndex(index: number): Edit<TChange> {
|
|
402
422
|
assert(
|
|
@@ -405,7 +425,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
405
425
|
);
|
|
406
426
|
|
|
407
427
|
if (index < this.numberOfSequencedEdits) {
|
|
408
|
-
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.
|
|
428
|
+
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
409
429
|
const { edits } = editChunk;
|
|
410
430
|
|
|
411
431
|
return joinEditAndId(
|
|
@@ -419,7 +439,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
419
439
|
}
|
|
420
440
|
|
|
421
441
|
/**
|
|
422
|
-
* {@inheritDoc
|
|
442
|
+
* {@inheritDoc OrderedEditSet.tryGetEdit}
|
|
423
443
|
*/
|
|
424
444
|
public async tryGetEdit(editId: EditId): Promise<Edit<TChange> | undefined> {
|
|
425
445
|
try {
|
|
@@ -455,7 +475,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
455
475
|
/**
|
|
456
476
|
* Assigns provided handles to edit chunks based on chunk index specified.
|
|
457
477
|
*/
|
|
458
|
-
public processEditChunkHandle(chunkHandle: EditHandle
|
|
478
|
+
public processEditChunkHandle(chunkHandle: EditHandle<TChange>, startRevision: number): void {
|
|
459
479
|
const chunk = this.editChunks.get(startRevision);
|
|
460
480
|
if (chunk !== undefined) {
|
|
461
481
|
assertNotUndefined(
|
|
@@ -466,6 +486,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
466
486
|
this.addKeyToCache(startRevision);
|
|
467
487
|
} else {
|
|
468
488
|
this.logger?.sendErrorEvent({ eventName: 'UnexpectedHistoryChunk' });
|
|
489
|
+
this.emit(SharedTreeDiagnosticEvent.UnexpectedHistoryChunk);
|
|
469
490
|
}
|
|
470
491
|
}
|
|
471
492
|
|
|
@@ -485,6 +506,17 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
485
506
|
this.addSequencedEditInternal(edit, message, message.minimumSequenceNumber);
|
|
486
507
|
}
|
|
487
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Returns all local edits from this EditLog
|
|
511
|
+
* This is useful for op format upgrades, which might warrant re-submission of these ops using the new format.
|
|
512
|
+
* See the breaking change documentation for more information.
|
|
513
|
+
*/
|
|
514
|
+
public *getLocalEdits(): Iterable<Edit<TChange>> {
|
|
515
|
+
for (const edit of this.localEdits) {
|
|
516
|
+
yield edit;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
488
520
|
/**
|
|
489
521
|
* Adds a sequenced (non-local) edit to the edit log.
|
|
490
522
|
* If the id of the supplied edit matches a local edit already present in the log, the local edit will be replaced.
|
|
@@ -583,7 +615,7 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
583
615
|
}
|
|
584
616
|
|
|
585
617
|
private emitAdd(editAdded: Edit<TChange>, isLocal: boolean, wasLocal: boolean): void {
|
|
586
|
-
for (const handler of this.
|
|
618
|
+
for (const handler of this._editAddedHandlers) {
|
|
587
619
|
handler(editAdded, isLocal, wasLocal);
|
|
588
620
|
}
|
|
589
621
|
}
|
|
@@ -591,36 +623,51 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
591
623
|
/**
|
|
592
624
|
* @returns true iff this `EditLog` and `other` are equivalent, regardless of locality.
|
|
593
625
|
*/
|
|
594
|
-
public equals<
|
|
626
|
+
public equals<TOtherChangeTypesInternal>(other: EditLog<TOtherChangeTypesInternal>): boolean {
|
|
595
627
|
// TODO #45414: We should also be deep comparing the list of changes in the edit. This is not straightforward.
|
|
596
628
|
// We can use our edit validation code when we write it since it will need to do deep walks of the changes.
|
|
597
629
|
return compareArrays(this.editIds, other.editIds);
|
|
598
630
|
}
|
|
599
631
|
|
|
600
632
|
/**
|
|
601
|
-
*
|
|
633
|
+
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
634
|
+
* @internal
|
|
602
635
|
*/
|
|
603
|
-
public getEditLogSummary(
|
|
604
|
-
|
|
636
|
+
public getEditLogSummary(): EditLogSummary<TChange, FluidEditHandle>;
|
|
637
|
+
/**
|
|
638
|
+
* @param compressEdit - a function which compresses edits
|
|
639
|
+
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
640
|
+
* @internal
|
|
641
|
+
*/
|
|
642
|
+
public getEditLogSummary<TCompressedChange>(
|
|
643
|
+
compressEdit: (edit: Pick<Edit<TChange>, 'changes'>) => Pick<Edit<TCompressedChange>, 'changes'>
|
|
644
|
+
): EditLogSummary<TCompressedChange, FluidEditHandle>;
|
|
645
|
+
public getEditLogSummary<TCompressedChange>(
|
|
646
|
+
compressEdit?: (edit: Pick<Edit<TChange>, 'changes'>) => Pick<Edit<TCompressedChange>, 'changes'>
|
|
647
|
+
): EditLogSummary<TChange, FluidEditHandle> | EditLogSummary<TCompressedChange, FluidEditHandle> {
|
|
648
|
+
if (compressEdit !== undefined) {
|
|
649
|
+
return {
|
|
650
|
+
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => ({
|
|
651
|
+
startRevision,
|
|
652
|
+
chunk:
|
|
653
|
+
handle?.baseHandle ??
|
|
654
|
+
edits?.map((edit) => compressEdit(edit)) ??
|
|
655
|
+
fail('An edit chunk must have either a handle or a list of edits.'),
|
|
656
|
+
})),
|
|
657
|
+
editIds: this.sequencedEditIds,
|
|
658
|
+
};
|
|
659
|
+
} else {
|
|
605
660
|
return {
|
|
606
|
-
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
661
|
+
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => ({
|
|
662
|
+
startRevision,
|
|
663
|
+
chunk:
|
|
664
|
+
handle?.baseHandle ??
|
|
665
|
+
edits ??
|
|
666
|
+
fail('An edit chunk must have either a handle or a list of edits.'),
|
|
667
|
+
})),
|
|
612
668
|
editIds: this.sequencedEditIds,
|
|
613
669
|
};
|
|
614
670
|
}
|
|
615
|
-
|
|
616
|
-
// TODO:#49901: When writing format version 0.1.0, change to prefer sending the handle when not undefined.
|
|
617
|
-
// For now, no chunks are evicted so edits are sent as is to be aggregated during summary write.
|
|
618
|
-
return {
|
|
619
|
-
editChunks: this.editChunks.toArray().map(([startRevision, { edits }]) => {
|
|
620
|
-
return { startRevision, chunk: assertNotUndefined(edits) };
|
|
621
|
-
}),
|
|
622
|
-
editIds: this.sequencedEditIds,
|
|
623
|
-
};
|
|
624
671
|
}
|
|
625
672
|
|
|
626
673
|
private addKeyToCache(newKey: number): void {
|
|
@@ -645,3 +692,9 @@ export class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
645
692
|
}
|
|
646
693
|
}
|
|
647
694
|
}
|
|
695
|
+
|
|
696
|
+
function isEditHandle<TChange>(
|
|
697
|
+
chunk: EditHandle<TChange> | readonly EditWithoutId<unknown>[]
|
|
698
|
+
): chunk is EditHandle<TChange> {
|
|
699
|
+
return !Array.isArray(chunk);
|
|
700
|
+
}
|