@fluidframework/sequence 2.0.0-rc.1.0.4 → 2.0.0-rc.2.0.0
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/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor.json +1 -1
- package/api-report/sequence.api.md +15 -27
- package/dist/defaultMap.d.ts +10 -16
- package/dist/defaultMap.d.ts.map +1 -1
- package/dist/defaultMap.js +73 -70
- package/dist/defaultMap.js.map +1 -1
- package/dist/defaultMapInterfaces.d.ts +1 -8
- package/dist/defaultMapInterfaces.d.ts.map +1 -1
- package/dist/defaultMapInterfaces.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +21 -15
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +59 -110
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.d.ts +3 -3
- package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.js +8 -8
- package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/dist/intervalIndex/endpointIndex.d.ts +3 -3
- package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
- package/dist/intervalIndex/endpointIndex.js +4 -4
- package/dist/intervalIndex/endpointIndex.js.map +1 -1
- package/dist/intervalIndex/idIntervalIndex.d.ts +2 -2
- package/dist/intervalIndex/idIntervalIndex.d.ts.map +1 -1
- package/dist/intervalIndex/idIntervalIndex.js +2 -2
- package/dist/intervalIndex/idIntervalIndex.js.map +1 -1
- package/dist/intervalIndex/index.d.ts +8 -8
- package/dist/intervalIndex/index.d.ts.map +1 -1
- package/dist/intervalIndex/index.js +16 -16
- package/dist/intervalIndex/index.js.map +1 -1
- package/dist/intervalIndex/intervalIndex.d.ts +1 -1
- package/dist/intervalIndex/intervalIndex.d.ts.map +1 -1
- package/dist/intervalIndex/intervalIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +7 -10
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.js +12 -13
- package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +2 -2
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +7 -7
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -2
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.d.ts +3 -3
- package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.js +8 -8
- package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/dist/intervalTree.d.ts +1 -1
- package/dist/intervalTree.d.ts.map +1 -1
- package/dist/intervalTree.js.map +1 -1
- package/dist/intervals/index.d.ts +3 -3
- package/dist/intervals/index.d.ts.map +1 -1
- package/dist/intervals/index.js +16 -16
- package/dist/intervals/index.js.map +1 -1
- package/dist/intervals/interval.d.ts +2 -2
- package/dist/intervals/interval.d.ts.map +1 -1
- package/dist/intervals/interval.js +2 -2
- package/dist/intervals/interval.js.map +1 -1
- package/dist/intervals/intervalUtils.d.ts +3 -3
- package/dist/intervals/intervalUtils.d.ts.map +1 -1
- package/dist/intervals/intervalUtils.js +1 -1
- package/dist/intervals/intervalUtils.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +2 -2
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/intervals/sequenceInterval.js +22 -23
- package/dist/intervals/sequenceInterval.js.map +1 -1
- package/dist/localValues.d.ts +2 -2
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/revertibles.d.ts +12 -12
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +26 -26
- package/dist/revertibles.js.map +1 -1
- package/dist/sequence-alpha.d.ts +172 -13
- package/dist/sequence-beta.d.ts +2 -0
- package/dist/sequence-public.d.ts +2 -0
- package/dist/sequence-untrimmed.d.ts +73 -14
- package/dist/sequence.d.ts +48 -5
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +103 -29
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceFactory.d.ts +4 -1
- package/dist/sequenceFactory.d.ts.map +1 -1
- package/dist/sequenceFactory.js +8 -5
- package/dist/sequenceFactory.js.map +1 -1
- package/dist/sharedIntervalCollection.d.ts +2 -2
- package/dist/sharedIntervalCollection.d.ts.map +1 -1
- package/dist/sharedIntervalCollection.js +5 -5
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sharedSequence.d.ts +1 -1
- package/dist/sharedSequence.d.ts.map +1 -1
- package/dist/sharedSequence.js +2 -2
- package/dist/sharedSequence.js.map +1 -1
- package/dist/sharedString.d.ts +2 -2
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js +6 -6
- package/dist/sharedString.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{defaultMap.d.mts → defaultMap.d.ts} +11 -17
- package/lib/defaultMap.d.ts.map +1 -0
- package/lib/{defaultMap.mjs → defaultMap.js} +72 -69
- package/lib/defaultMap.js.map +1 -0
- package/lib/{defaultMapInterfaces.d.mts → defaultMapInterfaces.d.ts} +2 -9
- package/lib/defaultMapInterfaces.d.ts.map +1 -0
- package/lib/{defaultMapInterfaces.mjs → defaultMapInterfaces.js} +1 -1
- package/lib/defaultMapInterfaces.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +24 -12
- package/lib/index.d.ts.map +1 -0
- package/lib/{index.mjs → index.js} +11 -11
- package/lib/index.js.map +1 -0
- package/lib/{intervalCollection.d.mts → intervalCollection.d.ts} +22 -16
- package/lib/intervalCollection.d.ts.map +1 -0
- package/lib/{intervalCollection.mjs → intervalCollection.js} +23 -74
- package/lib/intervalCollection.js.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.d.mts → endpointInRangeIndex.d.ts} +4 -4
- package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.mjs → endpointInRangeIndex.js} +3 -3
- package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -0
- package/lib/intervalIndex/{endpointIndex.d.mts → endpointIndex.d.ts} +4 -4
- package/lib/intervalIndex/endpointIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{endpointIndex.mjs → endpointIndex.js} +2 -2
- package/lib/intervalIndex/endpointIndex.js.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.d.mts → idIntervalIndex.d.ts} +3 -3
- package/lib/intervalIndex/idIntervalIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.mjs → idIntervalIndex.js} +2 -2
- package/lib/intervalIndex/idIntervalIndex.js.map +1 -0
- package/lib/intervalIndex/{index.d.mts → index.d.ts} +9 -9
- package/lib/intervalIndex/index.d.ts.map +1 -0
- package/lib/intervalIndex/{index.mjs → index.js} +7 -7
- package/lib/intervalIndex/index.js.map +1 -0
- package/lib/intervalIndex/{intervalIndex.d.mts → intervalIndex.d.ts} +2 -2
- package/lib/intervalIndex/intervalIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{intervalIndex.mjs → intervalIndex.js} +1 -1
- package/lib/intervalIndex/intervalIndex.js.map +1 -0
- package/lib/intervalIndex/{intervalIndexUtils.d.mts → intervalIndexUtils.d.ts} +1 -1
- package/lib/intervalIndex/intervalIndexUtils.d.ts.map +1 -0
- package/lib/intervalIndex/{intervalIndexUtils.mjs → intervalIndexUtils.js} +1 -1
- package/lib/intervalIndex/intervalIndexUtils.js.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.d.mts → overlappingIntervalsIndex.d.ts} +8 -11
- package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.mjs → overlappingIntervalsIndex.js} +8 -9
- package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.mts → overlappingSequenceIntervalsIndex.d.ts} +3 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.mjs → overlappingSequenceIntervalsIndex.js} +3 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.d.mts → sequenceIntervalIndexes.d.ts} +3 -3
- package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.mjs → sequenceIntervalIndexes.js} +1 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.d.mts → startpointInRangeIndex.d.ts} +4 -4
- package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.mjs → startpointInRangeIndex.js} +3 -3
- package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -0
- package/lib/{intervalTree.d.mts → intervalTree.d.ts} +2 -2
- package/lib/intervalTree.d.ts.map +1 -0
- package/lib/{intervalTree.mjs → intervalTree.js} +1 -1
- package/lib/intervalTree.js.map +1 -0
- package/lib/intervals/{index.d.mts → index.d.ts} +4 -4
- package/lib/intervals/index.d.ts.map +1 -0
- package/lib/intervals/{index.mjs → index.js} +4 -4
- package/lib/intervals/index.js.map +1 -0
- package/lib/intervals/{interval.d.mts → interval.d.ts} +3 -3
- package/lib/intervals/{interval.d.mts.map → interval.d.ts.map} +1 -1
- package/lib/intervals/{interval.mjs → interval.js} +2 -2
- package/lib/intervals/interval.js.map +1 -0
- package/lib/intervals/{intervalUtils.d.mts → intervalUtils.d.ts} +4 -4
- package/lib/intervals/intervalUtils.d.ts.map +1 -0
- package/lib/intervals/{intervalUtils.mjs → intervalUtils.js} +3 -2
- package/lib/intervals/intervalUtils.js.map +1 -0
- package/lib/intervals/{sequenceInterval.d.mts → sequenceInterval.d.ts} +3 -3
- package/lib/intervals/sequenceInterval.d.ts.map +1 -0
- package/lib/intervals/{sequenceInterval.mjs → sequenceInterval.js} +5 -4
- package/lib/intervals/{sequenceInterval.mjs.map → sequenceInterval.js.map} +1 -1
- package/lib/{localValues.d.mts → localValues.d.ts} +3 -3
- package/lib/{localValues.d.mts.map → localValues.d.ts.map} +1 -1
- package/lib/{localValues.mjs → localValues.js} +1 -1
- package/lib/localValues.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{revertibles.d.mts → revertibles.d.ts} +13 -13
- package/lib/revertibles.d.ts.map +1 -0
- package/lib/{revertibles.mjs → revertibles.js} +11 -10
- package/lib/revertibles.js.map +1 -0
- package/lib/{sequence-alpha.d.mts → sequence-alpha.d.ts} +185 -13
- package/lib/{sequence-public.d.mts → sequence-beta.d.ts} +15 -0
- package/lib/{sequence-beta.d.mts → sequence-public.d.ts} +15 -0
- package/lib/{sequence-untrimmed.d.mts → sequence-untrimmed.d.ts} +86 -14
- package/lib/{sequence.d.mts → sequence.d.ts} +49 -6
- package/lib/sequence.d.ts.map +1 -0
- package/lib/{sequence.mjs → sequence.js} +100 -29
- package/lib/sequence.js.map +1 -0
- package/lib/{sequenceDeltaEvent.d.mts → sequenceDeltaEvent.d.ts} +1 -1
- package/lib/sequenceDeltaEvent.d.ts.map +1 -0
- package/lib/{sequenceDeltaEvent.mjs → sequenceDeltaEvent.js} +1 -1
- package/lib/sequenceDeltaEvent.js.map +1 -0
- package/lib/{sequenceFactory.d.mts → sequenceFactory.d.ts} +5 -2
- package/lib/sequenceFactory.d.ts.map +1 -0
- package/lib/{sequenceFactory.mjs → sequenceFactory.js} +6 -3
- package/lib/sequenceFactory.js.map +1 -0
- package/lib/{sharedIntervalCollection.d.mts → sharedIntervalCollection.d.ts} +3 -3
- package/lib/sharedIntervalCollection.d.ts.map +1 -0
- package/lib/{sharedIntervalCollection.mjs → sharedIntervalCollection.js} +4 -4
- package/lib/sharedIntervalCollection.js.map +1 -0
- package/lib/{sharedSequence.d.mts → sharedSequence.d.ts} +2 -2
- package/lib/sharedSequence.d.ts.map +1 -0
- package/lib/{sharedSequence.mjs → sharedSequence.js} +2 -2
- package/lib/sharedSequence.js.map +1 -0
- package/lib/{sharedString.d.mts → sharedString.d.ts} +3 -3
- package/lib/sharedString.d.ts.map +1 -0
- package/lib/{sharedString.mjs → sharedString.js} +3 -3
- package/lib/sharedString.js.map +1 -0
- package/lib/test/collections.intervalTree.js +73 -0
- package/lib/test/collections.intervalTree.js.map +1 -0
- package/lib/test/createSnapshotFiles.js +15 -0
- package/lib/test/createSnapshotFiles.js.map +1 -0
- package/lib/test/dirname.cjs +16 -0
- package/lib/test/dirname.cjs.map +1 -0
- package/lib/test/endpointInRangeIndex.spec.js +182 -0
- package/lib/test/endpointInRangeIndex.spec.js.map +1 -0
- package/lib/test/fuzz/fuzzUtils.js +250 -0
- package/lib/test/fuzz/fuzzUtils.js.map +1 -0
- package/lib/test/fuzz/intervalCollection.fuzz.spec.js +200 -0
- package/lib/test/fuzz/intervalCollection.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js +129 -0
- package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/sharedString.fuzz.spec.js +91 -0
- package/lib/test/fuzz/sharedString.fuzz.spec.js.map +1 -0
- package/lib/test/generateSharedStrings.js +138 -0
- package/lib/test/generateSharedStrings.js.map +1 -0
- package/lib/test/intervalCollection.detached.spec.js +126 -0
- package/lib/test/intervalCollection.detached.spec.js.map +1 -0
- package/lib/test/intervalCollection.events.spec.js +491 -0
- package/lib/test/intervalCollection.events.spec.js.map +1 -0
- package/lib/test/intervalCollection.perf.spec.js +88 -0
- package/lib/test/intervalCollection.perf.spec.js.map +1 -0
- package/lib/test/intervalCollection.snapshot.spec.js +171 -0
- package/lib/test/intervalCollection.snapshot.spec.js.map +1 -0
- package/lib/test/intervalCollection.spec.js +1660 -0
- package/lib/test/intervalCollection.spec.js.map +1 -0
- package/lib/test/intervalIndexTestUtils.js +49 -0
- package/lib/test/intervalIndexTestUtils.js.map +1 -0
- package/lib/test/intervalRebasing.spec.js +589 -0
- package/lib/test/intervalRebasing.spec.js.map +1 -0
- package/lib/test/intervalStashedOps.spec.js +142 -0
- package/lib/test/intervalStashedOps.spec.js.map +1 -0
- package/lib/test/intervalTestUtils.js +81 -0
- package/lib/test/intervalTestUtils.js.map +1 -0
- package/lib/test/marshalling.spec.js +55 -0
- package/lib/test/marshalling.spec.js.map +1 -0
- package/lib/test/memory/sharedSequence.spec.js +82 -0
- package/lib/test/memory/sharedSequence.spec.js.map +1 -0
- package/lib/test/memory/sharedString.spec.js +134 -0
- package/lib/test/memory/sharedString.spec.js.map +1 -0
- package/lib/test/overlappingSequenceIntervalsIndex.spec.js +348 -0
- package/lib/test/overlappingSequenceIntervalsIndex.spec.js.map +1 -0
- package/lib/test/partialLoad.spec.js +211 -0
- package/lib/test/partialLoad.spec.js.map +1 -0
- package/lib/test/rebasing.spec.js +81 -0
- package/lib/test/rebasing.spec.js.map +1 -0
- package/lib/test/reentrancy.spec.js +174 -0
- package/lib/test/reentrancy.spec.js.map +1 -0
- package/lib/test/revertibles.spec.js +971 -0
- package/lib/test/revertibles.spec.js.map +1 -0
- package/lib/test/sequenceDeltaEvent.spec.js +2144 -0
- package/lib/test/sequenceDeltaEvent.spec.js.map +1 -0
- package/lib/test/sharedIntervalCollection.spec.js +159 -0
- package/lib/test/sharedIntervalCollection.spec.js.map +1 -0
- package/lib/test/sharedString.spec.js +532 -0
- package/lib/test/sharedString.spec.js.map +1 -0
- package/lib/test/snapshotEmptyProps.spec.js +45 -0
- package/lib/test/snapshotEmptyProps.spec.js.map +1 -0
- package/lib/test/snapshotVersion.spec.js +149 -0
- package/lib/test/snapshotVersion.spec.js.map +1 -0
- package/lib/test/startpointInRangeIndex.spec.js +182 -0
- package/lib/test/startpointInRangeIndex.spec.js.map +1 -0
- package/lib/test/subSequence.spec.js +92 -0
- package/lib/test/subSequence.spec.js.map +1 -0
- package/lib/test/types/validateSequencePrevious.generated.js +162 -0
- package/lib/test/types/validateSequencePrevious.generated.js.map +1 -0
- package/lib/test/v1IntervalCollectionHelpers.js +93 -0
- package/lib/test/v1IntervalCollectionHelpers.js.map +1 -0
- package/package.json +66 -60
- package/src/defaultMap.ts +97 -123
- package/src/defaultMapInterfaces.ts +1 -9
- package/src/index.ts +15 -11
- package/src/intervalCollection.ts +57 -84
- package/src/intervalIndex/endpointInRangeIndex.ts +4 -4
- package/src/intervalIndex/endpointIndex.ts +3 -3
- package/src/intervalIndex/idIntervalIndex.ts +3 -4
- package/src/intervalIndex/index.ts +8 -8
- package/src/intervalIndex/intervalIndex.ts +1 -1
- package/src/intervalIndex/overlappingIntervalsIndex.ts +10 -11
- package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +4 -4
- package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -2
- package/src/intervalIndex/startpointInRangeIndex.ts +4 -4
- package/src/intervalTree.ts +1 -1
- package/src/intervals/index.ts +3 -3
- package/src/intervals/interval.ts +2 -4
- package/src/intervals/intervalUtils.ts +3 -3
- package/src/intervals/sequenceInterval.ts +3 -4
- package/src/localValues.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/revertibles.ts +13 -13
- package/src/sequence.ts +126 -44
- package/src/sequenceFactory.ts +5 -2
- package/src/sharedIntervalCollection.ts +5 -5
- package/src/sharedSequence.ts +1 -1
- package/src/sharedString.ts +2 -2
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/defaultMap.d.mts.map +0 -1
- package/lib/defaultMap.mjs.map +0 -1
- package/lib/defaultMapInterfaces.d.mts.map +0 -1
- package/lib/defaultMapInterfaces.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/intervalCollection.d.mts.map +0 -1
- package/lib/intervalCollection.mjs.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.mjs.map +0 -1
- package/lib/intervalIndex/endpointIndex.d.mts.map +0 -1
- package/lib/intervalIndex/endpointIndex.mjs.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.d.mts.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.mjs.map +0 -1
- package/lib/intervalIndex/index.d.mts.map +0 -1
- package/lib/intervalIndex/index.mjs.map +0 -1
- package/lib/intervalIndex/intervalIndex.d.mts.map +0 -1
- package/lib/intervalIndex/intervalIndex.mjs.map +0 -1
- package/lib/intervalIndex/intervalIndexUtils.d.mts.map +0 -1
- package/lib/intervalIndex/intervalIndexUtils.mjs.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.mjs.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.mjs.map +0 -1
- package/lib/intervalTree.d.mts.map +0 -1
- package/lib/intervalTree.mjs.map +0 -1
- package/lib/intervals/index.d.mts.map +0 -1
- package/lib/intervals/index.mjs.map +0 -1
- package/lib/intervals/interval.mjs.map +0 -1
- package/lib/intervals/intervalUtils.d.mts.map +0 -1
- package/lib/intervals/intervalUtils.mjs.map +0 -1
- package/lib/intervals/sequenceInterval.d.mts.map +0 -1
- package/lib/localValues.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/revertibles.d.mts.map +0 -1
- package/lib/revertibles.mjs.map +0 -1
- package/lib/sequence.d.mts.map +0 -1
- package/lib/sequence.mjs.map +0 -1
- package/lib/sequenceDeltaEvent.d.mts.map +0 -1
- package/lib/sequenceDeltaEvent.mjs.map +0 -1
- package/lib/sequenceFactory.d.mts.map +0 -1
- package/lib/sequenceFactory.mjs.map +0 -1
- package/lib/sharedIntervalCollection.d.mts.map +0 -1
- package/lib/sharedIntervalCollection.mjs.map +0 -1
- package/lib/sharedSequence.d.mts.map +0 -1
- package/lib/sharedSequence.mjs.map +0 -1
- package/lib/sharedString.d.mts.map +0 -1
- package/lib/sharedString.mjs.map +0 -1
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
extends: [
|
|
7
|
+
extends: [
|
|
8
|
+
require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"),
|
|
9
|
+
"prettier",
|
|
10
|
+
],
|
|
8
11
|
parserOptions: {
|
|
9
12
|
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
13
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require("@
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/sequence
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- container-definitions: ILoaderOptions no longer accepts arbitrary key/value pairs ([#19306](https://github.com/microsoft/FluidFramework/issues/19306)) [741926e225](https://github.com/microsoft/FluidFramework/commits/741926e2253a161504ecc6a6451d8f15d7ac4ed6)
|
|
8
|
+
|
|
9
|
+
ILoaderOptions has been narrowed to the specific set of supported loader options, and may no longer be used to pass arbitrary key/value pairs through to the runtime.
|
|
10
|
+
|
|
3
11
|
## 2.0.0-rc.1.0.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -595,8 +595,8 @@ There are plans to make attribution policies more flexible, for example tracking
|
|
|
595
595
|
- [smde](https://github.com/microsoft/FluidFramework/tree/main/examples/data-objects/smde)
|
|
596
596
|
|
|
597
597
|
- Plain Text Editor Implementations
|
|
598
|
-
- [collaborativeTextArea](https://github.com/microsoft/FluidFramework/blob/main/
|
|
599
|
-
- [collaborativeInput](https://github.com/microsoft/FluidFramework/blob/main/
|
|
598
|
+
- [collaborativeTextArea](https://github.com/microsoft/FluidFramework/blob/main/examples/utils/example-utils/src/reactInputs/CollaborativeTextArea.tsx)
|
|
599
|
+
- [collaborativeInput](https://github.com/microsoft/FluidFramework/blob/main/examples/utils/example-utils/src/reactInputs/CollaborativeInput.tsx)
|
|
600
600
|
|
|
601
601
|
<!-- This line ends the content that is copied to the string.md README -->
|
|
602
602
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
|
|
4
|
+
// CJS is actually secondary; so, no report.
|
|
5
|
+
"apiReport": {
|
|
6
|
+
"enabled": false
|
|
7
|
+
}
|
|
4
8
|
}
|
package/api-extractor.json
CHANGED
|
@@ -50,19 +50,19 @@ import { TextSegment } from '@fluidframework/merge-tree';
|
|
|
50
50
|
import { TrackingGroup } from '@fluidframework/merge-tree';
|
|
51
51
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
52
52
|
|
|
53
|
-
// @
|
|
53
|
+
// @alpha
|
|
54
54
|
export function appendAddIntervalToRevertibles(interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
55
55
|
|
|
56
|
-
// @
|
|
56
|
+
// @alpha
|
|
57
57
|
export function appendChangeIntervalToRevertibles(string: SharedString, newInterval: SequenceInterval, previousInterval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
58
58
|
|
|
59
|
-
// @
|
|
59
|
+
// @alpha
|
|
60
60
|
export function appendDeleteIntervalToRevertibles(string: SharedString, interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
61
61
|
|
|
62
|
-
// @
|
|
62
|
+
// @alpha
|
|
63
63
|
export function appendIntervalPropertyChangedToRevertibles(interval: SequenceInterval, deltas: PropertySet, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
|
|
64
64
|
|
|
65
|
-
// @
|
|
65
|
+
// @alpha
|
|
66
66
|
export function appendSharedStringDeltaToRevertibles(string: SharedString, delta: SequenceDeltaEvent, revertibles: SharedStringRevertible[]): void;
|
|
67
67
|
|
|
68
68
|
export { BaseSegment }
|
|
@@ -76,7 +76,7 @@ export function createEndpointInRangeIndex(sharedString: SharedString): IEndpoin
|
|
|
76
76
|
// @internal (undocumented)
|
|
77
77
|
export function createIdIntervalIndex<TInterval extends ISerializableInterval>(): IIdIntervalIndex<TInterval>;
|
|
78
78
|
|
|
79
|
-
// @
|
|
79
|
+
// @alpha (undocumented)
|
|
80
80
|
export function createOverlappingIntervalsIndex(sharedString: SharedString): IOverlappingIntervalsIndex<SequenceInterval>;
|
|
81
81
|
|
|
82
82
|
// @internal (undocumented)
|
|
@@ -88,7 +88,7 @@ export function createStartpointInRangeIndex(sharedString: SharedString): IStart
|
|
|
88
88
|
// @alpha (undocumented)
|
|
89
89
|
export type DeserializeCallback = (properties: PropertySet) => void;
|
|
90
90
|
|
|
91
|
-
// @
|
|
91
|
+
// @alpha
|
|
92
92
|
export function discardSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
|
|
93
93
|
|
|
94
94
|
// @internal
|
|
@@ -178,6 +178,7 @@ export interface IIntervalCollectionEvent<TInterval extends ISerializableInterva
|
|
|
178
178
|
(event: "changeInterval", listener: (interval: TInterval, previousInterval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined, slide: boolean) => void): void;
|
|
179
179
|
(event: "addInterval" | "deleteInterval", listener: (interval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined) => void): void;
|
|
180
180
|
(event: "propertyChanged", listener: (interval: TInterval, propertyDeltas: PropertySet, local: boolean, op: ISequencedDocumentMessage | undefined) => void): void;
|
|
181
|
+
(event: "changed", listener: (interval: TInterval, propertyDeltas: PropertySet, previousInterval: TInterval | undefined, local: boolean, slide: boolean) => void): void;
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
// @internal @sealed @deprecated (undocumented)
|
|
@@ -254,7 +255,7 @@ export interface IntervalLocator {
|
|
|
254
255
|
// @internal
|
|
255
256
|
export function intervalLocatorFromEndpoint(potentialEndpoint: LocalReferencePosition): IntervalLocator | undefined;
|
|
256
257
|
|
|
257
|
-
// @
|
|
258
|
+
// @alpha
|
|
258
259
|
export const IntervalOpType: {
|
|
259
260
|
readonly PROPERTY_CHANGED: "propertyChanged";
|
|
260
261
|
readonly POSITION_REMOVE: "positionRemove";
|
|
@@ -263,10 +264,10 @@ export const IntervalOpType: {
|
|
|
263
264
|
readonly CHANGE: "change";
|
|
264
265
|
};
|
|
265
266
|
|
|
266
|
-
// @
|
|
267
|
+
// @alpha (undocumented)
|
|
267
268
|
export type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];
|
|
268
269
|
|
|
269
|
-
// @
|
|
270
|
+
// @alpha
|
|
270
271
|
export type IntervalRevertible = {
|
|
271
272
|
event: typeof IntervalOpType.CHANGE;
|
|
272
273
|
interval: SequenceInterval;
|
|
@@ -320,7 +321,7 @@ export enum IntervalType {
|
|
|
320
321
|
Transient = 4
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
// @
|
|
324
|
+
// @alpha (undocumented)
|
|
324
325
|
export interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
|
|
325
326
|
// (undocumented)
|
|
326
327
|
findOverlappingIntervals(start: SequencePlace, end: SequencePlace): TInterval[];
|
|
@@ -418,7 +419,7 @@ export { reservedRangeLabelsKey }
|
|
|
418
419
|
|
|
419
420
|
export { reservedTileLabelsKey }
|
|
420
421
|
|
|
421
|
-
// @
|
|
422
|
+
// @alpha
|
|
422
423
|
export function revertSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
|
|
423
424
|
|
|
424
425
|
// @alpha
|
|
@@ -529,7 +530,6 @@ export class SharedIntervalCollection extends SharedObject implements ISharedInt
|
|
|
529
530
|
// (undocumented)
|
|
530
531
|
getIntervalCollection(label: string): IIntervalCollection<Interval>;
|
|
531
532
|
protected getIntervalCollectionPath(label: string): string;
|
|
532
|
-
// (undocumented)
|
|
533
533
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
534
534
|
// (undocumented)
|
|
535
535
|
protected onDisconnect(): void;
|
|
@@ -549,7 +549,6 @@ export class SharedIntervalCollectionFactory implements IChannelFactory {
|
|
|
549
549
|
get attributes(): IChannelAttributes;
|
|
550
550
|
// (undocumented)
|
|
551
551
|
create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection;
|
|
552
|
-
// (undocumented)
|
|
553
552
|
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedIntervalCollection>;
|
|
554
553
|
// (undocumented)
|
|
555
554
|
static readonly Type = "https://graph.microsoft.com/types/sharedIntervalCollection";
|
|
@@ -561,12 +560,10 @@ export class SharedIntervalCollectionFactory implements IChannelFactory {
|
|
|
561
560
|
export abstract class SharedSegmentSequence<T extends ISegment> extends SharedObject<ISharedSegmentSequenceEvents> implements ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
|
|
562
561
|
constructor(dataStoreRuntime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, segmentFromSpec: (spec: IJSONSegment) => ISegment);
|
|
563
562
|
annotateRange(start: number, end: number, props: PropertySet): void;
|
|
564
|
-
|
|
565
|
-
protected applyStashedOp(content: any): unknown;
|
|
563
|
+
protected applyStashedOp(content: any): void;
|
|
566
564
|
// (undocumented)
|
|
567
565
|
protected client: Client;
|
|
568
566
|
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
569
|
-
// (undocumented)
|
|
570
567
|
protected didAttach(): void;
|
|
571
568
|
getContainingSegment(pos: number): {
|
|
572
569
|
segment: T | undefined;
|
|
@@ -591,23 +588,18 @@ export abstract class SharedSegmentSequence<T extends ISegment> extends SharedOb
|
|
|
591
588
|
protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
|
|
592
589
|
// (undocumented)
|
|
593
590
|
id: string;
|
|
594
|
-
// (undocumented)
|
|
595
591
|
protected initializeLocalCore(): void;
|
|
596
592
|
insertAtReferencePosition(pos: ReferencePosition, segment: T): void;
|
|
597
593
|
insertFromSpec(pos: number, spec: IJSONSegment): void;
|
|
598
|
-
// (undocumented)
|
|
599
594
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
600
595
|
// (undocumented)
|
|
601
596
|
get loaded(): Promise<void>;
|
|
602
597
|
protected loadedDeferred: Deferred<void>;
|
|
603
598
|
localReferencePositionToPosition(lref: ReferencePosition): number;
|
|
604
599
|
obliterateRange(start: number, end: number): void;
|
|
605
|
-
// (undocumented)
|
|
606
600
|
protected onConnect(): void;
|
|
607
|
-
// (undocumented)
|
|
608
601
|
protected onDisconnect(): void;
|
|
609
602
|
posFromRelativePos(relativePos: IRelativePosition): number;
|
|
610
|
-
// (undocumented)
|
|
611
603
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
612
604
|
protected processGCDataCore(serializer: IFluidSerializer): void;
|
|
613
605
|
removeLocalReferencePosition(lref: LocalReferencePosition): LocalReferencePosition | undefined;
|
|
@@ -615,11 +607,9 @@ export abstract class SharedSegmentSequence<T extends ISegment> extends SharedOb
|
|
|
615
607
|
removeRange(start: number, end: number): void;
|
|
616
608
|
protected replaceRange(start: number, end: number, segment: ISegment): void;
|
|
617
609
|
resolveRemoteClientPosition(remoteClientPosition: number, remoteClientRefSeq: number, remoteClientId: string): number | undefined;
|
|
618
|
-
// (undocumented)
|
|
619
610
|
protected reSubmitCore(content: any, localOpMetadata: unknown): void;
|
|
620
611
|
// (undocumented)
|
|
621
612
|
readonly segmentFromSpec: (spec: IJSONSegment) => ISegment;
|
|
622
|
-
// (undocumented)
|
|
623
613
|
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
624
614
|
walkSegments<TClientData>(handler: ISegmentAction<TClientData>, start?: number, end?: number, accum?: TClientData, splitRange?: boolean): void;
|
|
625
615
|
}
|
|
@@ -668,9 +658,7 @@ export class SharedStringFactory implements IChannelFactory {
|
|
|
668
658
|
static readonly Attributes: IChannelAttributes;
|
|
669
659
|
// (undocumented)
|
|
670
660
|
get attributes(): IChannelAttributes;
|
|
671
|
-
// (undocumented)
|
|
672
661
|
create(document: IFluidDataStoreRuntime, id: string): SharedString;
|
|
673
|
-
// (undocumented)
|
|
674
662
|
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedString>;
|
|
675
663
|
// (undocumented)
|
|
676
664
|
static segmentFromSpec(spec: any): SharedStringSegment;
|
|
@@ -680,7 +668,7 @@ export class SharedStringFactory implements IChannelFactory {
|
|
|
680
668
|
get type(): string;
|
|
681
669
|
}
|
|
682
670
|
|
|
683
|
-
// @
|
|
671
|
+
// @alpha
|
|
684
672
|
export type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;
|
|
685
673
|
|
|
686
674
|
// @alpha (undocumented)
|
package/dist/defaultMap.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
|
6
6
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { IFluidSerializer } from "@fluidframework/shared-object-base";
|
|
8
8
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
|
-
import { ISerializableValue, ISerializedValue, IValueType, ISharedDefaultMapEvents, IMapMessageLocalMetadata, SequenceOptions, IValueTypeOperationValue } from "./defaultMapInterfaces";
|
|
9
|
+
import { ISerializableValue, ISerializedValue, IValueType, ISharedDefaultMapEvents, IMapMessageLocalMetadata, SequenceOptions, IValueTypeOperationValue } from "./defaultMapInterfaces.js";
|
|
10
|
+
import { type IntervalCollection } from "./intervalCollection.js";
|
|
10
11
|
/**
|
|
11
12
|
* Describes an operation specific to a value type.
|
|
12
13
|
*/
|
|
@@ -21,7 +22,6 @@ export interface IMapValueTypeOperation {
|
|
|
21
22
|
key: string;
|
|
22
23
|
/**
|
|
23
24
|
* Value of the operation, specific to the value type.
|
|
24
|
-
* @alpha
|
|
25
25
|
*/
|
|
26
26
|
value: IValueTypeOperationValue;
|
|
27
27
|
}
|
|
@@ -46,7 +46,7 @@ export interface IMapDataObjectSerialized {
|
|
|
46
46
|
* Creation of values is implicit on access (either via `get` or a remote op application referring to
|
|
47
47
|
* a collection that wasn't previously known)
|
|
48
48
|
*/
|
|
49
|
-
export declare class DefaultMap<T> {
|
|
49
|
+
export declare class DefaultMap<T extends IntervalCollection<any> = IntervalCollection<any>> {
|
|
50
50
|
private readonly serializer;
|
|
51
51
|
private readonly handle;
|
|
52
52
|
private readonly submitMessage;
|
|
@@ -60,7 +60,7 @@ export declare class DefaultMap<T> {
|
|
|
60
60
|
/**
|
|
61
61
|
* Mapping of op types to message handlers.
|
|
62
62
|
*/
|
|
63
|
-
private readonly
|
|
63
|
+
private readonly messageHandler;
|
|
64
64
|
/**
|
|
65
65
|
* The in-memory data the map is storing.
|
|
66
66
|
*/
|
|
@@ -119,10 +119,10 @@ export declare class DefaultMap<T> {
|
|
|
119
119
|
serialize(serializer: IFluidSerializer): string;
|
|
120
120
|
/**
|
|
121
121
|
* Populate the kernel with the given map data.
|
|
122
|
-
*
|
|
122
|
+
*
|
|
123
|
+
* @param serialized - A JSON string containing serialized map data
|
|
123
124
|
*/
|
|
124
|
-
|
|
125
|
-
populate(json: string): void;
|
|
125
|
+
populate(serialized: string): void;
|
|
126
126
|
/**
|
|
127
127
|
* Submit the given op if a handler is registered.
|
|
128
128
|
* @param op - The operation to attempt to submit
|
|
@@ -131,8 +131,8 @@ export declare class DefaultMap<T> {
|
|
|
131
131
|
* also sent if we are asked to resubmit the message.
|
|
132
132
|
* @returns True if the operation was submitted, false otherwise.
|
|
133
133
|
*/
|
|
134
|
-
tryResubmitMessage(op:
|
|
135
|
-
|
|
134
|
+
tryResubmitMessage(op: unknown, localOpMetadata: IMapMessageLocalMetadata): boolean;
|
|
135
|
+
tryApplyStashedOp(op: unknown): boolean;
|
|
136
136
|
/**
|
|
137
137
|
* Process the given op if a handler is registered.
|
|
138
138
|
* @param message - The message to process
|
|
@@ -141,7 +141,7 @@ export declare class DefaultMap<T> {
|
|
|
141
141
|
* For messages from a remote client, this will be undefined.
|
|
142
142
|
* @returns True if the operation was processed, false otherwise.
|
|
143
143
|
*/
|
|
144
|
-
tryProcessMessage(op:
|
|
144
|
+
tryProcessMessage(op: unknown, local: boolean, message: ISequencedDocumentMessage, localOpMetadata: unknown): boolean;
|
|
145
145
|
/**
|
|
146
146
|
* Initializes a default ValueType at the provided key.
|
|
147
147
|
* Should be used when a map operation incurs creation.
|
|
@@ -160,14 +160,8 @@ export declare class DefaultMap<T> {
|
|
|
160
160
|
* @returns The local value that was produced
|
|
161
161
|
*/
|
|
162
162
|
private makeLocal;
|
|
163
|
-
/**
|
|
164
|
-
* Get the message handlers for the map.
|
|
165
|
-
* @returns A map of string op names to IMapMessageHandlers for those ops
|
|
166
|
-
*/
|
|
167
|
-
private getMessageHandlers;
|
|
168
163
|
/**
|
|
169
164
|
* Create an emitter for a value type to emit ops from the given key.
|
|
170
|
-
* @alpha
|
|
171
165
|
* @param key - The key of the map that the value type will be stored on
|
|
172
166
|
* @returns A value op emitter for the given key
|
|
173
167
|
*/
|
package/dist/defaultMap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultMap.d.ts","sourceRoot":"","sources":["../src/defaultMap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"defaultMap.d.ts","sourceRoot":"","sources":["../src/defaultMap.ts"],"names":[],"mappings":"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"}
|
package/dist/defaultMap.js
CHANGED
|
@@ -8,7 +8,8 @@ exports.DefaultMap = void 0;
|
|
|
8
8
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
9
9
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
10
10
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
11
|
-
const
|
|
11
|
+
const localValues_js_1 = require("./localValues.js");
|
|
12
|
+
const intervalCollection_js_1 = require("./intervalCollection.js");
|
|
12
13
|
function isMapOperation(op) {
|
|
13
14
|
return typeof op === "object" && op !== null && "type" in op && op.type === "act";
|
|
14
15
|
}
|
|
@@ -44,12 +45,34 @@ class DefaultMap {
|
|
|
44
45
|
/**
|
|
45
46
|
* Mapping of op types to message handlers.
|
|
46
47
|
*/
|
|
47
|
-
this.
|
|
48
|
+
this.messageHandler = {
|
|
49
|
+
process: (op, local, message, localOpMetadata) => {
|
|
50
|
+
const localValue = this.data.get(op.key) ?? this.createCore(op.key, local);
|
|
51
|
+
const handler = localValue.getOpHandler(op.value.opName);
|
|
52
|
+
const previousValue = localValue.value;
|
|
53
|
+
const translatedValue = op.value.value;
|
|
54
|
+
handler.process(previousValue, translatedValue, local, message, localOpMetadata);
|
|
55
|
+
const event = { key: op.key, previousValue };
|
|
56
|
+
this.eventEmitter.emit("valueChanged", event, local, message, this.eventEmitter);
|
|
57
|
+
},
|
|
58
|
+
submit: (op, localOpMetadata) => {
|
|
59
|
+
this.submitMessage(op, localOpMetadata);
|
|
60
|
+
},
|
|
61
|
+
resubmit: (op, localOpMetadata) => {
|
|
62
|
+
const localValue = this.data.get(op.key);
|
|
63
|
+
(0, core_utils_1.assert)(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);
|
|
64
|
+
const handler = localValue.getOpHandler(op.value.opName);
|
|
65
|
+
const rebased = handler.rebase(localValue.value, op.value, localOpMetadata);
|
|
66
|
+
if (rebased !== undefined) {
|
|
67
|
+
const { rebasedOp, rebasedLocalOpMetadata } = rebased;
|
|
68
|
+
this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
48
72
|
/**
|
|
49
73
|
* The in-memory data the map is storing.
|
|
50
74
|
*/
|
|
51
75
|
this.data = new Map();
|
|
52
|
-
this.messageHandlers = this.getMessageHandlers();
|
|
53
76
|
}
|
|
54
77
|
/**
|
|
55
78
|
* Get an iterator over the keys in this map.
|
|
@@ -142,7 +165,7 @@ class DefaultMap {
|
|
|
142
165
|
getSerializableStorage(serializer) {
|
|
143
166
|
const serializableMapData = {};
|
|
144
167
|
this.data.forEach((localValue, key) => {
|
|
145
|
-
serializableMapData[key] = (0,
|
|
168
|
+
serializableMapData[key] = (0, localValues_js_1.makeSerializable)(localValue, serializer, this.handle);
|
|
146
169
|
});
|
|
147
170
|
return serializableMapData;
|
|
148
171
|
}
|
|
@@ -151,10 +174,12 @@ class DefaultMap {
|
|
|
151
174
|
}
|
|
152
175
|
/**
|
|
153
176
|
* Populate the kernel with the given map data.
|
|
154
|
-
*
|
|
177
|
+
*
|
|
178
|
+
* @param serialized - A JSON string containing serialized map data
|
|
155
179
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
180
|
+
populate(serialized) {
|
|
181
|
+
const parsed = this.serializer.parse(serialized);
|
|
182
|
+
for (const [key, serializable] of Object.entries(parsed)) {
|
|
158
183
|
// Back-compat: legacy documents may have handles to an intervalCollection map kernel.
|
|
159
184
|
// These collections should be empty, and ValueTypes are no longer supported.
|
|
160
185
|
if (serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] ||
|
|
@@ -173,9 +198,6 @@ class DefaultMap {
|
|
|
173
198
|
this.data.set(localValue.key, localValue.value);
|
|
174
199
|
}
|
|
175
200
|
}
|
|
176
|
-
populate(json) {
|
|
177
|
-
this.populateFromSerializable(JSON.parse(json));
|
|
178
|
-
}
|
|
179
201
|
/**
|
|
180
202
|
* Submit the given op if a handler is registered.
|
|
181
203
|
* @param op - The operation to attempt to submit
|
|
@@ -185,20 +207,47 @@ class DefaultMap {
|
|
|
185
207
|
* @returns True if the operation was submitted, false otherwise.
|
|
186
208
|
*/
|
|
187
209
|
tryResubmitMessage(op, localOpMetadata) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (handler !== undefined) {
|
|
191
|
-
handler.resubmit(op, localOpMetadata);
|
|
210
|
+
if (isMapOperation(op)) {
|
|
211
|
+
this.messageHandler.resubmit(op, localOpMetadata);
|
|
192
212
|
return true;
|
|
193
213
|
}
|
|
194
214
|
return false;
|
|
195
215
|
}
|
|
196
|
-
|
|
197
|
-
if (isMapOperation(op)
|
|
198
|
-
|
|
199
|
-
|
|
216
|
+
tryApplyStashedOp(op) {
|
|
217
|
+
if (isMapOperation(op)) {
|
|
218
|
+
const { value, key } = op;
|
|
219
|
+
const map = this.get(key);
|
|
220
|
+
switch (value.opName) {
|
|
221
|
+
case "add": {
|
|
222
|
+
map.add({
|
|
223
|
+
// Todo: we should improve typing so we know add ops always have start and end
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
225
|
+
start: (0, intervalCollection_js_1.toSequencePlace)(value.value.start, value.value.startSide),
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
227
|
+
end: (0, intervalCollection_js_1.toSequencePlace)(value.value.end, value.value.endSide),
|
|
228
|
+
props: value.value.properties,
|
|
229
|
+
});
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
case "change": {
|
|
233
|
+
const { [intervalCollection_js_1.reservedIntervalIdKey]: id, ...props } = value.value.properties ?? {};
|
|
234
|
+
map.change(id, {
|
|
235
|
+
start: (0, intervalCollection_js_1.toOptionalSequencePlace)(value.value.start, value.value.startSide),
|
|
236
|
+
end: (0, intervalCollection_js_1.toOptionalSequencePlace)(value.value.end, value.value.endSide),
|
|
237
|
+
props,
|
|
238
|
+
});
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
case "delete": {
|
|
242
|
+
const { [intervalCollection_js_1.reservedIntervalIdKey]: id } = value.value.properties ?? {};
|
|
243
|
+
map.removeIntervalById(id);
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
default:
|
|
247
|
+
throw new Error("unknown ops should not be stashed");
|
|
248
|
+
}
|
|
200
249
|
}
|
|
201
|
-
return
|
|
250
|
+
return false;
|
|
202
251
|
}
|
|
203
252
|
/**
|
|
204
253
|
* Process the given op if a handler is registered.
|
|
@@ -209,9 +258,8 @@ class DefaultMap {
|
|
|
209
258
|
* @returns True if the operation was processed, false otherwise.
|
|
210
259
|
*/
|
|
211
260
|
tryProcessMessage(op, local, message, localOpMetadata) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
handler.process(op, local, message, localOpMetadata);
|
|
261
|
+
if (isMapOperation(op)) {
|
|
262
|
+
this.messageHandler.process(op, local, message, localOpMetadata);
|
|
215
263
|
return true;
|
|
216
264
|
}
|
|
217
265
|
return false;
|
|
@@ -223,7 +271,7 @@ class DefaultMap {
|
|
|
223
271
|
* @param local - Whether the message originated from the local client
|
|
224
272
|
*/
|
|
225
273
|
createCore(key, local) {
|
|
226
|
-
const localValue = new
|
|
274
|
+
const localValue = new localValues_js_1.ValueTypeLocalValue(this.type.factory.load(this.makeMapValueOpEmitter(key), undefined, this.options), this.type);
|
|
227
275
|
const previousValue = this.data.get(key);
|
|
228
276
|
this.data.set(key, localValue);
|
|
229
277
|
const event = { key, previousValue };
|
|
@@ -243,55 +291,11 @@ class DefaultMap {
|
|
|
243
291
|
makeLocal(key, serializable) {
|
|
244
292
|
(0, core_utils_1.assert)(serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] &&
|
|
245
293
|
serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared], 0x2e1 /* "Support for plain value types removed." */);
|
|
246
|
-
serializable.value = (0, shared_object_base_1.parseHandles)(serializable.value, this.serializer);
|
|
247
294
|
const localValue = this.type.factory.load(this.makeMapValueOpEmitter(key), serializable.value, this.options);
|
|
248
|
-
return new
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Get the message handlers for the map.
|
|
252
|
-
* @returns A map of string op names to IMapMessageHandlers for those ops
|
|
253
|
-
*/
|
|
254
|
-
getMessageHandlers() {
|
|
255
|
-
const messageHandlers = new Map();
|
|
256
|
-
// Ops with type "act" describe actions taken by custom value type handlers of whatever item is
|
|
257
|
-
// being addressed. These custom handlers can be retrieved from the ValueTypeLocalValue which has
|
|
258
|
-
// stashed its valueType (and therefore its handlers). We also emit a valueChanged for anyone
|
|
259
|
-
// watching for manipulations of that item.
|
|
260
|
-
messageHandlers.set("act", {
|
|
261
|
-
process: (op, local, message, localOpMetadata) => {
|
|
262
|
-
const localValue = this.data.get(op.key) ?? this.createCore(op.key, local);
|
|
263
|
-
const handler = localValue.getOpHandler(op.value.opName);
|
|
264
|
-
const previousValue = localValue.value;
|
|
265
|
-
const translatedValue = (0, shared_object_base_1.parseHandles)(op.value.value, this.serializer);
|
|
266
|
-
handler.process(previousValue, translatedValue, local, message, localOpMetadata);
|
|
267
|
-
const event = { key: op.key, previousValue };
|
|
268
|
-
this.eventEmitter.emit("valueChanged", event, local, message, this.eventEmitter);
|
|
269
|
-
},
|
|
270
|
-
submit: (op, localOpMetadata) => {
|
|
271
|
-
this.submitMessage(op, localOpMetadata);
|
|
272
|
-
},
|
|
273
|
-
resubmit: (op, localOpMetadata) => {
|
|
274
|
-
const localValue = this.data.get(op.key);
|
|
275
|
-
(0, core_utils_1.assert)(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);
|
|
276
|
-
const handler = localValue.getOpHandler(op.value.opName);
|
|
277
|
-
const rebased = handler.rebase(localValue.value, op.value, localOpMetadata);
|
|
278
|
-
if (rebased !== undefined) {
|
|
279
|
-
const { rebasedOp, rebasedLocalOpMetadata } = rebased;
|
|
280
|
-
this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
getStashedOpLocalMetadata: (op) => {
|
|
284
|
-
const localValue = this.data.get(op.key) ?? this.createCore(op.key, true);
|
|
285
|
-
(0, core_utils_1.assert)(localValue !== undefined, 0x879 /* Local value expected on applying stashed op */);
|
|
286
|
-
const handler = localValue.getOpHandler(op.value.opName);
|
|
287
|
-
return handler.applyStashedOp(localValue.value, op.value);
|
|
288
|
-
},
|
|
289
|
-
});
|
|
290
|
-
return messageHandlers;
|
|
295
|
+
return new localValues_js_1.ValueTypeLocalValue(localValue, this.type);
|
|
291
296
|
}
|
|
292
297
|
/**
|
|
293
298
|
* Create an emitter for a value type to emit ops from the given key.
|
|
294
|
-
* @alpha
|
|
295
299
|
* @param key - The key of the map that the value type will be stored on
|
|
296
300
|
* @returns A value op emitter for the given key
|
|
297
301
|
*/
|
|
@@ -299,13 +303,12 @@ class DefaultMap {
|
|
|
299
303
|
makeMapValueOpEmitter(key) {
|
|
300
304
|
// eslint-disable-next-line import/no-deprecated
|
|
301
305
|
const emit = (opName, previousValue, params, localOpMetadata) => {
|
|
302
|
-
const translatedParams = (0, shared_object_base_1.makeHandlesSerializable)(params, this.serializer, this.handle);
|
|
303
306
|
const op = {
|
|
304
307
|
key,
|
|
305
308
|
type: "act",
|
|
306
309
|
value: {
|
|
307
310
|
opName,
|
|
308
|
-
value:
|
|
311
|
+
value: params,
|
|
309
312
|
},
|
|
310
313
|
};
|
|
311
314
|
this.submitMessage(op, localOpMetadata);
|