@fluidframework/sequence 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.1
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/CHANGELOG.md +57 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +8 -3
- package/api-report/sequence.api.md +87 -84
- package/dist/{defaultMap.js → defaultMap.cjs} +9 -4
- package/dist/defaultMap.cjs.map +1 -0
- package/dist/defaultMap.d.ts +3 -3
- package/dist/defaultMap.d.ts.map +1 -1
- package/dist/{defaultMapInterfaces.js → defaultMapInterfaces.cjs} +1 -1
- package/dist/defaultMapInterfaces.cjs.map +1 -0
- package/dist/defaultMapInterfaces.d.ts +11 -10
- package/dist/defaultMapInterfaces.d.ts.map +1 -1
- package/dist/{index.js → index.cjs} +11 -11
- package/dist/index.cjs.map +1 -0
- package/dist/{intervalCollection.js → intervalCollection.cjs} +53 -48
- package/dist/intervalCollection.cjs.map +1 -0
- package/dist/intervalCollection.d.ts +66 -12
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.cjs} +4 -4
- package/dist/intervalIndex/endpointInRangeIndex.cjs.map +1 -0
- package/dist/intervalIndex/endpointInRangeIndex.d.ts +2 -2
- package/dist/intervalIndex/{endpointIndex.js → endpointIndex.cjs} +3 -3
- package/dist/intervalIndex/endpointIndex.cjs.map +1 -0
- package/dist/intervalIndex/endpointIndex.d.ts +2 -2
- package/dist/intervalIndex/{idIntervalIndex.js → idIntervalIndex.cjs} +2 -2
- package/dist/intervalIndex/idIntervalIndex.cjs.map +1 -0
- package/dist/intervalIndex/idIntervalIndex.d.ts +2 -2
- package/dist/intervalIndex/{index.js → index.cjs} +7 -7
- package/dist/intervalIndex/index.cjs.map +1 -0
- package/dist/intervalIndex/{intervalIndex.js → intervalIndex.cjs} +1 -1
- package/dist/intervalIndex/intervalIndex.cjs.map +1 -0
- package/dist/intervalIndex/intervalIndex.d.ts +1 -1
- package/dist/intervalIndex/{intervalIndexUtils.js → intervalIndexUtils.cjs} +1 -1
- package/dist/intervalIndex/intervalIndexUtils.cjs.map +1 -0
- package/dist/intervalIndex/{overlappingIntervalsIndex.js → overlappingIntervalsIndex.cjs} +5 -5
- package/dist/intervalIndex/overlappingIntervalsIndex.cjs.map +1 -0
- package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +2 -2
- package/dist/intervalIndex/{overlappingSequenceIntervalsIndex.js → overlappingSequenceIntervalsIndex.cjs} +4 -4
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs.map +1 -0
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +1 -1
- package/dist/intervalIndex/{sequenceIntervalIndexes.js → sequenceIntervalIndexes.cjs} +1 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.cjs.map +1 -0
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
- package/dist/intervalIndex/{startpointInRangeIndex.js → startpointInRangeIndex.cjs} +4 -4
- package/dist/intervalIndex/startpointInRangeIndex.cjs.map +1 -0
- package/dist/intervalIndex/startpointInRangeIndex.d.ts +2 -2
- package/dist/{intervalTree.js → intervalTree.cjs} +1 -1
- package/dist/intervalTree.cjs.map +1 -0
- package/dist/intervals/{index.js → index.cjs} +4 -4
- package/dist/intervals/index.cjs.map +1 -0
- package/dist/intervals/{interval.js → interval.cjs} +2 -6
- package/dist/intervals/interval.cjs.map +1 -0
- package/dist/intervals/interval.d.ts +2 -7
- package/dist/intervals/interval.d.ts.map +1 -1
- package/dist/intervals/{intervalUtils.js → intervalUtils.cjs} +4 -4
- package/dist/intervals/intervalUtils.cjs.map +1 -0
- package/dist/intervals/intervalUtils.d.ts +15 -14
- package/dist/intervals/intervalUtils.d.ts.map +1 -1
- package/dist/intervals/{sequenceInterval.js → sequenceInterval.cjs} +6 -14
- package/dist/intervals/sequenceInterval.cjs.map +1 -0
- package/dist/intervals/sequenceInterval.d.ts +3 -12
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/{localValues.js → localValues.cjs} +1 -1
- package/dist/localValues.cjs.map +1 -0
- package/dist/localValues.d.ts +2 -1
- package/dist/localValues.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/{revertibles.js → revertibles.cjs} +10 -12
- package/dist/revertibles.cjs.map +1 -0
- package/dist/revertibles.d.ts +9 -15
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/sequence-alpha.d.ts +226 -507
- package/dist/sequence-beta.d.ts +131 -1368
- package/dist/sequence-public.d.ts +131 -1368
- package/dist/sequence-untrimmed.d.ts +121 -90
- package/dist/{sequence.js → sequence.cjs} +5 -5
- package/dist/sequence.cjs.map +1 -0
- package/dist/sequence.d.ts +2 -3
- package/dist/sequence.d.ts.map +1 -1
- package/dist/{sequenceDeltaEvent.js → sequenceDeltaEvent.cjs} +4 -4
- package/dist/sequenceDeltaEvent.cjs.map +1 -0
- package/dist/sequenceDeltaEvent.d.ts +4 -4
- package/dist/{sequenceFactory.js → sequenceFactory.cjs} +4 -4
- package/dist/sequenceFactory.cjs.map +1 -0
- package/dist/sequenceFactory.d.ts +1 -1
- package/dist/{sharedIntervalCollection.js → sharedIntervalCollection.cjs} +6 -6
- package/dist/sharedIntervalCollection.cjs.map +1 -0
- package/dist/sharedIntervalCollection.d.ts +3 -3
- package/dist/{sharedSequence.js → sharedSequence.cjs} +4 -4
- package/dist/sharedSequence.cjs.map +1 -0
- package/dist/sharedSequence.d.ts +3 -3
- package/dist/{sharedString.js → sharedString.cjs} +9 -6
- package/dist/sharedString.cjs.map +1 -0
- package/dist/sharedString.d.ts +8 -5
- package/dist/sharedString.d.ts.map +1 -1
- package/lib/{defaultMap.d.ts → defaultMap.d.mts} +4 -4
- package/lib/defaultMap.d.mts.map +1 -0
- package/lib/{defaultMap.js → defaultMap.mjs} +9 -4
- package/lib/defaultMap.mjs.map +1 -0
- package/lib/{defaultMapInterfaces.d.ts → defaultMapInterfaces.d.mts} +11 -10
- package/lib/defaultMapInterfaces.d.mts.map +1 -0
- package/lib/{defaultMapInterfaces.js → defaultMapInterfaces.mjs} +1 -1
- package/lib/defaultMapInterfaces.mjs.map +1 -0
- package/lib/{index.d.ts → index.d.mts} +11 -23
- package/lib/index.d.mts.map +1 -0
- package/lib/{index.js → index.mjs} +11 -11
- package/lib/index.mjs.map +1 -0
- package/lib/{intervalCollection.d.ts → intervalCollection.d.mts} +68 -14
- package/lib/intervalCollection.d.mts.map +1 -0
- package/lib/{intervalCollection.js → intervalCollection.mjs} +53 -50
- package/lib/intervalCollection.mjs.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.d.ts → endpointInRangeIndex.d.mts} +5 -5
- package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.mjs} +4 -4
- package/lib/intervalIndex/endpointInRangeIndex.mjs.map +1 -0
- package/lib/intervalIndex/{endpointIndex.d.ts → endpointIndex.d.mts} +5 -5
- package/lib/intervalIndex/endpointIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{endpointIndex.js → endpointIndex.mjs} +3 -3
- package/lib/intervalIndex/endpointIndex.mjs.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.d.ts → idIntervalIndex.d.mts} +4 -4
- package/lib/intervalIndex/idIntervalIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{idIntervalIndex.js → idIntervalIndex.mjs} +2 -2
- package/lib/intervalIndex/idIntervalIndex.mjs.map +1 -0
- package/lib/intervalIndex/{index.d.ts → index.d.mts} +8 -8
- package/lib/intervalIndex/index.d.mts.map +1 -0
- package/lib/intervalIndex/{index.js → index.mjs} +7 -7
- package/{dist/intervalIndex/index.js.map → lib/intervalIndex/index.mjs.map} +1 -1
- package/lib/intervalIndex/{intervalIndex.d.ts → intervalIndex.d.mts} +2 -2
- package/lib/intervalIndex/intervalIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{intervalIndex.js → intervalIndex.mjs} +1 -1
- package/lib/intervalIndex/intervalIndex.mjs.map +1 -0
- package/lib/intervalIndex/{intervalIndexUtils.js → intervalIndexUtils.mjs} +1 -1
- package/lib/intervalIndex/intervalIndexUtils.mjs.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.d.ts → overlappingIntervalsIndex.d.mts} +7 -7
- package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{overlappingIntervalsIndex.js → overlappingIntervalsIndex.mjs} +5 -5
- package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.ts → overlappingSequenceIntervalsIndex.d.mts} +3 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.js → overlappingSequenceIntervalsIndex.mjs} +4 -4
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.d.ts → sequenceIntervalIndexes.d.mts} +4 -3
- package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +1 -0
- package/lib/intervalIndex/{sequenceIntervalIndexes.js → sequenceIntervalIndexes.mjs} +1 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.mjs.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.d.ts → startpointInRangeIndex.d.mts} +5 -5
- package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +1 -0
- package/lib/intervalIndex/{startpointInRangeIndex.js → startpointInRangeIndex.mjs} +4 -4
- package/lib/intervalIndex/startpointInRangeIndex.mjs.map +1 -0
- package/lib/{intervalTree.d.ts → intervalTree.d.mts} +1 -1
- package/lib/intervalTree.d.mts.map +1 -0
- package/lib/{intervalTree.js → intervalTree.mjs} +1 -1
- package/lib/intervalTree.mjs.map +1 -0
- package/lib/intervals/{index.d.ts → index.d.mts} +3 -3
- package/lib/intervals/index.d.mts.map +1 -0
- package/lib/intervals/{index.js → index.mjs} +4 -4
- package/lib/intervals/{index.js.map → index.mjs.map} +1 -1
- package/lib/intervals/{interval.d.ts → interval.d.mts} +4 -9
- package/lib/intervals/interval.d.mts.map +1 -0
- package/lib/intervals/{interval.js → interval.mjs} +2 -6
- package/lib/intervals/interval.mjs.map +1 -0
- package/lib/intervals/{intervalUtils.d.ts → intervalUtils.d.mts} +16 -15
- package/lib/intervals/intervalUtils.d.mts.map +1 -0
- package/lib/intervals/{intervalUtils.js → intervalUtils.mjs} +4 -6
- package/lib/intervals/intervalUtils.mjs.map +1 -0
- package/lib/intervals/{sequenceInterval.d.ts → sequenceInterval.d.mts} +5 -14
- package/lib/intervals/sequenceInterval.d.mts.map +1 -0
- package/lib/intervals/{sequenceInterval.js → sequenceInterval.mjs} +6 -16
- package/lib/intervals/sequenceInterval.mjs.map +1 -0
- package/lib/{localValues.d.ts → localValues.d.mts} +3 -2
- package/lib/localValues.d.mts.map +1 -0
- package/lib/{localValues.js → localValues.mjs} +1 -1
- package/lib/localValues.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{revertibles.d.ts → revertibles.d.mts} +12 -18
- package/lib/revertibles.d.mts.map +1 -0
- package/lib/{revertibles.js → revertibles.mjs} +10 -14
- package/lib/revertibles.mjs.map +1 -0
- package/lib/{sequence-public.d.ts → sequence-alpha.d.mts} +221 -422
- package/lib/sequence-beta.d.mts +270 -0
- package/lib/sequence-public.d.mts +270 -0
- package/lib/{sequence-untrimmed.d.ts → sequence-untrimmed.d.mts} +121 -90
- package/lib/{sequence.d.ts → sequence.d.mts} +6 -7
- package/lib/sequence.d.mts.map +1 -0
- package/lib/{sequence.js → sequence.mjs} +5 -6
- package/lib/sequence.mjs.map +1 -0
- package/lib/{sequenceDeltaEvent.d.ts → sequenceDeltaEvent.d.mts} +4 -4
- package/lib/sequenceDeltaEvent.d.mts.map +1 -0
- package/lib/{sequenceDeltaEvent.js → sequenceDeltaEvent.mjs} +4 -5
- package/lib/sequenceDeltaEvent.mjs.map +1 -0
- package/lib/{sequenceFactory.d.ts → sequenceFactory.d.mts} +2 -2
- package/lib/sequenceFactory.d.mts.map +1 -0
- package/lib/{sequenceFactory.js → sequenceFactory.mjs} +4 -4
- package/lib/sequenceFactory.mjs.map +1 -0
- package/lib/{sharedIntervalCollection.d.ts → sharedIntervalCollection.d.mts} +5 -5
- package/lib/sharedIntervalCollection.d.mts.map +1 -0
- package/lib/{sharedIntervalCollection.js → sharedIntervalCollection.mjs} +6 -6
- package/lib/sharedIntervalCollection.mjs.map +1 -0
- package/lib/{sharedSequence.d.ts → sharedSequence.d.mts} +4 -4
- package/lib/sharedSequence.d.mts.map +1 -0
- package/lib/{sharedSequence.js → sharedSequence.mjs} +4 -4
- package/lib/sharedSequence.mjs.map +1 -0
- package/lib/{sharedString.d.ts → sharedString.d.mts} +10 -7
- package/lib/sharedString.d.mts.map +1 -0
- package/lib/{sharedString.js → sharedString.mjs} +9 -6
- package/lib/sharedString.mjs.map +1 -0
- package/package.json +46 -29
- package/sequence.test-files.tar +0 -0
- package/src/defaultMap.ts +22 -16
- package/src/defaultMapInterfaces.ts +15 -12
- package/src/intervalCollection.ts +131 -67
- package/src/intervalIndex/endpointInRangeIndex.ts +2 -2
- package/src/intervalIndex/endpointIndex.ts +2 -2
- package/src/intervalIndex/idIntervalIndex.ts +2 -2
- package/src/intervalIndex/intervalIndex.ts +1 -1
- package/src/intervalIndex/overlappingIntervalsIndex.ts +2 -2
- package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +1 -1
- package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -1
- package/src/intervalIndex/startpointInRangeIndex.ts +2 -2
- package/src/intervals/interval.ts +2 -7
- package/src/intervals/intervalUtils.ts +15 -15
- package/src/intervals/sequenceInterval.ts +3 -12
- package/src/localValues.ts +2 -1
- package/src/packageVersion.ts +1 -1
- package/src/revertibles.ts +9 -15
- package/src/sequence.ts +2 -3
- package/src/sequenceDeltaEvent.ts +4 -4
- package/src/sequenceFactory.ts +1 -1
- package/src/sharedIntervalCollection.ts +3 -3
- package/src/sharedSequence.ts +3 -3
- package/src/sharedString.ts +8 -5
- package/tsc-multi.test.json +10 -0
- package/dist/defaultMap.js.map +0 -1
- package/dist/defaultMapInterfaces.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/intervalCollection.js.map +0 -1
- package/dist/intervalIndex/endpointInRangeIndex.js.map +0 -1
- package/dist/intervalIndex/endpointIndex.js.map +0 -1
- package/dist/intervalIndex/idIntervalIndex.js.map +0 -1
- package/dist/intervalIndex/intervalIndex.js.map +0 -1
- package/dist/intervalIndex/intervalIndexUtils.js.map +0 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
- package/dist/intervalIndex/sequenceIntervalIndexes.js.map +0 -1
- package/dist/intervalIndex/startpointInRangeIndex.js.map +0 -1
- package/dist/intervalTree.js.map +0 -1
- package/dist/intervals/index.js.map +0 -1
- package/dist/intervals/interval.js.map +0 -1
- package/dist/intervals/intervalUtils.js.map +0 -1
- package/dist/intervals/sequenceInterval.js.map +0 -1
- package/dist/localValues.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/revertibles.js.map +0 -1
- package/dist/sequence.js.map +0 -1
- package/dist/sequenceDeltaEvent.js.map +0 -1
- package/dist/sequenceFactory.js.map +0 -1
- package/dist/sharedIntervalCollection.js.map +0 -1
- package/dist/sharedSequence.js.map +0 -1
- package/dist/sharedString.js.map +0 -1
- package/lib/defaultMap.d.ts.map +0 -1
- package/lib/defaultMap.js.map +0 -1
- package/lib/defaultMapInterfaces.d.ts.map +0 -1
- package/lib/defaultMapInterfaces.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/intervalCollection.d.ts.map +0 -1
- package/lib/intervalCollection.js.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +0 -1
- package/lib/intervalIndex/endpointInRangeIndex.js.map +0 -1
- package/lib/intervalIndex/endpointIndex.d.ts.map +0 -1
- package/lib/intervalIndex/endpointIndex.js.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.d.ts.map +0 -1
- package/lib/intervalIndex/idIntervalIndex.js.map +0 -1
- package/lib/intervalIndex/index.d.ts.map +0 -1
- package/lib/intervalIndex/index.js.map +0 -1
- package/lib/intervalIndex/intervalIndex.d.ts.map +0 -1
- package/lib/intervalIndex/intervalIndex.js.map +0 -1
- package/lib/intervalIndex/intervalIndexUtils.js.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +0 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +0 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +0 -1
- package/lib/intervalIndex/sequenceIntervalIndexes.js.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +0 -1
- package/lib/intervalIndex/startpointInRangeIndex.js.map +0 -1
- package/lib/intervalTree.d.ts.map +0 -1
- package/lib/intervalTree.js.map +0 -1
- package/lib/intervals/index.d.ts.map +0 -1
- package/lib/intervals/interval.d.ts.map +0 -1
- package/lib/intervals/interval.js.map +0 -1
- package/lib/intervals/intervalUtils.d.ts.map +0 -1
- package/lib/intervals/intervalUtils.js.map +0 -1
- package/lib/intervals/sequenceInterval.d.ts.map +0 -1
- package/lib/intervals/sequenceInterval.js.map +0 -1
- package/lib/localValues.d.ts.map +0 -1
- package/lib/localValues.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/revertibles.d.ts.map +0 -1
- package/lib/revertibles.js.map +0 -1
- package/lib/sequence-alpha.d.ts +0 -1587
- package/lib/sequence-beta.d.ts +0 -1507
- package/lib/sequence.d.ts.map +0 -1
- package/lib/sequence.js.map +0 -1
- package/lib/sequenceDeltaEvent.d.ts.map +0 -1
- package/lib/sequenceDeltaEvent.js.map +0 -1
- package/lib/sequenceFactory.d.ts.map +0 -1
- package/lib/sequenceFactory.js.map +0 -1
- package/lib/sharedIntervalCollection.d.ts.map +0 -1
- package/lib/sharedIntervalCollection.js.map +0 -1
- package/lib/sharedSequence.d.ts.map +0 -1
- package/lib/sharedSequence.js.map +0 -1
- package/lib/sharedString.d.ts.map +0 -1
- package/lib/sharedString.js.map +0 -1
- package/tsconfig.esnext.json +0 -6
- /package/lib/intervalIndex/{intervalIndexUtils.d.ts → intervalIndexUtils.d.mts} +0 -0
- /package/lib/intervalIndex/{intervalIndexUtils.d.ts.map → intervalIndexUtils.d.mts.map} +0 -0
- /package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +0 -0
|
@@ -100,7 +100,7 @@ function maxSide(sideA: Side, sideB: Side): Side {
|
|
|
100
100
|
* `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints
|
|
101
101
|
* of the interval that are exclusive will have the ability to slide to these
|
|
102
102
|
* special endpoint segments.
|
|
103
|
-
* @
|
|
103
|
+
* @alpha
|
|
104
104
|
*/
|
|
105
105
|
export class SequenceInterval implements ISerializableInterval {
|
|
106
106
|
/**
|
|
@@ -109,13 +109,10 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
109
109
|
public properties: PropertySet;
|
|
110
110
|
/**
|
|
111
111
|
* {@inheritDoc ISerializableInterval.propertyManager}
|
|
112
|
-
* @internal
|
|
113
112
|
*/
|
|
114
113
|
public propertyManager: PropertiesManager;
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
* @internal
|
|
118
|
-
*/
|
|
115
|
+
/***/
|
|
119
116
|
public get stickiness(): IntervalStickiness {
|
|
120
117
|
const startSegment = this.start.getSegment();
|
|
121
118
|
const endSegment = this.end.getSegment();
|
|
@@ -156,7 +153,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
156
153
|
|
|
157
154
|
/**
|
|
158
155
|
* Subscribes to position change events on this interval if there are no current listeners.
|
|
159
|
-
* @internal
|
|
160
156
|
*/
|
|
161
157
|
public addPositionChangeListeners(
|
|
162
158
|
beforePositionChange: () => void,
|
|
@@ -177,7 +173,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
177
173
|
|
|
178
174
|
/**
|
|
179
175
|
* Removes the currently subscribed position change listeners.
|
|
180
|
-
* @internal
|
|
181
176
|
*/
|
|
182
177
|
public removePositionChangeListeners(): void {
|
|
183
178
|
if (this.callbacks) {
|
|
@@ -189,7 +184,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
189
184
|
|
|
190
185
|
/**
|
|
191
186
|
* {@inheritDoc ISerializableInterval.serialize}
|
|
192
|
-
* @internal
|
|
193
187
|
*/
|
|
194
188
|
public serialize(): ISerializedInterval {
|
|
195
189
|
const startPosition = this.client.localReferencePositionToPosition(this.start);
|
|
@@ -299,7 +293,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
299
293
|
|
|
300
294
|
/**
|
|
301
295
|
* {@inheritDoc IInterval.union}
|
|
302
|
-
* @internal
|
|
303
296
|
*/
|
|
304
297
|
public union(b: SequenceInterval) {
|
|
305
298
|
const newStart = minReferencePosition(this.start, b.start);
|
|
@@ -334,7 +327,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
334
327
|
|
|
335
328
|
/**
|
|
336
329
|
* {@inheritDoc ISerializableInterval.addProperties}
|
|
337
|
-
* @internal
|
|
338
330
|
*/
|
|
339
331
|
public addProperties(
|
|
340
332
|
newProps: PropertySet,
|
|
@@ -357,7 +349,6 @@ export class SequenceInterval implements ISerializableInterval {
|
|
|
357
349
|
|
|
358
350
|
/**
|
|
359
351
|
* {@inheritDoc IInterval.modify}
|
|
360
|
-
* @internal
|
|
361
352
|
*/
|
|
362
353
|
public modify(
|
|
363
354
|
label: string,
|
|
@@ -637,7 +628,7 @@ export function createSequenceInterval(
|
|
|
637
628
|
|
|
638
629
|
/**
|
|
639
630
|
* @deprecated The methods within have substitutions
|
|
640
|
-
* @
|
|
631
|
+
* @internal
|
|
641
632
|
*/
|
|
642
633
|
export const sequenceIntervalHelpers: IIntervalHelpers<SequenceInterval> = {
|
|
643
634
|
create: createSequenceInterval,
|
package/src/localValues.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
IValueOperation,
|
|
12
12
|
IValueType,
|
|
13
13
|
} from "./defaultMapInterfaces";
|
|
14
|
+
import { IntervalOpType } from "./intervals";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* A local value to be stored in a container type DDS.
|
|
@@ -88,7 +89,7 @@ export class ValueTypeLocalValue<T> implements ILocalValue<T> {
|
|
|
88
89
|
* @param opName - The name of the operation that needs processing
|
|
89
90
|
* @returns The object which can process the given op
|
|
90
91
|
*/
|
|
91
|
-
public getOpHandler(opName:
|
|
92
|
+
public getOpHandler(opName: IntervalOpType): IValueOperation<T> {
|
|
92
93
|
const handler = this.valueType.ops.get(opName);
|
|
93
94
|
if (!handler) {
|
|
94
95
|
throw new Error("Unknown type message");
|
package/src/packageVersion.ts
CHANGED
package/src/revertibles.ts
CHANGED
|
@@ -30,19 +30,15 @@ import { ISequenceDeltaRange, SequenceDeltaEvent } from "./sequenceDeltaEvent";
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Data for undoing edits on SharedStrings and Intervals.
|
|
33
|
-
*
|
|
34
|
-
* @alpha
|
|
33
|
+
* @internal
|
|
35
34
|
*/
|
|
36
35
|
export type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;
|
|
37
36
|
|
|
38
37
|
const idMap = new Map<string, string>();
|
|
39
38
|
|
|
40
|
-
type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];
|
|
41
|
-
|
|
42
39
|
/**
|
|
43
40
|
* Data for undoing edits affecting Intervals.
|
|
44
|
-
*
|
|
45
|
-
* @alpha
|
|
41
|
+
* @internal
|
|
46
42
|
*/
|
|
47
43
|
export type IntervalRevertible =
|
|
48
44
|
| {
|
|
@@ -96,7 +92,7 @@ function getUpdatedId(intervalId: string): string {
|
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* Create revertibles for adding an interval
|
|
99
|
-
* @
|
|
95
|
+
* @internal
|
|
100
96
|
*/
|
|
101
97
|
export function appendAddIntervalToRevertibles(
|
|
102
98
|
interval: SequenceInterval,
|
|
@@ -112,7 +108,7 @@ export function appendAddIntervalToRevertibles(
|
|
|
112
108
|
|
|
113
109
|
/**
|
|
114
110
|
* Create revertibles for deleting an interval
|
|
115
|
-
* @
|
|
111
|
+
* @internal
|
|
116
112
|
*/
|
|
117
113
|
export function appendDeleteIntervalToRevertibles(
|
|
118
114
|
string: SharedString,
|
|
@@ -158,7 +154,7 @@ export function appendDeleteIntervalToRevertibles(
|
|
|
158
154
|
|
|
159
155
|
/**
|
|
160
156
|
* Create revertibles for moving endpoints of an interval
|
|
161
|
-
* @
|
|
157
|
+
* @internal
|
|
162
158
|
*/
|
|
163
159
|
export function appendChangeIntervalToRevertibles(
|
|
164
160
|
string: SharedString,
|
|
@@ -208,7 +204,7 @@ export function appendChangeIntervalToRevertibles(
|
|
|
208
204
|
|
|
209
205
|
/**
|
|
210
206
|
* Create revertibles for changing properties of an interval
|
|
211
|
-
* @
|
|
207
|
+
* @internal
|
|
212
208
|
*/
|
|
213
209
|
export function appendIntervalPropertyChangedToRevertibles(
|
|
214
210
|
interval: SequenceInterval,
|
|
@@ -268,8 +264,7 @@ function addIfRevertibleRef(
|
|
|
268
264
|
/**
|
|
269
265
|
* Create revertibles for SharedStringDeltas, handling indirectly modified intervals
|
|
270
266
|
* (e.g. reverting remove of a range that contains an interval will move the interval back)
|
|
271
|
-
*
|
|
272
|
-
* @alpha
|
|
267
|
+
* @internal
|
|
273
268
|
*/
|
|
274
269
|
export function appendSharedStringDeltaToRevertibles(
|
|
275
270
|
string: SharedString,
|
|
@@ -362,7 +357,7 @@ export function appendSharedStringDeltaToRevertibles(
|
|
|
362
357
|
|
|
363
358
|
/**
|
|
364
359
|
* Clean up resources held by revertibles that are no longer needed.
|
|
365
|
-
* @
|
|
360
|
+
* @internal
|
|
366
361
|
*/
|
|
367
362
|
export function discardSharedStringRevertibles(
|
|
368
363
|
sharedString: SharedString,
|
|
@@ -654,8 +649,7 @@ function revertLocalSequenceRemove(
|
|
|
654
649
|
|
|
655
650
|
/**
|
|
656
651
|
* Invoke revertibles to reverse prior edits
|
|
657
|
-
*
|
|
658
|
-
* @alpha
|
|
652
|
+
* @internal
|
|
659
653
|
*/
|
|
660
654
|
export function revertSharedStringRevertibles(
|
|
661
655
|
sharedString: SharedString,
|
package/src/sequence.ts
CHANGED
|
@@ -98,7 +98,7 @@ const contentPath = "content";
|
|
|
98
98
|
* - `event` - Various information on the segments that were modified.
|
|
99
99
|
*
|
|
100
100
|
* - `target` - The sequence itself.
|
|
101
|
-
* @
|
|
101
|
+
* @alpha
|
|
102
102
|
*/
|
|
103
103
|
export interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
|
|
104
104
|
(
|
|
@@ -116,7 +116,7 @@ export interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* @
|
|
119
|
+
* @alpha
|
|
120
120
|
*/
|
|
121
121
|
export abstract class SharedSegmentSequence<T extends ISegment>
|
|
122
122
|
extends SharedObject<ISharedSegmentSequenceEvents>
|
|
@@ -137,7 +137,6 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
137
137
|
*
|
|
138
138
|
* An application using SharedString which explicitly wants to opt in to allowing reentrancy anyway can set `sharedStringPreventReentrancy`
|
|
139
139
|
* on the data store options to `false`.
|
|
140
|
-
* @internal
|
|
141
140
|
*/
|
|
142
141
|
protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
|
|
143
142
|
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
* The properties of this object and its sub-objects represent the state of the sequence at the
|
|
26
26
|
* point in time at which the operation was applied.
|
|
27
27
|
* They will not take into any future modifications performed to the underlying sequence and merge tree.
|
|
28
|
-
* @
|
|
28
|
+
* @alpha
|
|
29
29
|
*/
|
|
30
30
|
export abstract class SequenceEvent<
|
|
31
31
|
TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,
|
|
@@ -108,7 +108,7 @@ export abstract class SequenceEvent<
|
|
|
108
108
|
* For group ops, each op will get its own event, and the group op property will be set on the op args.
|
|
109
109
|
*
|
|
110
110
|
* Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
|
|
111
|
-
* @
|
|
111
|
+
* @alpha
|
|
112
112
|
*/
|
|
113
113
|
export class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
|
|
114
114
|
/**
|
|
@@ -132,7 +132,7 @@ export class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationTyp
|
|
|
132
132
|
* The properties of this object and its sub-objects represent the state of the sequence at the
|
|
133
133
|
* point in time at which the operation was applied.
|
|
134
134
|
* They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
|
|
135
|
-
* @
|
|
135
|
+
* @alpha
|
|
136
136
|
*/
|
|
137
137
|
export class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
|
|
138
138
|
constructor(
|
|
@@ -146,7 +146,7 @@ export class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenance
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* A range that has changed corresponding to a segment modification.
|
|
149
|
-
* @
|
|
149
|
+
* @alpha
|
|
150
150
|
*/
|
|
151
151
|
export interface ISequenceDeltaRange<
|
|
152
152
|
TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,
|
package/src/sequenceFactory.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { pkgVersion } from "./packageVersion";
|
|
|
14
14
|
import { SharedString, SharedStringSegment } from "./sharedString";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
17
|
+
* @alpha
|
|
18
18
|
*/
|
|
19
19
|
export class SharedStringFactory implements IChannelFactory {
|
|
20
20
|
// TODO rename back to https://graph.microsoft.com/types/mergeTree/string once paparazzi is able to dynamically
|
|
@@ -33,7 +33,7 @@ const snapshotFileName = "header";
|
|
|
33
33
|
/**
|
|
34
34
|
* The factory that defines the SharedIntervalCollection.
|
|
35
35
|
* @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
|
|
36
|
-
* @
|
|
36
|
+
* @internal
|
|
37
37
|
*/
|
|
38
38
|
export class SharedIntervalCollectionFactory implements IChannelFactory {
|
|
39
39
|
public static readonly Type = "https://graph.microsoft.com/types/sharedIntervalCollection";
|
|
@@ -76,7 +76,7 @@ export class SharedIntervalCollectionFactory implements IChannelFactory {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* @
|
|
79
|
+
* @alpha
|
|
80
80
|
*/
|
|
81
81
|
export interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
|
|
82
82
|
getIntervalCollection(label: string): IIntervalCollection<TInterval>;
|
|
@@ -84,7 +84,7 @@ export interface ISharedIntervalCollection<TInterval extends ISerializableInterv
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
|
|
87
|
-
* @
|
|
87
|
+
* @internal
|
|
88
88
|
*/
|
|
89
89
|
export class SharedIntervalCollection
|
|
90
90
|
extends SharedObject
|
package/src/sharedSequence.ts
CHANGED
|
@@ -16,7 +16,7 @@ const MaxRun = 128;
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @deprecated IJSONRunSegment will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
|
|
19
|
-
* @
|
|
19
|
+
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export interface IJSONRunSegment<T> extends IJSONSegment {
|
|
22
22
|
items: Serializable<T>[];
|
|
@@ -24,7 +24,7 @@ export interface IJSONRunSegment<T> extends IJSONSegment {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated SubSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
|
|
27
|
-
* @
|
|
27
|
+
* @internal
|
|
28
28
|
*/
|
|
29
29
|
export class SubSequence<T> extends BaseSegment {
|
|
30
30
|
public static readonly typeString: string = "SubSequence";
|
|
@@ -108,7 +108,7 @@ export class SubSequence<T> extends BaseSegment {
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* @deprecated SharedSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
|
|
111
|
-
* @
|
|
111
|
+
* @internal
|
|
112
112
|
*/
|
|
113
113
|
export class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>> {
|
|
114
114
|
constructor(
|
package/src/sharedString.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { SharedStringFactory } from "./sequenceFactory";
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Fluid object interface describing access methods on a SharedString
|
|
27
|
-
* @
|
|
27
|
+
* @alpha
|
|
28
28
|
*/
|
|
29
29
|
export interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {
|
|
30
30
|
/**
|
|
@@ -54,7 +54,7 @@ export interface ISharedString extends SharedSegmentSequence<SharedStringSegment
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* @
|
|
57
|
+
* @alpha
|
|
58
58
|
*/
|
|
59
59
|
export type SharedStringSegment = TextSegment | Marker;
|
|
60
60
|
|
|
@@ -66,8 +66,7 @@ export type SharedStringSegment = TextSegment | Marker;
|
|
|
66
66
|
* In addition to text, a Shared String can also contain markers. Markers can be
|
|
67
67
|
* used to store metadata at positions within the text, like the details of an
|
|
68
68
|
* image or Fluid object that should be rendered with the text.
|
|
69
|
-
*
|
|
70
|
-
* @public
|
|
69
|
+
* @alpha
|
|
71
70
|
*/
|
|
72
71
|
export class SharedString
|
|
73
72
|
extends SharedSegmentSequence<SharedStringSegment>
|
|
@@ -196,6 +195,10 @@ export class SharedString
|
|
|
196
195
|
* @param marker - The marker to annotate
|
|
197
196
|
* @param props - The properties to annotate the marker with
|
|
198
197
|
* @param consensusCallback - The callback called when consensus is reached
|
|
198
|
+
*
|
|
199
|
+
* @deprecated We no longer intend to support this functionality and it will
|
|
200
|
+
* be removed in a future release. There is no replacement for this
|
|
201
|
+
* functionality.
|
|
199
202
|
*/
|
|
200
203
|
public annotateMarkerNotifyConsensus(
|
|
201
204
|
marker: Marker,
|
|
@@ -339,7 +342,7 @@ interface ITextAndMarkerAccumulator {
|
|
|
339
342
|
* // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
|
|
340
343
|
* // Note parallelText does not include "missing".
|
|
341
344
|
* ```
|
|
342
|
-
* @
|
|
345
|
+
* @internal
|
|
343
346
|
*/
|
|
344
347
|
export function getTextAndMarkers(
|
|
345
348
|
sharedString: SharedString,
|
package/dist/defaultMap.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultMap.js","sourceRoot":"","sources":["../src/defaultMap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2EAK4C;AAC5C,+DAAiE;AACjE,2DAAoD;AACpD,+CAAsE;AAiFtE;;;;;;GAMG;AACH,MAAa,UAAU;IACtB;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACvB,CAAC;IAYD;;;;;;;OAOG;IACH,YACkB,UAA4B,EAC5B,MAAo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AC,CAAC;YAExC,MAAM,KAAK,GAAkB,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;YACpD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9E,CAAC,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,CAAC;IACjB,CAAC;CACD;AAnWD,gCAmWC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIFluidSerializer,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tValueType,\n} from \"@fluidframework/shared-object-base\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { makeSerializable, ValueTypeLocalValue } from \"./localValues\";\nimport {\n\tISerializableValue,\n\tISerializedValue,\n\tIValueChanged,\n\tIValueOpEmitter,\n\tIValueType,\n\tIValueTypeOperationValue,\n\tISharedDefaultMapEvents,\n\tIMapMessageLocalMetadata,\n\tSequenceOptions,\n} from \"./defaultMapInterfaces\";\n\n/**\n * Defines the means to process and submit a given op on a map.\n */\ninterface IMapMessageHandler {\n\t/**\n\t * Apply the given operation.\n\t * @param op - The map operation to apply\n\t * @param local - Whether the message originated from the local client\n\t * @param message - The full message. Not provided for stashed ops.\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprocess(\n\t\top: IMapOperation,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): void;\n\n\t/**\n\t * Communicate the operation to remote clients.\n\t * @param op - The map operation to submit\n\t */\n\tsubmit(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): void;\n\n\tresubmit(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): void;\n\n\tgetStashedOpLocalMetadata(op: IMapOperation): unknown;\n}\n\n/**\n * Describes an operation specific to a value type.\n */\nexport interface IMapValueTypeOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"act\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value of the operation, specific to the value type.\n\t * @alpha\n\t */\n\tvalue: IValueTypeOperationValue;\n}\n\n/**\n * Description of a map delta operation\n */\nexport type IMapOperation = IMapValueTypeOperation;\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n\t[key: string]: ISerializableValue;\n}\n\nexport interface IMapDataObjectSerialized {\n\t[key: string]: ISerializedValue;\n}\n\n/**\n * A DefaultMap is a map-like distributed data structure, supporting operations on values stored by\n * string key locations.\n *\n * Creation of values is implicit on access (either via `get` or a remote op application referring to\n * a collection that wasn't previously known)\n */\nexport class DefaultMap<T> {\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.data.size;\n\t}\n\n\t/**\n\t * Mapping of op types to message handlers.\n\t */\n\tprivate readonly messageHandlers: ReadonlyMap<string, IMapMessageHandler> = new Map();\n\n\t/**\n\t * The in-memory data the map is storing.\n\t */\n\tprivate readonly data = new Map<string, ValueTypeLocalValue<T>>();\n\n\t/**\n\t * Create a new default map.\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param handle - The handle of the shared object using the kernel\n\t * @param submitMessage - A callback to submit a message through the shared object\n\t * @param type - The value type to create at values of this map\n\t * @param eventEmitter - The object that will emit map events\n\t */\n\tconstructor(\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tprivate readonly handle: IFluidHandle,\n\t\tprivate readonly submitMessage: (\n\t\t\top: any,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t) => void,\n\t\tprivate readonly type: IValueType<T>,\n\t\tprivate readonly options?: Partial<SequenceOptions>,\n\t\tpublic readonly eventEmitter = new TypedEventEmitter<ISharedDefaultMapEvents>(),\n\t) {\n\t\tthis.messageHandlers = this.getMessageHandlers();\n\t}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.data.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\tconst localEntriesIterator = this.data.entries();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<[string, any]> {\n\t\t\t\tconst nextVal = localEntriesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: [nextVal.value[0], nextVal.value[1].value], done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<any> {\n\t\tconst localValuesIterator = this.data.values();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<any> {\n\t\t\t\tconst nextVal = localValuesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: nextVal.value.value, done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Executes the given callback on each entry in the map.\n\t * @param callbackFn - Callback function\n\t */\n\tpublic forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\tthis.data.forEach((localValue, key, m) => {\n\t\t\tcallbackFn(localValue.value, key, m);\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\tpublic get(key: string): T {\n\t\tconst localValue = this.data.get(key) ?? this.createCore(key, true);\n\n\t\treturn localValue.value;\n\t}\n\n\t/**\n\t * Check if a key exists in the map.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.data.has(key);\n\t}\n\n\t/**\n\t * Serializes the data stored in the shared map to a JSON string\n\t * @param serializer - The serializer to use to serialize handles in its values.\n\t * @returns A JSON string containing serialized map data\n\t */\n\tpublic getSerializedStorage(serializer: IFluidSerializer): IMapDataObjectSerialized {\n\t\tconst serializableMapData: IMapDataObjectSerialized = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = localValue.makeSerialized(serializer, this.handle);\n\t\t});\n\t\treturn serializableMapData;\n\t}\n\n\tpublic getSerializableStorage(serializer: IFluidSerializer): IMapDataObjectSerializable {\n\t\tconst serializableMapData: IMapDataObjectSerializable = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = makeSerializable(localValue, serializer, this.handle);\n\t\t});\n\t\treturn serializableMapData;\n\t}\n\n\tpublic serialize(serializer: IFluidSerializer): string {\n\t\treturn JSON.stringify(this.getSerializableStorage(serializer));\n\t}\n\n\t/**\n\t * Populate the kernel with the given map data.\n\t * @param data - A JSON string containing serialized map data\n\t */\n\tpublic populateFromSerializable(json: IMapDataObjectSerializable): void {\n\t\tfor (const [key, serializable] of Object.entries(json)) {\n\t\t\t// Back-compat: legacy documents may have handles to an intervalCollection map kernel.\n\t\t\t// These collections should be empty, and ValueTypes are no longer supported.\n\t\t\tif (\n\t\t\t\tserializable.type === ValueType[ValueType.Plain] ||\n\t\t\t\tserializable.type === ValueType[ValueType.Shared]\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Back-compat: Sequence previously arbitrarily prefixed all interval collection keys with\n\t\t\t// \"intervalCollections/\". This would burden users trying to iterate the collection and\n\t\t\t// access its value, as well as those trying to match a create message to its underlying\n\t\t\t// collection. See https://github.com/microsoft/FluidFramework/issues/10557 for more context.\n\t\t\tconst normalizedKey = key.startsWith(\"intervalCollections/\") ? key.substring(20) : key;\n\n\t\t\tconst localValue = {\n\t\t\t\tkey: normalizedKey,\n\t\t\t\tvalue: this.makeLocal(key, serializable),\n\t\t\t};\n\n\t\t\tthis.data.set(localValue.key, localValue.value);\n\t\t}\n\t}\n\n\tpublic populate(json: string): void {\n\t\tthis.populateFromSerializable(JSON.parse(json) as IMapDataObjectSerializable);\n\t}\n\n\t/**\n\t * Submit the given op if a handler is registered.\n\t * @param op - The operation to attempt to submit\n\t * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n\t * and not sent to the server. This will be sent back when this message is received back from the server. This is\n\t * also sent if we are asked to resubmit the message.\n\t * @returns True if the operation was submitted, false otherwise.\n\t */\n\tpublic tryResubmitMessage(op: any, localOpMetadata: IMapMessageLocalMetadata): boolean {\n\t\tconst type: string = op.type;\n\t\tconst handler = this.messageHandlers.get(type);\n\t\tif (handler !== undefined) {\n\t\t\thandler.resubmit(op as IMapOperation, localOpMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic tryGetStashedOpLocalMetadata(op: any): unknown {\n\t\tconst type: string = op.type;\n\t\tif (this.messageHandlers.has(type)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op as IMapOperation);\n\t\t}\n\t\tthrow new Error(\"no apply stashed op handler\");\n\t}\n\n\t/**\n\t * Process the given op if a handler is registered.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @returns True if the operation was processed, false otherwise.\n\t */\n\tpublic tryProcessMessage(\n\t\top: IMapOperation,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: unknown,\n\t): boolean {\n\t\tconst handler = this.messageHandlers.get(op.type);\n\t\tif (handler !== undefined) {\n\t\t\thandler.process(op, local, message, localOpMetadata as IMapMessageLocalMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Initializes a default ValueType at the provided key.\n\t * Should be used when a map operation incurs creation.\n\t * @param key - The key being initialized\n\t * @param local - Whether the message originated from the local client\n\t */\n\tprivate createCore(key: string, local: boolean): ValueTypeLocalValue<T> {\n\t\tconst localValue = new ValueTypeLocalValue(\n\t\t\tthis.type.factory.load(this.makeMapValueOpEmitter(key), undefined, this.options),\n\t\t\tthis.type,\n\t\t);\n\t\tconst previousValue = this.data.get(key);\n\t\tthis.data.set(key, localValue);\n\t\tconst event: IValueChanged = { key, previousValue };\n\t\tthis.eventEmitter.emit(\"create\", event, local, this.eventEmitter);\n\t\treturn localValue;\n\t}\n\n\t/**\n\t * The remote ISerializableValue we're receiving (either as a result of a load or an incoming set op) will\n\t * have the information we need to create a real object, but will not be the real object yet. For example,\n\t * we might know it's a map and the map's ID but not have the actual map or its data yet. makeLocal's\n\t * job is to convert that information into a real object for local usage.\n\t * @param key - The key that the caller intends to store the local value into (used for ops later). But\n\t * doesn't actually store the local value into that key. So better not lie!\n\t * @param serializable - The remote information that we can convert into a real object\n\t * @returns The local value that was produced\n\t */\n\tprivate makeLocal(key: string, serializable: ISerializableValue): ValueTypeLocalValue<T> {\n\t\tassert(\n\t\t\tserializable.type !== ValueType[ValueType.Plain] &&\n\t\t\t\tserializable.type !== ValueType[ValueType.Shared],\n\t\t\t0x2e1 /* \"Support for plain value types removed.\" */,\n\t\t);\n\n\t\tserializable.value = parseHandles(serializable.value, this.serializer);\n\t\tconst localValue = this.type.factory.load(\n\t\t\tthis.makeMapValueOpEmitter(key),\n\t\t\tserializable.value,\n\t\t\tthis.options,\n\t\t);\n\t\treturn new ValueTypeLocalValue(localValue, this.type);\n\t}\n\n\t/**\n\t * Get the message handlers for the map.\n\t * @returns A map of string op names to IMapMessageHandlers for those ops\n\t */\n\tprivate getMessageHandlers() {\n\t\tconst messageHandlers = new Map<string, IMapMessageHandler>();\n\t\t// Ops with type \"act\" describe actions taken by custom value type handlers of whatever item is\n\t\t// being addressed. These custom handlers can be retrieved from the ValueTypeLocalValue which has\n\t\t// stashed its valueType (and therefore its handlers). We also emit a valueChanged for anyone\n\t\t// watching for manipulations of that item.\n\t\tmessageHandlers.set(\"act\", {\n\t\t\tprocess: (op: IMapValueTypeOperation, local, message, localOpMetadata) => {\n\t\t\t\tconst localValue = this.data.get(op.key) ?? this.createCore(op.key, local);\n\t\t\t\tconst handler = localValue.getOpHandler(op.value.opName);\n\t\t\t\tconst previousValue = localValue.value;\n\t\t\t\tconst translatedValue = parseHandles(op.value.value, this.serializer);\n\t\t\t\thandler.process(previousValue, translatedValue, local, message, localOpMetadata);\n\t\t\t\tconst event: IValueChanged = { key: op.key, previousValue };\n\t\t\t\tthis.eventEmitter.emit(\"valueChanged\", event, local, message, this.eventEmitter);\n\t\t\t},\n\t\t\tsubmit: (op: IMapValueTypeOperation, localOpMetadata: IMapMessageLocalMetadata) => {\n\t\t\t\tthis.submitMessage(op, localOpMetadata);\n\t\t\t},\n\t\t\tresubmit: (op: IMapValueTypeOperation, localOpMetadata: IMapMessageLocalMetadata) => {\n\t\t\t\tconst localValue = this.data.get(op.key);\n\n\t\t\t\tassert(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);\n\n\t\t\t\tconst handler = localValue.getOpHandler(op.value.opName);\n\t\t\t\tconst { rebasedOp, rebasedLocalOpMetadata } = handler.rebase(\n\t\t\t\t\tlocalValue.value,\n\t\t\t\t\top.value,\n\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t);\n\t\t\t\tthis.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);\n\t\t\t},\n\t\t\tgetStashedOpLocalMetadata: (op: IMapValueTypeOperation) => {\n\t\t\t\tassert(\n\t\t\t\t\tfalse,\n\t\t\t\t\t0x016 /* \"apply stashed op not implemented for custom value type ops\" */,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\n\t\treturn messageHandlers;\n\t}\n\n\t/**\n\t * Create an emitter for a value type to emit ops from the given key.\n\t * @alpha\n\t * @param key - The key of the map that the value type will be stored on\n\t * @returns A value op emitter for the given key\n\t */\n\tprivate makeMapValueOpEmitter(key: string): IValueOpEmitter {\n\t\tconst emit = (\n\t\t\topName: string,\n\t\t\tpreviousValue: any,\n\t\t\tparams: any,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t) => {\n\t\t\tconst translatedParams = makeHandlesSerializable(params, this.serializer, this.handle);\n\n\t\t\tconst op: IMapValueTypeOperation = {\n\t\t\t\tkey,\n\t\t\t\ttype: \"act\",\n\t\t\t\tvalue: {\n\t\t\t\t\topName,\n\t\t\t\t\tvalue: translatedParams,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tthis.submitMessage(op, localOpMetadata);\n\n\t\t\tconst event: IValueChanged = { key, previousValue };\n\t\t\tthis.eventEmitter.emit(\"valueChanged\", event, true, null, this.eventEmitter);\n\t\t};\n\n\t\treturn { emit };\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultMapInterfaces.js","sourceRoot":"","sources":["../src/defaultMapInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IEventThisPlaceHolder } from \"@fluidframework/core-interfaces\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n\t/**\n\t * The key storing the value that changed.\n\t */\n\tkey: string;\n\n\t/**\n\t * The value that was stored at the key prior to the change.\n\t */\n\tpreviousValue: any;\n}\n\n/**\n * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.\n * @internal\n */\nexport interface IValueOpEmitter {\n\t/**\n\t * Called by the value type to emit a value type operation through the container type holding it.\n\t * @param opName - Name of the emitted operation\n\t * @param previousValue - JSONable previous value as defined by the value type\n\t * @param params - JSONable params for the operation as defined by the value type\n\t * @param localOpMetadata - JSONable local metadata which should be submitted with the op\n\t * @internal\n\t */\n\temit(\n\t\topName: string,\n\t\tpreviousValue: any,\n\t\tparams: any,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): void;\n}\n\n/**\n * @internal\n */\nexport interface IMapMessageLocalMetadata {\n\tlocalSeq: number;\n}\n\n/**\n * Optional flags that configure options for sequence DDSs\n * @public\n */\nexport interface SequenceOptions {\n\t/**\n\t * Enable the ability to use interval APIs that rely on positions before and\n\t * after individual characters, referred to as \"sides\". See {@link SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link SequencePlace} to\n\t * any IIntervalCollection API.\n\t *\n\t * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow\n\t * endpoints to slide to the special endpoint segments.\n\t *\n\t * The default value is false.\n\t */\n\tintervalStickinessEnabled: boolean;\n\t/**\n\t * Enable the ability for interval endpoints to slide to the special endpoint\n\t * segments that exist before and after the bounds of the string. This is\n\t * primarily useful for workflows involving interval stickiness, and it is\n\t * suggested to enable both this flag and `intervalStickinessEnabled` at the\n\t * same time.\n\t *\n\t * The default value is false.\n\t */\n\tmergeTreeReferencesCanSlideToEndpoint: boolean;\n\t[key: string]: boolean;\n}\n\n/**\n * A value factory is used to serialize/deserialize value types to a map\n * @alpha\n */\nexport interface IValueFactory<T> {\n\t/**\n\t * Create a new value type. Used both in creation of new value types, as well as in loading existing ones\n\t * from remote.\n\t * @param emitter - Emitter object that the created value type will use to emit operations\n\t * @param raw - Initialization parameters as defined by the value type\n\t * @returns The new value type\n\t * @alpha\n\t */\n\tload(emitter: IValueOpEmitter, raw: any, options?: Partial<SequenceOptions>): T;\n\n\t/**\n\t * Given a value type, provides a JSONable form of its data to be used for snapshotting. This data must be\n\t * loadable using the load method of its factory.\n\t * @param value - The value type to serialize\n\t * @returns The JSONable form of the value type\n\t * @alpha\n\t */\n\tstore(value: T): any;\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n * @alpha\n */\nexport interface IValueOperation<T> {\n\t/**\n\t * Performs the actual processing on the incoming operation.\n\t * @param value - The current value stored at the given key, which should be the value type\n\t * @param params - The params on the incoming operation\n\t * @param local - Whether the operation originated from this client\n\t * @param message - The operation itself\n\t * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.\n\t * @alpha\n\t */\n\tprocess(\n\t\tvalue: T,\n\t\tparams: any,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata | undefined,\n\t);\n\n\t/**\n\t * Rebases an `op` on `value` from its original perspective (ref/local seq) to the current\n\t * perspective. Should be invoked on reconnection.\n\t * @param value - The current value stored at the given key, which should be the value type.\n\t * @param op - The op to be rebased.\n\t * @param localOpMetadata - Any local metadata that was originally submitted with the op.\n\t * @returns A rebased version of the op and any local metadata that should be submitted with it.\n\t */\n\trebase(\n\t\tvalue: T,\n\t\top: IValueTypeOperationValue,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): { rebasedOp: IValueTypeOperationValue; rebasedLocalOpMetadata: IMapMessageLocalMetadata };\n}\n\n/**\n * Defines a value type that can be registered on a container type.\n */\nexport interface IValueType<T> {\n\t/**\n\t * Name of the value type.\n\t * @alpha\n\t */\n\tname: string;\n\n\t/**\n\t * Factory method used to convert to/from a JSON form of the type.\n\t * @alpha\n\t */\n\tfactory: IValueFactory<T>;\n\n\t/**\n\t * Operations that can be applied to the value type.\n\t * @alpha\n\t */\n\tops: Map<string, IValueOperation<T>>;\n}\n\nexport interface ISharedDefaultMapEvents extends ISharedObjectEvents {\n\t(\n\t\tevent: \"valueChanged\" | \"create\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * The DefaultMap impelmentation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: any;\n}\n\nexport interface ISerializedValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t */\n\tvalue: string | undefined;\n}\n\n/**\n * ValueTypes handle ops slightly differently from SharedObjects or plain JS objects. Since the Map/Directory doesn't\n * know how to handle the ValueType's ops, those ops are instead passed along to the ValueType for processing.\n * IValueTypeOperationValue is that passed-along op. The opName on it is the ValueType-specific operation and the\n * value is whatever params the ValueType needs to complete that operation. Similar to ISerializableValue, it is\n * serializable via JSON.stringify/parse but differs in that it has no equivalency with an in-memory value - rather\n * it just describes an operation to be applied to an already-in-memory value.\n * @alpha\n */\nexport interface IValueTypeOperationValue {\n\t/**\n\t * The name of the operation.\n\t */\n\topName: string;\n\n\t/**\n\t * The payload that is submitted along with the operation.\n\t */\n\tvalue: any;\n}\n"]}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,yCAYqB;AAVpB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AAGZ,6GAAA,gBAAgB,OAAA;AAEhB,+GAAA,kBAAkB,OAAA;AAElB,oHAAA,uBAAuB,OAAA;AAExB,2DAS8B;AAJ7B,iIAAA,2BAA2B,OAAA;AAC3B,0GAAA,IAAI,OAAA;AAIL,iDAcyB;AAVxB,gIAAA,+BAA+B,OAAA;AAC/B,wIAAA,uCAAuC,OAAA;AAGvC,2HAAA,0BAA0B,OAAA;AAC1B,6HAAA,4BAA4B,OAAA;AAE5B,sHAAA,qBAAqB,OAAA;AAErB,oHAAA,mBAAmB,OAAA;AAEpB,6CAUuB;AATtB,6HAAA,8BAA8B,OAAA;AAC9B,gIAAA,iCAAiC,OAAA;AACjC,gIAAA,iCAAiC,OAAA;AACjC,yIAAA,0CAA0C,OAAA;AAC1C,mIAAA,oCAAoC,OAAA;AACpC,6HAAA,8BAA8B,OAAA;AAE9B,4HAAA,6BAA6B,OAAA;AAG9B,uCAAiF;AAA1C,iHAAA,qBAAqB,OAAA;AAC5D,2DAK8B;AAH7B,wHAAA,kBAAkB,OAAA;AAClB,mHAAA,aAAa,OAAA;AACb,8HAAA,wBAAwB,OAAA;AAEzB,qDAAwD;AAA/C,sHAAA,mBAAmB,OAAA;AAC5B,+CAKwB;AAJvB,iHAAA,iBAAiB,OAAA;AAEjB,4GAAA,YAAY,OAAA;AAGb,uEAIoC;AAFnC,oIAAA,wBAAwB,OAAA;AACxB,2IAAA,+BAA+B,OAAA;AAEhC,mDAAgF;AAAtD,gHAAA,cAAc,OAAA;AAAE,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Supports distributed data structures which are list-like.\n *\n * This library's main export is {@link SharedString}, a DDS for storing and simultaneously editing a sequence of\n * text.\n *\n * See the package's README for a high-level introduction to `SharedString`'s feature set.\n * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for\n * working with text.\n *\n * @packageDocumentation\n */\nexport { IMapMessageLocalMetadata, IValueOpEmitter, SequenceOptions } from \"./defaultMapInterfaces\";\nexport {\n\tIInterval,\n\tInterval,\n\tIntervalOpType,\n\tIntervalType,\n\tISerializableInterval,\n\tISerializedInterval,\n\tSequenceInterval,\n\tSerializedIntervalDelta,\n\tIntervalStickiness,\n\tIIntervalHelpers,\n\tsequenceIntervalHelpers,\n} from \"./intervals\";\nexport {\n\tDeserializeCallback,\n\tIIntervalCollectionEvent,\n\tIIntervalCollection,\n\tIntervalLocator,\n\tintervalLocatorFromEndpoint,\n\tSide,\n\tInteriorSequencePlace,\n\tSequencePlace,\n} from \"./intervalCollection\";\nexport {\n\tIntervalIndex,\n\tSequenceIntervalIndexes,\n\tIOverlappingIntervalsIndex,\n\tcreateOverlappingIntervalsIndex,\n\tcreateOverlappingSequenceIntervalsIndex,\n\tIEndpointInRangeIndex,\n\tIStartpointInRangeIndex,\n\tcreateEndpointInRangeIndex,\n\tcreateStartpointInRangeIndex,\n\tIIdIntervalIndex,\n\tcreateIdIntervalIndex,\n\tIEndpointIndex,\n\tcreateEndpointIndex,\n} from \"./intervalIndex\";\nexport {\n\tappendAddIntervalToRevertibles,\n\tappendChangeIntervalToRevertibles,\n\tappendDeleteIntervalToRevertibles,\n\tappendIntervalPropertyChangedToRevertibles,\n\tappendSharedStringDeltaToRevertibles,\n\tdiscardSharedStringRevertibles,\n\tIntervalRevertible,\n\trevertSharedStringRevertibles,\n\tSharedStringRevertible,\n} from \"./revertibles\";\nexport { ISharedSegmentSequenceEvents, SharedSegmentSequence } from \"./sequence\";\nexport {\n\tISequenceDeltaRange,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceMaintenanceEvent,\n} from \"./sequenceDeltaEvent\";\nexport { SharedStringFactory } from \"./sequenceFactory\";\nexport {\n\tgetTextAndMarkers,\n\tISharedString,\n\tSharedString,\n\tSharedStringSegment,\n} from \"./sharedString\";\nexport {\n\tISharedIntervalCollection,\n\tSharedIntervalCollection,\n\tSharedIntervalCollectionFactory,\n} from \"./sharedIntervalCollection\";\nexport { IJSONRunSegment, SharedSequence, SubSequence } from \"./sharedSequence\";\n"]}
|