@fluidframework/sequence 2.33.2 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/api-report/sequence.legacy.alpha.api.md +0 -68
  3. package/dist/index.d.ts +2 -3
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/intervalCollection.d.ts +2 -250
  7. package/dist/intervalCollection.d.ts.map +1 -1
  8. package/dist/intervalCollection.js.map +1 -1
  9. package/dist/intervalIndex/index.d.ts +2 -2
  10. package/dist/intervalIndex/index.d.ts.map +1 -1
  11. package/dist/intervalIndex/index.js.map +1 -1
  12. package/dist/intervalIndex/intervalIndex.d.ts +1 -28
  13. package/dist/intervalIndex/intervalIndex.d.ts.map +1 -1
  14. package/dist/intervalIndex/intervalIndex.js.map +1 -1
  15. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +2 -20
  16. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  17. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  18. package/dist/legacy.d.ts +0 -5
  19. package/dist/packageVersion.d.ts +1 -1
  20. package/dist/packageVersion.js +1 -1
  21. package/dist/packageVersion.js.map +1 -1
  22. package/lib/index.d.ts +2 -3
  23. package/lib/index.d.ts.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib/intervalCollection.d.ts +2 -250
  26. package/lib/intervalCollection.d.ts.map +1 -1
  27. package/lib/intervalCollection.js.map +1 -1
  28. package/lib/intervalIndex/index.d.ts +2 -2
  29. package/lib/intervalIndex/index.d.ts.map +1 -1
  30. package/lib/intervalIndex/index.js.map +1 -1
  31. package/lib/intervalIndex/intervalIndex.d.ts +1 -28
  32. package/lib/intervalIndex/intervalIndex.d.ts.map +1 -1
  33. package/lib/intervalIndex/intervalIndex.js.map +1 -1
  34. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +2 -20
  35. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  36. package/lib/intervalIndex/overlappingIntervalsIndex.js +1 -1
  37. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  38. package/lib/legacy.d.ts +0 -5
  39. package/lib/packageVersion.d.ts +1 -1
  40. package/lib/packageVersion.js +1 -1
  41. package/lib/packageVersion.js.map +1 -1
  42. package/package.json +39 -18
  43. package/src/index.ts +0 -5
  44. package/src/intervalCollection.ts +0 -308
  45. package/src/intervalIndex/index.ts +1 -2
  46. package/src/intervalIndex/intervalIndex.ts +1 -30
  47. package/src/intervalIndex/overlappingIntervalsIndex.ts +2 -32
  48. package/src/packageVersion.ts +1 -1
  49. package/dist/sharedIntervalCollection.d.ts +0 -15
  50. package/dist/sharedIntervalCollection.d.ts.map +0 -1
  51. package/dist/sharedIntervalCollection.js +0 -7
  52. package/dist/sharedIntervalCollection.js.map +0 -1
  53. package/lib/sharedIntervalCollection.d.ts +0 -15
  54. package/lib/sharedIntervalCollection.d.ts.map +0 -1
  55. package/lib/sharedIntervalCollection.js +0 -6
  56. package/lib/sharedIntervalCollection.js.map +0 -1
  57. package/src/sharedIntervalCollection.ts +0 -18
@@ -4,27 +4,9 @@
4
4
  */
5
5
  import { Client, SequencePlace } from "@fluidframework/merge-tree/internal";
6
6
  import { IntervalTree } from "../intervalTree.js";
7
- import { ISerializableInterval, SequenceInterval } from "../intervals/index.js";
7
+ import { SequenceInterval } from "../intervals/index.js";
8
8
  import { ISharedString } from "../sharedString.js";
9
- import { IntervalIndex, type SequenceIntervalIndex } from "./intervalIndex.js";
10
- /**
11
- * The generic version of this interface is deprecated and will be removed in a future release.
12
- * Use {@link ISequenceOverlappingIntervalsIndex} instead.
13
- * @legacy
14
- * @alpha
15
- * @deprecated The generic version of this interface is no longer used and will be removed. Use {@link ISequenceOverlappingIntervalsIndex} instead.
16
- */
17
- export interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
18
- /**
19
- * @returns an array of all intervals contained in this collection that overlap the range
20
- * `[start end]`.
21
- */
22
- findOverlappingIntervals(start: SequencePlace, end: SequencePlace): TInterval[];
23
- /**
24
- * Gathers the interval results based on specified parameters.
25
- */
26
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
27
- }
9
+ import { type SequenceIntervalIndex } from "./intervalIndex.js";
28
10
  /**
29
11
  * @legacy
30
12
  * @alpha
@@ -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,EACN,qBAAqB,EACrB,gBAAgB,EAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B,CAAC,SAAS,SAAS,qBAAqB,CAClF,SAAQ,aAAa,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,GAAG,SAAS,EAAE,CAAC;IAEhF;;OAEG;IACH,sBAAsB,CACrB,OAAO,EAAE,SAAS,EAAE,EACpB,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,aAAa,EACrB,GAAG,CAAC,EAAE,aAAa,GACjB,IAAI,CAAC;CACR;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAmC,SAAQ,qBAAqB;IAChF;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,aAA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B,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,EAAE,aAAa,GAAG,gBAAgB,EAAE,CAAC;IAEvF;;OAEG;IACH,sBAAsB,CACrB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,aAAa,EACrB,GAAG,CAAC,EAAE,aAAa,GACjB,IAAI,CAAC;CACR;AAED,qBAAa,yBAA0B,YAAW,kCAAkC;IACnF,SAAS,CAAC,QAAQ,CAAC,YAAY,iCAAwC;IACvE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEtB,MAAM,EAAE,MAAM;IAInB,GAAG,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI;IAI5C,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO;IAIpD,sBAAsB,CAC5B,OAAO,EAAE,gBAAgB,EAAE,EAC3B,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,aAAa,EACrB,GAAG,CAAC,EAAE,aAAa,GACjB,IAAI;IA2EA,wBAAwB,CAC9B,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,aAAa,GAChB,gBAAgB,EAAE;IAmBd,MAAM,CAAC,QAAQ,EAAE,gBAAgB;IAIjC,GAAG,CAAC,QAAQ,EAAE,gBAAgB;CAGrC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC9C,YAAY,EAAE,aAAa,GACzB,kCAAkC,CAGpC"}
@@ -5,7 +5,7 @@
5
5
  /* eslint-disable import/no-deprecated */
6
6
  import { endpointPosAndSide, } from "@fluidframework/merge-tree/internal";
7
7
  import { IntervalTree } from "../intervalTree.js";
8
- import { createTransientInterval, } from "../intervals/index.js";
8
+ import { createTransientInterval } from "../intervals/index.js";
9
9
  export class OverlappingIntervalsIndex {
10
10
  constructor(client) {
11
11
  this.intervalTree = new IntervalTree();
@@ -1 +1 @@
1
- {"version":3,"file":"overlappingIntervalsIndex.js","sourceRoot":"","sources":["../../src/intervalIndex/overlappingIntervalsIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yCAAyC;AAEzC,OAAO,EAGN,kBAAkB,GAClB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAgB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAGN,uBAAuB,GACvB,MAAM,uBAAuB,CAAC;AAqD/B,MAAM,OAAO,yBAAyB;IAIrC,YAAY,MAAc;QAHP,iBAAY,GAAG,IAAI,YAAY,EAAoB,CAAC;QAItE,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,QAA0B,EAAE,EAAE;oBACpD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxB,CAAC,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACP,IAAI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,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,QAA0B;QACvC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,GAAG,CAAC,QAA0B;QACpC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC9C,YAA2B;IAE3B,MAAM,MAAM,GAAI,YAA8C,CAAC,MAAM,CAAC;IACtE,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC","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\tISerializableInterval,\n\tSequenceInterval,\n\tcreateTransientInterval,\n} from \"../intervals/index.js\";\nimport { ISharedString } from \"../sharedString.js\";\n\nimport { IntervalIndex, type SequenceIntervalIndex } from \"./intervalIndex.js\";\n\n/**\n * The generic version of this interface is deprecated and will be removed in a future release.\n * Use {@link ISequenceOverlappingIntervalsIndex} instead.\n * @legacy\n * @alpha\n * @deprecated The generic version of this interface is no longer used and will be removed. Use {@link ISequenceOverlappingIntervalsIndex} instead.\n */\nexport interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval>\n\textends IntervalIndex<TInterval> {\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): TInterval[];\n\n\t/**\n\t * Gathers the interval results based on specified parameters.\n\t */\n\tgatherIterationResults(\n\t\tresults: TInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: SequencePlace,\n\t\tend?: SequencePlace,\n\t): void;\n}\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,OAAO,EAGN,kBAAkB,GAClB,MAAM,q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C;IAEM,GAAG,CAAC,QAA0B;QACpC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC9C,YAA2B;IAE3B,MAAM,MAAM,GAAI,YAA8C,CAAC,MAAM,CAAC;IACtE,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC","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"]}
package/lib/legacy.d.ts CHANGED
@@ -26,9 +26,6 @@ export {
26
26
  BaseSegment,
27
27
  DeserializeCallback,
28
28
  IInterval,
29
- IIntervalCollection,
30
- IIntervalCollectionEvent,
31
- IOverlappingIntervalsIndex,
32
29
  ISegment,
33
30
  ISequenceDeltaRange,
34
31
  ISequenceIntervalCollection,
@@ -36,12 +33,10 @@ export {
36
33
  ISequenceOverlappingIntervalsIndex,
37
34
  ISerializableInterval,
38
35
  ISerializedInterval,
39
- ISharedIntervalCollection,
40
36
  ISharedSegmentSequence,
41
37
  ISharedSegmentSequenceEvents,
42
38
  ISharedString,
43
39
  InteriorSequencePlace,
44
- IntervalIndex,
45
40
  IntervalOpType,
46
41
  IntervalRevertible,
47
42
  IntervalStickiness,
@@ -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.33.2";
8
+ export declare const pkgVersion = "2.40.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/sequence";
8
- export const pkgVersion = "2.33.2";
8
+ export const pkgVersion = "2.40.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.33.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.40.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/sequence",
3
- "version": "2.33.2",
3
+ "version": "2.40.0",
4
4
  "description": "Distributed sequence",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -91,33 +91,33 @@
91
91
  "temp-directory": "nyc/.nyc_output"
92
92
  },
93
93
  "dependencies": {
94
- "@fluid-internal/client-utils": "~2.33.2",
95
- "@fluidframework/core-interfaces": "~2.33.2",
96
- "@fluidframework/core-utils": "~2.33.2",
97
- "@fluidframework/datastore-definitions": "~2.33.2",
98
- "@fluidframework/driver-definitions": "~2.33.2",
99
- "@fluidframework/merge-tree": "~2.33.2",
100
- "@fluidframework/runtime-definitions": "~2.33.2",
101
- "@fluidframework/runtime-utils": "~2.33.2",
102
- "@fluidframework/shared-object-base": "~2.33.2",
103
- "@fluidframework/telemetry-utils": "~2.33.2",
94
+ "@fluid-internal/client-utils": "~2.40.0",
95
+ "@fluidframework/core-interfaces": "~2.40.0",
96
+ "@fluidframework/core-utils": "~2.40.0",
97
+ "@fluidframework/datastore-definitions": "~2.40.0",
98
+ "@fluidframework/driver-definitions": "~2.40.0",
99
+ "@fluidframework/merge-tree": "~2.40.0",
100
+ "@fluidframework/runtime-definitions": "~2.40.0",
101
+ "@fluidframework/runtime-utils": "~2.40.0",
102
+ "@fluidframework/shared-object-base": "~2.40.0",
103
+ "@fluidframework/telemetry-utils": "~2.40.0",
104
104
  "double-ended-queue": "^2.1.0-0",
105
105
  "uuid": "^9.0.0"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@arethetypeswrong/cli": "^0.17.1",
109
109
  "@biomejs/biome": "~1.9.3",
110
- "@fluid-internal/mocha-test-setup": "~2.33.2",
111
- "@fluid-private/stochastic-test-utils": "~2.33.2",
112
- "@fluid-private/test-dds-utils": "~2.33.2",
113
- "@fluid-tools/benchmark": "^0.50.0",
110
+ "@fluid-internal/mocha-test-setup": "~2.40.0",
111
+ "@fluid-private/stochastic-test-utils": "~2.40.0",
112
+ "@fluid-private/test-dds-utils": "~2.40.0",
113
+ "@fluid-tools/benchmark": "^0.51.0",
114
114
  "@fluid-tools/build-cli": "^0.55.0",
115
115
  "@fluidframework/build-common": "^2.0.3",
116
116
  "@fluidframework/build-tools": "^0.55.0",
117
- "@fluidframework/container-definitions": "~2.33.2",
117
+ "@fluidframework/container-definitions": "~2.40.0",
118
118
  "@fluidframework/eslint-config-fluid": "^5.7.3",
119
119
  "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.33.0",
120
- "@fluidframework/test-runtime-utils": "~2.33.2",
120
+ "@fluidframework/test-runtime-utils": "~2.40.0",
121
121
  "@microsoft/api-extractor": "7.52.5",
122
122
  "@types/diff": "^3.5.1",
123
123
  "@types/double-ended-queue": "^2.1.0",
@@ -145,7 +145,28 @@
145
145
  }
146
146
  },
147
147
  "typeValidation": {
148
- "broken": {},
148
+ "broken": {
149
+ "Interface_IIntervalCollection": {
150
+ "forwardCompat": false,
151
+ "backCompat": false
152
+ },
153
+ "Interface_IIntervalCollectionEvent": {
154
+ "forwardCompat": false,
155
+ "backCompat": false
156
+ },
157
+ "Interface_IntervalIndex": {
158
+ "forwardCompat": false,
159
+ "backCompat": false
160
+ },
161
+ "Interface_IOverlappingIntervalsIndex": {
162
+ "forwardCompat": false,
163
+ "backCompat": false
164
+ },
165
+ "Interface_ISharedIntervalCollection": {
166
+ "forwardCompat": false,
167
+ "backCompat": false
168
+ }
169
+ },
149
170
  "entrypoint": "legacy"
150
171
  },
151
172
  "scripts": {
package/src/index.ts CHANGED
@@ -28,16 +28,12 @@ export {
28
28
  } from "./intervals/index.js";
29
29
  export {
30
30
  DeserializeCallback,
31
- IIntervalCollectionEvent,
32
- IIntervalCollection,
33
31
  ISequenceIntervalCollection,
34
32
  ISequenceIntervalCollectionEvents,
35
33
  } from "./intervalCollection.js";
36
34
  export {
37
- IntervalIndex,
38
35
  SequenceIntervalIndex,
39
36
  SequenceIntervalIndexes,
40
- IOverlappingIntervalsIndex,
41
37
  ISequenceOverlappingIntervalsIndex,
42
38
  IEndpointIndex,
43
39
  createOverlappingIntervalsIndex,
@@ -72,7 +68,6 @@ export {
72
68
  SharedStringSegment,
73
69
  SharedStringClass,
74
70
  } from "./sharedString.js";
75
- export { ISharedIntervalCollection } from "./sharedIntervalCollection.js";
76
71
  export { IJSONRunSegment, SharedSequence, SubSequence } from "./sharedSequence.js";
77
72
 
78
73
  export {
@@ -40,8 +40,6 @@ import {
40
40
  OverlappingIntervalsIndex,
41
41
  type IEndpointIndex,
42
42
  type IIdIntervalIndex,
43
- // eslint-disable-next-line import/no-deprecated
44
- type IntervalIndex,
45
43
  type ISequenceOverlappingIntervalsIndex,
46
44
  type SequenceIntervalIndex,
47
45
  } from "./intervalIndex/index.js";
@@ -58,7 +56,6 @@ import {
58
56
  endReferenceSlidingPreference,
59
57
  getSerializedProperties,
60
58
  startReferenceSlidingPreference,
61
- type ISerializableInterval,
62
59
  } from "./intervals/index.js";
63
60
 
64
61
  export type ISerializedIntervalCollectionV1 = ISerializedInterval[];
@@ -389,92 +386,6 @@ class IntervalCollectionIterator implements Iterator<SequenceIntervalClass> {
389
386
  }
390
387
  }
391
388
 
392
- /**
393
- * Change events emitted by `IntervalCollection`s
394
- * @legacy
395
- * @alpha
396
- * @deprecated The generic version of this interface is no longer used and will be removed. Use {@link ISequenceIntervalCollectionEvents} instead.
397
- */
398
- export interface IIntervalCollectionEvent<TInterval extends ISerializableInterval>
399
- extends IEvent {
400
- /**
401
- * This event is invoked whenever the endpoints of an interval may have changed.
402
- * This can happen on:
403
- * - local endpoint modification
404
- * - ack of a remote endpoint modification
405
- * - position change due to segment sliding (slides due to mergeTree segment deletion will always appear local)
406
- * The `interval` argument reflects the new values.
407
- * `previousInterval` contains transient `ReferencePosition`s at the same location as the interval's original
408
- * endpoints. These references should be used for position information only.
409
- * `local` reflects whether the change originated locally.
410
- * `op` is defined if and only if the server has acked this change.
411
- * `slide` is true if the change is due to sliding on removal of position
412
- */
413
- (
414
- event: "changeInterval",
415
- listener: (
416
- interval: TInterval,
417
- previousInterval: TInterval,
418
- local: boolean,
419
- op: ISequencedDocumentMessage | undefined,
420
- slide: boolean,
421
- ) => void,
422
- ): void;
423
- /**
424
- * This event is invoked whenever an interval is added or removed from the collection.
425
- * `local` reflects whether the change originated locally.
426
- * `op` is defined if and only if the server has acked this change.
427
- */
428
- (
429
- event: "addInterval" | "deleteInterval",
430
- listener: (
431
- interval: TInterval,
432
- local: boolean,
433
- op: ISequencedDocumentMessage | undefined,
434
- ) => void,
435
- ): void;
436
- /**
437
- * This event is invoked whenever an interval's properties have changed.
438
- * `interval` reflects the state of the updated properties.
439
- * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
440
- * values contain all previous values of the property set.
441
- * This object can be used directly in a call to `changeProperties` to revert the property change if desired.
442
- * `local` reflects whether the change originated locally.
443
- * `op` is defined if and only if the server has acked this change.
444
- */
445
- (
446
- event: "propertyChanged",
447
- listener: (
448
- interval: TInterval,
449
- propertyDeltas: PropertySet,
450
- local: boolean,
451
- op: ISequencedDocumentMessage | undefined,
452
- ) => void,
453
- ): void;
454
- /**
455
- * This event is invoked whenever an interval's endpoints or properties (or both) have changed.
456
- * `interval` reflects the state of the updated endpoints or properties.
457
- * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
458
- * values contain all previous values of the property set.
459
- * This object can be used directly in a call to `changeProperties` to revert the property change if desired.
460
- * 'previousInterval' contains transient `ReferencePosition`s at the same location as the interval's original
461
- * endpoints. These references should be used for position information only. In the case of a property change
462
- * only, this argument should be undefined.
463
- * `local` reflects whether the change originated locally.
464
- * `slide` is true if the change is due to sliding on removal of position.
465
- */
466
- (
467
- event: "changed",
468
- listener: (
469
- interval: TInterval,
470
- propertyDeltas: PropertySet,
471
- previousInterval: TInterval | undefined,
472
- local: boolean,
473
- slide: boolean,
474
- ) => void,
475
- ): void;
476
- }
477
-
478
389
  /**
479
390
  * Change events emitted by `IntervalCollection`s
480
391
  * @legacy
@@ -559,225 +470,6 @@ export interface ISequenceIntervalCollectionEvents extends IEvent {
559
470
  ): void;
560
471
  }
561
472
 
562
- /**
563
- * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
564
- * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
565
- * @legacy
566
- * @alpha
567
- * @deprecated The generic version of this interface is no longer used and will be removed. Use {@link ISequenceIntervalCollection} instead.
568
- */
569
- export interface IIntervalCollection<TInterval extends ISerializableInterval>
570
- extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>> {
571
- readonly attached: boolean;
572
- /**
573
- * Attaches an index to this collection.
574
- * All intervals which are part of this collection will be added to the index, and the index will automatically
575
- * be updated when this collection updates due to local or remote changes.
576
- *
577
- * @remarks After attaching an index to an interval collection, applications should typically store this
578
- * index somewhere in their in-memory data model for future reference and querying.
579
- */
580
- // eslint-disable-next-line import/no-deprecated
581
- attachIndex(index: IntervalIndex<TInterval>): void;
582
- /**
583
- * Detaches an index from this collection.
584
- * All intervals which are part of this collection will be removed from the index, and updates to this collection
585
- * due to local or remote changes will no longer incur updates to the index.
586
- *
587
- * @returns `false` if the target index cannot be found in the indexes, otherwise remove all intervals in the index and return `true`.
588
- */
589
- // eslint-disable-next-line import/no-deprecated
590
- detachIndex(index: IntervalIndex<TInterval>): boolean;
591
- /**
592
- * @returns the interval in this collection that has the provided `id`.
593
- * If no interval in the collection has this `id`, returns `undefined`.
594
- */
595
- getIntervalById(id: string): TInterval | undefined;
596
- /**
597
- * Creates a new interval and add it to the collection.
598
- * @param start - interval start position (inclusive)
599
- * @param end - interval end position (exclusive)
600
- * @param props - properties of the interval
601
- * @returns - the created interval
602
- * @remarks See documentation on {@link SequenceInterval} for comments on
603
- * interval endpoint semantics: there are subtleties with how the current
604
- * half-open behavior is represented.
605
- *
606
- * Note that intervals may behave unexpectedly if the entire contents
607
- * of the string are deleted. In this case, it is possible for one endpoint
608
- * of the interval to become detached, while the other remains on the string.
609
- *
610
- * By adjusting the `side` and `pos` values of the `start` and `end` parameters,
611
- * it is possible to control whether the interval expands to include content
612
- * inserted at its start or end.
613
- *
614
- * See {@link @fluidframework/merge-tree#SequencePlace} for more details on the model.
615
- *
616
- * @example
617
- *
618
- * Given the string "ABCD":
619
- *
620
- *```typescript
621
- * // Refers to "BC". If any content is inserted before B or after C, this
622
- * // interval will include that content
623
- * //
624
- * // Picture:
625
- * // \{start\} - A[- B - C -]D - \{end\}
626
- * // \{start\} - A - B - C - D - \{end\}
627
- * collection.add(\{ pos: 0, side: Side.After \}, \{ pos: 3, side: Side.Before \}, IntervalType.SlideOnRemove);
628
- * // Equivalent to specifying the same positions and Side.Before.
629
- * // Refers to "ABC". Content inserted after C will be included in the
630
- * // interval, but content inserted before A will not.
631
- * // \{start\} -[A - B - C -]D - \{end\}
632
- * // \{start\} - A - B - C - D - \{end\}
633
- * collection.add(0, 3, IntervalType.SlideOnRemove);
634
- *```
635
- *
636
- * In the case of the first example, if text is deleted,
637
- *
638
- * ```typescript
639
- * // Delete the character "B"
640
- * string.removeRange(1, 2);
641
- * ```
642
- *
643
- * The start point of the interval will slide to the position immediately
644
- * before "C", and the same will be true.
645
- *
646
- * ```
647
- * \{start\} - A[- C -]D - \{end\}
648
- * ```
649
- *
650
- * In this case, text inserted immediately before "C" would be included in
651
- * the interval.
652
- *
653
- * ```typescript
654
- * string.insertText(1, "EFG");
655
- * ```
656
- *
657
- * With the string now being,
658
- *
659
- * ```
660
- * \{start\} - A[- E - F - G - C -]D - \{end\}
661
- * ```
662
- *
663
- * @privateRemarks TODO: ADO:5205 the above comment regarding behavior in
664
- * the case that the entire interval has been deleted should be resolved at
665
- * the same time as this ticket
666
- */
667
- add({
668
- start,
669
- end,
670
- props,
671
- }: {
672
- start: SequencePlace;
673
- end: SequencePlace;
674
- props?: PropertySet;
675
- }): TInterval;
676
- /**
677
- * Removes an interval from the collection.
678
- * @param id - Id of the interval to remove
679
- * @returns the removed interval
680
- */
681
- removeIntervalById(id: string): TInterval | undefined;
682
- /**
683
- * Changes the endpoints, properties, or both of an existing interval.
684
- * @param id - Id of the Interval to change
685
- * @returns the interval that was changed, if it existed in the collection.
686
- * Pass the desired new start position, end position, and/or properties in an object. Start and end positions must be changed
687
- * simultaneously - they must either both be specified or both undefined. To only change the properties, leave both endpoints
688
- * undefined. To only change the endpoints, leave the properties undefined.
689
- */
690
- change(
691
- id: string,
692
- { start, end, props }: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet },
693
- ): TInterval | undefined;
694
-
695
- attachDeserializer(onDeserialize: DeserializeCallback): void;
696
- /**
697
- * @returns an iterator over all intervals in this collection.
698
- */
699
- [Symbol.iterator](): Iterator<TInterval>;
700
-
701
- /**
702
- * @returns a forward iterator over all intervals in this collection with start point equal to `startPosition`.
703
- */
704
- CreateForwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
705
-
706
- /**
707
- * @returns a backward iterator over all intervals in this collection with start point equal to `startPosition`.
708
- */
709
- CreateBackwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
710
-
711
- /**
712
- * @returns a forward iterator over all intervals in this collection with end point equal to `endPosition`.
713
- */
714
- CreateForwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
715
-
716
- /**
717
- * @returns a backward iterator over all intervals in this collection with end point equal to `endPosition`.
718
- */
719
- CreateBackwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
720
-
721
- /**
722
- * Gathers iteration results that optionally match a start/end criteria into the provided array.
723
- * @param results - Array to gather the results into. In lieu of a return value, this array will be populated with
724
- * intervals matching the query upon edit.
725
- * @param iteratesForward - whether or not iteration should be in the forward direction
726
- * @param start - If provided, only match intervals whose start point is equal to `start`.
727
- * @param end - If provided, only match intervals whose end point is equal to `end`.
728
- */
729
- gatherIterationResults(
730
- results: TInterval[],
731
- iteratesForward: boolean,
732
- start?: number,
733
- end?: number,
734
- ): void;
735
-
736
- /**
737
- * @deprecated - Users must manually attach the corresponding interval index to utilize this functionality, for instance:
738
- *
739
- * ```typescript
740
- * const overlappingIntervalsIndex = createOverlappingIntervalsIndex(sharedString);
741
- * collection.attachIndex(overlappingIntervalsIndex)
742
- * const result = overlappingIntervalsIndex.findOverlappingIntervals(start, end);
743
- * ```
744
- *
745
- * @returns an array of all intervals in this collection that overlap with the interval
746
- * `[startPosition, endPosition]`.
747
- */
748
- findOverlappingIntervals(startPosition: number, endPosition: number): TInterval[];
749
-
750
- /**
751
- * Applies a function to each interval in this collection.
752
- */
753
- map(fn: (interval: TInterval) => void): void;
754
-
755
- /**
756
- * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
757
- * automatically added to the collection. Users are advised to independently attach the
758
- * index to the collection and utilize the API accordingly, for instance:
759
- * ```typescript
760
- * const endpointIndex = createEndpointIndex(sharedString);
761
- * collection.attachIndex(endpointIndex);
762
- * const result1 = endpointIndex.previousInterval(pos);
763
- * ```
764
- * If an index is used repeatedly, applications should generally attach it once and store it in memory.
765
- */
766
- previousInterval(pos: number): TInterval | undefined;
767
-
768
- /**
769
- * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
770
- * automatically added to the collection. Users are advised to independently attach the
771
- * index to the collection and utilize the API accordingly, for instance:
772
- * ```typescript
773
- * const endpointIndex = createEndpointIndex(sharedString);
774
- * collection.attachIndex(endpointIndex);
775
- * const result2 = endpointIndex.nextInterval(pos);
776
- * ```
777
- */
778
- nextInterval(pos: number): TInterval | undefined;
779
- }
780
-
781
473
  /**
782
474
  * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
783
475
  * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export { IntervalIndex, SequenceIntervalIndex } from "./intervalIndex.js";
6
+ export { SequenceIntervalIndex } from "./intervalIndex.js";
7
7
  export { IIdIntervalIndex, createIdIntervalIndex } from "./idIntervalIndex.js";
8
8
  export { IEndpointIndex, createEndpointIndex, EndpointIndex } from "./endpointIndex.js";
9
9
  export {
@@ -18,7 +18,6 @@ export {
18
18
  } from "./startpointInRangeIndex.js";
19
19
  export { SequenceIntervalIndexes } from "./sequenceIntervalIndexes.js";
20
20
  export {
21
- IOverlappingIntervalsIndex,
22
21
  createOverlappingIntervalsIndex,
23
22
  OverlappingIntervalsIndex,
24
23
  ISequenceOverlappingIntervalsIndex,
@@ -3,36 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISerializableInterval, type SequenceInterval } from "../intervals/index.js";
7
-
8
- /**
9
- * Collection of intervals.
10
- *
11
- * Implementers of this interface will typically implement additional APIs to support efficiently querying a collection
12
- * of intervals in some manner, for example:
13
- * - "find all intervals with start endpoint between these two points"
14
- * - "find all intervals which overlap this range"
15
- * etc.
16
- * @legacy
17
- * @alpha
18
- *
19
- * @deprecated The generic version of this interface is no longer used and will be removed. Use {@link SequenceIntervalIndex} instead.
20
- */
21
- export interface IntervalIndex<TInterval extends ISerializableInterval> {
22
- /**
23
- * Adds an interval to the index.
24
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
25
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
26
- */
27
- add(interval: TInterval): void;
28
-
29
- /**
30
- * Removes an interval from the index.
31
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
32
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
33
- */
34
- remove(interval: TInterval): void;
35
- }
6
+ import { type SequenceInterval } from "../intervals/index.js";
36
7
 
37
8
  /**
38
9
  * Collection of intervals.