@fluid-experimental/tree 0.58.2002 → 0.59.1000
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 +159 -46
- 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 -105
- 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 +61 -32
- 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 +129 -85
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +111 -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 +105 -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 +439 -0
- package/dist/SharedTree.d.ts.map +1 -0
- package/dist/SharedTree.js +1109 -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 +52 -0
- package/dist/Transaction.d.ts.map +1 -0
- package/dist/Transaction.js +72 -0
- package/dist/Transaction.js.map +1 -0
- package/dist/TransactionInternal.d.ts +540 -0
- package/dist/TransactionInternal.d.ts.map +1 -0
- package/dist/TransactionInternal.js +626 -0
- package/dist/TransactionInternal.js.map +1 -0
- package/dist/TreeCompressor.d.ts +36 -0
- package/dist/TreeCompressor.d.ts.map +1 -0
- package/dist/TreeCompressor.js +137 -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 +218 -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/docs/Write-Format.md +19 -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 -105
- 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 +53 -24
- 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 +129 -85
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +103 -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 +105 -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 +439 -0
- package/lib/SharedTree.d.ts.map +1 -0
- package/lib/SharedTree.js +1104 -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 +52 -0
- package/lib/Transaction.d.ts.map +1 -0
- package/lib/Transaction.js +68 -0
- package/lib/Transaction.js.map +1 -0
- package/lib/TransactionInternal.d.ts +540 -0
- package/lib/TransactionInternal.d.ts.map +1 -0
- package/lib/TransactionInternal.js +622 -0
- package/lib/TransactionInternal.js.map +1 -0
- package/lib/TreeCompressor.d.ts +36 -0
- package/lib/TreeCompressor.d.ts.map +1 -0
- package/lib/TreeCompressor.js +133 -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 +214 -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 +276 -191
- 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 +176 -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 +146 -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 +217 -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 +370 -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 +22 -17
- package/src/ChangeCompression.ts +159 -0
- package/src/{default-edits/PersistedTypes.ts → ChangeTypes.ts} +62 -125
- package/src/Checkout.ts +82 -53
- 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 +156 -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 +1501 -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 +89 -0
- package/src/TransactionInternal.ts +1087 -0
- package/src/TreeCompressor.ts +213 -0
- package/src/TreeNodeHandle.ts +19 -32
- package/src/TreeView.ts +322 -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 +118 -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/docs/Future.md +0 -155
- 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/lib/EditLog.d.ts
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { EditId } from './Identifiers';
|
|
5
|
+
import { TypedEventEmitter } from '@fluidframework/common-utils';
|
|
6
|
+
import type { IEvent, ITelemetryLogger } from '@fluidframework/common-definitions';
|
|
7
|
+
import type { EditId } from './Identifiers';
|
|
8
|
+
import type { StringInterner } from './StringInterner';
|
|
9
|
+
import { Edit, EditLogSummary, EditWithoutId, FluidEditHandle } from './persisted-types';
|
|
10
|
+
import type { ChangeCompressor } from './ChangeCompression';
|
|
8
11
|
/**
|
|
9
12
|
* An ordered set of Edits associated with a SharedTree.
|
|
10
13
|
* Supports fast lookup of edits by ID and enforces idempotence.
|
|
@@ -13,7 +16,7 @@ import { EditId } from './Identifiers';
|
|
|
13
16
|
* @public
|
|
14
17
|
* @sealed
|
|
15
18
|
*/
|
|
16
|
-
export interface OrderedEditSet<TChange> {
|
|
19
|
+
export interface OrderedEditSet<TChange = unknown> {
|
|
17
20
|
/**
|
|
18
21
|
* The length of this `OrderedEditSet`.
|
|
19
22
|
*/
|
|
@@ -46,39 +49,6 @@ export interface OrderedEditSet<TChange> {
|
|
|
46
49
|
* @returns the Edit associated with the EditId or undefined if there is no such edit in the set.
|
|
47
50
|
*/
|
|
48
51
|
tryGetEdit(editId: EditId): Promise<Edit<TChange> | undefined>;
|
|
49
|
-
/**
|
|
50
|
-
* @param useHandles - By default, false. If true, returns handles instead of edit chunks where possible.
|
|
51
|
-
* TODO:#49901: This parameter is used for testing and should be removed once format version 0.1.0 is written.
|
|
52
|
-
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
getEditLogSummary(useHandles?: boolean): EditLogSummary<TChange>;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Information used to populate an edit log.
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
export interface EditLogSummary<TChange> {
|
|
62
|
-
/**
|
|
63
|
-
* A of list of serialized chunks and their corresponding keys.
|
|
64
|
-
* Start revision is the index of the first edit in the chunk in relation to the edit log.
|
|
65
|
-
*/
|
|
66
|
-
readonly editChunks: readonly {
|
|
67
|
-
readonly startRevision: number;
|
|
68
|
-
readonly chunk: EditChunkOrHandle<TChange>;
|
|
69
|
-
}[];
|
|
70
|
-
/**
|
|
71
|
-
* A list of edits IDs for all sequenced edits.
|
|
72
|
-
*/
|
|
73
|
-
readonly editIds: readonly EditId[];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* EditHandles are used to load edit chunks stored outside of the EditLog.
|
|
77
|
-
* Can be satisfied by IFluidHandle<ArrayBufferLike>.
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
export interface EditHandle {
|
|
81
|
-
readonly get: () => Promise<ArrayBufferLike>;
|
|
82
52
|
}
|
|
83
53
|
/**
|
|
84
54
|
* Server-provided metadata for edits that have been sequenced.
|
|
@@ -122,19 +92,34 @@ export interface LocalOrderedEditId {
|
|
|
122
92
|
readonly isLocal: true;
|
|
123
93
|
readonly localSequence: number;
|
|
124
94
|
}
|
|
125
|
-
interface EditChunk<TChange> {
|
|
126
|
-
handle?: EditHandle;
|
|
127
|
-
edits?: EditWithoutId<TChange>[];
|
|
128
|
-
}
|
|
129
95
|
/**
|
|
130
|
-
*
|
|
96
|
+
* Metadata for an edit.
|
|
97
|
+
*/
|
|
98
|
+
export declare type OrderedEditId = SequencedOrderedEditId | LocalOrderedEditId;
|
|
99
|
+
/**
|
|
100
|
+
* Compressor+interner pair used for encoding an {@link EditLog} into a summary.
|
|
131
101
|
* @internal
|
|
132
102
|
*/
|
|
133
|
-
export
|
|
103
|
+
export interface EditLogEncoder {
|
|
104
|
+
compressor: ChangeCompressor;
|
|
105
|
+
interner: StringInterner;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A sequence of edits that may or may not need to be downloaded into the EditLog from an external service
|
|
109
|
+
*/
|
|
110
|
+
export interface EditChunk<TChange> {
|
|
111
|
+
handle?: EditHandle<TChange>;
|
|
112
|
+
edits?: EditWithoutId<TChange>[];
|
|
113
|
+
}
|
|
134
114
|
/**
|
|
135
|
-
*
|
|
115
|
+
* EditHandles are used to load edit chunks stored outside of the EditLog.
|
|
116
|
+
* This is typically implemented by a wrapper around an IFluidHandle<ArrayBufferLike>.
|
|
117
|
+
* @public
|
|
136
118
|
*/
|
|
137
|
-
export
|
|
119
|
+
export interface EditHandle<TChange> {
|
|
120
|
+
readonly get: () => Promise<EditWithoutId<TChange>[]>;
|
|
121
|
+
readonly baseHandle: FluidEditHandle;
|
|
122
|
+
}
|
|
138
123
|
/**
|
|
139
124
|
* Returns an object that separates an Edit into two fields, id and editWithoutId.
|
|
140
125
|
*/
|
|
@@ -142,12 +127,24 @@ export declare function separateEditAndId<TChange>(edit: Edit<TChange>): {
|
|
|
142
127
|
id: EditId;
|
|
143
128
|
editWithoutId: EditWithoutId<TChange>;
|
|
144
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* @param summary - The edit log summary to parse.
|
|
132
|
+
* @returns the number of handles saved to the provided edit log summary.
|
|
133
|
+
*/
|
|
134
|
+
export declare function getNumberOfHandlesFromEditLogSummary(summary: EditLogSummary<unknown, unknown>): number;
|
|
145
135
|
/**
|
|
146
136
|
* Event fired when an edit is added to an `EditLog`.
|
|
147
137
|
* @param edit - The edit that was added to the log
|
|
148
138
|
* @param isLocal - true iff this edit was generated locally
|
|
149
139
|
*/
|
|
150
140
|
export declare type EditAddedHandler<TChange> = (edit: Edit<TChange>, isLocal: boolean, wasLocal: boolean) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Events which may be emitted by `EditLog`.
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
export interface IEditLogEvents extends IEvent {
|
|
146
|
+
(event: 'unexpectedHistoryChunk', listener: () => void): any;
|
|
147
|
+
}
|
|
151
148
|
/**
|
|
152
149
|
* The edit history log for SharedTree.
|
|
153
150
|
* Contains only completed edits (no in-progress edits).
|
|
@@ -155,7 +152,7 @@ export declare type EditAddedHandler<TChange> = (edit: Edit<TChange>, isLocal: b
|
|
|
155
152
|
* May not contain more than one edit with the same ID.
|
|
156
153
|
* @sealed
|
|
157
154
|
*/
|
|
158
|
-
export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
155
|
+
export declare class EditLog<TChange = unknown> extends TypedEventEmitter<IEditLogEvents> implements OrderedEditSet<TChange> {
|
|
159
156
|
private localEditSequence;
|
|
160
157
|
private _minSequenceNumber;
|
|
161
158
|
private readonly sequencedEditIds;
|
|
@@ -165,7 +162,7 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
165
162
|
private readonly indexOfFirstEditInSession;
|
|
166
163
|
private readonly maximumEvictableIndex;
|
|
167
164
|
private readonly allEditIds;
|
|
168
|
-
private readonly
|
|
165
|
+
private readonly _editAddedHandlers;
|
|
169
166
|
private readonly logger?;
|
|
170
167
|
/**
|
|
171
168
|
* The number of edits associated with each blob.
|
|
@@ -184,13 +181,18 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
184
181
|
* @param summary - An edit log summary used to populate the edit log.
|
|
185
182
|
* @param logger - An optional logger to record telemetry/errors
|
|
186
183
|
*/
|
|
187
|
-
constructor(summary?: EditLogSummary<TChange
|
|
184
|
+
constructor(summary?: EditLogSummary<TChange, EditHandle<TChange>>, logger?: ITelemetryLogger, editAddedHandlers?: readonly EditAddedHandler<TChange>[], indexOfFirstEditInSession?: number);
|
|
188
185
|
/**
|
|
189
186
|
* Registers a handler for when an edit is added to this `EditLog`.
|
|
187
|
+
* @returns A callback which can be invoked to unregister this handler.
|
|
188
|
+
*/
|
|
189
|
+
registerEditAddedHandler(handler: EditAddedHandler<TChange>): () => void;
|
|
190
|
+
/**
|
|
191
|
+
* @returns the `EditAddedHandler`s registered on this `EditLog`.
|
|
190
192
|
*/
|
|
191
|
-
|
|
193
|
+
get editAddedHandlers(): readonly EditAddedHandler<TChange>[];
|
|
192
194
|
/**
|
|
193
|
-
* {@inheritDoc
|
|
195
|
+
* {@inheritDoc OrderedEditSet.length}
|
|
194
196
|
*/
|
|
195
197
|
get length(): number;
|
|
196
198
|
/**
|
|
@@ -202,7 +204,7 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
202
204
|
*/
|
|
203
205
|
get numberOfLocalEdits(): number;
|
|
204
206
|
/**
|
|
205
|
-
* {@inheritDoc
|
|
207
|
+
* {@inheritDoc OrderedEditSet.editIds}
|
|
206
208
|
*/
|
|
207
209
|
get editIds(): EditId[];
|
|
208
210
|
/**
|
|
@@ -210,11 +212,11 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
210
212
|
*/
|
|
211
213
|
isLocalEdit(editId: EditId): boolean;
|
|
212
214
|
/**
|
|
213
|
-
* @returns true iff the revision is a
|
|
215
|
+
* @returns true iff the revision is a sequenced revision (not local).
|
|
214
216
|
*/
|
|
215
217
|
isSequencedRevision(revision: number): boolean;
|
|
216
218
|
/**
|
|
217
|
-
* {@inheritDoc
|
|
219
|
+
* {@inheritDoc OrderedEditSet.tryGetIndexOfId}
|
|
218
220
|
*/
|
|
219
221
|
tryGetIndexOfId(editId: EditId): number | undefined;
|
|
220
222
|
/**
|
|
@@ -222,23 +224,23 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
222
224
|
*/
|
|
223
225
|
getOrderedEditId(editId: EditId): OrderedEditId;
|
|
224
226
|
/**
|
|
225
|
-
* {@inheritDoc
|
|
227
|
+
* {@inheritDoc OrderedEditSet.getIndexOfId}
|
|
226
228
|
*/
|
|
227
229
|
getIndexOfId(editId: EditId): number;
|
|
228
230
|
/**
|
|
229
|
-
* {@inheritDoc
|
|
231
|
+
* {@inheritDoc OrderedEditSet.getIdAtIndex}
|
|
230
232
|
*/
|
|
231
233
|
getIdAtIndex(index: number): EditId;
|
|
232
234
|
/**
|
|
233
|
-
* {@inheritDoc
|
|
235
|
+
* {@inheritDoc OrderedEditSet.getEditAtIndex}
|
|
234
236
|
*/
|
|
235
237
|
getEditAtIndex(index: number): Promise<Edit<TChange>>;
|
|
236
238
|
/**
|
|
237
|
-
* {@inheritDoc
|
|
239
|
+
* {@inheritDoc OrderedEditSet.getEditInSessionAtIndex}
|
|
238
240
|
*/
|
|
239
241
|
getEditInSessionAtIndex(index: number): Edit<TChange>;
|
|
240
242
|
/**
|
|
241
|
-
* {@inheritDoc
|
|
243
|
+
* {@inheritDoc OrderedEditSet.tryGetEdit}
|
|
242
244
|
*/
|
|
243
245
|
tryGetEdit(editId: EditId): Promise<Edit<TChange> | undefined>;
|
|
244
246
|
/**
|
|
@@ -248,7 +250,7 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
248
250
|
/**
|
|
249
251
|
* Assigns provided handles to edit chunks based on chunk index specified.
|
|
250
252
|
*/
|
|
251
|
-
processEditChunkHandle(chunkHandle: EditHandle
|
|
253
|
+
processEditChunkHandle(chunkHandle: EditHandle<TChange>, startRevision: number): void;
|
|
252
254
|
/**
|
|
253
255
|
* Sequences all local edits.
|
|
254
256
|
*/
|
|
@@ -259,6 +261,12 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
259
261
|
*
|
|
260
262
|
*/
|
|
261
263
|
addSequencedEdit(edit: Edit<TChange>, message: MessageSequencingInfo): void;
|
|
264
|
+
/**
|
|
265
|
+
* Returns all local edits from this EditLog
|
|
266
|
+
* This is useful for op format upgrades, which might warrant re-submission of these ops using the new format.
|
|
267
|
+
* See the breaking change documentation for more information.
|
|
268
|
+
*/
|
|
269
|
+
getLocalEdits(): Iterable<Edit<TChange>>;
|
|
262
270
|
/**
|
|
263
271
|
* Adds a sequenced (non-local) edit to the edit log.
|
|
264
272
|
* If the id of the supplied edit matches a local edit already present in the log, the local edit will be replaced.
|
|
@@ -280,12 +288,18 @@ export declare class EditLog<TChange> implements OrderedEditSet<TChange> {
|
|
|
280
288
|
/**
|
|
281
289
|
* @returns true iff this `EditLog` and `other` are equivalent, regardless of locality.
|
|
282
290
|
*/
|
|
283
|
-
equals<
|
|
291
|
+
equals<TOtherChangeTypesInternal>(other: EditLog<TOtherChangeTypesInternal>): boolean;
|
|
284
292
|
/**
|
|
285
|
-
*
|
|
293
|
+
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
294
|
+
* @internal
|
|
295
|
+
*/
|
|
296
|
+
getEditLogSummary(): EditLogSummary<TChange, FluidEditHandle>;
|
|
297
|
+
/**
|
|
298
|
+
* @param compressEdit - a function which compresses edits
|
|
299
|
+
* @returns the summary of this `OrderedEditSet` that can be used to reconstruct the edit set.
|
|
300
|
+
* @internal
|
|
286
301
|
*/
|
|
287
|
-
getEditLogSummary(
|
|
302
|
+
getEditLogSummary<TCompressedChange>(compressEdit: (edit: Pick<Edit<TChange>, 'changes'>) => Pick<Edit<TCompressedChange>, 'changes'>): EditLogSummary<TCompressedChange, FluidEditHandle>;
|
|
288
303
|
private addKeyToCache;
|
|
289
304
|
}
|
|
290
|
-
export {};
|
|
291
305
|
//# sourceMappingURL=EditLog.d.ts.map
|
package/lib/EditLog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditLog.d.ts","sourceRoot":"","sources":["../src/EditLog.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"EditLog.d.ts","sourceRoot":"","sources":["../src/EditLog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAiB,aAAa,EAAE,eAAe,EAAE,MAAM,mB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IACK,aAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAMhD;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAwEhC;;;;;OAKG;IACI,gBAAgB,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS;IAIzF;;;OAGG;IACI,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI;IAO9C,OAAO,CAAC,OAAO;IAMf;;OAEG;IACI,MAAM,CAAC,yBAAyB,EAAE,KAAK,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,OAAO;IAM5F;;;OAGG;IACI,iBAAiB,IAAI,cAAc,CAAC,OAAO,EAAE,eAAe,CAAC;IACpE;;;;OAIG;IACI,iBAAiB,CAAC,iBAAiB,EACzC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,GAC9F,cAAc,CAAC,iBAAiB,EAAE,eAAe,CAAC;IA6BrD,OAAO,CAAC,aAAa;CAqBrB"}
|
package/lib/EditLog.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import BTree from 'sorted-btree';
|
|
6
|
-
import {
|
|
7
|
-
import { assert, assertNotUndefined, compareArrays, fail } from './Common';
|
|
8
|
-
import {
|
|
6
|
+
import { TypedEventEmitter } from '@fluidframework/common-utils';
|
|
7
|
+
import { assert, assertNotUndefined, compareArrays, compareFiniteNumbers, fail } from './Common';
|
|
8
|
+
import { editsPerChunk } from './persisted-types';
|
|
9
|
+
import { SharedTreeDiagnosticEvent } from './EventTypes';
|
|
9
10
|
/**
|
|
10
11
|
* Returns an object that separates an Edit into two fields, id and editWithoutId.
|
|
11
12
|
*/
|
|
@@ -17,6 +18,20 @@ export function separateEditAndId(edit) {
|
|
|
17
18
|
function joinEditAndId(id, edit) {
|
|
18
19
|
return Object.assign({ id }, edit);
|
|
19
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @param summary - The edit log summary to parse.
|
|
23
|
+
* @returns the number of handles saved to the provided edit log summary.
|
|
24
|
+
*/
|
|
25
|
+
export function getNumberOfHandlesFromEditLogSummary(summary) {
|
|
26
|
+
const { editChunks } = summary;
|
|
27
|
+
let numberOfHandles = 0;
|
|
28
|
+
editChunks.forEach(({ chunk }) => {
|
|
29
|
+
if (!Array.isArray(chunk)) {
|
|
30
|
+
numberOfHandles++;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return numberOfHandles;
|
|
34
|
+
}
|
|
20
35
|
/**
|
|
21
36
|
* The number of blobs to be loaded in memory at any time.
|
|
22
37
|
* TODO:#49901: Change cache size once the virtualized history summary format is being written.
|
|
@@ -30,39 +45,38 @@ const loadedChunkCacheSize = Number.POSITIVE_INFINITY;
|
|
|
30
45
|
* May not contain more than one edit with the same ID.
|
|
31
46
|
* @sealed
|
|
32
47
|
*/
|
|
33
|
-
export class EditLog {
|
|
48
|
+
export class EditLog extends TypedEventEmitter {
|
|
34
49
|
/**
|
|
35
50
|
* Construct an `EditLog` using the given options.
|
|
36
51
|
* @param summary - An edit log summary used to populate the edit log.
|
|
37
52
|
* @param logger - An optional logger to record telemetry/errors
|
|
38
53
|
*/
|
|
39
|
-
constructor(summary = { editIds: [], editChunks: [] }, logger,
|
|
54
|
+
constructor(summary = { editIds: [], editChunks: [] }, logger, editAddedHandlers = [], indexOfFirstEditInSession = summary.editIds.length) {
|
|
55
|
+
super();
|
|
40
56
|
this.localEditSequence = 0;
|
|
41
57
|
this._minSequenceNumber = 0;
|
|
42
58
|
this.localEdits = [];
|
|
43
59
|
this.loadedChunkCache = [];
|
|
44
60
|
this.allEditIds = new Map();
|
|
45
|
-
this.
|
|
61
|
+
this._editAddedHandlers = new Set();
|
|
46
62
|
const { editChunks, editIds } = summary;
|
|
47
63
|
this.logger = logger;
|
|
48
64
|
this.editsPerChunk = editsPerChunk;
|
|
65
|
+
for (const handler of editAddedHandlers) {
|
|
66
|
+
this.registerEditAddedHandler(handler);
|
|
67
|
+
}
|
|
49
68
|
this.editChunks = new BTree(undefined, compareFiniteNumbers);
|
|
50
69
|
editChunks.forEach((editChunkOrHandle) => {
|
|
51
70
|
const { startRevision, chunk } = editChunkOrHandle;
|
|
52
|
-
if (
|
|
53
|
-
this.editChunks.set(startRevision, {
|
|
71
|
+
if (isEditHandle(chunk)) {
|
|
72
|
+
this.editChunks.set(startRevision, { handle: chunk });
|
|
54
73
|
}
|
|
55
74
|
else {
|
|
56
|
-
this.editChunks.set(startRevision, {
|
|
57
|
-
// This typecast should not be required,
|
|
58
|
-
// however typescript fails to infer types correctly in the case of readonly arrays guarded by Array.isArray
|
|
59
|
-
// See https://github.com/microsoft/TypeScript/issues/17002
|
|
60
|
-
handle: chunk,
|
|
61
|
-
});
|
|
75
|
+
this.editChunks.set(startRevision, { edits: chunk });
|
|
62
76
|
}
|
|
63
77
|
});
|
|
64
78
|
this.sequencedEditIds = editIds.slice();
|
|
65
|
-
this.indexOfFirstEditInSession =
|
|
79
|
+
this.indexOfFirstEditInSession = indexOfFirstEditInSession;
|
|
66
80
|
this.maximumEvictableIndex = this.indexOfFirstEditInSession - 1;
|
|
67
81
|
this.sequencedEditIds.forEach((id, index) => {
|
|
68
82
|
const encounteredEditId = this.allEditIds.get(id);
|
|
@@ -84,12 +98,20 @@ export class EditLog {
|
|
|
84
98
|
}
|
|
85
99
|
/**
|
|
86
100
|
* Registers a handler for when an edit is added to this `EditLog`.
|
|
101
|
+
* @returns A callback which can be invoked to unregister this handler.
|
|
87
102
|
*/
|
|
88
103
|
registerEditAddedHandler(handler) {
|
|
89
|
-
this.
|
|
104
|
+
this._editAddedHandlers.add(handler);
|
|
105
|
+
return () => this._editAddedHandlers.delete(handler);
|
|
90
106
|
}
|
|
91
107
|
/**
|
|
92
|
-
*
|
|
108
|
+
* @returns the `EditAddedHandler`s registered on this `EditLog`.
|
|
109
|
+
*/
|
|
110
|
+
get editAddedHandlers() {
|
|
111
|
+
return Array.from(this._editAddedHandlers);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* {@inheritDoc OrderedEditSet.length}
|
|
93
115
|
*/
|
|
94
116
|
get length() {
|
|
95
117
|
return this.numberOfSequencedEdits + this.numberOfLocalEdits;
|
|
@@ -107,7 +129,7 @@ export class EditLog {
|
|
|
107
129
|
return this.localEdits.length;
|
|
108
130
|
}
|
|
109
131
|
/**
|
|
110
|
-
* {@inheritDoc
|
|
132
|
+
* {@inheritDoc OrderedEditSet.editIds}
|
|
111
133
|
*/
|
|
112
134
|
get editIds() {
|
|
113
135
|
return this.sequencedEditIds.concat(this.localEdits.map(({ id }) => id));
|
|
@@ -120,13 +142,13 @@ export class EditLog {
|
|
|
120
142
|
return entry !== undefined && entry.isLocal;
|
|
121
143
|
}
|
|
122
144
|
/**
|
|
123
|
-
* @returns true iff the revision is a
|
|
145
|
+
* @returns true iff the revision is a sequenced revision (not local).
|
|
124
146
|
*/
|
|
125
147
|
isSequencedRevision(revision) {
|
|
126
148
|
return revision <= this.sequencedEditIds.length;
|
|
127
149
|
}
|
|
128
150
|
/**
|
|
129
|
-
* {@inheritDoc
|
|
151
|
+
* {@inheritDoc OrderedEditSet.tryGetIndexOfId}
|
|
130
152
|
*/
|
|
131
153
|
tryGetIndexOfId(editId) {
|
|
132
154
|
const orderedEdit = this.allEditIds.get(editId);
|
|
@@ -147,14 +169,14 @@ export class EditLog {
|
|
|
147
169
|
return assertNotUndefined(this.allEditIds.get(editId), 'All edits should exist in this map');
|
|
148
170
|
}
|
|
149
171
|
/**
|
|
150
|
-
* {@inheritDoc
|
|
172
|
+
* {@inheritDoc OrderedEditSet.getIndexOfId}
|
|
151
173
|
*/
|
|
152
174
|
getIndexOfId(editId) {
|
|
153
175
|
var _a;
|
|
154
176
|
return (_a = this.tryGetIndexOfId(editId)) !== null && _a !== void 0 ? _a : fail('edit not found');
|
|
155
177
|
}
|
|
156
178
|
/**
|
|
157
|
-
* {@inheritDoc
|
|
179
|
+
* {@inheritDoc OrderedEditSet.getIdAtIndex}
|
|
158
180
|
*/
|
|
159
181
|
getIdAtIndex(index) {
|
|
160
182
|
if (this.numberOfSequencedEdits <= index) {
|
|
@@ -163,16 +185,15 @@ export class EditLog {
|
|
|
163
185
|
return this.sequencedEditIds[index];
|
|
164
186
|
}
|
|
165
187
|
/**
|
|
166
|
-
* {@inheritDoc
|
|
188
|
+
* {@inheritDoc OrderedEditSet.getEditAtIndex}
|
|
167
189
|
*/
|
|
168
190
|
async getEditAtIndex(index) {
|
|
169
191
|
if (index < this.numberOfSequencedEdits) {
|
|
170
|
-
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.
|
|
192
|
+
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
171
193
|
const { handle, edits } = editChunk;
|
|
172
194
|
if (edits === undefined) {
|
|
173
195
|
assert(handle !== undefined, 'An edit chunk should include at least a handle or edits.');
|
|
174
|
-
const edits =
|
|
175
|
-
.edits;
|
|
196
|
+
const edits = await handle.get();
|
|
176
197
|
// Make sure the loaded edit chunk is the correct size. If a higher starting revison is set, the length is the difference of both.
|
|
177
198
|
// Otherwise, it means that there are no sequenced edits in memory so the length is the difference of the number of
|
|
178
199
|
// sequenced edits and the starting revision.
|
|
@@ -188,12 +209,12 @@ export class EditLog {
|
|
|
188
209
|
return this.localEdits[index - this.numberOfSequencedEdits];
|
|
189
210
|
}
|
|
190
211
|
/**
|
|
191
|
-
* {@inheritDoc
|
|
212
|
+
* {@inheritDoc OrderedEditSet.getEditInSessionAtIndex}
|
|
192
213
|
*/
|
|
193
214
|
getEditInSessionAtIndex(index) {
|
|
194
215
|
assert(index > this.maximumEvictableIndex, 'Edit to retrieve must have been added to the log during the current session.');
|
|
195
216
|
if (index < this.numberOfSequencedEdits) {
|
|
196
|
-
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.
|
|
217
|
+
const [startRevision, editChunk] = assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
197
218
|
const { edits } = editChunk;
|
|
198
219
|
return joinEditAndId(this.getIdAtIndex(index), assertNotUndefined(edits, 'Edits should not have been evicted.')[index - startRevision]);
|
|
199
220
|
}
|
|
@@ -201,7 +222,7 @@ export class EditLog {
|
|
|
201
222
|
return this.localEdits[index - this.numberOfSequencedEdits];
|
|
202
223
|
}
|
|
203
224
|
/**
|
|
204
|
-
* {@inheritDoc
|
|
225
|
+
* {@inheritDoc OrderedEditSet.tryGetEdit}
|
|
205
226
|
*/
|
|
206
227
|
async tryGetEdit(editId) {
|
|
207
228
|
try {
|
|
@@ -243,6 +264,7 @@ export class EditLog {
|
|
|
243
264
|
}
|
|
244
265
|
else {
|
|
245
266
|
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.sendErrorEvent({ eventName: 'UnexpectedHistoryChunk' });
|
|
267
|
+
this.emit(SharedTreeDiagnosticEvent.UnexpectedHistoryChunk);
|
|
246
268
|
}
|
|
247
269
|
}
|
|
248
270
|
/**
|
|
@@ -259,6 +281,16 @@ export class EditLog {
|
|
|
259
281
|
addSequencedEdit(edit, message) {
|
|
260
282
|
this.addSequencedEditInternal(edit, message, message.minimumSequenceNumber);
|
|
261
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Returns all local edits from this EditLog
|
|
286
|
+
* This is useful for op format upgrades, which might warrant re-submission of these ops using the new format.
|
|
287
|
+
* See the breaking change documentation for more information.
|
|
288
|
+
*/
|
|
289
|
+
*getLocalEdits() {
|
|
290
|
+
for (const edit of this.localEdits) {
|
|
291
|
+
yield edit;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
262
294
|
/**
|
|
263
295
|
* Adds a sequenced (non-local) edit to the edit log.
|
|
264
296
|
* If the id of the supplied edit matches a local edit already present in the log, the local edit will be replaced.
|
|
@@ -341,7 +373,7 @@ export class EditLog {
|
|
|
341
373
|
this.emitAdd(edit, true, false);
|
|
342
374
|
}
|
|
343
375
|
emitAdd(editAdded, isLocal, wasLocal) {
|
|
344
|
-
for (const handler of this.
|
|
376
|
+
for (const handler of this._editAddedHandlers) {
|
|
345
377
|
handler(editAdded, isLocal, wasLocal);
|
|
346
378
|
}
|
|
347
379
|
}
|
|
@@ -353,30 +385,31 @@ export class EditLog {
|
|
|
353
385
|
// We can use our edit validation code when we write it since it will need to do deep walks of the changes.
|
|
354
386
|
return compareArrays(this.editIds, other.editIds);
|
|
355
387
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
*/
|
|
359
|
-
getEditLogSummary(useHandles = false) {
|
|
360
|
-
if (useHandles) {
|
|
388
|
+
getEditLogSummary(compressEdit) {
|
|
389
|
+
if (compressEdit !== undefined) {
|
|
361
390
|
return {
|
|
362
391
|
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => {
|
|
363
|
-
var _a;
|
|
364
|
-
return {
|
|
392
|
+
var _a, _b;
|
|
393
|
+
return ({
|
|
365
394
|
startRevision,
|
|
366
|
-
chunk: (_a = handle !== null &&
|
|
367
|
-
};
|
|
395
|
+
chunk: (_b = (_a = handle === null || handle === void 0 ? void 0 : handle.baseHandle) !== null && _a !== void 0 ? _a : edits === null || edits === void 0 ? void 0 : edits.map((edit) => compressEdit(edit))) !== null && _b !== void 0 ? _b : fail('An edit chunk must have either a handle or a list of edits.'),
|
|
396
|
+
});
|
|
397
|
+
}),
|
|
398
|
+
editIds: this.sequencedEditIds,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
return {
|
|
403
|
+
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => {
|
|
404
|
+
var _a, _b;
|
|
405
|
+
return ({
|
|
406
|
+
startRevision,
|
|
407
|
+
chunk: (_b = (_a = handle === null || handle === void 0 ? void 0 : handle.baseHandle) !== null && _a !== void 0 ? _a : edits) !== null && _b !== void 0 ? _b : fail('An edit chunk must have either a handle or a list of edits.'),
|
|
408
|
+
});
|
|
368
409
|
}),
|
|
369
410
|
editIds: this.sequencedEditIds,
|
|
370
411
|
};
|
|
371
412
|
}
|
|
372
|
-
// TODO:#49901: When writing format version 0.1.0, change to prefer sending the handle when not undefined.
|
|
373
|
-
// For now, no chunks are evicted so edits are sent as is to be aggregated during summary write.
|
|
374
|
-
return {
|
|
375
|
-
editChunks: this.editChunks.toArray().map(([startRevision, { edits }]) => {
|
|
376
|
-
return { startRevision, chunk: assertNotUndefined(edits) };
|
|
377
|
-
}),
|
|
378
|
-
editIds: this.sequencedEditIds,
|
|
379
|
-
};
|
|
380
413
|
}
|
|
381
414
|
addKeyToCache(newKey) {
|
|
382
415
|
// Indices are only added to the cache if they are not higher than the maximum evicted index.
|
|
@@ -395,4 +428,7 @@ export class EditLog {
|
|
|
395
428
|
}
|
|
396
429
|
}
|
|
397
430
|
}
|
|
431
|
+
function isEditHandle(chunk) {
|
|
432
|
+
return !Array.isArray(chunk);
|
|
433
|
+
}
|
|
398
434
|
//# sourceMappingURL=EditLog.js.map
|