@fluid-experimental/tree 0.58.2001 → 0.59.2000-61729
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 +71 -0
- package/dist/Transaction.d.ts.map +1 -0
- package/dist/Transaction.js +92 -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 +71 -0
- package/lib/Transaction.d.ts.map +1 -0
- package/lib/Transaction.js +88 -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 +109 -329
- 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 +120 -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/tree",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.2000-61729",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -36,28 +36,32 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
38
38
|
"@fluidframework/common-utils": "^0.32.1",
|
|
39
|
-
"@fluidframework/container-definitions": "^0.
|
|
40
|
-
"@fluidframework/core-interfaces": "^0.
|
|
41
|
-
"@fluidframework/datastore-definitions": "
|
|
42
|
-
"@fluidframework/protocol-definitions": "^0.
|
|
43
|
-
"@fluidframework/runtime-definitions": "
|
|
44
|
-
"@fluidframework/shared-object-base": "
|
|
45
|
-
"@fluidframework/telemetry-utils": "
|
|
39
|
+
"@fluidframework/container-definitions": "^0.48.1000-0",
|
|
40
|
+
"@fluidframework/core-interfaces": "^0.43.1000-0",
|
|
41
|
+
"@fluidframework/datastore-definitions": "0.59.2000-61729",
|
|
42
|
+
"@fluidframework/protocol-definitions": "^0.1028.1000-0",
|
|
43
|
+
"@fluidframework/runtime-definitions": "0.59.2000-61729",
|
|
44
|
+
"@fluidframework/shared-object-base": "0.59.2000-61729",
|
|
45
|
+
"@fluidframework/telemetry-utils": "0.59.2000-61729",
|
|
46
46
|
"buffer": "^6.0.3",
|
|
47
|
-
"denque": "^1.5.
|
|
47
|
+
"denque": "^1.5.1",
|
|
48
48
|
"lru-cache": "^6.0.0",
|
|
49
|
-
"sorted-btree": "^1.
|
|
49
|
+
"sorted-btree": "^1.8.0",
|
|
50
50
|
"uuid": "^8.3.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
+
"@fluid-tools/benchmark": "^0.40.0",
|
|
53
54
|
"@fluidframework/build-common": "^0.23.0",
|
|
54
|
-
"@fluidframework/container-loader": "
|
|
55
|
-
"@fluidframework/
|
|
56
|
-
"@fluidframework/
|
|
57
|
-
"@fluidframework/
|
|
58
|
-
"@fluidframework/
|
|
59
|
-
"@fluidframework/test-
|
|
60
|
-
"@fluidframework/test-
|
|
55
|
+
"@fluidframework/container-loader": "0.59.2000-61729",
|
|
56
|
+
"@fluidframework/container-runtime": "0.59.2000-61729",
|
|
57
|
+
"@fluidframework/eslint-config-fluid": "^0.28.1000-61189",
|
|
58
|
+
"@fluidframework/mocha-test-setup": "0.59.2000-61729",
|
|
59
|
+
"@fluidframework/runtime-utils": "0.59.2000-61729",
|
|
60
|
+
"@fluidframework/test-driver-definitions": "0.59.2000-61729",
|
|
61
|
+
"@fluidframework/test-drivers": "0.59.2000-61729",
|
|
62
|
+
"@fluidframework/test-runtime-utils": "0.59.2000-61729",
|
|
63
|
+
"@fluidframework/test-utils": "0.59.2000-61729",
|
|
64
|
+
"@fluidframework/undo-redo": "0.59.2000-61729",
|
|
61
65
|
"@microsoft/api-extractor": "^7.16.1",
|
|
62
66
|
"@rushstack/eslint-config": "^2.5.1",
|
|
63
67
|
"@types/lru-cache": "^5.1.0",
|
|
@@ -77,6 +81,7 @@
|
|
|
77
81
|
"eslint-plugin-unicorn": "~40.0.0",
|
|
78
82
|
"mocha": "^8.4.0",
|
|
79
83
|
"nyc": "^15.0.0",
|
|
84
|
+
"prando": "^6.0.1",
|
|
80
85
|
"prettier": "^2.3.1",
|
|
81
86
|
"rimraf": "^2.6.2",
|
|
82
87
|
"typescript": "~4.1.3"
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { DetachedSequenceId, NodeId, OpSpaceNodeId } from './Identifiers';
|
|
7
|
+
import {
|
|
8
|
+
BuildInternal,
|
|
9
|
+
BuildNodeInternal,
|
|
10
|
+
ChangeInternal,
|
|
11
|
+
CompressedChangeInternal,
|
|
12
|
+
ChangeTypeInternal,
|
|
13
|
+
CompressedBuildInternal,
|
|
14
|
+
CompressedPlaceholderTree,
|
|
15
|
+
InsertInternal,
|
|
16
|
+
DetachInternal,
|
|
17
|
+
SetValueInternal,
|
|
18
|
+
ConstraintInternal,
|
|
19
|
+
} from './persisted-types';
|
|
20
|
+
import { ContextualizedNodeIdNormalizer } from './NodeIdUtilities';
|
|
21
|
+
import { copyPropertyIfDefined, fail, Mutable, ReplaceRecursive } from './Common';
|
|
22
|
+
import { TreeCompressor } from './TreeCompressor';
|
|
23
|
+
import { StringInterner } from './StringInterner';
|
|
24
|
+
import { convertStablePlaceIds, convertStableRangeIds } from './IdConversion';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Encapsulates knowledge of how to compress/decompress a change into a compressed change
|
|
28
|
+
* Compression and decompression each take in a {@link StringInterner} for deduplicating shared strings.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export class ChangeCompressor {
|
|
32
|
+
public constructor(private readonly treeCompressor: TreeCompressor<DetachedSequenceId>) {}
|
|
33
|
+
|
|
34
|
+
public compress<TId extends OpSpaceNodeId>(
|
|
35
|
+
change: ChangeInternal,
|
|
36
|
+
interner: StringInterner,
|
|
37
|
+
idNormalizer: ContextualizedNodeIdNormalizer<TId>
|
|
38
|
+
): CompressedChangeInternal<TId> {
|
|
39
|
+
if (change.type === ChangeTypeInternal.Build) {
|
|
40
|
+
const source: CompressedPlaceholderTree<TId, DetachedSequenceId>[] = [];
|
|
41
|
+
for (const node of change.source) {
|
|
42
|
+
source.push(this.treeCompressor.compress(node, interner, idNormalizer));
|
|
43
|
+
}
|
|
44
|
+
const newChange: CompressedBuildInternal<TId> = {
|
|
45
|
+
destination: change.destination,
|
|
46
|
+
source,
|
|
47
|
+
type: ChangeTypeInternal.CompressedBuild,
|
|
48
|
+
};
|
|
49
|
+
return newChange;
|
|
50
|
+
} else {
|
|
51
|
+
return normalizeChange(change, (id) => idNormalizer.normalizeToOpSpace(id));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public decompress<TId extends OpSpaceNodeId>(
|
|
56
|
+
change: CompressedChangeInternal<TId>,
|
|
57
|
+
interner: StringInterner,
|
|
58
|
+
idNormalizer: ContextualizedNodeIdNormalizer<TId>
|
|
59
|
+
): ChangeInternal {
|
|
60
|
+
if (change.type === ChangeTypeInternal.CompressedBuild) {
|
|
61
|
+
const source: BuildNodeInternal[] = [];
|
|
62
|
+
for (const node of change.source) {
|
|
63
|
+
source.push(this.treeCompressor.decompress(node, interner, idNormalizer));
|
|
64
|
+
}
|
|
65
|
+
const newChange: BuildInternal = {
|
|
66
|
+
destination: change.destination,
|
|
67
|
+
source,
|
|
68
|
+
type: ChangeTypeInternal.Build,
|
|
69
|
+
};
|
|
70
|
+
return newChange;
|
|
71
|
+
} else {
|
|
72
|
+
return normalizeChange(change, (id) => idNormalizer.normalizeToSessionSpace(id));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function normalizeChange<From extends NodeId | OpSpaceNodeId, To extends NodeId | OpSpaceNodeId>(
|
|
78
|
+
change: ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, From>,
|
|
79
|
+
normalizeId: (id: From) => To
|
|
80
|
+
): ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, To> {
|
|
81
|
+
switch (change.type) {
|
|
82
|
+
case ChangeTypeInternal.Insert: {
|
|
83
|
+
const insert: ReplaceRecursive<InsertInternal, NodeId, To> = {
|
|
84
|
+
source: change.source,
|
|
85
|
+
destination: convertStablePlaceIds(change.destination, normalizeId),
|
|
86
|
+
type: ChangeTypeInternal.Insert,
|
|
87
|
+
};
|
|
88
|
+
return insert;
|
|
89
|
+
}
|
|
90
|
+
case ChangeTypeInternal.Detach: {
|
|
91
|
+
const detach: ReplaceRecursive<DetachInternal, NodeId, To> = {
|
|
92
|
+
source: convertStableRangeIds(change.source, normalizeId),
|
|
93
|
+
type: ChangeTypeInternal.Detach,
|
|
94
|
+
};
|
|
95
|
+
copyPropertyIfDefined(change, detach, 'destination');
|
|
96
|
+
return detach;
|
|
97
|
+
}
|
|
98
|
+
case ChangeTypeInternal.SetValue: {
|
|
99
|
+
const setValue: ReplaceRecursive<SetValueInternal, NodeId, To> = {
|
|
100
|
+
nodeToModify: normalizeId(change.nodeToModify),
|
|
101
|
+
payload: change.payload,
|
|
102
|
+
type: ChangeTypeInternal.SetValue,
|
|
103
|
+
};
|
|
104
|
+
return setValue;
|
|
105
|
+
}
|
|
106
|
+
case ChangeTypeInternal.Constraint: {
|
|
107
|
+
const constraint: Mutable<ReplaceRecursive<ConstraintInternal, NodeId, To>> = {
|
|
108
|
+
effect: change.effect,
|
|
109
|
+
toConstrain: convertStableRangeIds(change.toConstrain, normalizeId),
|
|
110
|
+
type: ChangeTypeInternal.Constraint,
|
|
111
|
+
};
|
|
112
|
+
copyPropertyIfDefined(change, constraint, 'contentHash');
|
|
113
|
+
copyPropertyIfDefined(change, constraint, 'identityHash');
|
|
114
|
+
copyPropertyIfDefined(change, constraint, 'label');
|
|
115
|
+
copyPropertyIfDefined(change, constraint, 'length');
|
|
116
|
+
if (change.parentNode !== undefined) {
|
|
117
|
+
constraint.parentNode = normalizeId(change.parentNode);
|
|
118
|
+
}
|
|
119
|
+
return constraint;
|
|
120
|
+
}
|
|
121
|
+
default:
|
|
122
|
+
fail('unexpected change type');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Compresses the provided edit by applying `compressor` to each change and leaving other fields
|
|
128
|
+
* untouched.
|
|
129
|
+
*/
|
|
130
|
+
export function compressEdit<TId extends OpSpaceNodeId, TEdit extends { changes: readonly ChangeInternal[] }>(
|
|
131
|
+
compressor: ChangeCompressor,
|
|
132
|
+
interner: StringInterner,
|
|
133
|
+
idNormalizer: ContextualizedNodeIdNormalizer<TId>,
|
|
134
|
+
edit: TEdit
|
|
135
|
+
): Omit<TEdit, 'changes'> & { changes: readonly CompressedChangeInternal<TId>[] } {
|
|
136
|
+
return {
|
|
137
|
+
...edit,
|
|
138
|
+
changes: edit.changes.map((change) => compressor.compress(change, interner, idNormalizer)),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Decompresses the provided edit by applying `compressor` to each change and leaving other fields
|
|
144
|
+
* untouched.
|
|
145
|
+
*/
|
|
146
|
+
export function decompressEdit<
|
|
147
|
+
TId extends OpSpaceNodeId,
|
|
148
|
+
TEdit extends { changes: readonly CompressedChangeInternal<TId>[] }
|
|
149
|
+
>(
|
|
150
|
+
compressor: ChangeCompressor,
|
|
151
|
+
interner: StringInterner,
|
|
152
|
+
idNormalizer: ContextualizedNodeIdNormalizer<TId>,
|
|
153
|
+
edit: TEdit
|
|
154
|
+
): Omit<TEdit, 'changes'> & { changes: readonly ChangeInternal[] } {
|
|
155
|
+
return {
|
|
156
|
+
...edit,
|
|
157
|
+
changes: edit.changes.map((change) => compressor.decompress(change, interner, idNormalizer)),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -3,48 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { DetachedSequenceId, NodeId, TraitLabel, UuidString } from '../Identifiers';
|
|
12
|
-
import { assertNotUndefined, assert } from '../Common';
|
|
13
|
-
import { Side } from '../Snapshot';
|
|
14
|
-
import { EditBase, BuildNode, NodeData, Payload, TraitLocation, TreeNodeSequence } from '../generic';
|
|
6
|
+
import { NodeId, TraitLabel, UuidString } from './Identifiers';
|
|
7
|
+
import { assert, assertNotUndefined } from './Common';
|
|
8
|
+
import { ConstraintEffect, NodeData, Payload, Side, TreeNodeSequence } from './persisted-types';
|
|
9
|
+
import { TraitLocation } from './TreeView';
|
|
10
|
+
import { getNodeId } from './NodeIdUtilities';
|
|
15
11
|
|
|
16
12
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Types describing locations in the tree are stable in the presence of other concurrent edits.
|
|
20
|
-
*
|
|
21
|
-
* All types are compatible with Fluid Serializable.
|
|
22
|
-
*
|
|
23
|
-
* These types can only be modified in ways that are both backwards and forwards compatible since they
|
|
24
|
-
* are used in edits, and thus are persisted (using Fluid serialization).
|
|
25
|
-
*
|
|
26
|
-
* This means these types cannot be changed in any way that impacts their Fluid serialization
|
|
27
|
-
* except through a very careful process:
|
|
28
|
-
*
|
|
29
|
-
* 1. The planned change must support all old data, and maintain the exact semantics of it.
|
|
30
|
-
* This means that the change is pretty much limited to adding optional fields,
|
|
31
|
-
* or making required fields optional.
|
|
32
|
-
* 2. Support for the new format must be deployed to all users (This means all applications using SharedTree must do this),
|
|
33
|
-
* and this deployment must be confirmed to be stable and will not be rolled back.
|
|
34
|
-
* 3. Usage of the new format may start.
|
|
35
|
-
*
|
|
36
|
-
* Support for the old format can NEVER be removed: it must be maintained indefinably or old documents will break.
|
|
37
|
-
* Because this process puts requirements on applications using shared tree,
|
|
38
|
-
* step 3 should only ever be done in a Major version update,
|
|
39
|
-
* and must be explicitly called out in the release notes
|
|
40
|
-
* stating which versions of SharedTree are supported for documents modified by the new version.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The information included in an edit.
|
|
13
|
+
* An object which may have traits with children of the given type underneath it
|
|
45
14
|
* @public
|
|
46
15
|
*/
|
|
47
|
-
export
|
|
16
|
+
export interface HasVariadicTraits<TChild> {
|
|
17
|
+
readonly traits?: {
|
|
18
|
+
readonly [key: string]: TChild | TreeNodeSequence<TChild> | undefined;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
48
21
|
|
|
49
22
|
/**
|
|
50
23
|
* The type of a Change
|
|
@@ -68,6 +41,27 @@ export enum ChangeType {
|
|
|
68
41
|
*/
|
|
69
42
|
export type Change = Insert | Detach | Build | SetValue | Constraint;
|
|
70
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Node or a detached sequence of nodes (referred to by a detached sequence ID) for use in a Build change.
|
|
46
|
+
* See `BuildTreeNode` for more.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export type BuildNode = BuildTreeNode | number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Node for use in a Build change, which is composed of a definition describing what this nodes type, an identifier identifying this node
|
|
53
|
+
* within the tree, and a payload containing an opaque serializable piece of data.
|
|
54
|
+
* An identifier can be provided explicitly if the node must be referred to before the results of the `Change` containing this
|
|
55
|
+
* BuildTreeNode can be observed. If `identifier` is not supplied, one will be generated for it in an especially efficient manner
|
|
56
|
+
* that allows for compact storage and transmission and thus this property should be omitted if convenient.
|
|
57
|
+
* See the SharedTree readme for more on the tree format.
|
|
58
|
+
*/
|
|
59
|
+
export interface BuildTreeNode extends HasVariadicTraits<BuildNode> {
|
|
60
|
+
definition: string;
|
|
61
|
+
identifier?: NodeId;
|
|
62
|
+
payload?: Payload;
|
|
63
|
+
}
|
|
64
|
+
|
|
71
65
|
/**
|
|
72
66
|
* Constructs a sequence of nodes, associates it with the supplied ID, and stores it for use in later changes.
|
|
73
67
|
* Does not modify the document.
|
|
@@ -75,17 +69,11 @@ export type Change = Insert | Detach | Build | SetValue | Constraint;
|
|
|
75
69
|
* Valid if (transitively) all DetachedSequenceId are used according to their rules (use here counts as a destination),
|
|
76
70
|
* and all Nodes' identifiers are previously unused.
|
|
77
71
|
*
|
|
78
|
-
* TODO: Design Decision:
|
|
79
|
-
* If allowing 'moving from nowhere' to restore nodes: all new Nodes must have never before used identifiers.
|
|
80
|
-
* Otherwise could just forbid identifiers currently reachable?
|
|
81
|
-
* Could also allow introducing a node with a particular identifier to mean replacing that node with the new one
|
|
82
|
-
* (could include optional constraint to require/prevent this).
|
|
83
|
-
*
|
|
84
72
|
* @public
|
|
85
73
|
*/
|
|
86
74
|
export interface Build {
|
|
87
|
-
readonly destination:
|
|
88
|
-
readonly source: TreeNodeSequence<BuildNode>;
|
|
75
|
+
readonly destination: number;
|
|
76
|
+
readonly source: BuildNode | TreeNodeSequence<BuildNode>;
|
|
89
77
|
readonly type: typeof ChangeType.Build;
|
|
90
78
|
}
|
|
91
79
|
|
|
@@ -96,7 +84,7 @@ export interface Build {
|
|
|
96
84
|
*/
|
|
97
85
|
export interface Insert {
|
|
98
86
|
readonly destination: StablePlace;
|
|
99
|
-
readonly source:
|
|
87
|
+
readonly source: number;
|
|
100
88
|
readonly type: typeof ChangeType.Insert;
|
|
101
89
|
}
|
|
102
90
|
|
|
@@ -108,7 +96,7 @@ export interface Insert {
|
|
|
108
96
|
* @public
|
|
109
97
|
*/
|
|
110
98
|
export interface Detach {
|
|
111
|
-
readonly destination?:
|
|
99
|
+
readonly destination?: number;
|
|
112
100
|
readonly source: StableRange;
|
|
113
101
|
readonly type: typeof ChangeType.Detach;
|
|
114
102
|
}
|
|
@@ -125,6 +113,7 @@ export interface SetValue {
|
|
|
125
113
|
* SetValue may use `undefined` in future API versions to mean "don't change the payload" (which is useful if e.g. other
|
|
126
114
|
* fields are added to SetValue that can be changed without altering the payload)
|
|
127
115
|
*/
|
|
116
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
128
117
|
readonly payload: Payload | null;
|
|
129
118
|
readonly type: typeof ChangeType.SetValue;
|
|
130
119
|
}
|
|
@@ -191,47 +180,24 @@ export interface Constraint {
|
|
|
191
180
|
readonly type: typeof ChangeType.Constraint;
|
|
192
181
|
}
|
|
193
182
|
|
|
194
|
-
/**
|
|
195
|
-
* What to do when a Constraint is violated.
|
|
196
|
-
* @public
|
|
197
|
-
*/
|
|
198
|
-
export enum ConstraintEffect {
|
|
199
|
-
/**
|
|
200
|
-
* Discard Edit.
|
|
201
|
-
*/
|
|
202
|
-
InvalidAndDiscard,
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Discard Edit, but record metadata that application may want to try and recover this change by recreating it.
|
|
206
|
-
* Should this be the default policy for when another (non Constraint) change is invalid?
|
|
207
|
-
*/
|
|
208
|
-
InvalidRetry,
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Apply the change, but flag it for possible reconsideration by the app
|
|
212
|
-
* (applying it is better than not, but perhaps the high level logic could produce something better).
|
|
213
|
-
*/
|
|
214
|
-
ValidRetry,
|
|
215
|
-
}
|
|
216
|
-
|
|
217
183
|
// Note: Documentation of this constant is merged with documentation of the `Change` interface.
|
|
218
184
|
/**
|
|
219
185
|
* @public
|
|
220
186
|
*/
|
|
221
187
|
export const Change = {
|
|
222
|
-
build: (source: TreeNodeSequence<BuildNode>, destination:
|
|
188
|
+
build: (source: BuildNode | TreeNodeSequence<BuildNode>, destination: number): Build => ({
|
|
223
189
|
destination,
|
|
224
190
|
source,
|
|
225
191
|
type: ChangeType.Build,
|
|
226
192
|
}),
|
|
227
193
|
|
|
228
|
-
insert: (source:
|
|
194
|
+
insert: (source: number, destination: StablePlace): Insert => ({
|
|
229
195
|
destination,
|
|
230
196
|
source,
|
|
231
197
|
type: ChangeType.Insert,
|
|
232
198
|
}),
|
|
233
199
|
|
|
234
|
-
detach: (source: StableRange, destination?:
|
|
200
|
+
detach: (source: StableRange, destination?: number): Detach => ({
|
|
235
201
|
destination,
|
|
236
202
|
source,
|
|
237
203
|
type: ChangeType.Detach,
|
|
@@ -268,43 +234,27 @@ export const Change = {
|
|
|
268
234
|
label,
|
|
269
235
|
type: ChangeType.Constraint,
|
|
270
236
|
}),
|
|
271
|
-
};
|
|
272
237
|
|
|
273
|
-
/**
|
|
274
|
-
|
|
275
|
-
* @public
|
|
276
|
-
*/
|
|
277
|
-
export const Delete = {
|
|
238
|
+
/** Helpers for making high-level composite operations */
|
|
239
|
+
|
|
278
240
|
/**
|
|
279
|
-
* @returns a
|
|
241
|
+
* @returns a change that deletes the supplied part of the tree.
|
|
280
242
|
*/
|
|
281
|
-
|
|
282
|
-
};
|
|
243
|
+
delete: (stableRange: StableRange): Change => Change.detach(stableRange),
|
|
283
244
|
|
|
284
|
-
/**
|
|
285
|
-
* Helper for creating an `Insert` edit.
|
|
286
|
-
* @public
|
|
287
|
-
*/
|
|
288
|
-
export const Insert = {
|
|
289
245
|
/**
|
|
290
|
-
* @returns
|
|
246
|
+
* @returns changes that insert 'nodes' into the specified location in the tree.
|
|
291
247
|
*/
|
|
292
|
-
|
|
293
|
-
const build = Change.build(nodes, 0
|
|
248
|
+
insertTree: (nodes: BuildNode | TreeNodeSequence<BuildNode>, destination: StablePlace): Change[] => {
|
|
249
|
+
const build = Change.build(nodes, 0);
|
|
294
250
|
return [build, Change.insert(build.destination, destination)];
|
|
295
251
|
},
|
|
296
|
-
};
|
|
297
252
|
|
|
298
|
-
/**
|
|
299
|
-
* Helper for creating a `Move` edit.
|
|
300
|
-
* @public
|
|
301
|
-
*/
|
|
302
|
-
export const Move = {
|
|
303
253
|
/**
|
|
304
|
-
* @returns
|
|
254
|
+
* @returns changes that moves the specified content to a new location in the tree.
|
|
305
255
|
*/
|
|
306
|
-
|
|
307
|
-
const detach = Change.detach(source, 0
|
|
256
|
+
move: (source: StableRange, destination: StablePlace): Change[] => {
|
|
257
|
+
const detach = Change.detach(source, 0);
|
|
308
258
|
return [detach, Change.insert(assertNotUndefined(detach.destination), destination)];
|
|
309
259
|
},
|
|
310
260
|
};
|
|
@@ -317,8 +267,10 @@ export const Move = {
|
|
|
317
267
|
* To be well formed, either `sibling` or `trait` must be defined, but not both.
|
|
318
268
|
*
|
|
319
269
|
* Any given insertion location can be described by two `StablePlace` objects, one with `Side.After` and one with `Side.Before`.
|
|
320
|
-
* For example, in a trait containing two strings "foo" and "bar", there are 6
|
|
321
|
-
* could be inserted: at the start, before "foo", after "foo", before "bar", after "bar", and at the end.
|
|
270
|
+
* For example, in a trait containing two strings "foo" and "bar", there are 6 different `StablePlace`s corresponding to 3 locations in the
|
|
271
|
+
* trait a new node could be inserted: at the start, before "foo", after "foo", before "bar", after "bar", and at the end.
|
|
272
|
+
* Neither of the two ways to specify the same location are considered to be after each other.
|
|
273
|
+
*
|
|
322
274
|
* The anchor (`referenceSibling` or `referenceTrait`) used for a particular `StablePlace` can have an impact in collaborative scenarios.
|
|
323
275
|
*
|
|
324
276
|
* `StablePlace` objects can be conveniently constructed with the helper methods exported on a constant of the same name.
|
|
@@ -352,6 +304,8 @@ export interface StablePlace {
|
|
|
352
304
|
* Specifies the range of nodes from `start` to `end` within a trait.
|
|
353
305
|
* Valid iff start and end are valid and are within the same trait and the start does not occur after the end in the trait.
|
|
354
306
|
*
|
|
307
|
+
* See {@link (StablePlace:interface)} for what it means for a place to be "after" another place.
|
|
308
|
+
*
|
|
355
309
|
* `StableRange` objects can be conveniently constructed with the helper methods exported on a constant of the same name.
|
|
356
310
|
* @example
|
|
357
311
|
* StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode))
|
|
@@ -378,14 +332,14 @@ export const StablePlace = {
|
|
|
378
332
|
/**
|
|
379
333
|
* @returns The location directly before `node`.
|
|
380
334
|
*/
|
|
381
|
-
before: (node: NodeData | NodeId): StablePlace => ({
|
|
335
|
+
before: (node: NodeData<NodeId> | NodeId): StablePlace => ({
|
|
382
336
|
side: Side.Before,
|
|
383
337
|
referenceSibling: getNodeId(node),
|
|
384
338
|
}),
|
|
385
339
|
/**
|
|
386
340
|
* @returns The location directly after `node`.
|
|
387
341
|
*/
|
|
388
|
-
after: (node: NodeData | NodeId): StablePlace => ({ side: Side.After, referenceSibling: getNodeId(node) }),
|
|
342
|
+
after: (node: NodeData<NodeId> | NodeId): StablePlace => ({ side: Side.After, referenceSibling: getNodeId(node) }),
|
|
389
343
|
/**
|
|
390
344
|
* @returns The location at the start of `trait`.
|
|
391
345
|
*/
|
|
@@ -420,7 +374,10 @@ export const StableRange = {
|
|
|
420
374
|
* @returns a `StableRange` which contains only the provided `node`.
|
|
421
375
|
* Both the start and end `StablePlace` objects used to anchor this `StableRange` are in terms of the passed in node.
|
|
422
376
|
*/
|
|
423
|
-
only: (node: NodeData | NodeId): StableRange => ({
|
|
377
|
+
only: (node: NodeData<NodeId> | NodeId): StableRange => ({
|
|
378
|
+
start: StablePlace.before(node),
|
|
379
|
+
end: StablePlace.after(node),
|
|
380
|
+
}),
|
|
424
381
|
/**
|
|
425
382
|
* @returns a `StableRange` which contains everything in the trait.
|
|
426
383
|
* This is anchored using the provided `trait`, and is independent of the actual contents of the trait:
|
|
@@ -431,23 +388,3 @@ export const StableRange = {
|
|
|
431
388
|
end: StablePlace.atEndOf(trait),
|
|
432
389
|
}),
|
|
433
390
|
};
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* @returns True iff the given `node` is of type NodeData.
|
|
437
|
-
* @internal
|
|
438
|
-
*/
|
|
439
|
-
export function isNodeData(node: NodeData | NodeId): node is NodeData {
|
|
440
|
-
return (node as NodeData).definition !== undefined && (node as NodeData).identifier !== undefined;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* @returns The NodeId for a given node or its id.
|
|
445
|
-
* @internal
|
|
446
|
-
*/
|
|
447
|
-
export function getNodeId(node: NodeData | NodeId): NodeId {
|
|
448
|
-
if (isNodeData(node)) {
|
|
449
|
-
return node.identifier;
|
|
450
|
-
} else {
|
|
451
|
-
return node;
|
|
452
|
-
}
|
|
453
|
-
}
|