@fluidframework/sequence 2.0.0-internal.4.4.0 → 2.0.0-internal.5.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/intervalCollection.d.ts +6 -18
  7. package/dist/intervalCollection.d.ts.map +1 -1
  8. package/dist/intervalCollection.js +3 -8
  9. package/dist/intervalCollection.js.map +1 -1
  10. package/dist/packageVersion.d.ts +1 -1
  11. package/dist/packageVersion.js +1 -1
  12. package/dist/packageVersion.js.map +1 -1
  13. package/dist/revertibles.js +2 -2
  14. package/dist/revertibles.js.map +1 -1
  15. package/dist/sequence.d.ts +2 -2
  16. package/dist/sequence.d.ts.map +1 -1
  17. package/dist/sequence.js.map +1 -1
  18. package/dist/sharedIntervalCollection.d.ts +3 -3
  19. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  20. package/dist/sharedIntervalCollection.js.map +1 -1
  21. package/lib/index.d.ts +1 -1
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib/intervalCollection.d.ts +6 -18
  26. package/lib/intervalCollection.d.ts.map +1 -1
  27. package/lib/intervalCollection.js +3 -7
  28. package/lib/intervalCollection.js.map +1 -1
  29. package/lib/packageVersion.d.ts +1 -1
  30. package/lib/packageVersion.js +1 -1
  31. package/lib/packageVersion.js.map +1 -1
  32. package/lib/revertibles.js +2 -2
  33. package/lib/revertibles.js.map +1 -1
  34. package/lib/sequence.d.ts +2 -2
  35. package/lib/sequence.d.ts.map +1 -1
  36. package/lib/sequence.js.map +1 -1
  37. package/lib/sharedIntervalCollection.d.ts +3 -3
  38. package/lib/sharedIntervalCollection.d.ts.map +1 -1
  39. package/lib/sharedIntervalCollection.js.map +1 -1
  40. package/package.json +29 -13
  41. package/src/index.ts +0 -4
  42. package/src/intervalCollection.ts +12 -18
  43. package/src/packageVersion.ts +1 -1
  44. package/src/revertibles.ts +2 -2
  45. package/src/sequence.ts +2 -1
  46. package/src/sharedIntervalCollection.ts +3 -2
package/src/index.ts CHANGED
@@ -23,8 +23,6 @@ export {
23
23
  Interval,
24
24
  IntervalIndex,
25
25
  IIntervalCollection,
26
- IntervalCollection,
27
- IntervalCollectionIterator,
28
26
  IntervalLocator,
29
27
  intervalLocatorFromEndpoint,
30
28
  IntervalOpType,
@@ -32,8 +30,6 @@ export {
32
30
  ISerializableInterval,
33
31
  ISerializedInterval,
34
32
  SequenceInterval,
35
- ISerializedIntervalCollectionV2,
36
- CompressedSerializedInterval,
37
33
  SerializedIntervalDelta,
38
34
  IntervalStickiness,
39
35
  } from "./intervalCollection";
@@ -117,17 +117,11 @@ export type SerializedIntervalDelta = Omit<ISerializedInterval, "start" | "end"
117
117
  * Intervals are of the format:
118
118
  *
119
119
  * [start, end, sequenceNumber, intervalType, properties, stickiness?]
120
- *
121
- * @deprecated - Public export was never intended and will be removed.
122
120
  */
123
121
  export type CompressedSerializedInterval =
124
122
  | [number, number, number, IntervalType, PropertySet, IntervalStickiness]
125
123
  | [number, number, number, IntervalType, PropertySet];
126
124
 
127
- /**
128
- * @internal
129
- * @deprecated - Public export will be removed.
130
- */
131
125
  export interface ISerializedIntervalCollectionV2 {
132
126
  label: string;
133
127
  version: 2;
@@ -322,7 +316,7 @@ export class Interval implements ISerializableInterval {
322
316
  * Adds an auxiliary set of properties to this interval.
323
317
  * These properties can be recovered using `getAdditionalPropertySets`
324
318
  * @param props - set of properties to add
325
- * @remarks - This gets called as part of the default conflict resolver for `IntervalCollection<Interval>`
319
+ * @remarks - This gets called as part of the default conflict resolver for `IIntervalCollection<Interval>`
326
320
  * (i.e. non-sequence-based interval collections). However, the additional properties don't get serialized.
327
321
  * This functionality seems half-baked.
328
322
  */
@@ -1558,11 +1552,7 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
1558
1552
 
1559
1553
  export type DeserializeCallback = (properties: PropertySet) => void;
1560
1554
 
1561
- /**
1562
- * @deprecated - Public export will be removed. Use an appropriate iterator creation method on
1563
- * {@link IIntervalCollection} to iterate intervals instead.
1564
- */
1565
- export class IntervalCollectionIterator<TInterval extends ISerializableInterval>
1555
+ class IntervalCollectionIterator<TInterval extends ISerializableInterval>
1566
1556
  implements Iterator<TInterval>
1567
1557
  {
1568
1558
  private readonly results: TInterval[];
@@ -1655,10 +1645,7 @@ export interface IIntervalCollectionEvent<TInterval extends ISerializableInterva
1655
1645
 
1656
1646
  /**
1657
1647
  * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
1658
- * This class is not a DDS in its own right, but emits events on mutating operations such that it's possible to
1659
- * integrate into a DDS.
1660
- * This aligns with its usage in `SharedSegmentSequence`, which allows associating intervals to positions in the
1661
- * sequence DDS which are broadcast to all other clients in an eventually consistent fashion.
1648
+ * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
1662
1649
  */
1663
1650
  export interface IIntervalCollection<TInterval extends ISerializableInterval>
1664
1651
  extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>> {
@@ -1691,11 +1678,18 @@ export interface IIntervalCollection<TInterval extends ISerializableInterval>
1691
1678
  * @param end - interval end position (exclusive)
1692
1679
  * @param intervalType - type of the interval. All intervals are SlideOnRemove. Intervals may not be Transient.
1693
1680
  * @param props - properties of the interval
1681
+ * @param stickiness - {@link (IntervalStickiness:type)} to apply to the added interval.
1694
1682
  * @returns - the created interval
1695
1683
  * @remarks - See documentation on {@link SequenceInterval} for comments on interval endpoint semantics: there are subtleties
1696
1684
  * with how the current half-open behavior is represented.
1697
1685
  */
1698
- add(start: number, end: number, intervalType: IntervalType, props?: PropertySet): TInterval;
1686
+ add(
1687
+ start: number,
1688
+ end: number,
1689
+ intervalType: IntervalType,
1690
+ props?: PropertySet,
1691
+ stickiness?: IntervalStickiness,
1692
+ ): TInterval;
1699
1693
  /**
1700
1694
  * Removes an interval from the collection.
1701
1695
  * @param id - Id of the interval to remove
@@ -1776,7 +1770,7 @@ export interface IIntervalCollection<TInterval extends ISerializableInterval>
1776
1770
  }
1777
1771
 
1778
1772
  /**
1779
- * @deprecated - Use {@link IIntervalCollection} instead.
1773
+ * {@inheritdoc IIntervalCollection}
1780
1774
  */
1781
1775
  export class IntervalCollection<TInterval extends ISerializableInterval>
1782
1776
  extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>>
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/sequence";
9
- export const pkgVersion = "2.0.0-internal.4.4.0";
9
+ export const pkgVersion = "2.0.0-internal.5.0.0";
@@ -284,7 +284,7 @@ export function appendSharedStringDeltaToRevertibles(
284
284
 
285
285
  if (startIntervals.length > 0 || endIntervals.length > 0 || revertibleRefs.length > 0) {
286
286
  const removeRevertibles: MergeTreeDeltaRevertible[] = [];
287
- appendToMergeTreeDeltaRevertibles(string, delta.deltaArgs, removeRevertibles);
287
+ appendToMergeTreeDeltaRevertibles(delta.deltaArgs, removeRevertibles);
288
288
  assert(
289
289
  removeRevertibles.length === 1,
290
290
  0x6c4 /* Remove revertible should be a single delta */,
@@ -337,7 +337,7 @@ export function appendSharedStringDeltaToRevertibles(
337
337
  if (revertibles.length > 0 && isMergeTreeDeltaRevertible(revertibles[revertibles.length - 1])) {
338
338
  mergeTreeRevertibles.push(revertibles.pop() as MergeTreeDeltaRevertible);
339
339
  }
340
- appendToMergeTreeDeltaRevertibles(string, delta.deltaArgs, mergeTreeRevertibles);
340
+ appendToMergeTreeDeltaRevertibles(delta.deltaArgs, mergeTreeRevertibles);
341
341
  revertibles.push(...mergeTreeRevertibles);
342
342
  }
343
343
 
package/src/sequence.ts CHANGED
@@ -52,6 +52,7 @@ import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtim
52
52
  import { DefaultMap, IMapOperation } from "./defaultMap";
53
53
  import { IMapMessageLocalMetadata, IValueChanged } from "./defaultMapInterfaces";
54
54
  import {
55
+ IIntervalCollection,
55
56
  IntervalCollection,
56
57
  SequenceInterval,
57
58
  SequenceIntervalCollectionValueType,
@@ -451,7 +452,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
451
452
  * Retrieves the interval collection keyed on `label`. If no such interval collection exists,
452
453
  * creates one.
453
454
  */
454
- public getIntervalCollection(label: string): IntervalCollection<SequenceInterval> {
455
+ public getIntervalCollection(label: string): IIntervalCollection<SequenceInterval> {
455
456
  return this.intervalCollections.get(label);
456
457
  }
457
458
 
@@ -21,6 +21,7 @@ import {
21
21
  import {
22
22
  Interval,
23
23
  IntervalCollection,
24
+ IIntervalCollection,
24
25
  IntervalCollectionValueType,
25
26
  ISerializableInterval,
26
27
  } from "./intervalCollection";
@@ -75,7 +76,7 @@ export class SharedIntervalCollectionFactory implements IChannelFactory {
75
76
  }
76
77
 
77
78
  export interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
78
- getIntervalCollection(label: string): IntervalCollection<TInterval>;
79
+ getIntervalCollection(label: string): IIntervalCollection<TInterval>;
79
80
  }
80
81
 
81
82
  /**
@@ -126,7 +127,7 @@ export class SharedIntervalCollection
126
127
  );
127
128
  }
128
129
 
129
- public getIntervalCollection(label: string): IntervalCollection<Interval> {
130
+ public getIntervalCollection(label: string): IIntervalCollection<Interval> {
130
131
  const realLabel = this.getIntervalCollectionPath(label);
131
132
  const sharedCollection = this.intervalCollections.get(realLabel);
132
133
  return sharedCollection;