@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/dist/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/dist/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/dist/EditLog.js
CHANGED
|
@@ -7,11 +7,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EditLog = exports.separateEditAndId = void 0;
|
|
10
|
+
exports.EditLog = exports.getNumberOfHandlesFromEditLogSummary = exports.separateEditAndId = void 0;
|
|
11
11
|
const sorted_btree_1 = __importDefault(require("sorted-btree"));
|
|
12
12
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
13
13
|
const Common_1 = require("./Common");
|
|
14
|
-
const
|
|
14
|
+
const persisted_types_1 = require("./persisted-types");
|
|
15
|
+
const EventTypes_1 = require("./EventTypes");
|
|
15
16
|
/**
|
|
16
17
|
* Returns an object that separates an Edit into two fields, id and editWithoutId.
|
|
17
18
|
*/
|
|
@@ -24,6 +25,21 @@ exports.separateEditAndId = separateEditAndId;
|
|
|
24
25
|
function joinEditAndId(id, edit) {
|
|
25
26
|
return Object.assign({ id }, edit);
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @param summary - The edit log summary to parse.
|
|
30
|
+
* @returns the number of handles saved to the provided edit log summary.
|
|
31
|
+
*/
|
|
32
|
+
function getNumberOfHandlesFromEditLogSummary(summary) {
|
|
33
|
+
const { editChunks } = summary;
|
|
34
|
+
let numberOfHandles = 0;
|
|
35
|
+
editChunks.forEach(({ chunk }) => {
|
|
36
|
+
if (!Array.isArray(chunk)) {
|
|
37
|
+
numberOfHandles++;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return numberOfHandles;
|
|
41
|
+
}
|
|
42
|
+
exports.getNumberOfHandlesFromEditLogSummary = getNumberOfHandlesFromEditLogSummary;
|
|
27
43
|
/**
|
|
28
44
|
* The number of blobs to be loaded in memory at any time.
|
|
29
45
|
* TODO:#49901: Change cache size once the virtualized history summary format is being written.
|
|
@@ -37,39 +53,38 @@ const loadedChunkCacheSize = Number.POSITIVE_INFINITY;
|
|
|
37
53
|
* May not contain more than one edit with the same ID.
|
|
38
54
|
* @sealed
|
|
39
55
|
*/
|
|
40
|
-
class EditLog {
|
|
56
|
+
class EditLog extends common_utils_1.TypedEventEmitter {
|
|
41
57
|
/**
|
|
42
58
|
* Construct an `EditLog` using the given options.
|
|
43
59
|
* @param summary - An edit log summary used to populate the edit log.
|
|
44
60
|
* @param logger - An optional logger to record telemetry/errors
|
|
45
61
|
*/
|
|
46
|
-
constructor(summary = { editIds: [], editChunks: [] }, logger,
|
|
62
|
+
constructor(summary = { editIds: [], editChunks: [] }, logger, editAddedHandlers = [], indexOfFirstEditInSession = summary.editIds.length) {
|
|
63
|
+
super();
|
|
47
64
|
this.localEditSequence = 0;
|
|
48
65
|
this._minSequenceNumber = 0;
|
|
49
66
|
this.localEdits = [];
|
|
50
67
|
this.loadedChunkCache = [];
|
|
51
68
|
this.allEditIds = new Map();
|
|
52
|
-
this.
|
|
69
|
+
this._editAddedHandlers = new Set();
|
|
53
70
|
const { editChunks, editIds } = summary;
|
|
54
71
|
this.logger = logger;
|
|
55
|
-
this.editsPerChunk = editsPerChunk;
|
|
56
|
-
|
|
72
|
+
this.editsPerChunk = persisted_types_1.editsPerChunk;
|
|
73
|
+
for (const handler of editAddedHandlers) {
|
|
74
|
+
this.registerEditAddedHandler(handler);
|
|
75
|
+
}
|
|
76
|
+
this.editChunks = new sorted_btree_1.default(undefined, Common_1.compareFiniteNumbers);
|
|
57
77
|
editChunks.forEach((editChunkOrHandle) => {
|
|
58
78
|
const { startRevision, chunk } = editChunkOrHandle;
|
|
59
|
-
if (
|
|
60
|
-
this.editChunks.set(startRevision, {
|
|
79
|
+
if (isEditHandle(chunk)) {
|
|
80
|
+
this.editChunks.set(startRevision, { handle: chunk });
|
|
61
81
|
}
|
|
62
82
|
else {
|
|
63
|
-
this.editChunks.set(startRevision, {
|
|
64
|
-
// This typecast should not be required,
|
|
65
|
-
// however typescript fails to infer types correctly in the case of readonly arrays guarded by Array.isArray
|
|
66
|
-
// See https://github.com/microsoft/TypeScript/issues/17002
|
|
67
|
-
handle: chunk,
|
|
68
|
-
});
|
|
83
|
+
this.editChunks.set(startRevision, { edits: chunk });
|
|
69
84
|
}
|
|
70
85
|
});
|
|
71
86
|
this.sequencedEditIds = editIds.slice();
|
|
72
|
-
this.indexOfFirstEditInSession =
|
|
87
|
+
this.indexOfFirstEditInSession = indexOfFirstEditInSession;
|
|
73
88
|
this.maximumEvictableIndex = this.indexOfFirstEditInSession - 1;
|
|
74
89
|
this.sequencedEditIds.forEach((id, index) => {
|
|
75
90
|
const encounteredEditId = this.allEditIds.get(id);
|
|
@@ -91,12 +106,20 @@ class EditLog {
|
|
|
91
106
|
}
|
|
92
107
|
/**
|
|
93
108
|
* Registers a handler for when an edit is added to this `EditLog`.
|
|
109
|
+
* @returns A callback which can be invoked to unregister this handler.
|
|
94
110
|
*/
|
|
95
111
|
registerEditAddedHandler(handler) {
|
|
96
|
-
this.
|
|
112
|
+
this._editAddedHandlers.add(handler);
|
|
113
|
+
return () => this._editAddedHandlers.delete(handler);
|
|
97
114
|
}
|
|
98
115
|
/**
|
|
99
|
-
*
|
|
116
|
+
* @returns the `EditAddedHandler`s registered on this `EditLog`.
|
|
117
|
+
*/
|
|
118
|
+
get editAddedHandlers() {
|
|
119
|
+
return Array.from(this._editAddedHandlers);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* {@inheritDoc OrderedEditSet.length}
|
|
100
123
|
*/
|
|
101
124
|
get length() {
|
|
102
125
|
return this.numberOfSequencedEdits + this.numberOfLocalEdits;
|
|
@@ -114,7 +137,7 @@ class EditLog {
|
|
|
114
137
|
return this.localEdits.length;
|
|
115
138
|
}
|
|
116
139
|
/**
|
|
117
|
-
* {@inheritDoc
|
|
140
|
+
* {@inheritDoc OrderedEditSet.editIds}
|
|
118
141
|
*/
|
|
119
142
|
get editIds() {
|
|
120
143
|
return this.sequencedEditIds.concat(this.localEdits.map(({ id }) => id));
|
|
@@ -127,13 +150,13 @@ class EditLog {
|
|
|
127
150
|
return entry !== undefined && entry.isLocal;
|
|
128
151
|
}
|
|
129
152
|
/**
|
|
130
|
-
* @returns true iff the revision is a
|
|
153
|
+
* @returns true iff the revision is a sequenced revision (not local).
|
|
131
154
|
*/
|
|
132
155
|
isSequencedRevision(revision) {
|
|
133
156
|
return revision <= this.sequencedEditIds.length;
|
|
134
157
|
}
|
|
135
158
|
/**
|
|
136
|
-
* {@inheritDoc
|
|
159
|
+
* {@inheritDoc OrderedEditSet.tryGetIndexOfId}
|
|
137
160
|
*/
|
|
138
161
|
tryGetIndexOfId(editId) {
|
|
139
162
|
const orderedEdit = this.allEditIds.get(editId);
|
|
@@ -154,14 +177,14 @@ class EditLog {
|
|
|
154
177
|
return Common_1.assertNotUndefined(this.allEditIds.get(editId), 'All edits should exist in this map');
|
|
155
178
|
}
|
|
156
179
|
/**
|
|
157
|
-
* {@inheritDoc
|
|
180
|
+
* {@inheritDoc OrderedEditSet.getIndexOfId}
|
|
158
181
|
*/
|
|
159
182
|
getIndexOfId(editId) {
|
|
160
183
|
var _a;
|
|
161
184
|
return (_a = this.tryGetIndexOfId(editId)) !== null && _a !== void 0 ? _a : Common_1.fail('edit not found');
|
|
162
185
|
}
|
|
163
186
|
/**
|
|
164
|
-
* {@inheritDoc
|
|
187
|
+
* {@inheritDoc OrderedEditSet.getIdAtIndex}
|
|
165
188
|
*/
|
|
166
189
|
getIdAtIndex(index) {
|
|
167
190
|
if (this.numberOfSequencedEdits <= index) {
|
|
@@ -170,16 +193,15 @@ class EditLog {
|
|
|
170
193
|
return this.sequencedEditIds[index];
|
|
171
194
|
}
|
|
172
195
|
/**
|
|
173
|
-
* {@inheritDoc
|
|
196
|
+
* {@inheritDoc OrderedEditSet.getEditAtIndex}
|
|
174
197
|
*/
|
|
175
198
|
async getEditAtIndex(index) {
|
|
176
199
|
if (index < this.numberOfSequencedEdits) {
|
|
177
|
-
const [startRevision, editChunk] = Common_1.assertNotUndefined(this.editChunks.
|
|
200
|
+
const [startRevision, editChunk] = Common_1.assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
178
201
|
const { handle, edits } = editChunk;
|
|
179
202
|
if (edits === undefined) {
|
|
180
203
|
Common_1.assert(handle !== undefined, 'An edit chunk should include at least a handle or edits.');
|
|
181
|
-
const edits =
|
|
182
|
-
.edits;
|
|
204
|
+
const edits = await handle.get();
|
|
183
205
|
// Make sure the loaded edit chunk is the correct size. If a higher starting revison is set, the length is the difference of both.
|
|
184
206
|
// Otherwise, it means that there are no sequenced edits in memory so the length is the difference of the number of
|
|
185
207
|
// sequenced edits and the starting revision.
|
|
@@ -195,12 +217,12 @@ class EditLog {
|
|
|
195
217
|
return this.localEdits[index - this.numberOfSequencedEdits];
|
|
196
218
|
}
|
|
197
219
|
/**
|
|
198
|
-
* {@inheritDoc
|
|
220
|
+
* {@inheritDoc OrderedEditSet.getEditInSessionAtIndex}
|
|
199
221
|
*/
|
|
200
222
|
getEditInSessionAtIndex(index) {
|
|
201
223
|
Common_1.assert(index > this.maximumEvictableIndex, 'Edit to retrieve must have been added to the log during the current session.');
|
|
202
224
|
if (index < this.numberOfSequencedEdits) {
|
|
203
|
-
const [startRevision, editChunk] = Common_1.assertNotUndefined(this.editChunks.
|
|
225
|
+
const [startRevision, editChunk] = Common_1.assertNotUndefined(this.editChunks.getPairOrNextLower(index));
|
|
204
226
|
const { edits } = editChunk;
|
|
205
227
|
return joinEditAndId(this.getIdAtIndex(index), Common_1.assertNotUndefined(edits, 'Edits should not have been evicted.')[index - startRevision]);
|
|
206
228
|
}
|
|
@@ -208,7 +230,7 @@ class EditLog {
|
|
|
208
230
|
return this.localEdits[index - this.numberOfSequencedEdits];
|
|
209
231
|
}
|
|
210
232
|
/**
|
|
211
|
-
* {@inheritDoc
|
|
233
|
+
* {@inheritDoc OrderedEditSet.tryGetEdit}
|
|
212
234
|
*/
|
|
213
235
|
async tryGetEdit(editId) {
|
|
214
236
|
try {
|
|
@@ -250,6 +272,7 @@ class EditLog {
|
|
|
250
272
|
}
|
|
251
273
|
else {
|
|
252
274
|
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.sendErrorEvent({ eventName: 'UnexpectedHistoryChunk' });
|
|
275
|
+
this.emit(EventTypes_1.SharedTreeDiagnosticEvent.UnexpectedHistoryChunk);
|
|
253
276
|
}
|
|
254
277
|
}
|
|
255
278
|
/**
|
|
@@ -266,6 +289,16 @@ class EditLog {
|
|
|
266
289
|
addSequencedEdit(edit, message) {
|
|
267
290
|
this.addSequencedEditInternal(edit, message, message.minimumSequenceNumber);
|
|
268
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Returns all local edits from this EditLog
|
|
294
|
+
* This is useful for op format upgrades, which might warrant re-submission of these ops using the new format.
|
|
295
|
+
* See the breaking change documentation for more information.
|
|
296
|
+
*/
|
|
297
|
+
*getLocalEdits() {
|
|
298
|
+
for (const edit of this.localEdits) {
|
|
299
|
+
yield edit;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
269
302
|
/**
|
|
270
303
|
* Adds a sequenced (non-local) edit to the edit log.
|
|
271
304
|
* If the id of the supplied edit matches a local edit already present in the log, the local edit will be replaced.
|
|
@@ -348,7 +381,7 @@ class EditLog {
|
|
|
348
381
|
this.emitAdd(edit, true, false);
|
|
349
382
|
}
|
|
350
383
|
emitAdd(editAdded, isLocal, wasLocal) {
|
|
351
|
-
for (const handler of this.
|
|
384
|
+
for (const handler of this._editAddedHandlers) {
|
|
352
385
|
handler(editAdded, isLocal, wasLocal);
|
|
353
386
|
}
|
|
354
387
|
}
|
|
@@ -360,30 +393,31 @@ class EditLog {
|
|
|
360
393
|
// We can use our edit validation code when we write it since it will need to do deep walks of the changes.
|
|
361
394
|
return Common_1.compareArrays(this.editIds, other.editIds);
|
|
362
395
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
*/
|
|
366
|
-
getEditLogSummary(useHandles = false) {
|
|
367
|
-
if (useHandles) {
|
|
396
|
+
getEditLogSummary(compressEdit) {
|
|
397
|
+
if (compressEdit !== undefined) {
|
|
368
398
|
return {
|
|
369
399
|
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => {
|
|
370
|
-
var _a;
|
|
371
|
-
return {
|
|
400
|
+
var _a, _b;
|
|
401
|
+
return ({
|
|
372
402
|
startRevision,
|
|
373
|
-
chunk: (_a = handle !== null &&
|
|
374
|
-
};
|
|
403
|
+
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 : Common_1.fail('An edit chunk must have either a handle or a list of edits.'),
|
|
404
|
+
});
|
|
405
|
+
}),
|
|
406
|
+
editIds: this.sequencedEditIds,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
return {
|
|
411
|
+
editChunks: this.editChunks.toArray().map(([startRevision, { handle, edits }]) => {
|
|
412
|
+
var _a, _b;
|
|
413
|
+
return ({
|
|
414
|
+
startRevision,
|
|
415
|
+
chunk: (_b = (_a = handle === null || handle === void 0 ? void 0 : handle.baseHandle) !== null && _a !== void 0 ? _a : edits) !== null && _b !== void 0 ? _b : Common_1.fail('An edit chunk must have either a handle or a list of edits.'),
|
|
416
|
+
});
|
|
375
417
|
}),
|
|
376
418
|
editIds: this.sequencedEditIds,
|
|
377
419
|
};
|
|
378
420
|
}
|
|
379
|
-
// TODO:#49901: When writing format version 0.1.0, change to prefer sending the handle when not undefined.
|
|
380
|
-
// For now, no chunks are evicted so edits are sent as is to be aggregated during summary write.
|
|
381
|
-
return {
|
|
382
|
-
editChunks: this.editChunks.toArray().map(([startRevision, { edits }]) => {
|
|
383
|
-
return { startRevision, chunk: Common_1.assertNotUndefined(edits) };
|
|
384
|
-
}),
|
|
385
|
-
editIds: this.sequencedEditIds,
|
|
386
|
-
};
|
|
387
421
|
}
|
|
388
422
|
addKeyToCache(newKey) {
|
|
389
423
|
// Indices are only added to the cache if they are not higher than the maximum evicted index.
|
|
@@ -403,4 +437,7 @@ class EditLog {
|
|
|
403
437
|
}
|
|
404
438
|
}
|
|
405
439
|
exports.EditLog = EditLog;
|
|
440
|
+
function isEditHandle(chunk) {
|
|
441
|
+
return !Array.isArray(chunk);
|
|
442
|
+
}
|
|
406
443
|
//# sourceMappingURL=EditLog.js.map
|