@fluidframework/sequence 2.41.0 → 2.43.0-343119

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 (75) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/sequence.legacy.alpha.api.md +13 -5
  3. package/dist/intervalCollection.d.ts +14 -19
  4. package/dist/intervalCollection.d.ts.map +1 -1
  5. package/dist/intervalCollection.js +113 -128
  6. package/dist/intervalCollection.js.map +1 -1
  7. package/dist/intervalCollectionMap.d.ts +3 -3
  8. package/dist/intervalCollectionMap.d.ts.map +1 -1
  9. package/dist/intervalCollectionMap.js.map +1 -1
  10. package/dist/intervalCollectionMapInterfaces.d.ts +22 -4
  11. package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
  12. package/dist/intervalCollectionMapInterfaces.js.map +1 -1
  13. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +4 -4
  14. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  15. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  16. package/dist/intervals/intervalUtils.d.ts +12 -1
  17. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  18. package/dist/intervals/intervalUtils.js.map +1 -1
  19. package/dist/intervals/sequenceInterval.d.ts +18 -5
  20. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  21. package/dist/intervals/sequenceInterval.js +2 -1
  22. package/dist/intervals/sequenceInterval.js.map +1 -1
  23. package/dist/packageVersion.d.ts +1 -1
  24. package/dist/packageVersion.d.ts.map +1 -1
  25. package/dist/packageVersion.js +1 -1
  26. package/dist/packageVersion.js.map +1 -1
  27. package/dist/revertibles.d.ts.map +1 -1
  28. package/dist/revertibles.js +6 -3
  29. package/dist/revertibles.js.map +1 -1
  30. package/dist/sequence.d.ts +2 -1
  31. package/dist/sequence.d.ts.map +1 -1
  32. package/dist/sequence.js +6 -3
  33. package/dist/sequence.js.map +1 -1
  34. package/lib/intervalCollection.d.ts +14 -19
  35. package/lib/intervalCollection.d.ts.map +1 -1
  36. package/lib/intervalCollection.js +114 -129
  37. package/lib/intervalCollection.js.map +1 -1
  38. package/lib/intervalCollectionMap.d.ts +3 -3
  39. package/lib/intervalCollectionMap.d.ts.map +1 -1
  40. package/lib/intervalCollectionMap.js.map +1 -1
  41. package/lib/intervalCollectionMapInterfaces.d.ts +22 -4
  42. package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
  43. package/lib/intervalCollectionMapInterfaces.js.map +1 -1
  44. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +4 -4
  45. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  46. package/lib/intervalIndex/overlappingIntervalsIndex.js +1 -1
  47. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  48. package/lib/intervals/intervalUtils.d.ts +12 -1
  49. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  50. package/lib/intervals/intervalUtils.js.map +1 -1
  51. package/lib/intervals/sequenceInterval.d.ts +18 -5
  52. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  53. package/lib/intervals/sequenceInterval.js +2 -1
  54. package/lib/intervals/sequenceInterval.js.map +1 -1
  55. package/lib/packageVersion.d.ts +1 -1
  56. package/lib/packageVersion.d.ts.map +1 -1
  57. package/lib/packageVersion.js +1 -1
  58. package/lib/packageVersion.js.map +1 -1
  59. package/lib/revertibles.d.ts.map +1 -1
  60. package/lib/revertibles.js +6 -3
  61. package/lib/revertibles.js.map +1 -1
  62. package/lib/sequence.d.ts +2 -1
  63. package/lib/sequence.d.ts.map +1 -1
  64. package/lib/sequence.js +6 -3
  65. package/lib/sequence.js.map +1 -1
  66. package/package.json +17 -17
  67. package/src/intervalCollection.ts +191 -195
  68. package/src/intervalCollectionMap.ts +4 -11
  69. package/src/intervalCollectionMapInterfaces.ts +25 -5
  70. package/src/intervalIndex/overlappingIntervalsIndex.ts +15 -11
  71. package/src/intervals/intervalUtils.ts +12 -1
  72. package/src/intervals/sequenceInterval.ts +22 -4
  73. package/src/packageVersion.ts +1 -1
  74. package/src/revertibles.ts +7 -6
  75. package/src/sequence.ts +11 -13
@@ -3,13 +3,31 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
6
- import type { IMergeTreeOptions } from "@fluidframework/merge-tree/internal";
6
+ import { IMergeTreeOptions, ListNode } from "@fluidframework/merge-tree/internal";
7
7
  import type { IntervalCollection, ISerializedIntervalCollectionV1, ISerializedIntervalCollectionV2 } from "./intervalCollection.js";
8
8
  import { ISerializedInterval, IntervalDeltaOpType, SerializedIntervalDelta } from "./intervals/index.js";
9
- export interface IMapMessageLocalMetadata {
9
+ export interface IntervalAddLocalMetadata {
10
+ type: typeof IntervalDeltaOpType.ADD;
10
11
  localSeq: number;
11
- previous?: ISerializedInterval;
12
+ endpointChangesNode?: ListNode<IntervalAddLocalMetadata | IntervalChangeLocalMetadata>;
13
+ rebased?: ISerializedInterval;
14
+ original: ISerializedInterval;
12
15
  }
16
+ export interface IntervalChangeLocalMetadata {
17
+ type: typeof IntervalDeltaOpType.CHANGE;
18
+ localSeq: number;
19
+ previous: ISerializedInterval;
20
+ endpointChangesNode?: ListNode<IntervalChangeLocalMetadata | IntervalChangeLocalMetadata>;
21
+ rebased?: SerializedIntervalDelta;
22
+ original: SerializedIntervalDelta;
23
+ }
24
+ export interface IntervalDeleteLocalMetadata {
25
+ type: typeof IntervalDeltaOpType.DELETE;
26
+ localSeq: number;
27
+ previous: ISerializedInterval;
28
+ endpointChangesNode?: undefined;
29
+ }
30
+ export type IntervalMessageLocalMetadata = IntervalAddLocalMetadata | IntervalChangeLocalMetadata | IntervalDeleteLocalMetadata;
13
31
  /**
14
32
  * Optional flags that configure options for sequence DDSs
15
33
  * @internal
@@ -47,7 +65,7 @@ export interface IIntervalCollectionOperation {
47
65
  * @param message - The operation itself
48
66
  * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.
49
67
  */
50
- process(value: IntervalCollection, params: ISerializedInterval, local: boolean, message: ISequencedDocumentMessage | undefined, localOpMetadata: IMapMessageLocalMetadata | undefined): void;
68
+ process(value: IntervalCollection, params: ISerializedInterval, local: boolean, message: ISequencedDocumentMessage | undefined, localOpMetadata: IntervalMessageLocalMetadata | undefined): void;
51
69
  }
52
70
  /**
53
71
  * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollectionMapInterfaces.d.ts","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,eAChB,SAAQ,IAAI,CACX,iBAAiB,EACf,uCAAuC,GACvC,2BAA2B,GAC3B,gCAAgC,GAChC,+BAA+B,CACjC;IACD;;;;;;;;;;;;OAYG;IACH,yBAAyB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,2BAA2B,EAAE,GAAG,GAAG,GAAG,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;;;;OAOG;IACH,OAAO,CACN,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,yBAAyB,GAAG,SAAS,EAC9C,eAAe,EAAE,wBAAwB,GAAG,SAAS,GACnD,IAAI,CAAC;CACR;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,IAAI,EAAE,gCAAgC,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,+BAA+B,GAAG,+BAA+B,CAAC;CACzE;AAED,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qCAAqC,GAC9C;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,GAAG,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAC;CAC1B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"intervalCollectionMapInterfaces.d.ts","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,KAAK,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,OAAO,mBAAmB,CAAC,GAAG,CAAC;IACrC,Q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R;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,IAAI,EAAE,gCAAgC,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,+BAA+B,GAAG,+BAA+B,CAAC;CACzE;AAED,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qCAAqC,GAC9C;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,GAAG,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAC;CAC1B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollectionMapInterfaces.js","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.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/driver-definitions/internal\";\nimport type { IMergeTreeOptions } from \"@fluidframework/merge-tree/internal\";\n\nimport type {\n\tIntervalCollection,\n\tISerializedIntervalCollectionV1,\n\tISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tISerializedInterval,\n\tIntervalDeltaOpType,\n\tSerializedIntervalDelta,\n} from \"./intervals/index.js\";\n\nexport interface IMapMessageLocalMetadata {\n\tlocalSeq: number;\n\tprevious?: ISerializedInterval;\n}\n\n/**\n * Optional flags that configure options for sequence DDSs\n * @internal\n */\nexport interface SequenceOptions\n\textends Pick<\n\t\tIMergeTreeOptions,\n\t\t| \"mergeTreeReferencesCanSlideToEndpoint\"\n\t\t| \"mergeTreeEnableObliterate\"\n\t\t| \"mergeTreeEnableSidedObliterate\"\n\t\t| \"mergeTreeEnableAnnotateAdjust\"\n\t> {\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 @fluidframework/merge-tree#SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link @fluidframework/merge-tree#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\n\t/**\n\t * This is for testing, and allows us to output intervals in the older formats.\n\t */\n\tintervalSerializationFormat: \"1\" | \"2\";\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n *\n */\nexport interface IIntervalCollectionOperation {\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 */\n\tprocess(\n\t\tvalue: IntervalCollection,\n\t\tparams: ISerializedInterval,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata | undefined,\n\t): void;\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 implementation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: \"sharedStringIntervalCollection\";\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;\n}\n\nexport interface ISerializedIntervalCollection {\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 */\nexport type IIntervalCollectionTypeOperationValue =\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.ADD;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: ISerializedInterval;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.CHANGE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.DELETE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t };\n"]}
1
+ {"version":3,"file":"intervalCollectionMapInterfaces.js","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.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/driver-definitions/internal\";\nimport { IMergeTreeOptions, ListNode } from \"@fluidframework/merge-tree/internal\";\n\nimport type {\n\tIntervalCollection,\n\tISerializedIntervalCollectionV1,\n\tISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tISerializedInterval,\n\tIntervalDeltaOpType,\n\tSerializedIntervalDelta,\n} from \"./intervals/index.js\";\n\nexport interface IntervalAddLocalMetadata {\n\ttype: typeof IntervalDeltaOpType.ADD;\n\tlocalSeq: number;\n\tendpointChangesNode?: ListNode<IntervalAddLocalMetadata | IntervalChangeLocalMetadata>;\n\trebased?: ISerializedInterval;\n\toriginal: ISerializedInterval;\n}\nexport interface IntervalChangeLocalMetadata {\n\ttype: typeof IntervalDeltaOpType.CHANGE;\n\tlocalSeq: number;\n\tprevious: ISerializedInterval;\n\tendpointChangesNode?: ListNode<IntervalChangeLocalMetadata | IntervalChangeLocalMetadata>;\n\trebased?: SerializedIntervalDelta;\n\toriginal: SerializedIntervalDelta;\n}\nexport interface IntervalDeleteLocalMetadata {\n\ttype: typeof IntervalDeltaOpType.DELETE;\n\tlocalSeq: number;\n\tprevious: ISerializedInterval;\n\tendpointChangesNode?: undefined;\n}\nexport type IntervalMessageLocalMetadata =\n\t| IntervalAddLocalMetadata\n\t| IntervalChangeLocalMetadata\n\t| IntervalDeleteLocalMetadata;\n/**\n * Optional flags that configure options for sequence DDSs\n * @internal\n */\nexport interface SequenceOptions\n\textends Pick<\n\t\tIMergeTreeOptions,\n\t\t| \"mergeTreeReferencesCanSlideToEndpoint\"\n\t\t| \"mergeTreeEnableObliterate\"\n\t\t| \"mergeTreeEnableSidedObliterate\"\n\t\t| \"mergeTreeEnableAnnotateAdjust\"\n\t> {\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 @fluidframework/merge-tree#SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link @fluidframework/merge-tree#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\n\t/**\n\t * This is for testing, and allows us to output intervals in the older formats.\n\t */\n\tintervalSerializationFormat: \"1\" | \"2\";\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n *\n */\nexport interface IIntervalCollectionOperation {\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 */\n\tprocess(\n\t\tvalue: IntervalCollection,\n\t\tparams: ISerializedInterval,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IntervalMessageLocalMetadata | undefined,\n\t): void;\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 implementation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: \"sharedStringIntervalCollection\";\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;\n}\n\nexport interface ISerializedIntervalCollection {\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 */\nexport type IIntervalCollectionTypeOperationValue =\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.ADD;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: ISerializedInterval;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.CHANGE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.DELETE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t };\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { Client, SequencePlace } from "@fluidframework/merge-tree/internal";
6
6
  import { IntervalTree } from "../intervalTree.js";
7
- import { SequenceInterval } from "../intervals/index.js";
7
+ import { SequenceInterval, SequenceIntervalClass } from "../intervals/index.js";
8
8
  import { ISharedString } from "../sharedString.js";
9
9
  import { type SequenceIntervalIndex } from "./intervalIndex.js";
10
10
  /**
@@ -23,15 +23,15 @@ export interface ISequenceOverlappingIntervalsIndex extends SequenceIntervalInde
23
23
  gatherIterationResults(results: SequenceInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
24
24
  }
25
25
  export declare class OverlappingIntervalsIndex implements ISequenceOverlappingIntervalsIndex {
26
- protected readonly intervalTree: IntervalTree<SequenceInterval>;
26
+ protected readonly intervalTree: IntervalTree<SequenceIntervalClass>;
27
27
  protected readonly client: Client;
28
28
  constructor(client: Client);
29
29
  map(fn: (interval: SequenceInterval) => void): void;
30
30
  mapUntil(fn: (interval: SequenceInterval) => boolean): void;
31
31
  gatherIterationResults(results: SequenceInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
32
32
  findOverlappingIntervals(start: SequencePlace, end: SequencePlace): SequenceInterval[];
33
- remove(interval: SequenceInterval): void;
34
- add(interval: SequenceInterval): void;
33
+ remove(interval: SequenceIntervalClass): void;
34
+ add(interval: SequenceIntervalClass): void;
35
35
  }
36
36
  /**
37
37
  * @legacy
@@ -1 +1 @@
1
- {"version":3,"file":"overlappingIntervalsIndex.d.ts","sourceRoot":"","sources":["../../src/intervalIndex/overlappingIntervalsIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,MAAM,EACN,aAAa,EAEb,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAgB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAA2B,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,kCAAmC,SAAQ,qBAAqB;IAChF;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,E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0B;QACpC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACD;AA7HD,8DA6HC;AAED;;;GAGG;AACH,SAAgB,+BAA+B,CAC9C,YAA2B;IAE3B,MAAM,MAAM,GAAI,YAA8C,CAAC,MAAM,CAAC;IACtE,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AALD,0EAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable import/no-deprecated */\n\nimport {\n\tClient,\n\tSequencePlace,\n\tendpointPosAndSide,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { IntervalNode, IntervalTree } from \"../intervalTree.js\";\nimport { SequenceInterval, createTransientInterval } from \"../intervals/index.js\";\nimport { ISharedString } from \"../sharedString.js\";\n\nimport { type SequenceIntervalIndex } from \"./intervalIndex.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISequenceOverlappingIntervalsIndex extends SequenceIntervalIndex {\n\t/**\n\t * @returns an array of all intervals contained in this collection that overlap the range\n\t * `[start end]`.\n\t */\n\tfindOverlappingIntervals(start: SequencePlace, end: SequencePlace): SequenceInterval[];\n\n\t/**\n\t * Gathers the interval results based on specified parameters.\n\t */\n\tgatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: SequencePlace,\n\t\tend?: SequencePlace,\n\t): void;\n}\n\nexport class OverlappingIntervalsIndex implements ISequenceOverlappingIntervalsIndex {\n\tprotected readonly intervalTree = new IntervalTree<SequenceInterval>();\n\tprotected readonly client: Client;\n\n\tconstructor(client: Client) {\n\t\tthis.client = client;\n\t}\n\n\tpublic map(fn: (interval: SequenceInterval) => void) {\n\t\tthis.intervalTree.map(fn);\n\t}\n\n\tpublic mapUntil(fn: (interval: SequenceInterval) => boolean) {\n\t\tthis.intervalTree.mapUntil(fn);\n\t}\n\n\tpublic gatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: SequencePlace,\n\t\tend?: SequencePlace,\n\t): void {\n\t\tif (this.intervalTree.intervals.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (start === undefined && end === undefined) {\n\t\t\t// No start/end provided. Gather the whole tree in the specified order.\n\t\t\tif (iteratesForward) {\n\t\t\t\tthis.intervalTree.map((interval: SequenceInterval) => {\n\t\t\t\t\tresults.push(interval);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.intervalTree.mapBackward((interval: SequenceInterval) => {\n\t\t\t\t\tresults.push(interval);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst transientInterval: SequenceInterval = createTransientInterval(\n\t\t\t\tstart ?? \"start\",\n\t\t\t\tend ?? \"end\",\n\t\t\t\tthis.client,\n\t\t\t);\n\n\t\t\tif (start === undefined) {\n\t\t\t\t// Only end position provided. Since the tree is not sorted by end position,\n\t\t\t\t// walk the whole tree in the specified order, gathering intervals that match the end.\n\t\t\t\tif (iteratesForward) {\n\t\t\t\t\tthis.intervalTree.map((interval: SequenceInterval) => {\n\t\t\t\t\t\tif (transientInterval.compareEnd(interval) === 0) {\n\t\t\t\t\t\t\tresults.push(interval);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.intervalTree.mapBackward((interval: SequenceInterval) => {\n\t\t\t\t\t\tif (transientInterval.compareEnd(interval) === 0) {\n\t\t\t\t\t\t\tresults.push(interval);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Start and (possibly) end provided. Walk the subtrees that may contain\n\t\t\t\t// this start position.\n\t\t\t\tconst compareFn =\n\t\t\t\t\tend === undefined\n\t\t\t\t\t\t? (node: IntervalNode<SequenceInterval>) => {\n\t\t\t\t\t\t\t\treturn transientInterval.compareStart(node.key);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: (node: IntervalNode<SequenceInterval>) => {\n\t\t\t\t\t\t\t\treturn transientInterval.compare(node.key);\n\t\t\t\t\t\t\t};\n\t\t\t\tconst continueLeftFn = (cmpResult: number) => cmpResult <= 0;\n\t\t\t\tconst continueRightFn = (cmpResult: number) => cmpResult >= 0;\n\t\t\t\tconst actionFn = (node: IntervalNode<SequenceInterval>) => {\n\t\t\t\t\tresults.push(node.key);\n\t\t\t\t};\n\n\t\t\t\tif (iteratesForward) {\n\t\t\t\t\tthis.intervalTree.intervals.walkExactMatchesForward(\n\t\t\t\t\t\tcompareFn,\n\t\t\t\t\t\tactionFn,\n\t\t\t\t\t\tcontinueLeftFn,\n\t\t\t\t\t\tcontinueRightFn,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.intervalTree.intervals.walkExactMatchesBackward(\n\t\t\t\t\t\tcompareFn,\n\t\t\t\t\t\tactionFn,\n\t\t\t\t\t\tcontinueLeftFn,\n\t\t\t\t\t\tcontinueRightFn,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic findOverlappingIntervals(\n\t\tstart: SequencePlace,\n\t\tend: SequencePlace,\n\t): SequenceInterval[] {\n\t\tconst { startPos, endPos } = endpointPosAndSide(start, end);\n\n\t\tif (\n\t\t\tstartPos === undefined ||\n\t\t\tendPos === undefined ||\n\t\t\t(typeof startPos === \"number\" && typeof endPos === \"number\" && endPos < startPos) ||\n\t\t\t(startPos === \"end\" && endPos !== \"end\") ||\n\t\t\t(startPos !== \"start\" && endPos === \"start\") ||\n\t\t\tthis.intervalTree.intervals.isEmpty()\n\t\t) {\n\t\t\treturn [];\n\t\t}\n\t\tconst transientInterval = createTransientInterval(start, end, this.client);\n\n\t\tconst overlappingIntervalNodes = this.intervalTree.match(transientInterval);\n\t\treturn overlappingIntervalNodes.map((node) => node.key);\n\t}\n\n\tpublic remove(interval: SequenceInterval) {\n\t\tthis.intervalTree.removeExisting(interval);\n\t}\n\n\tpublic add(interval: SequenceInterval) {\n\t\tthis.intervalTree.put(interval);\n\t}\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport function createOverlappingIntervalsIndex(\n\tsharedString: ISharedString,\n): ISequenceOverlappingIntervalsIndex {\n\tconst client = (sharedString as unknown as { client: Client }).client;\n\treturn new OverlappingIntervalsIndex(client);\n}\n"]}
1
+ {"version":3,"file":"overlappingIntervalsIndex.js","sourceRoot":"","sources":["../../src/intervalIndex/overlappingIntervalsIndex.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAyC;AAEzC,kEAI6C;AAE7C,wDAAgE;AAChE,oDAI+B;AA2B/B,MAAa,yBAAyB;IAIrC,YAAY,MAAc;QAHP,iBAAY,GAAG,IAAI,8BAAY,EAAyB,CAAC;QAI3E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAEM,GAAG,CAAC,EAAwC;QAClD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAEM,QAAQ,CAAC,EAA2C;QAC1D,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAEM,sBAAsB,CAC5B,OAA2B,EAC3B,eAAwB,EACxB,KAAqB,EACrB,GAAmB;QAEnB,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YAC3C,OAAO;QACR,CAAC;QAED,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YAC9C,uEAAuE;YACvE,IAAI,eAAe,EAAE,CAAC;gBACrB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,QAA+B,EAAE,EAAE;oBACzD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxB,CAAC,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,YAAY,CAAC,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M,CAAC,CAAC;QAE3E,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC5E,OAAO,wBAAwB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAEM,MAAM,CAAC,QAA+B;QAC5C,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,GAAG,CAAC,QAA+B;QACzC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACD;AA7HD,8DA6HC;AAED;;;GAGG;AACH,SAAgB,+BAA+B,CAC9C,YAA2B;IAE3B,MAAM,MAAM,GAAI,YAA8C,CAAC,MAAM,CAAC;IACtE,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AALD,0EAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable import/no-deprecated */\n\nimport {\n\tClient,\n\tSequencePlace,\n\tendpointPosAndSide,\n} from \"@fluidframework/merge-tree/internal\";\n\nimport { IntervalNode, IntervalTree } from \"../intervalTree.js\";\nimport {\n\tSequenceInterval,\n\tSequenceIntervalClass,\n\tcreateTransientInterval,\n} from \"../intervals/index.js\";\nimport { ISharedString } from \"../sharedString.js\";\n\nimport { type SequenceIntervalIndex } from \"./intervalIndex.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISequenceOverlappingIntervalsIndex extends SequenceIntervalIndex {\n\t/**\n\t * @returns an array of all intervals contained in this collection that overlap the range\n\t * `[start end]`.\n\t */\n\tfindOverlappingIntervals(start: SequencePlace, end: SequencePlace): SequenceInterval[];\n\n\t/**\n\t * Gathers the interval results based on specified parameters.\n\t */\n\tgatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: SequencePlace,\n\t\tend?: SequencePlace,\n\t): void;\n}\n\nexport class OverlappingIntervalsIndex implements ISequenceOverlappingIntervalsIndex {\n\tprotected readonly intervalTree = new IntervalTree<SequenceIntervalClass>();\n\tprotected readonly client: Client;\n\n\tconstructor(client: Client) {\n\t\tthis.client = client;\n\t}\n\n\tpublic map(fn: (interval: SequenceInterval) => void) {\n\t\tthis.intervalTree.map(fn);\n\t}\n\n\tpublic mapUntil(fn: (interval: SequenceInterval) => boolean) {\n\t\tthis.intervalTree.mapUntil(fn);\n\t}\n\n\tpublic gatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: SequencePlace,\n\t\tend?: SequencePlace,\n\t): void {\n\t\tif (this.intervalTree.intervals.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (start === undefined && end === undefined) {\n\t\t\t// No start/end provided. Gather the whole tree in the specified order.\n\t\t\tif (iteratesForward) {\n\t\t\t\tthis.intervalTree.map((interval: SequenceIntervalClass) => {\n\t\t\t\t\tresults.push(interval);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.intervalTree.mapBackward((interval: SequenceInterval) => {\n\t\t\t\t\tresults.push(interval);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst transientInterval: SequenceIntervalClass = createTransientInterval(\n\t\t\t\tstart ?? \"start\",\n\t\t\t\tend ?? \"end\",\n\t\t\t\tthis.client,\n\t\t\t);\n\n\t\t\tif (start === undefined) {\n\t\t\t\t// Only end position provided. Since the tree is not sorted by end position,\n\t\t\t\t// walk the whole tree in the specified order, gathering intervals that match the end.\n\t\t\t\tif (iteratesForward) {\n\t\t\t\t\tthis.intervalTree.map((interval: SequenceIntervalClass) => {\n\t\t\t\t\t\tif (transientInterval.compareEnd(interval) === 0) {\n\t\t\t\t\t\t\tresults.push(interval);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.intervalTree.mapBackward((interval: SequenceIntervalClass) => {\n\t\t\t\t\t\tif (transientInterval.compareEnd(interval) === 0) {\n\t\t\t\t\t\t\tresults.push(interval);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Start and (possibly) end provided. Walk the subtrees that may contain\n\t\t\t\t// this start position.\n\t\t\t\tconst compareFn =\n\t\t\t\t\tend === undefined\n\t\t\t\t\t\t? (node: IntervalNode<SequenceIntervalClass>) => {\n\t\t\t\t\t\t\t\treturn transientInterval.compareStart(node.key);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: (node: IntervalNode<SequenceIntervalClass>) => {\n\t\t\t\t\t\t\t\treturn transientInterval.compare(node.key);\n\t\t\t\t\t\t\t};\n\t\t\t\tconst continueLeftFn = (cmpResult: number) => cmpResult <= 0;\n\t\t\t\tconst continueRightFn = (cmpResult: number) => cmpResult >= 0;\n\t\t\t\tconst actionFn = (node: IntervalNode<SequenceIntervalClass>) => {\n\t\t\t\t\tresults.push(node.key);\n\t\t\t\t};\n\n\t\t\t\tif (iteratesForward) {\n\t\t\t\t\tthis.intervalTree.intervals.walkExactMatchesForward(\n\t\t\t\t\t\tcompareFn,\n\t\t\t\t\t\tactionFn,\n\t\t\t\t\t\tcontinueLeftFn,\n\t\t\t\t\t\tcontinueRightFn,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.intervalTree.intervals.walkExactMatchesBackward(\n\t\t\t\t\t\tcompareFn,\n\t\t\t\t\t\tactionFn,\n\t\t\t\t\t\tcontinueLeftFn,\n\t\t\t\t\t\tcontinueRightFn,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic findOverlappingIntervals(\n\t\tstart: SequencePlace,\n\t\tend: SequencePlace,\n\t): SequenceInterval[] {\n\t\tconst { startPos, endPos } = endpointPosAndSide(start, end);\n\n\t\tif (\n\t\t\tstartPos === undefined ||\n\t\t\tendPos === undefined ||\n\t\t\t(typeof startPos === \"number\" && typeof endPos === \"number\" && endPos < startPos) ||\n\t\t\t(startPos === \"end\" && endPos !== \"end\") ||\n\t\t\t(startPos !== \"start\" && endPos === \"start\") ||\n\t\t\tthis.intervalTree.intervals.isEmpty()\n\t\t) {\n\t\t\treturn [];\n\t\t}\n\t\tconst transientInterval = createTransientInterval(start, end, this.client);\n\n\t\tconst overlappingIntervalNodes = this.intervalTree.match(transientInterval);\n\t\treturn overlappingIntervalNodes.map((node) => node.key);\n\t}\n\n\tpublic remove(interval: SequenceIntervalClass) {\n\t\tthis.intervalTree.removeExisting(interval);\n\t}\n\n\tpublic add(interval: SequenceIntervalClass) {\n\t\tthis.intervalTree.put(interval);\n\t}\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport function createOverlappingIntervalsIndex(\n\tsharedString: ISharedString,\n): ISequenceOverlappingIntervalsIndex {\n\tconst client = (sharedString as unknown as { client: Client }).client;\n\treturn new OverlappingIntervalsIndex(client);\n}\n"]}
@@ -12,6 +12,9 @@ import { PropertySet, SlidingPreference, SequencePlace, Side } from "@fluidframe
12
12
  export interface IInterval {
13
13
  /**
14
14
  * @returns a new interval object with identical semantics.
15
+ *
16
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
17
+ * @privateRemarks Move to ISerializableInterval after deprecation period
15
18
  */
16
19
  clone(): IInterval;
17
20
  /**
@@ -36,6 +39,8 @@ export interface IInterval {
36
39
  compareEnd(b: IInterval): number;
37
40
  /**
38
41
  * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.
42
+ *
43
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
39
44
  */
40
45
  modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): IInterval | undefined;
41
46
  /**
@@ -47,6 +52,8 @@ export interface IInterval {
47
52
  * Unions this interval with `b`, returning a new interval.
48
53
  * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes
49
54
  * intermediate values between the two intervals.
55
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
56
+ * @privateRemarks Move to ISerializableInterval after deprecation period
50
57
  */
51
58
  union(b: IInterval): IInterval;
52
59
  }
@@ -129,11 +136,15 @@ export interface ISerializedInterval {
129
136
  /**
130
137
  * @legacy
131
138
  * @alpha
139
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
140
+ * @privateRemarks Remove from external exports, and replace usages of IInterval with this interface after deprecation period
132
141
  */
133
142
  export interface ISerializableInterval extends IInterval {
134
143
  /** Serializable bag of properties associated with the interval. */
135
144
  properties: PropertySet;
136
- /***/
145
+ /**
146
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
147
+ */
137
148
  serialize(): ISerializedInterval;
138
149
  /**
139
150
  * Gets the id associated with this interval.
@@ -1 +1 @@
1
- {"version":3,"file":"intervalUtils.d.ts","sourceRoot":"","sources":["../../src/intervals/intervalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,MAAM,qCAAqC,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,KAAK,IAAI,SAAS,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,MAAM,CACL,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,EAAE,CA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/B,CAAC;AAPD,0EAOC;AAED,SAAgB,6BAA6B,CAC5C,UAA8B;IAE9B,iDAAiD;IACjD,OAAO,CAAC,UAAU,GAAG,0BAAkB,CAAC,GAAG,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,4BAAiB,CAAC,QAAQ;QAC5B,CAAC,CAAC,4BAAiB,CAAC,OAAO,CAAC;AAC9B,CAAC;AAPD,sEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tPropertySet,\n\tSlidingPreference,\n\tSequencePlace,\n\tSide,\n} from \"@fluidframework/merge-tree/internal\";\n\n/**\n * Basic interval abstraction\n * @legacy\n * @alpha\n */\nexport interface IInterval {\n\t/**\n\t * @returns a new interval object with identical semantics.\n\t */\n\tclone(): IInterval;\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: IInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: IInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: IInterval): number;\n\t/**\n\t * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.\n\t */\n\tmodify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior?: boolean,\n\t): IInterval | undefined;\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: IInterval): boolean;\n\t/**\n\t * Unions this interval with `b`, returning a new interval.\n\t * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes\n\t * intermediate values between the two intervals.\n\t */\n\tunion(b: IInterval): IInterval;\n}\n\n/**\n * Values are used in persisted formats (ops).\n * @internal\n */\nexport const IntervalDeltaOpType = {\n\tADD: \"add\",\n\tDELETE: \"delete\",\n\tCHANGE: \"change\",\n} as const;\n\nexport type IntervalDeltaOpType =\n\t(typeof IntervalDeltaOpType)[keyof typeof IntervalDeltaOpType];\n\n/**\n * Values are used in revertibles.\n * @legacy\n * @alpha\n */\nexport const IntervalOpType = {\n\t...IntervalDeltaOpType,\n\tPROPERTY_CHANGED: \"propertyChanged\",\n\tPOSITION_REMOVE: \"positionRemove\",\n} as const;\n/**\n * @legacy\n * @alpha\n */\nexport type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];\n\n/**\n * @legacy\n * @alpha\n */\nexport enum IntervalType {\n\tSimple = 0x0,\n\n\t/**\n\t * SlideOnRemove indicates that the ends of the interval will slide if the segment\n\t * they reference is removed and acked.\n\t * See `packages\\dds\\merge-tree\\docs\\REFERENCEPOSITIONS.md` for details\n\t * SlideOnRemove is the default interval behavior and does not need to be specified.\n\t */\n\tSlideOnRemove = 0x2, // SlideOnRemove is default behavior - all intervals are SlideOnRemove\n\n\t/**\n\t * A temporary interval, used internally\n\t * @internal\n\t */\n\tTransient = 0x4,\n}\n\n/**\n * Serialized object representation of an interval.\n * This representation is used for ops that create or change intervals.\n * @legacy\n * @alpha\n */\nexport interface ISerializedInterval {\n\t/**\n\t * Sequence number at which `start` and `end` should be interpreted\n\t *\n\t * @remarks It's unclear that this is necessary to store here.\n\t * This should just be the refSeq on the op that modified the interval, which should be available via other means.\n\t * At the time of writing, it's not plumbed through to the reconnect/rebase code, however, which does need it.\n\t */\n\tsequenceNumber: number;\n\t/** Start position of the interval */\n\tstart: number | \"start\" | \"end\";\n\t/** End position of the interval */\n\tend: number | \"start\" | \"end\";\n\t/** Interval type to create */\n\tintervalType: IntervalType;\n\t/**\n\t * The stickiness of this interval\n\t */\n\tstickiness?: IntervalStickiness;\n\tstartSide?: Side;\n\tendSide?: Side;\n\t/** Any properties the interval has */\n\tproperties?: PropertySet;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISerializableInterval extends IInterval {\n\t/** Serializable bag of properties associated with the interval. */\n\tproperties: PropertySet;\n\n\t/***/\n\tserialize(): ISerializedInterval;\n\n\t/**\n\t * Gets the id associated with this interval.\n\t * When the interval is used as part of an interval collection, this id can be used to modify or remove the\n\t * interval.\n\t */\n\tgetIntervalId(): string;\n}\n\n/**\n * Represents a change that should be applied to an existing interval.\n * Changes can modify any of start/end/properties, with `undefined` signifying no change should be made.\n * @internal\n */\nexport type SerializedIntervalDelta = Omit<\n\tISerializedInterval,\n\t\"start\" | \"end\" | \"properties\"\n> &\n\tPartial<Pick<ISerializedInterval, \"start\" | \"end\" | \"properties\">>;\n\n/**\n * A size optimization to avoid redundantly storing keys when serializing intervals\n * as JSON for summaries.\n *\n * Intervals are of the format:\n *\n * [\n * start,\n * end,\n * sequenceNumber,\n * intervalType,\n * properties,\n * stickiness?,\n * startSide?,\n * endSide?,\n * ]\n */\nexport type CompressedSerializedInterval =\n\t| [\n\t\t\tnumber | \"start\" | \"end\",\n\t\t\tnumber | \"start\" | \"end\",\n\t\t\tnumber,\n\t\t\tIntervalType,\n\t\t\tPropertySet,\n\t\t\tIntervalStickiness,\n\t ]\n\t| [number | \"start\" | \"end\", number | \"start\" | \"end\", number, IntervalType, PropertySet];\n\n/**\n * Determines how an interval should expand when segments are inserted adjacent\n * to the range it spans\n *\n * Note that interval stickiness is currently an experimental feature and must\n * be explicitly enabled with the `intervalStickinessEnabled` flag\n *\n * @legacy\n * @alpha\n */\nexport const IntervalStickiness = {\n\t/**\n\t * Interval does not expand to include adjacent segments\n\t */\n\tNONE: 0b00,\n\n\t/**\n\t * Interval expands to include segments inserted adjacent to the start\n\t */\n\tSTART: 0b01,\n\n\t/**\n\t * Interval expands to include segments inserted adjacent to the end\n\t *\n\t * This is the default stickiness\n\t */\n\tEND: 0b10,\n\n\t/**\n\t * Interval expands to include all segments inserted adjacent to it\n\t */\n\tFULL: 0b11,\n} as const;\n\n/**\n * Determines how an interval should expand when segments are inserted adjacent\n * to the range it spans\n *\n * Note that interval stickiness is currently an experimental feature and must\n * be explicitly enabled with the `intervalStickinessEnabled` flag\n * @legacy\n * @alpha\n */\nexport type IntervalStickiness = (typeof IntervalStickiness)[keyof typeof IntervalStickiness];\n\nexport function startReferenceSlidingPreference(\n\tstickiness: IntervalStickiness,\n): SlidingPreference {\n\t// if any start stickiness, prefer sliding backwards\n\treturn (stickiness & IntervalStickiness.START) === 0\n\t\t? SlidingPreference.FORWARD\n\t\t: SlidingPreference.BACKWARD;\n}\n\nexport function endReferenceSlidingPreference(\n\tstickiness: IntervalStickiness,\n): SlidingPreference {\n\t// if any end stickiness, prefer sliding forwards\n\treturn (stickiness & IntervalStickiness.END) === 0\n\t\t? SlidingPreference.BACKWARD\n\t\t: SlidingPreference.FORWARD;\n}\n"]}
1
+ {"version":3,"file":"intervalUtils.js","sourceRoot":"","sources":["../../src/intervals/intervalUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,kEAK6C;AA+D7C;;;GAGG;AACU,QAAA,mBAAmB,GAAG;IAClC,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACP,CAAC;AAKX;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,GAAG,2BAAmB;IACtB,gBAAgB,EAAE,iBAAiB;IACnC,eAAe,EAAE,gBAAgB;CACxB,CAAC;AAOX;;;GAGG;AACH,IAAY,YAgBX;AAhBD,WAAY,YAAY;IACvB,mDAAY,CAAA;IAEZ;;;;;OAKG;IACH,iEAAmB,CAAA;IAEnB;;;OAGG;IACH,yDAAe,CAAA;AAChB,CAAC,EAhBW,YAAY,4BAAZ,YAAY,QAgBvB;AA+FD;;;;;;;;;GASG;AACU,QAAA,kBAAkB,GAAG;IACjC;;OAEG;IACH,IAAI,EAAE,IAAI;IAEV;;OAEG;IACH,KAAK,EAAE,IAAI;IAEX;;;;OAIG;IACH,GAAG,EAAE,IAAI;IAET;;OAEG;IACH,IAAI,EAAE,IAAI;CACD,CAAC;AAaX,SAAgB,+BAA+B,CAC9C,UAA8B;IAE9B,oDAAoD;IACpD,OAAO,CAAC,UAAU,GAAG,0BAAkB,CAAC,KAAK,CAAC,KAAK,CAAC;QACnD,CAAC,CAAC,4BAAiB,CAAC,OAAO;QAC3B,CAAC,CAAC,4BAAiB,CAAC,QAAQ,CAAC;AAC/B,CAAC;AAPD,0EAOC;AAED,SAAgB,6BAA6B,CAC5C,UAA8B;IAE9B,iDAAiD;IACjD,OAAO,CAAC,UAAU,GAAG,0BAAkB,CAAC,GAAG,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,4BAAiB,CAAC,QAAQ;QAC5B,CAAC,CAAC,4BAAiB,CAAC,OAAO,CAAC;AAC9B,CAAC;AAPD,sEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tPropertySet,\n\tSlidingPreference,\n\tSequencePlace,\n\tSide,\n} from \"@fluidframework/merge-tree/internal\";\n\n/**\n * Basic interval abstraction\n * @legacy\n * @alpha\n */\nexport interface IInterval {\n\t/**\n\t * @returns a new interval object with identical semantics.\n\t *\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t * @privateRemarks Move to ISerializableInterval after deprecation period\n\t */\n\tclone(): IInterval;\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: IInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: IInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: IInterval): number;\n\t/**\n\t * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.\n\t *\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tmodify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior?: boolean,\n\t): IInterval | undefined;\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: IInterval): boolean;\n\t/**\n\t * Unions this interval with `b`, returning a new interval.\n\t * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes\n\t * intermediate values between the two intervals.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t * @privateRemarks Move to ISerializableInterval after deprecation period\n\t */\n\tunion(b: IInterval): IInterval;\n}\n\n/**\n * Values are used in persisted formats (ops).\n * @internal\n */\nexport const IntervalDeltaOpType = {\n\tADD: \"add\",\n\tDELETE: \"delete\",\n\tCHANGE: \"change\",\n} as const;\n\nexport type IntervalDeltaOpType =\n\t(typeof IntervalDeltaOpType)[keyof typeof IntervalDeltaOpType];\n\n/**\n * Values are used in revertibles.\n * @legacy\n * @alpha\n */\nexport const IntervalOpType = {\n\t...IntervalDeltaOpType,\n\tPROPERTY_CHANGED: \"propertyChanged\",\n\tPOSITION_REMOVE: \"positionRemove\",\n} as const;\n/**\n * @legacy\n * @alpha\n */\nexport type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];\n\n/**\n * @legacy\n * @alpha\n */\nexport enum IntervalType {\n\tSimple = 0x0,\n\n\t/**\n\t * SlideOnRemove indicates that the ends of the interval will slide if the segment\n\t * they reference is removed and acked.\n\t * See `packages\\dds\\merge-tree\\docs\\REFERENCEPOSITIONS.md` for details\n\t * SlideOnRemove is the default interval behavior and does not need to be specified.\n\t */\n\tSlideOnRemove = 0x2, // SlideOnRemove is default behavior - all intervals are SlideOnRemove\n\n\t/**\n\t * A temporary interval, used internally\n\t * @internal\n\t */\n\tTransient = 0x4,\n}\n\n/**\n * Serialized object representation of an interval.\n * This representation is used for ops that create or change intervals.\n * @legacy\n * @alpha\n */\nexport interface ISerializedInterval {\n\t/**\n\t * Sequence number at which `start` and `end` should be interpreted\n\t *\n\t * @remarks It's unclear that this is necessary to store here.\n\t * This should just be the refSeq on the op that modified the interval, which should be available via other means.\n\t * At the time of writing, it's not plumbed through to the reconnect/rebase code, however, which does need it.\n\t */\n\tsequenceNumber: number;\n\t/** Start position of the interval */\n\tstart: number | \"start\" | \"end\";\n\t/** End position of the interval */\n\tend: number | \"start\" | \"end\";\n\t/** Interval type to create */\n\tintervalType: IntervalType;\n\t/**\n\t * The stickiness of this interval\n\t */\n\tstickiness?: IntervalStickiness;\n\tstartSide?: Side;\n\tendSide?: Side;\n\t/** Any properties the interval has */\n\tproperties?: PropertySet;\n}\n\n/**\n * @legacy\n * @alpha\n * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n * @privateRemarks Remove from external exports, and replace usages of IInterval with this interface after deprecation period\n */\nexport interface ISerializableInterval extends IInterval {\n\t/** Serializable bag of properties associated with the interval. */\n\tproperties: PropertySet;\n\n\t/**\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tserialize(): ISerializedInterval;\n\n\t/**\n\t * Gets the id associated with this interval.\n\t * When the interval is used as part of an interval collection, this id can be used to modify or remove the\n\t * interval.\n\t */\n\tgetIntervalId(): string;\n}\n\n/**\n * Represents a change that should be applied to an existing interval.\n * Changes can modify any of start/end/properties, with `undefined` signifying no change should be made.\n * @internal\n */\nexport type SerializedIntervalDelta = Omit<\n\tISerializedInterval,\n\t\"start\" | \"end\" | \"properties\"\n> &\n\tPartial<Pick<ISerializedInterval, \"start\" | \"end\" | \"properties\">>;\n\n/**\n * A size optimization to avoid redundantly storing keys when serializing intervals\n * as JSON for summaries.\n *\n * Intervals are of the format:\n *\n * [\n * start,\n * end,\n * sequenceNumber,\n * intervalType,\n * properties,\n * stickiness?,\n * startSide?,\n * endSide?,\n * ]\n */\nexport type CompressedSerializedInterval =\n\t| [\n\t\t\tnumber | \"start\" | \"end\",\n\t\t\tnumber | \"start\" | \"end\",\n\t\t\tnumber,\n\t\t\tIntervalType,\n\t\t\tPropertySet,\n\t\t\tIntervalStickiness,\n\t ]\n\t| [number | \"start\" | \"end\", number | \"start\" | \"end\", number, IntervalType, PropertySet];\n\n/**\n * Determines how an interval should expand when segments are inserted adjacent\n * to the range it spans\n *\n * Note that interval stickiness is currently an experimental feature and must\n * be explicitly enabled with the `intervalStickinessEnabled` flag\n *\n * @legacy\n * @alpha\n */\nexport const IntervalStickiness = {\n\t/**\n\t * Interval does not expand to include adjacent segments\n\t */\n\tNONE: 0b00,\n\n\t/**\n\t * Interval expands to include segments inserted adjacent to the start\n\t */\n\tSTART: 0b01,\n\n\t/**\n\t * Interval expands to include segments inserted adjacent to the end\n\t *\n\t * This is the default stickiness\n\t */\n\tEND: 0b10,\n\n\t/**\n\t * Interval expands to include all segments inserted adjacent to it\n\t */\n\tFULL: 0b11,\n} as const;\n\n/**\n * Determines how an interval should expand when segments are inserted adjacent\n * to the range it spans\n *\n * Note that interval stickiness is currently an experimental feature and must\n * be explicitly enabled with the `intervalStickinessEnabled` flag\n * @legacy\n * @alpha\n */\nexport type IntervalStickiness = (typeof IntervalStickiness)[keyof typeof IntervalStickiness];\n\nexport function startReferenceSlidingPreference(\n\tstickiness: IntervalStickiness,\n): SlidingPreference {\n\t// if any start stickiness, prefer sliding backwards\n\treturn (stickiness & IntervalStickiness.START) === 0\n\t\t? SlidingPreference.FORWARD\n\t\t: SlidingPreference.BACKWARD;\n}\n\nexport function endReferenceSlidingPreference(\n\tstickiness: IntervalStickiness,\n): SlidingPreference {\n\t// if any end stickiness, prefer sliding forwards\n\treturn (stickiness & IntervalStickiness.END) === 0\n\t\t? SlidingPreference.BACKWARD\n\t\t: SlidingPreference.FORWARD;\n}\n"]}
@@ -50,8 +50,11 @@ export interface SequenceInterval extends ISerializableInterval {
50
50
  readonly startSide: Side;
51
51
  readonly endSide: Side;
52
52
  readonly stickiness: IntervalStickiness;
53
+ /** Serializable bag of properties associated with the interval. */
54
+ properties: PropertySet;
53
55
  /**
54
56
  * @returns a new interval object with identical semantics.
57
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
55
58
  */
56
59
  clone(): SequenceInterval;
57
60
  /**
@@ -76,6 +79,7 @@ export interface SequenceInterval extends ISerializableInterval {
76
79
  compareEnd(b: SequenceInterval): number;
77
80
  /**
78
81
  * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.
82
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
79
83
  */
80
84
  modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): SequenceInterval | undefined;
81
85
  /**
@@ -87,22 +91,31 @@ export interface SequenceInterval extends ISerializableInterval {
87
91
  * Unions this interval with `b`, returning a new interval.
88
92
  * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes
89
93
  * intermediate values between the two intervals.
94
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
90
95
  */
91
96
  union(b: SequenceInterval): SequenceInterval;
92
97
  /**
93
98
  * Subscribes to position change events on this interval if there are no current listeners.
99
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
94
100
  */
95
101
  addPositionChangeListeners(beforePositionChange: () => void, afterPositionChange: () => void): void;
96
102
  /**
97
103
  * Removes the currently subscribed position change listeners.
104
+ * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release
98
105
  */
99
106
  removePositionChangeListeners(): void;
100
107
  /**
101
108
  * @returns whether this interval overlaps two numerical positions.
102
109
  */
103
110
  overlapsPos(bstart: number, bend: number): boolean;
111
+ /**
112
+ * Gets the id associated with this interval.
113
+ * When the interval is used as part of an interval collection, this id can be used to modify or remove the
114
+ * interval.
115
+ */
116
+ getIntervalId(): string;
104
117
  }
105
- export declare class SequenceIntervalClass implements SequenceInterval {
118
+ export declare class SequenceIntervalClass implements SequenceInterval, ISerializableInterval {
106
119
  #private;
107
120
  private readonly client;
108
121
  private readonly id;
@@ -182,7 +195,7 @@ export declare class SequenceIntervalClass implements SequenceInterval {
182
195
  /**
183
196
  * {@inheritDoc IInterval.union}
184
197
  */
185
- union(b: SequenceInterval): SequenceIntervalClass;
198
+ union(b: SequenceIntervalClass): SequenceIntervalClass;
186
199
  /**
187
200
  * @returns whether this interval overlaps two numerical positions.
188
201
  */
@@ -194,9 +207,9 @@ export declare class SequenceIntervalClass implements SequenceInterval {
194
207
  ackPropertiesChange(newProps: PropertySet, op: ISequencedDocumentMessage): void;
195
208
  }
196
209
  export declare function createPositionReferenceFromSegoff(client: Client, segoff: {
197
- segment: ISegment | undefined;
198
- offset: number | undefined;
199
- } | "start" | "end", refType: ReferenceType, op?: ISequencedDocumentMessage, localSeq?: number, fromSnapshot?: boolean, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean, rollback?: boolean): LocalReferencePosition;
210
+ segment: ISegment;
211
+ offset: number;
212
+ } | undefined | "start" | "end", refType: ReferenceType, op?: ISequencedDocumentMessage, localSeq?: number, fromSnapshot?: boolean, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean, rollback?: boolean): LocalReferencePosition;
200
213
  export declare function createTransientInterval(start: SequencePlace | undefined, end: SequencePlace | undefined, client: Client): SequenceIntervalClass;
201
214
  export declare function createSequenceInterval(label: string, id: string, start: SequencePlace | undefined, end: SequencePlace | undefined, client: Client, intervalType: IntervalType, op?: ISequencedDocumentMessage, fromSnapshot?: boolean, useNewSlidingBehavior?: boolean, props?: PropertySet, rollback?: boolean): SequenceIntervalClass;
202
215
  //# sourceMappingURL=sequenceInterval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceInterval.d.ts","sourceRoot":"","sources":["../../src/intervals/sequenceInterval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACN,MAAM,EACN,QAAQ,EACR,sBAAsB,EAEtB,WAAW,EACX,aAAa,EACb,iBAAiB,EASjB,aAAa,EACb,IAAI,EAOJ,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EAGZ,KAAK,uBAAuB,EAC5B,MAAM,oBAAoB,CAAC;AAkC5B,wBAAgB,uBAAuB,CACtC,kBAAkB,EAAE,mBAAmB,GAAG,uBAAuB,GAC/D;IACF,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,WAAW,CAAC;CACxB,CAYA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC9D,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,sBAAsB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;OAEG;IACH,KAAK,IAAI,gBAAgB,CAAC;IAC1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AE,yBAAyB,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,qBAAqB,GAAE,OAAe;IAuEhC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,yBAAyB;CAO/E;AAED,wBAAgB,iCAAiC,CAChD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,EAC3E,OAAO,EAAE,aAAa,EACtB,EAAE,CAAC,EAAE,yBAAyB,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,OAAO,EACtB,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,kBAAkB,CAAC,EAAE,OAAO,EAC5B,QAAQ,CAAC,EAAE,OAAO,GAChB,sBAAsB,CAwCxB;AAsDD,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,yBAUd;AAED,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,EAAE,CAAC,EAAE,yBAAyB,EAC9B,YAAY,CAAC,EAAE,OAAO,EACtB,qBAAqB,GAAE,OAAe,EACtC,KAAK,CAAC,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,OAAO,GAChB,qBAAqB,CA6EvB"}
@@ -49,6 +49,7 @@ function getSerializedProperties(serializedInterval) {
49
49
  return { id, labels, properties };
50
50
  }
51
51
  exports.getSerializedProperties = getSerializedProperties;
52
+ // eslint-disable-next-line import/no-deprecated
52
53
  class SequenceIntervalClass {
53
54
  /**
54
55
  * {@inheritDoc ISerializableInterval.properties}
@@ -297,7 +298,7 @@ function createPositionReferenceFromSegoff(client, segoff, refType, op, localSeq
297
298
  if (segoff === "start" || segoff === "end") {
298
299
  return client.createLocalReferencePosition(segoff, undefined, refType, undefined, slidingPreference, canSlideToEndpoint);
299
300
  }
300
- if (segoff.segment) {
301
+ if (segoff?.segment) {
301
302
  const ref = client.createLocalReferencePosition(segoff.segment, segoff.offset, refType, undefined, slidingPreference, canSlideToEndpoint);
302
303
  return ref;
303
304
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceInterval.js","sourceRoot":"","sources":["../../src/intervals/sequenceInterval.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+BAA+B;AAE/B,kEAA6D;AAE7D,kEAwB6C;AAC7C,uEAAsE;AACtE,+BAAkC;AAElC,oEAAqE;AAErE,yDAQ4B;AAE5B,SAAS,YAAY,CAAC,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACX,CAAC;AAED,SAAS,OAAO,CAAC,KAAW,EAAE,KAAW;IACxC,IAAI,KAAK,KAAK,eAAI,CAAC,KAAK,IAAI,KAAK,KAAK,eAAI,CAAC,KAAK,EAAE,CAAC;QAClD,OAAO,eAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,eAAI,CAAC,MAAM,CAAC;AACpB,CAAC;AAED,SAAS,OAAO,CAAC,KAAW,EAAE,KAAW;IACxC,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,eAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,OAAO,eAAI,CAAC,KAAK,CAAC;AACnB,CAAC;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* Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertiesManager,\n\tPropertySet,\n\tReferenceType,\n\tSlidingPreference,\n\tcompareReferencePositions,\n\tcreateDetachedLocalReferencePosition,\n\tcreateMap,\n\tgetSlideToSegoff,\n\tmaxReferencePosition,\n\tminReferencePosition,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSequencePlace,\n\tSide,\n\tendpointPosAndSide,\n\taddProperties,\n\tcopyPropertiesAndManager,\n\ttype ISegmentInternal,\n\tUnassignedSequenceNumber,\n\tUniversalSequenceNumber,\n} from \"@fluidframework/merge-tree/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { computeStickinessFromSide } from \"../intervalCollection.js\";\n\nimport {\n\tISerializableInterval,\n\tISerializedInterval,\n\tIntervalStickiness,\n\tIntervalType,\n\tendReferenceSlidingPreference,\n\tstartReferenceSlidingPreference,\n\ttype SerializedIntervalDelta,\n} from \"./intervalUtils.js\";\n\nfunction compareSides(sideA: Side, sideB: Side): number {\n\tif (sideA === sideB) {\n\t\treturn 0;\n\t}\n\n\tif (sideA === Side.Before) {\n\t\treturn 1;\n\t}\n\n\treturn -1;\n}\n\nfunction minSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.After && sideB === Side.After) {\n\t\treturn Side.After;\n\t}\n\n\treturn Side.Before;\n}\n\nfunction maxSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.Before && sideB === Side.Before) {\n\t\treturn Side.Before;\n\t}\n\n\treturn Side.After;\n}\n\nconst reservedIntervalIdKey = \"intervalId\";\n\nconst legacyIdPrefix = \"legacy\";\n\nexport function getSerializedProperties(\n\tserializedInterval: ISerializedInterval | SerializedIntervalDelta,\n): {\n\tid: string;\n\tlabels: string[];\n\tproperties: PropertySet;\n} {\n\tconst {\n\t\t[reservedIntervalIdKey]: maybeId,\n\t\t[reservedRangeLabelsKey]: labels,\n\t\t...properties\n\t} = serializedInterval.properties ?? {};\n\t// Create a non-unique ID based on start and end to be used on intervals that come from legacy clients\n\t// without ID's.\n\tconst id =\n\t\tmaybeId ?? `${legacyIdPrefix}${serializedInterval.start}-${serializedInterval.end}`;\n\n\treturn { id, labels, properties };\n}\n\n/**\n * Interval implementation whose ends are associated with positions in a mutatable sequence.\n * As such, when content is inserted into the middle of the interval, the interval expands to\n * include that content.\n *\n * @remarks The endpoints' positions should be treated exclusively to get\n * reasonable behavior. E.g., an interval referring to \"hello\" in \"hello world\"\n * should have a start position of 0 and an end position of 5.\n *\n * To see why, consider what happens if \"llo wor\" is removed from the string to make \"held\".\n * The interval's startpoint remains on the \"h\" (it isn't altered), but the interval's endpoint\n * slides forward to the next unremoved position, which is the \"l\" in \"held\".\n * Users would generally expect the interval to now refer to \"he\" (as it is the subset of content\n * remaining after the removal), hence the \"l\" should be excluded.\n * If the interval endpoint was treated inclusively, the interval would now refer to \"hel\", which\n * is undesirable.\n *\n * Since the endpoints of an interval are treated exclusively but cannot be greater\n * than or equal to the length of the associated sequence, there exist special\n * endpoint segments, \"start\" and \"end\", which represent the position immediately\n * before or immediately after the string respectively.\n *\n * If a `SequenceInterval` is created on a sequence with the\n * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints\n * of the interval that are exclusive will have the ability to slide to these\n * special endpoint segments.\n * @alpha\n * @legacy\n */\nexport interface SequenceInterval extends ISerializableInterval {\n\treadonly start: LocalReferencePosition;\n\t/**\n\t * End endpoint of this interval.\n\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t */\n\treadonly end: LocalReferencePosition;\n\treadonly intervalType: IntervalType;\n\treadonly startSide: Side;\n\treadonly endSide: Side;\n\treadonly stickiness: IntervalStickiness;\n\n\t/**\n\t * @returns a new interval object with identical semantics.\n\t */\n\tclone(): SequenceInterval;\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: SequenceInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: SequenceInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: SequenceInterval): number;\n\t/**\n\t * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.\n\t */\n\tmodify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior?: boolean,\n\t): SequenceInterval | undefined;\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: SequenceInterval): boolean;\n\t/**\n\t * Unions this interval with `b`, returning a new interval.\n\t * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes\n\t * intermediate values between the two intervals.\n\t */\n\tunion(b: SequenceInterval): SequenceInterval;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t */\n\taddPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void;\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t */\n\tremovePositionChangeListeners(): void;\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\toverlapsPos(bstart: number, bend: number): boolean;\n}\n\nexport class SequenceIntervalClass implements SequenceInterval {\n\treadonly #props: {\n\t\tpropertyManager?: PropertiesManager;\n\t\tproperties: PropertySet;\n\t} = { properties: createMap<any>() };\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.properties}\n\t */\n\tpublic get properties(): Readonly<PropertySet> {\n\t\treturn this.#props.properties;\n\t}\n\n\tpublic changeProperties(\n\t\tprops: PropertySet | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\trollback?: boolean,\n\t) {\n\t\tif (props !== undefined) {\n\t\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t\treturn this.#props.propertyManager.handleProperties(\n\t\t\t\t{ props },\n\t\t\t\tthis.#props,\n\t\t\t\tthis.client.getCollabWindow().collaborating\n\t\t\t\t\t? (op?.sequenceNumber ?? UnassignedSequenceNumber)\n\t\t\t\t\t: UniversalSequenceNumber,\n\t\t\t\top?.minimumSequenceNumber ?? UniversalSequenceNumber,\n\t\t\t\tthis.client.getCollabWindow().collaborating,\n\t\t\t\trollback,\n\t\t\t);\n\t\t}\n\t}\n\n\t/***/\n\tpublic get stickiness(): IntervalStickiness {\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\treturn computeStickinessFromSide(\n\t\t\tstartSegment?.endpointType,\n\t\t\tthis.startSide,\n\t\t\tendSegment?.endpointType,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tprivate readonly id: string,\n\t\tprivate readonly label: string,\n\t\t/**\n\t\t * Start endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic start: LocalReferencePosition,\n\t\t/**\n\t\t * End endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic end: LocalReferencePosition,\n\t\tpublic intervalType: IntervalType,\n\t\tprops?: PropertySet,\n\t\tpublic readonly startSide: Side = Side.Before,\n\t\tpublic readonly endSide: Side = Side.Before,\n\t) {\n\t\tif (props) {\n\t\t\tthis.#props.properties = addProperties(this.#props.properties, props);\n\t\t}\n\t}\n\n\tprivate callbacks?: Record<\"beforePositionChange\" | \"afterPositionChange\", () => void>;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t */\n\tpublic addPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void {\n\t\tif (this.callbacks === undefined) {\n\t\t\tthis.callbacks = {\n\t\t\t\tbeforePositionChange,\n\t\t\t\tafterPositionChange,\n\t\t\t};\n\n\t\t\tconst startCbs = (this.start.callbacks ??= {});\n\t\t\tconst endCbs = (this.end.callbacks ??= {});\n\t\t\tstartCbs.beforeSlide = endCbs.beforeSlide = beforePositionChange;\n\t\t\tstartCbs.afterSlide = endCbs.afterSlide = afterPositionChange;\n\t\t}\n\t}\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t */\n\tpublic removePositionChangeListeners(): void {\n\t\tif (this.callbacks) {\n\t\t\tthis.callbacks = undefined;\n\t\t\tthis.start.callbacks = undefined;\n\t\t\tthis.end.callbacks = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.serialize}\n\t */\n\tpublic serialize(): ISerializedInterval {\n\t\treturn this.serializeDelta({\n\t\t\tprops: this.properties,\n\t\t\tincludeEndpoints: true,\n\t\t}) as ISerializedInterval;\n\t}\n\n\tpublic serializeDelta({\n\t\tprops,\n\t\tincludeEndpoints,\n\t}: {\n\t\tprops: PropertySet | undefined;\n\t\tincludeEndpoints: boolean;\n\t}): SerializedIntervalDelta {\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst startPosition = includeEndpoints\n\t\t\t? (startSegment?.endpointType ??\n\t\t\t\tthis.client.localReferencePositionToPosition(this.start))\n\t\t\t: undefined;\n\t\tconst endPosition = includeEndpoints\n\t\t\t? (endSegment?.endpointType ?? this.client.localReferencePositionToPosition(this.end))\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tend: endPosition,\n\t\t\tintervalType: this.intervalType,\n\t\t\tsequenceNumber: this.client.getCurrentSeq(),\n\t\t\tstart: startPosition,\n\t\t\tstickiness: this.stickiness,\n\t\t\tstartSide: includeEndpoints ? this.startSide : undefined,\n\t\t\tendSide: includeEndpoints ? this.endSide : undefined,\n\t\t\tproperties: {\n\t\t\t\t...props,\n\t\t\t\t[reservedIntervalIdKey]: this.id,\n\t\t\t\t[reservedRangeLabelsKey]: [this.label],\n\t\t\t},\n\t\t} satisfies SerializedIntervalDelta;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.clone}\n\t */\n\tpublic clone(): SequenceIntervalClass {\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.id,\n\t\t\tthis.label,\n\t\t\tthis.start,\n\t\t\tthis.end,\n\t\t\tthis.intervalType,\n\t\t\tthis.properties,\n\t\t\tthis.startSide,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compare}\n\t */\n\tpublic compare(b: SequenceInterval) {\n\t\tconst startResult = this.compareStart(b);\n\t\tif (startResult === 0) {\n\t\t\tconst endResult = this.compareEnd(b);\n\t\t\tif (endResult === 0) {\n\t\t\t\tconst thisId = this.getIntervalId();\n\t\t\t\tif (thisId) {\n\t\t\t\t\tconst bId = b.getIntervalId();\n\t\t\t\t\tif (bId) {\n\t\t\t\t\t\treturn thisId > bId ? 1 : thisId < bId ? -1 : 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn endResult;\n\t\t\t}\n\t\t} else {\n\t\t\treturn startResult;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareStart}\n\t */\n\tpublic compareStart(b: SequenceInterval) {\n\t\tconst dist = compareReferencePositions(this.start, b.start);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(this.startSide, b.startSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareEnd}\n\t */\n\tpublic compareEnd(b: SequenceInterval): number {\n\t\tconst dist = compareReferencePositions(this.end, b.end);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(b.endSide, this.endSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.overlaps}\n\t */\n\tpublic overlaps(b: SequenceInterval) {\n\t\tconst result =\n\t\t\tcompareReferencePositions(this.start, b.end) <= 0 &&\n\t\t\tcompareReferencePositions(this.end, b.start) >= 0;\n\t\treturn result;\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.getIntervalId}\n\t */\n\tpublic getIntervalId(): string {\n\t\treturn this.id;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.union}\n\t */\n\tpublic union(b: SequenceInterval) {\n\t\tconst newStart = minReferencePosition(this.start, b.start);\n\t\tconst newEnd = maxReferencePosition(this.end, b.end);\n\n\t\tlet startSide: Side;\n\n\t\tif (this.start === b.start) {\n\t\t\tstartSide = minSide(this.startSide, b.startSide);\n\t\t} else {\n\t\t\tstartSide = this.start === newStart ? this.startSide : b.startSide;\n\t\t}\n\n\t\tlet endSide: Side;\n\n\t\tif (this.end === b.end) {\n\t\t\tendSide = maxSide(this.endSide, b.endSide);\n\t\t} else {\n\t\t\tendSide = this.end === newEnd ? this.endSide : b.endSide;\n\t\t}\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tuuid(),\n\t\t\tthis.label,\n\t\t\tnewStart,\n\t\t\tnewEnd,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide,\n\t\t\tendSide,\n\t\t);\n\t}\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\tpublic overlapsPos(bstart: number, bend: number) {\n\t\tconst startPos = this.client.localReferencePositionToPosition(this.start);\n\t\tconst endPos = this.client.localReferencePositionToPosition(this.end);\n\t\treturn endPos > bstart && startPos < bend;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.modify}\n\t */\n\tpublic modify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior: boolean = false,\n\t) {\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst stickiness = computeStickinessFromSide(\n\t\t\tstartPos ?? startSegment?.endpointType,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendPos ?? endSegment?.endpointType,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tconst getRefType = (baseType: ReferenceType): ReferenceType => {\n\t\t\tlet refType = baseType;\n\t\t\tif (op === undefined) {\n\t\t\t\trefType &= ~ReferenceType.SlideOnRemove;\n\t\t\t\trefType |= ReferenceType.StayOnRemove;\n\t\t\t}\n\t\t\treturn refType;\n\t\t};\n\n\t\tlet startRef = this.start;\n\t\tif (startPos !== undefined) {\n\t\t\tstartRef = createPositionReference(\n\t\t\t\tthis.client,\n\t\t\t\tstartPos,\n\t\t\t\tgetRefType(this.start.refType),\n\t\t\t\top,\n\t\t\t\tundefined,\n\t\t\t\tlocalSeq,\n\t\t\t\tstartReferenceSlidingPreference(stickiness),\n\t\t\t\tstartReferenceSlidingPreference(stickiness) === SlidingPreference.BACKWARD,\n\t\t\t\tuseNewSlidingBehavior,\n\t\t\t);\n\t\t\tif (this.start.properties) {\n\t\t\t\tstartRef.addProperties(this.start.properties);\n\t\t\t}\n\t\t}\n\n\t\tlet endRef = this.end;\n\t\tif (endPos !== undefined) {\n\t\t\tendRef = createPositionReference(\n\t\t\t\tthis.client,\n\t\t\t\tendPos,\n\t\t\t\tgetRefType(this.end.refType),\n\t\t\t\top,\n\t\t\t\tundefined,\n\t\t\t\tlocalSeq,\n\t\t\t\tendReferenceSlidingPreference(stickiness),\n\t\t\t\tendReferenceSlidingPreference(stickiness) === SlidingPreference.FORWARD,\n\t\t\t\tuseNewSlidingBehavior,\n\t\t\t);\n\t\t\tif (this.end.properties) {\n\t\t\t\tendRef.addProperties(this.end.properties);\n\t\t\t}\n\t\t}\n\n\t\tconst newInterval = new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.id,\n\t\t\tthis.label,\n\t\t\tstartRef,\n\t\t\tendRef,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tcopyPropertiesAndManager(this.#props, newInterval.#props);\n\t\treturn newInterval;\n\t}\n\n\tpublic ackPropertiesChange(newProps: PropertySet, op: ISequencedDocumentMessage) {\n\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t// Let the propertyManager prune its pending change-properties set.\n\t\tthis.#props.propertyManager.ack(op.sequenceNumber, op.minimumSequenceNumber, {\n\t\t\tprops: newProps,\n\t\t});\n\t}\n}\n\nexport function createPositionReferenceFromSegoff(\n\tclient: Client,\n\tsegoff: { segment: ISegment | undefined; offset: number | undefined } | \"start\" | \"end\",\n\trefType: ReferenceType,\n\top?: ISequencedDocumentMessage,\n\tlocalSeq?: number,\n\tfromSnapshot?: boolean,\n\tslidingPreference?: SlidingPreference,\n\tcanSlideToEndpoint?: boolean,\n\trollback?: boolean,\n): LocalReferencePosition {\n\tif (segoff === \"start\" || segoff === \"end\") {\n\t\treturn client.createLocalReferencePosition(\n\t\t\tsegoff,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\tif (segoff.segment) {\n\t\tconst ref = client.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t\treturn ref;\n\t}\n\n\t// Creating references on detached segments is allowed for:\n\t// - Transient segments\n\t// - References coming from a remote client (location may have been concurrently removed)\n\t// - References being rebased to a new sequence number\n\t// (segment they originally referred to may have been removed with no suitable replacement)\n\tif (\n\t\t!op &&\n\t\t!localSeq &&\n\t\t!fromSnapshot &&\n\t\t!refTypeIncludesFlag(refType, ReferenceType.Transient) &&\n\t\t!rollback\n\t) {\n\t\tthrow new UsageError(\"Non-transient references need segment\");\n\t}\n\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\nfunction createPositionReference(\n\tclient: Client,\n\tpos: number | \"start\" | \"end\",\n\trefType: ReferenceType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tlocalSeq?: number,\n\tslidingPreference?: SlidingPreference,\n\texclusive: boolean = false,\n\tuseNewSlidingBehavior: boolean = false,\n\trollback?: boolean,\n): LocalReferencePosition {\n\tlet segoff;\n\n\tif (op) {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) !== 0,\n\t\t\t0x2f5 /* op create references must be SlideOnRemove */,\n\t\t);\n\t\tif (pos === \"start\" || pos === \"end\") {\n\t\t\tsegoff = pos;\n\t\t} else {\n\t\t\tsegoff = client.getContainingSegment(pos, {\n\t\t\t\treferenceSequenceNumber: op.referenceSequenceNumber,\n\t\t\t\tclientId: op.clientId,\n\t\t\t});\n\t\t\tsegoff = getSlideToSegoff(segoff, slidingPreference, undefined, useNewSlidingBehavior);\n\t\t}\n\t} else {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) === 0 || !!fromSnapshot,\n\t\t\t0x2f6 /* SlideOnRemove references must be op created */,\n\t\t);\n\t\tsegoff =\n\t\t\tpos === \"start\" || pos === \"end\"\n\t\t\t\t? pos\n\t\t\t\t: client.getContainingSegment(pos, undefined, localSeq);\n\t}\n\n\treturn createPositionReferenceFromSegoff(\n\t\tclient,\n\t\tsegoff,\n\t\trefType,\n\t\top,\n\t\tlocalSeq,\n\t\tfromSnapshot,\n\t\tslidingPreference,\n\t\texclusive,\n\t\trollback,\n\t);\n}\n\nexport function createTransientInterval(\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n) {\n\treturn createSequenceInterval(\n\t\t\"transient\",\n\t\tuuid(),\n\t\tstart,\n\t\tend,\n\t\tclient,\n\t\tIntervalType.Transient,\n\t);\n}\n\nexport function createSequenceInterval(\n\tlabel: string,\n\tid: string,\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n\tintervalType: IntervalType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tuseNewSlidingBehavior: boolean = false,\n\tprops?: PropertySet,\n\trollback?: boolean,\n): SequenceIntervalClass {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0x794 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\tconst stickiness = computeStickinessFromSide(startPos, startSide, endPos, endSide);\n\tlet beginRefType = ReferenceType.RangeBegin;\n\tlet endRefType = ReferenceType.RangeEnd;\n\tif (intervalType === IntervalType.Transient) {\n\t\tbeginRefType = ReferenceType.Transient;\n\t\tendRefType = ReferenceType.Transient;\n\t} else {\n\t\t// All non-transient interval references must eventually be SlideOnRemove\n\t\t// To ensure eventual consistency, they must start as StayOnRemove when\n\t\t// pending (created locally and creation op is not acked)\n\t\tif (op ?? fromSnapshot) {\n\t\t\tbeginRefType |= ReferenceType.SlideOnRemove;\n\t\t\tendRefType |= ReferenceType.SlideOnRemove;\n\t\t} else {\n\t\t\tbeginRefType |= ReferenceType.StayOnRemove;\n\t\t\tendRefType |= ReferenceType.StayOnRemove;\n\t\t}\n\t}\n\n\tconst startLref = createPositionReference(\n\t\tclient,\n\t\tstartPos,\n\t\tbeginRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tundefined,\n\t\tstartReferenceSlidingPreference(stickiness),\n\t\tstartReferenceSlidingPreference(stickiness) === SlidingPreference.BACKWARD,\n\t\tuseNewSlidingBehavior,\n\t\trollback,\n\t);\n\n\tconst endLref = createPositionReference(\n\t\tclient,\n\t\tendPos,\n\t\tendRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tundefined,\n\t\tendReferenceSlidingPreference(stickiness),\n\t\tendReferenceSlidingPreference(stickiness) === SlidingPreference.FORWARD,\n\t\tuseNewSlidingBehavior,\n\t\trollback,\n\t);\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [label],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\tconst ival = new SequenceIntervalClass(\n\t\tclient,\n\t\tid,\n\t\tlabel,\n\t\tstartLref,\n\t\tendLref,\n\t\tintervalType,\n\t\tprops === undefined\n\t\t\t? undefined\n\t\t\t: { ...props, [reservedIntervalIdKey]: undefined, [reservedRangeLabelsKey]: undefined },\n\t\tstartSide,\n\t\tendSide,\n\t);\n\treturn ival;\n}\n"]}
1
+ {"version":3,"file":"sequenceInterval.js","sourceRoot":"","sources":["../../src/intervals/sequenceInterval.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;AAEH,+BAA+B;AAE/B,kEAA6D;AAE7D,kEAwB6C;AAC7C,uEAAsE;AACtE,+BAAkC;AAElC,oEAAqE;AAErE,yDAS4B;AAE5B,SAAS,YAAY,CAAC,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,IAAI,KAAK,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;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C;KACjC,CAAC;IACF,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,IAAI,qBAAqB,CACrC,MAAM,EACN,EAAE,EACF,KAAK,EACL,SAAS,EACT,OAAO,EACP,YAAY,EACZ,KAAK,KAAK,SAAS;QAClB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,iCAAsB,CAAC,EAAE,SAAS,EAAE,EACxF,SAAS,EACT,OAAO,CACP,CAAC;IACF,OAAO,IAAI,CAAC;AACb,CAAC;AAzFD,wDAyFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertiesManager,\n\tPropertySet,\n\tReferenceType,\n\tSlidingPreference,\n\tcompareReferencePositions,\n\tcreateDetachedLocalReferencePosition,\n\tcreateMap,\n\tgetSlideToSegoff,\n\tmaxReferencePosition,\n\tminReferencePosition,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSequencePlace,\n\tSide,\n\tendpointPosAndSide,\n\taddProperties,\n\tcopyPropertiesAndManager,\n\ttype ISegmentInternal,\n\tUnassignedSequenceNumber,\n\tUniversalSequenceNumber,\n} from \"@fluidframework/merge-tree/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { computeStickinessFromSide } from \"../intervalCollection.js\";\n\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tISerializableInterval,\n\tISerializedInterval,\n\tIntervalStickiness,\n\tIntervalType,\n\tendReferenceSlidingPreference,\n\tstartReferenceSlidingPreference,\n\ttype SerializedIntervalDelta,\n} from \"./intervalUtils.js\";\n\nfunction compareSides(sideA: Side, sideB: Side): number {\n\tif (sideA === sideB) {\n\t\treturn 0;\n\t}\n\n\tif (sideA === Side.Before) {\n\t\treturn 1;\n\t}\n\n\treturn -1;\n}\n\nfunction minSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.After && sideB === Side.After) {\n\t\treturn Side.After;\n\t}\n\n\treturn Side.Before;\n}\n\nfunction maxSide(sideA: Side, sideB: Side): Side {\n\tif (sideA === Side.Before && sideB === Side.Before) {\n\t\treturn Side.Before;\n\t}\n\n\treturn Side.After;\n}\n\nconst reservedIntervalIdKey = \"intervalId\";\n\nconst legacyIdPrefix = \"legacy\";\n\nexport function getSerializedProperties(\n\tserializedInterval: ISerializedInterval | SerializedIntervalDelta,\n): {\n\tid: string;\n\tlabels: string[];\n\tproperties: PropertySet;\n} {\n\tconst {\n\t\t[reservedIntervalIdKey]: maybeId,\n\t\t[reservedRangeLabelsKey]: labels,\n\t\t...properties\n\t} = serializedInterval.properties ?? {};\n\t// Create a non-unique ID based on start and end to be used on intervals that come from legacy clients\n\t// without ID's.\n\tconst id =\n\t\tmaybeId ?? `${legacyIdPrefix}${serializedInterval.start}-${serializedInterval.end}`;\n\n\treturn { id, labels, properties };\n}\n\n/**\n * Interval implementation whose ends are associated with positions in a mutatable sequence.\n * As such, when content is inserted into the middle of the interval, the interval expands to\n * include that content.\n *\n * @remarks The endpoints' positions should be treated exclusively to get\n * reasonable behavior. E.g., an interval referring to \"hello\" in \"hello world\"\n * should have a start position of 0 and an end position of 5.\n *\n * To see why, consider what happens if \"llo wor\" is removed from the string to make \"held\".\n * The interval's startpoint remains on the \"h\" (it isn't altered), but the interval's endpoint\n * slides forward to the next unremoved position, which is the \"l\" in \"held\".\n * Users would generally expect the interval to now refer to \"he\" (as it is the subset of content\n * remaining after the removal), hence the \"l\" should be excluded.\n * If the interval endpoint was treated inclusively, the interval would now refer to \"hel\", which\n * is undesirable.\n *\n * Since the endpoints of an interval are treated exclusively but cannot be greater\n * than or equal to the length of the associated sequence, there exist special\n * endpoint segments, \"start\" and \"end\", which represent the position immediately\n * before or immediately after the string respectively.\n *\n * If a `SequenceInterval` is created on a sequence with the\n * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints\n * of the interval that are exclusive will have the ability to slide to these\n * special endpoint segments.\n * @alpha\n * @legacy\n */\n// eslint-disable-next-line import/no-deprecated\nexport interface SequenceInterval extends ISerializableInterval {\n\treadonly start: LocalReferencePosition;\n\t/**\n\t * End endpoint of this interval.\n\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t */\n\treadonly end: LocalReferencePosition;\n\treadonly intervalType: IntervalType;\n\treadonly startSide: Side;\n\treadonly endSide: Side;\n\treadonly stickiness: IntervalStickiness;\n\n\t/** Serializable bag of properties associated with the interval. */\n\tproperties: PropertySet;\n\n\t/**\n\t * @returns a new interval object with identical semantics.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tclone(): SequenceInterval;\n\t/**\n\t * Compares this interval to `b` with standard comparator semantics:\n\t * - returns -1 if this is less than `b`\n\t * - returns 1 if this is greater than `b`\n\t * - returns 0 if this is equivalent to `b`\n\t * @param b - Interval to compare against\n\t */\n\tcompare(b: SequenceInterval): number;\n\t/**\n\t * Compares the start endpoint of this interval to `b`'s start endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareStart(b: SequenceInterval): number;\n\t/**\n\t * Compares the end endpoint of this interval to `b`'s end endpoint.\n\t * Standard comparator semantics apply.\n\t * @param b - Interval to compare against\n\t */\n\tcompareEnd(b: SequenceInterval): number;\n\t/**\n\t * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tmodify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior?: boolean,\n\t): SequenceInterval | undefined;\n\t/**\n\t * @returns whether this interval overlaps with `b`.\n\t * Intervals are considered to overlap if their intersection is non-empty.\n\t */\n\toverlaps(b: SequenceInterval): boolean;\n\t/**\n\t * Unions this interval with `b`, returning a new interval.\n\t * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes\n\t * intermediate values between the two intervals.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tunion(b: SequenceInterval): SequenceInterval;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\taddPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void;\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tremovePositionChangeListeners(): void;\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\toverlapsPos(bstart: number, bend: number): boolean;\n\n\t/**\n\t * Gets the id associated with this interval.\n\t * When the interval is used as part of an interval collection, this id can be used to modify or remove the\n\t * interval.\n\t */\n\tgetIntervalId(): string;\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport class SequenceIntervalClass implements SequenceInterval, ISerializableInterval {\n\treadonly #props: {\n\t\tpropertyManager?: PropertiesManager;\n\t\tproperties: PropertySet;\n\t} = { properties: createMap<any>() };\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.properties}\n\t */\n\tpublic get properties(): Readonly<PropertySet> {\n\t\treturn this.#props.properties;\n\t}\n\n\tpublic changeProperties(\n\t\tprops: PropertySet | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\trollback?: boolean,\n\t) {\n\t\tif (props !== undefined) {\n\t\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t\treturn this.#props.propertyManager.handleProperties(\n\t\t\t\t{ props },\n\t\t\t\tthis.#props,\n\t\t\t\tthis.client.getCollabWindow().collaborating\n\t\t\t\t\t? (op?.sequenceNumber ?? UnassignedSequenceNumber)\n\t\t\t\t\t: UniversalSequenceNumber,\n\t\t\t\top?.minimumSequenceNumber ?? UniversalSequenceNumber,\n\t\t\t\tthis.client.getCollabWindow().collaborating,\n\t\t\t\trollback,\n\t\t\t);\n\t\t}\n\t}\n\n\t/***/\n\tpublic get stickiness(): IntervalStickiness {\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\treturn computeStickinessFromSide(\n\t\t\tstartSegment?.endpointType,\n\t\t\tthis.startSide,\n\t\t\tendSegment?.endpointType,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tprivate readonly id: string,\n\t\tprivate readonly label: string,\n\t\t/**\n\t\t * Start endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic start: LocalReferencePosition,\n\t\t/**\n\t\t * End endpoint of this interval.\n\t\t * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.\n\t\t */\n\t\tpublic end: LocalReferencePosition,\n\t\tpublic intervalType: IntervalType,\n\t\tprops?: PropertySet,\n\t\tpublic readonly startSide: Side = Side.Before,\n\t\tpublic readonly endSide: Side = Side.Before,\n\t) {\n\t\tif (props) {\n\t\t\tthis.#props.properties = addProperties(this.#props.properties, props);\n\t\t}\n\t}\n\n\tprivate callbacks?: Record<\"beforePositionChange\" | \"afterPositionChange\", () => void>;\n\n\t/**\n\t * Subscribes to position change events on this interval if there are no current listeners.\n\t */\n\tpublic addPositionChangeListeners(\n\t\tbeforePositionChange: () => void,\n\t\tafterPositionChange: () => void,\n\t): void {\n\t\tif (this.callbacks === undefined) {\n\t\t\tthis.callbacks = {\n\t\t\t\tbeforePositionChange,\n\t\t\t\tafterPositionChange,\n\t\t\t};\n\n\t\t\tconst startCbs = (this.start.callbacks ??= {});\n\t\t\tconst endCbs = (this.end.callbacks ??= {});\n\t\t\tstartCbs.beforeSlide = endCbs.beforeSlide = beforePositionChange;\n\t\t\tstartCbs.afterSlide = endCbs.afterSlide = afterPositionChange;\n\t\t}\n\t}\n\n\t/**\n\t * Removes the currently subscribed position change listeners.\n\t */\n\tpublic removePositionChangeListeners(): void {\n\t\tif (this.callbacks) {\n\t\t\tthis.callbacks = undefined;\n\t\t\tthis.start.callbacks = undefined;\n\t\t\tthis.end.callbacks = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.serialize}\n\t */\n\tpublic serialize(): ISerializedInterval {\n\t\treturn this.serializeDelta({\n\t\t\tprops: this.properties,\n\t\t\tincludeEndpoints: true,\n\t\t}) as ISerializedInterval;\n\t}\n\n\tpublic serializeDelta({\n\t\tprops,\n\t\tincludeEndpoints,\n\t}: {\n\t\tprops: PropertySet | undefined;\n\t\tincludeEndpoints: boolean;\n\t}): SerializedIntervalDelta {\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst startPosition = includeEndpoints\n\t\t\t? (startSegment?.endpointType ??\n\t\t\t\tthis.client.localReferencePositionToPosition(this.start))\n\t\t\t: undefined;\n\t\tconst endPosition = includeEndpoints\n\t\t\t? (endSegment?.endpointType ?? this.client.localReferencePositionToPosition(this.end))\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tend: endPosition,\n\t\t\tintervalType: this.intervalType,\n\t\t\tsequenceNumber: this.client.getCurrentSeq(),\n\t\t\tstart: startPosition,\n\t\t\tstickiness: this.stickiness,\n\t\t\tstartSide: includeEndpoints ? this.startSide : undefined,\n\t\t\tendSide: includeEndpoints ? this.endSide : undefined,\n\t\t\tproperties: {\n\t\t\t\t...props,\n\t\t\t\t[reservedIntervalIdKey]: this.id,\n\t\t\t\t[reservedRangeLabelsKey]: [this.label],\n\t\t\t},\n\t\t} satisfies SerializedIntervalDelta;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.clone}\n\t */\n\tpublic clone(): SequenceIntervalClass {\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.id,\n\t\t\tthis.label,\n\t\t\tthis.start,\n\t\t\tthis.end,\n\t\t\tthis.intervalType,\n\t\t\tthis.properties,\n\t\t\tthis.startSide,\n\t\t\tthis.endSide,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compare}\n\t */\n\tpublic compare(b: SequenceInterval) {\n\t\tconst startResult = this.compareStart(b);\n\t\tif (startResult === 0) {\n\t\t\tconst endResult = this.compareEnd(b);\n\t\t\tif (endResult === 0) {\n\t\t\t\tconst thisId = this.getIntervalId();\n\t\t\t\tif (thisId) {\n\t\t\t\t\tconst bId = b.getIntervalId();\n\t\t\t\t\tif (bId) {\n\t\t\t\t\t\treturn thisId > bId ? 1 : thisId < bId ? -1 : 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn endResult;\n\t\t\t}\n\t\t} else {\n\t\t\treturn startResult;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareStart}\n\t */\n\tpublic compareStart(b: SequenceInterval) {\n\t\tconst dist = compareReferencePositions(this.start, b.start);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(this.startSide, b.startSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.compareEnd}\n\t */\n\tpublic compareEnd(b: SequenceInterval): number {\n\t\tconst dist = compareReferencePositions(this.end, b.end);\n\n\t\tif (dist === 0) {\n\t\t\treturn compareSides(b.endSide, this.endSide);\n\t\t}\n\n\t\treturn dist;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.overlaps}\n\t */\n\tpublic overlaps(b: SequenceInterval) {\n\t\tconst result =\n\t\t\tcompareReferencePositions(this.start, b.end) <= 0 &&\n\t\t\tcompareReferencePositions(this.end, b.start) >= 0;\n\t\treturn result;\n\t}\n\n\t/**\n\t * {@inheritDoc ISerializableInterval.getIntervalId}\n\t */\n\tpublic getIntervalId(): string {\n\t\treturn this.id;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.union}\n\t */\n\tpublic union(b: SequenceIntervalClass) {\n\t\tconst newStart = minReferencePosition(this.start, b.start);\n\t\tconst newEnd = maxReferencePosition(this.end, b.end);\n\n\t\tlet startSide: Side;\n\n\t\tif (this.start === b.start) {\n\t\t\tstartSide = minSide(this.startSide, b.startSide);\n\t\t} else {\n\t\t\tstartSide = this.start === newStart ? this.startSide : b.startSide;\n\t\t}\n\n\t\tlet endSide: Side;\n\n\t\tif (this.end === b.end) {\n\t\t\tendSide = maxSide(this.endSide, b.endSide);\n\t\t} else {\n\t\t\tendSide = this.end === newEnd ? this.endSide : b.endSide;\n\t\t}\n\n\t\treturn new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tuuid(),\n\t\t\tthis.label,\n\t\t\tnewStart,\n\t\t\tnewEnd,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide,\n\t\t\tendSide,\n\t\t);\n\t}\n\n\t/**\n\t * @returns whether this interval overlaps two numerical positions.\n\t */\n\tpublic overlapsPos(bstart: number, bend: number) {\n\t\tconst startPos = this.client.localReferencePositionToPosition(this.start);\n\t\tconst endPos = this.client.localReferencePositionToPosition(this.end);\n\t\treturn endPos > bstart && startPos < bend;\n\t}\n\n\t/**\n\t * {@inheritDoc IInterval.modify}\n\t */\n\tpublic modify(\n\t\tlabel: string,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t\tuseNewSlidingBehavior: boolean = false,\n\t) {\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\t\tconst startSegment: ISegmentInternal | undefined = this.start.getSegment();\n\t\tconst endSegment: ISegmentInternal | undefined = this.end.getSegment();\n\t\tconst stickiness = computeStickinessFromSide(\n\t\t\tstartPos ?? startSegment?.endpointType,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendPos ?? endSegment?.endpointType,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tconst getRefType = (baseType: ReferenceType): ReferenceType => {\n\t\t\tlet refType = baseType;\n\t\t\tif (op === undefined) {\n\t\t\t\trefType &= ~ReferenceType.SlideOnRemove;\n\t\t\t\trefType |= ReferenceType.StayOnRemove;\n\t\t\t}\n\t\t\treturn refType;\n\t\t};\n\n\t\tlet startRef = this.start;\n\t\tif (startPos !== undefined) {\n\t\t\tstartRef = createPositionReference(\n\t\t\t\tthis.client,\n\t\t\t\tstartPos,\n\t\t\t\tgetRefType(this.start.refType),\n\t\t\t\top,\n\t\t\t\tundefined,\n\t\t\t\tlocalSeq,\n\t\t\t\tstartReferenceSlidingPreference(stickiness),\n\t\t\t\tstartReferenceSlidingPreference(stickiness) === SlidingPreference.BACKWARD,\n\t\t\t\tuseNewSlidingBehavior,\n\t\t\t);\n\t\t\tif (this.start.properties) {\n\t\t\t\tstartRef.addProperties(this.start.properties);\n\t\t\t}\n\t\t}\n\n\t\tlet endRef = this.end;\n\t\tif (endPos !== undefined) {\n\t\t\tendRef = createPositionReference(\n\t\t\t\tthis.client,\n\t\t\t\tendPos,\n\t\t\t\tgetRefType(this.end.refType),\n\t\t\t\top,\n\t\t\t\tundefined,\n\t\t\t\tlocalSeq,\n\t\t\t\tendReferenceSlidingPreference(stickiness),\n\t\t\t\tendReferenceSlidingPreference(stickiness) === SlidingPreference.FORWARD,\n\t\t\t\tuseNewSlidingBehavior,\n\t\t\t);\n\t\t\tif (this.end.properties) {\n\t\t\t\tendRef.addProperties(this.end.properties);\n\t\t\t}\n\t\t}\n\n\t\tconst newInterval = new SequenceIntervalClass(\n\t\t\tthis.client,\n\t\t\tthis.id,\n\t\t\tthis.label,\n\t\t\tstartRef,\n\t\t\tendRef,\n\t\t\tthis.intervalType,\n\t\t\tundefined,\n\t\t\tstartSide ?? this.startSide,\n\t\t\tendSide ?? this.endSide,\n\t\t);\n\t\tcopyPropertiesAndManager(this.#props, newInterval.#props);\n\t\treturn newInterval;\n\t}\n\n\tpublic ackPropertiesChange(newProps: PropertySet, op: ISequencedDocumentMessage) {\n\t\tthis.#props.propertyManager ??= new PropertiesManager();\n\t\t// Let the propertyManager prune its pending change-properties set.\n\t\tthis.#props.propertyManager.ack(op.sequenceNumber, op.minimumSequenceNumber, {\n\t\t\tprops: newProps,\n\t\t});\n\t}\n}\n\nexport function createPositionReferenceFromSegoff(\n\tclient: Client,\n\tsegoff: { segment: ISegment; offset: number } | undefined | \"start\" | \"end\",\n\trefType: ReferenceType,\n\top?: ISequencedDocumentMessage,\n\tlocalSeq?: number,\n\tfromSnapshot?: boolean,\n\tslidingPreference?: SlidingPreference,\n\tcanSlideToEndpoint?: boolean,\n\trollback?: boolean,\n): LocalReferencePosition {\n\tif (segoff === \"start\" || segoff === \"end\") {\n\t\treturn client.createLocalReferencePosition(\n\t\t\tsegoff,\n\t\t\tundefined,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\tif (segoff?.segment) {\n\t\tconst ref = client.createLocalReferencePosition(\n\t\t\tsegoff.segment,\n\t\t\tsegoff.offset,\n\t\t\trefType,\n\t\t\tundefined,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t\treturn ref;\n\t}\n\n\t// Creating references on detached segments is allowed for:\n\t// - Transient segments\n\t// - References coming from a remote client (location may have been concurrently removed)\n\t// - References being rebased to a new sequence number\n\t// (segment they originally referred to may have been removed with no suitable replacement)\n\tif (\n\t\t!op &&\n\t\t!localSeq &&\n\t\t!fromSnapshot &&\n\t\t!refTypeIncludesFlag(refType, ReferenceType.Transient) &&\n\t\t!rollback\n\t) {\n\t\tthrow new UsageError(\"Non-transient references need segment\");\n\t}\n\n\treturn createDetachedLocalReferencePosition(slidingPreference, refType);\n}\n\nfunction createPositionReference(\n\tclient: Client,\n\tpos: number | \"start\" | \"end\",\n\trefType: ReferenceType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tlocalSeq?: number,\n\tslidingPreference?: SlidingPreference,\n\texclusive: boolean = false,\n\tuseNewSlidingBehavior: boolean = false,\n\trollback?: boolean,\n): LocalReferencePosition {\n\tlet segoff;\n\n\tif (op) {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) !== 0,\n\t\t\t0x2f5 /* op create references must be SlideOnRemove */,\n\t\t);\n\t\tif (pos === \"start\" || pos === \"end\") {\n\t\t\tsegoff = pos;\n\t\t} else {\n\t\t\tsegoff = client.getContainingSegment(pos, {\n\t\t\t\treferenceSequenceNumber: op.referenceSequenceNumber,\n\t\t\t\tclientId: op.clientId,\n\t\t\t});\n\t\t\tsegoff = getSlideToSegoff(segoff, slidingPreference, undefined, useNewSlidingBehavior);\n\t\t}\n\t} else {\n\t\tassert(\n\t\t\t(refType & ReferenceType.SlideOnRemove) === 0 || !!fromSnapshot,\n\t\t\t0x2f6 /* SlideOnRemove references must be op created */,\n\t\t);\n\t\tsegoff =\n\t\t\tpos === \"start\" || pos === \"end\"\n\t\t\t\t? pos\n\t\t\t\t: client.getContainingSegment(pos, undefined, localSeq);\n\t}\n\n\treturn createPositionReferenceFromSegoff(\n\t\tclient,\n\t\tsegoff,\n\t\trefType,\n\t\top,\n\t\tlocalSeq,\n\t\tfromSnapshot,\n\t\tslidingPreference,\n\t\texclusive,\n\t\trollback,\n\t);\n}\n\nexport function createTransientInterval(\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n) {\n\treturn createSequenceInterval(\n\t\t\"transient\",\n\t\tuuid(),\n\t\tstart,\n\t\tend,\n\t\tclient,\n\t\tIntervalType.Transient,\n\t);\n}\n\nexport function createSequenceInterval(\n\tlabel: string,\n\tid: string,\n\tstart: SequencePlace | undefined,\n\tend: SequencePlace | undefined,\n\tclient: Client,\n\tintervalType: IntervalType,\n\top?: ISequencedDocumentMessage,\n\tfromSnapshot?: boolean,\n\tuseNewSlidingBehavior: boolean = false,\n\tprops?: PropertySet,\n\trollback?: boolean,\n): SequenceIntervalClass {\n\tconst { startPos, startSide, endPos, endSide } = endpointPosAndSide(\n\t\tstart ?? \"start\",\n\t\tend ?? \"end\",\n\t);\n\tassert(\n\t\tstartPos !== undefined &&\n\t\t\tendPos !== undefined &&\n\t\t\tstartSide !== undefined &&\n\t\t\tendSide !== undefined,\n\t\t0x794 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t);\n\tconst stickiness = computeStickinessFromSide(startPos, startSide, endPos, endSide);\n\tlet beginRefType = ReferenceType.RangeBegin;\n\tlet endRefType = ReferenceType.RangeEnd;\n\tif (intervalType === IntervalType.Transient) {\n\t\tbeginRefType = ReferenceType.Transient;\n\t\tendRefType = ReferenceType.Transient;\n\t} else {\n\t\t// All non-transient interval references must eventually be SlideOnRemove\n\t\t// To ensure eventual consistency, they must start as StayOnRemove when\n\t\t// pending (created locally and creation op is not acked)\n\t\tif (op ?? fromSnapshot) {\n\t\t\tbeginRefType |= ReferenceType.SlideOnRemove;\n\t\t\tendRefType |= ReferenceType.SlideOnRemove;\n\t\t} else {\n\t\t\tbeginRefType |= ReferenceType.StayOnRemove;\n\t\t\tendRefType |= ReferenceType.StayOnRemove;\n\t\t}\n\t}\n\n\tconst startLref = createPositionReference(\n\t\tclient,\n\t\tstartPos,\n\t\tbeginRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tundefined,\n\t\tstartReferenceSlidingPreference(stickiness),\n\t\tstartReferenceSlidingPreference(stickiness) === SlidingPreference.BACKWARD,\n\t\tuseNewSlidingBehavior,\n\t\trollback,\n\t);\n\n\tconst endLref = createPositionReference(\n\t\tclient,\n\t\tendPos,\n\t\tendRefType,\n\t\top,\n\t\tfromSnapshot,\n\t\tundefined,\n\t\tendReferenceSlidingPreference(stickiness),\n\t\tendReferenceSlidingPreference(stickiness) === SlidingPreference.FORWARD,\n\t\tuseNewSlidingBehavior,\n\t\trollback,\n\t);\n\n\tconst rangeProp = {\n\t\t[reservedRangeLabelsKey]: [label],\n\t};\n\tstartLref.addProperties(rangeProp);\n\tendLref.addProperties(rangeProp);\n\n\tconst ival = new SequenceIntervalClass(\n\t\tclient,\n\t\tid,\n\t\tlabel,\n\t\tstartLref,\n\t\tendLref,\n\t\tintervalType,\n\t\tprops === undefined\n\t\t\t? undefined\n\t\t\t: { ...props, [reservedIntervalIdKey]: undefined, [reservedRangeLabelsKey]: undefined },\n\t\tstartSide,\n\t\tendSide,\n\t);\n\treturn ival;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/sequence";
8
- export declare const pkgVersion = "2.41.0";
8
+ export declare const pkgVersion = "2.43.0-343119";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,6BAA6B,CAAC;AAClD,eAAO,MAAM,UAAU,WAAW,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,6BAA6B,CAAC;AAClD,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/sequence";
11
- exports.pkgVersion = "2.41.0";
11
+ exports.pkgVersion = "2.43.0-343119";
12
12
  //# sourceMappingURL=packageVersion.js.map