@fluidframework/sequence 1.3.0 → 2.0.0-dev.1.4.5.105745

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 (73) hide show
  1. package/.mocharc.js +12 -0
  2. package/README.md +19 -18
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +3 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/intervalCollection.d.ts +51 -18
  8. package/dist/intervalCollection.d.ts.map +1 -1
  9. package/dist/intervalCollection.js +117 -73
  10. package/dist/intervalCollection.js.map +1 -1
  11. package/dist/packageVersion.d.ts +1 -1
  12. package/dist/packageVersion.d.ts.map +1 -1
  13. package/dist/packageVersion.js +1 -1
  14. package/dist/packageVersion.js.map +1 -1
  15. package/dist/sequence.d.ts +13 -22
  16. package/dist/sequence.d.ts.map +1 -1
  17. package/dist/sequence.js +11 -32
  18. package/dist/sequence.js.map +1 -1
  19. package/dist/sequenceDeltaEvent.d.ts +0 -6
  20. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  21. package/dist/sequenceDeltaEvent.js +0 -1
  22. package/dist/sequenceDeltaEvent.js.map +1 -1
  23. package/dist/sharedIntervalCollection.d.ts +5 -5
  24. package/dist/sharedIntervalCollection.js +5 -5
  25. package/dist/sharedIntervalCollection.js.map +1 -1
  26. package/dist/sharedString.d.ts +30 -1
  27. package/dist/sharedString.d.ts.map +1 -1
  28. package/dist/sharedString.js +40 -5
  29. package/dist/sharedString.js.map +1 -1
  30. package/dist/sparsematrix.d.ts +28 -15
  31. package/dist/sparsematrix.d.ts.map +1 -1
  32. package/dist/sparsematrix.js +24 -13
  33. package/dist/sparsematrix.js.map +1 -1
  34. package/lib/index.d.ts +2 -2
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/index.js +2 -2
  37. package/lib/index.js.map +1 -1
  38. package/lib/intervalCollection.d.ts +51 -18
  39. package/lib/intervalCollection.d.ts.map +1 -1
  40. package/lib/intervalCollection.js +116 -73
  41. package/lib/intervalCollection.js.map +1 -1
  42. package/lib/packageVersion.d.ts +1 -1
  43. package/lib/packageVersion.d.ts.map +1 -1
  44. package/lib/packageVersion.js +1 -1
  45. package/lib/packageVersion.js.map +1 -1
  46. package/lib/sequence.d.ts +13 -22
  47. package/lib/sequence.d.ts.map +1 -1
  48. package/lib/sequence.js +12 -33
  49. package/lib/sequence.js.map +1 -1
  50. package/lib/sequenceDeltaEvent.d.ts +0 -6
  51. package/lib/sequenceDeltaEvent.d.ts.map +1 -1
  52. package/lib/sequenceDeltaEvent.js +0 -1
  53. package/lib/sequenceDeltaEvent.js.map +1 -1
  54. package/lib/sharedIntervalCollection.d.ts +5 -5
  55. package/lib/sharedIntervalCollection.js +5 -5
  56. package/lib/sharedIntervalCollection.js.map +1 -1
  57. package/lib/sharedString.d.ts +30 -1
  58. package/lib/sharedString.d.ts.map +1 -1
  59. package/lib/sharedString.js +38 -4
  60. package/lib/sharedString.js.map +1 -1
  61. package/lib/sparsematrix.d.ts +28 -15
  62. package/lib/sparsematrix.d.ts.map +1 -1
  63. package/lib/sparsematrix.js +24 -13
  64. package/lib/sparsematrix.js.map +1 -1
  65. package/package.json +70 -25
  66. package/src/index.ts +3 -1
  67. package/src/intervalCollection.ts +209 -97
  68. package/src/packageVersion.ts +1 -1
  69. package/src/sequence.ts +12 -41
  70. package/src/sequenceDeltaEvent.ts +0 -7
  71. package/src/sharedIntervalCollection.ts +5 -5
  72. package/src/sharedString.ts +44 -6
  73. package/src/sparsematrix.ts +48 -35
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SharedString = void 0;
7
+ exports.getTextAndMarkers = exports.SharedString = void 0;
8
8
  const merge_tree_1 = require("@fluidframework/merge-tree");
9
9
  const sequence_1 = require("./sequence");
10
10
  const sequenceFactory_1 = require("./sequenceFactory");
@@ -150,6 +150,9 @@ class SharedString extends sequence_1.SharedSegmentSequence {
150
150
  findTile(startPos, tileLabel, preceding = true) {
151
151
  return this.client.findTile(startPos, tileLabel, preceding);
152
152
  }
153
+ /**
154
+ * @deprecated Use the free function {@link getTextAndMarkers} exported by this package instead.
155
+ */
153
156
  getTextAndMarkers(label) {
154
157
  const segmentWindow = this.client.getCollabWindow();
155
158
  return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);
@@ -167,13 +170,15 @@ class SharedString extends sequence_1.SharedSegmentSequence {
167
170
  /**
168
171
  * Adds spaces for markers and handles, so that position calculations account for them.
169
172
  */
170
- getTextWithPlaceholders() {
173
+ getTextWithPlaceholders(start, end) {
171
174
  const segmentWindow = this.client.getCollabWindow();
172
- return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ");
175
+ return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ", start, end);
173
176
  }
177
+ /**
178
+ * @deprecated Use {@link SharedString.getTextWithPlaceholders} instead.
179
+ */
174
180
  getTextRangeWithPlaceholders(start, end) {
175
- const segmentWindow = this.client.getCollabWindow();
176
- return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, " ", start, end);
181
+ return this.getTextWithPlaceholders(start, end);
177
182
  }
178
183
  getTextRangeWithMarkers(start, end) {
179
184
  const segmentWindow = this.client.getCollabWindow();
@@ -182,6 +187,36 @@ class SharedString extends sequence_1.SharedSegmentSequence {
182
187
  getMarkerFromId(id) {
183
188
  return this.client.getMarkerFromId(id);
184
189
  }
190
+ /**
191
+ * Revert an op
192
+ */
193
+ rollback(content, localOpMetadata) {
194
+ if (this.client.rollback !== undefined) {
195
+ this.client.rollback(content, localOpMetadata);
196
+ }
197
+ else {
198
+ super.rollback(content, localOpMetadata);
199
+ }
200
+ }
185
201
  }
186
202
  exports.SharedString = SharedString;
203
+ /**
204
+ * Splits the text into regions ending with markers with the given `label`.
205
+ * @param sharedString - String to retrieve text and markers from
206
+ * @param label - label to split on
207
+ * @returns Two parallel lists of text and markers, split by markers with the provided `label`.
208
+ *
209
+ * For example:
210
+ * ```typescript
211
+ * // Say sharedstring has contents "hello<paragraph marker 1>world<paragraph marker 2>missing".
212
+ * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, "paragraph");
213
+ * // parallelText === ["hello", "world"]
214
+ * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
215
+ * // Note parallelText does not include "missing".
216
+ * ```
217
+ */
218
+ function getTextAndMarkers(sharedString, label) {
219
+ return sharedString.getTextAndMarkers(label);
220
+ }
221
+ exports.getTextAndMarkers = getTextAndMarkers;
187
222
  //# sourceMappingURL=sharedString.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAYoC;AAEpC,yCAAmD;AACnD,uDAAwD;AA8BxD;;;;;;;;;GASG;AACH,MAAa,YAAa,SAAQ,gCAA0C;IAyBxE,YAAY,QAAgC,EAAS,EAAU,EAAE,UAA8B;QAC3F,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,qCAAmB,CAAC,eAAe,CAAC,CAAC;QADpB,OAAE,GAAF,EAAE,CAAQ;QAE3D,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9D,CAAC;IA3BD;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAC7D,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qCAAmB,CAAC,IAAI,CAAiB,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,qCAAmB,EAAE,CAAC;IACrC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IASD;;;;;OAKG;IACI,oBAAo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/G,CAAC;IAEM,uBAAuB,CAAC,KAAa,EAAE,GAAW;QACrD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/G,CAAC;IAEM,eAAe,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACJ;AA1MD,oCA0MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n ICombiningOp,\n IMergeTreeInsertMsg,\n IMergeTreeRemoveMsg,\n IRelativePosition,\n ISegment,\n Marker,\n MergeTreeTextHelper,\n PropertySet,\n ReferencePosition,\n ReferenceType,\n TextSegment,\n} from \"@fluidframework/merge-tree\";\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedSegmentSequence } from \"./sequence\";\nimport { SharedStringFactory } from \"./sequenceFactory\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n */\nexport interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {\n /**\n * Inserts the text at the position.\n * @param pos - The position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of the text\n */\n insertText(pos: number, text: string, props?: PropertySet): void;\n\n /**\n * Inserts a marker at the position.\n * @param pos - The position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;\n\n /**\n * {@inheritDoc SharedSegmentSequence.posFromRelativePos}\n */\n posFromRelativePos(relativePos: IRelativePosition): number;\n}\n\nexport type SharedStringSegment = TextSegment | Marker;\n\n/**\n * The Shared String is a specialized data structure for handling collaborative\n * text. It is based on a more general Sequence data structure but has\n * additional features that make working with text easier.\n *\n * In addition to text, a Shared String can also contain markers. Markers can be\n * used to store metadata at positions within the text, like the details of an\n * image or Fluid object that should be rendered with the text.\n *\n */\nexport class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {\n /**\n * Create a new shared string.\n * @param runtime - data store runtime the new shared string belongs to\n * @param id - optional name of the shared string\n * @returns newly create shared string (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedStringFactory.Type) as SharedString;\n }\n\n /**\n * Get a factory for SharedString to register with the data store.\n * @returns a factory that creates and load SharedString\n */\n public static getFactory() {\n return new SharedStringFactory();\n }\n\n public get ISharedString(): ISharedString {\n return this;\n }\n\n private readonly mergeTreeTextHelper: MergeTreeTextHelper;\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SharedStringFactory.segmentFromSpec);\n this.mergeTreeTextHelper = this.client.createTextHelper();\n }\n\n /**\n * Inserts a marker at a relative position.\n * @param relativePos1 - The relative position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n public insertMarkerRelative(\n relativePos1: IRelativePosition,\n refType: ReferenceType,\n props?: PropertySet) {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertMarker}\n */\n public insertMarker(\n pos: number,\n refType: ReferenceType,\n props?: PropertySet): IMergeTreeInsertMsg {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n return insertOp;\n }\n\n /**\n * Inserts the text at the position.\n * @param relativePos1 - The relative position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of text\n */\n public insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertText}\n */\n public insertText(pos: number, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * Replaces a range with the provided text.\n * @param start - The inclusive start of the range to replace\n * @param end - The exclusive end of the range to replace\n * @param text - The text to replace the range with\n * @param props - Optional. The properties of the replacement text\n */\n public replaceText(start: number, end: number, text: string, props?: PropertySet) {\n this.replaceRange(start, end, TextSegment.make(text, props));\n }\n\n /**\n * Removes the text in the given range.\n * @param start - The inclusive start of the range to remove\n * @param end - The exclusive end of the range to replace\n * @returns the message sent.\n */\n public removeText(start: number, end: number): IMergeTreeRemoveMsg {\n return this.removeRange(start, end);\n }\n\n /**\n * Annotates the marker with the provided properties and calls the callback on consensus.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param consensusCallback - The callback called when consensus is reached\n */\n public annotateMarkerNotifyConsensus(\n marker: Marker,\n props: PropertySet,\n callback: (m: Marker) => void) {\n const annotateOp = this.client.annotateMarkerNotifyConsensus(marker, props, callback);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n /**\n * Annotates the marker with the provided properties.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param combiningOp - Optional. Specifies how to combine values for the property, such as \"incr\" for increment.\n */\n public annotateMarker(\n marker: Marker,\n props: PropertySet,\n combiningOp?: ICombiningOp) {\n const annotateOp = this.client.annotateMarker(marker, props, combiningOp);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n public findTile(startPos: number | undefined, tileLabel: string, preceding = true): {\n tile: ReferencePosition;\n pos: number;\n } {\n return this.client.findTile(startPos, tileLabel, preceding);\n }\n\n public getTextAndMarkers(label: string) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);\n }\n\n /**\n * Retrieve text from the SharedString in string format.\n * @param start - The starting index of the text to retrieve, or 0 if omitted.\n * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n * @returns The requested text content as a string.\n */\n public getText(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"\", start, end);\n }\n\n /**\n * Adds spaces for markers and handles, so that position calculations account for them.\n */\n public getTextWithPlaceholders() {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \");\n }\n\n public getTextRangeWithPlaceholders(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \", start, end);\n }\n\n public getTextRangeWithMarkers(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"*\", start, end);\n }\n\n public getMarkerFromId(id: string): ISegment {\n return this.client.getMarkerFromId(id);\n }\n}\n"]}
1
+ {"version":3,"file":"sharedString.js","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAYoC;AAEpC,yCAAmD;AACnD,uDAAwD;AA8BxD;;;;;;;;;GASG;AACH,MAAa,YAAa,SAAQ,gCAA0C;IAyBxE,YAAY,QAAgC,EAAS,EAAU,EAAE,UAA8B;QAC3F,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,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ALD,8CAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n ICombiningOp,\n IMergeTreeInsertMsg,\n IMergeTreeRemoveMsg,\n IMergeTreeTextHelper,\n IRelativePosition,\n ISegment,\n Marker,\n PropertySet,\n ReferencePosition,\n ReferenceType,\n TextSegment,\n} from \"@fluidframework/merge-tree\";\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedSegmentSequence } from \"./sequence\";\nimport { SharedStringFactory } from \"./sequenceFactory\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n */\nexport interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {\n /**\n * Inserts the text at the position.\n * @param pos - The position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of the text\n */\n insertText(pos: number, text: string, props?: PropertySet): void;\n\n /**\n * Inserts a marker at the position.\n * @param pos - The position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;\n\n /**\n * {@inheritDoc SharedSegmentSequence.posFromRelativePos}\n */\n posFromRelativePos(relativePos: IRelativePosition): number;\n}\n\nexport type SharedStringSegment = TextSegment | Marker;\n\n/**\n * The Shared String is a specialized data structure for handling collaborative\n * text. It is based on a more general Sequence data structure but has\n * additional features that make working with text easier.\n *\n * In addition to text, a Shared String can also contain markers. Markers can be\n * used to store metadata at positions within the text, like the details of an\n * image or Fluid object that should be rendered with the text.\n *\n */\nexport class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {\n /**\n * Create a new shared string.\n * @param runtime - data store runtime the new shared string belongs to\n * @param id - optional name of the shared string\n * @returns newly create shared string (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedStringFactory.Type) as SharedString;\n }\n\n /**\n * Get a factory for SharedString to register with the data store.\n * @returns a factory that creates and load SharedString\n */\n public static getFactory() {\n return new SharedStringFactory();\n }\n\n public get ISharedString(): ISharedString {\n return this;\n }\n\n private readonly mergeTreeTextHelper: IMergeTreeTextHelper;\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SharedStringFactory.segmentFromSpec);\n this.mergeTreeTextHelper = this.client.createTextHelper();\n }\n\n /**\n * Inserts a marker at a relative position.\n * @param relativePos1 - The relative position to insert the marker at\n * @param refType - The reference type of the marker\n * @param props - The properties of the marker\n */\n public insertMarkerRelative(\n relativePos1: IRelativePosition,\n refType: ReferenceType,\n props?: PropertySet) {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertMarker}\n */\n public insertMarker(\n pos: number,\n refType: ReferenceType,\n props?: PropertySet): IMergeTreeInsertMsg {\n const segment = new Marker(refType);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n return insertOp;\n }\n\n /**\n * Inserts the text at the position.\n * @param relativePos1 - The relative position to insert the text at\n * @param text - The text to insert\n * @param props - The properties of text\n */\n public insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const pos = this.posFromRelativePos(relativePos1);\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * {@inheritDoc ISharedString.insertText}\n */\n public insertText(pos: number, text: string, props?: PropertySet) {\n const segment = new TextSegment(text);\n if (props) {\n segment.addProperties(props);\n }\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n /**\n * Replaces a range with the provided text.\n * @param start - The inclusive start of the range to replace\n * @param end - The exclusive end of the range to replace\n * @param text - The text to replace the range with\n * @param props - Optional. The properties of the replacement text\n */\n public replaceText(start: number, end: number, text: string, props?: PropertySet) {\n this.replaceRange(start, end, TextSegment.make(text, props));\n }\n\n /**\n * Removes the text in the given range.\n * @param start - The inclusive start of the range to remove\n * @param end - The exclusive end of the range to replace\n * @returns the message sent.\n */\n public removeText(start: number, end: number): IMergeTreeRemoveMsg {\n return this.removeRange(start, end);\n }\n\n /**\n * Annotates the marker with the provided properties and calls the callback on consensus.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param consensusCallback - The callback called when consensus is reached\n */\n public annotateMarkerNotifyConsensus(\n marker: Marker,\n props: PropertySet,\n callback: (m: Marker) => void) {\n const annotateOp = this.client.annotateMarkerNotifyConsensus(marker, props, callback);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n /**\n * Annotates the marker with the provided properties.\n * @param marker - The marker to annotate\n * @param props - The properties to annotate the marker with\n * @param combiningOp - Optional. Specifies how to combine values for the property, such as \"incr\" for increment.\n */\n public annotateMarker(\n marker: Marker,\n props: PropertySet,\n combiningOp?: ICombiningOp) {\n const annotateOp = this.client.annotateMarker(marker, props, combiningOp);\n if (annotateOp) {\n this.submitSequenceMessage(annotateOp);\n }\n }\n\n public findTile(startPos: number | undefined, tileLabel: string, preceding = true): {\n tile: ReferencePosition;\n pos: number;\n } {\n return this.client.findTile(startPos, tileLabel, preceding);\n }\n\n /**\n * @deprecated Use the free function {@link getTextAndMarkers} exported by this package instead.\n */\n public getTextAndMarkers(label: string) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getTextAndMarkers(segmentWindow.currentSeq, segmentWindow.clientId, label);\n }\n\n /**\n * Retrieve text from the SharedString in string format.\n * @param start - The starting index of the text to retrieve, or 0 if omitted.\n * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n * @returns The requested text content as a string.\n */\n public getText(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"\", start, end);\n }\n\n /**\n * Adds spaces for markers and handles, so that position calculations account for them.\n */\n public getTextWithPlaceholders(start?: number, end?: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \" \", start, end);\n }\n\n /**\n * @deprecated Use {@link SharedString.getTextWithPlaceholders} instead.\n */\n public getTextRangeWithPlaceholders(start: number, end: number) {\n return this.getTextWithPlaceholders(start, end);\n }\n\n public getTextRangeWithMarkers(start: number, end: number) {\n const segmentWindow = this.client.getCollabWindow();\n return this.mergeTreeTextHelper.getText(segmentWindow.currentSeq, segmentWindow.clientId, \"*\", start, end);\n }\n\n public getMarkerFromId(id: string): ISegment {\n return this.client.getMarkerFromId(id);\n }\n\n /**\n * Revert an op\n */\n protected rollback(content: any, localOpMetadata: unknown): void {\n if (this.client.rollback !== undefined) {\n this.client.rollback(content, localOpMetadata);\n } else {\n super.rollback(content, localOpMetadata);\n }\n }\n}\n\n/**\n * Splits the text into regions ending with markers with the given `label`.\n * @param sharedString - String to retrieve text and markers from\n * @param label - label to split on\n * @returns Two parallel lists of text and markers, split by markers with the provided `label`.\n *\n * For example:\n * ```typescript\n * // Say sharedstring has contents \"hello<paragraph marker 1>world<paragraph marker 2>missing\".\n * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, \"paragraph\");\n * // parallelText === [\"hello\", \"world\"]\n * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]\n * // Note parallelText does not include \"missing\".\n * ```\n */\nexport function getTextAndMarkers(sharedString: SharedString, label: string): {\n parallelText: string[];\n parallelMarkers: Marker[];\n} {\n return sharedString.getTextAndMarkers(label);\n}\n"]}
@@ -8,10 +8,11 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
8
8
  import { ISharedObject } from "@fluidframework/shared-object-base";
9
9
  import { SharedSegmentSequence, SubSequence } from "./";
10
10
  /**
11
- * An empty segment that occupies 'cachedLength' positions. SparseMatrix uses PaddingSegment
12
- * to "pad" a run of unoccupied cells.
11
+ * An empty segment that occupies 'cachedLength' positions.
12
+ * {@link SparseMatrix} uses `PaddingSegment` to "pad" a run of unoccupied cells.
13
13
  *
14
- * @deprecated PaddingSegment is part of an abandoned prototype. Use SharedMatrix instead.
14
+ * @deprecated `PaddingSegment` is part of an abandoned prototype.
15
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
15
16
  */
16
17
  export declare class PaddingSegment extends BaseSegment {
17
18
  static readonly typeString = "PaddingSegment";
@@ -31,11 +32,13 @@ export declare class PaddingSegment extends BaseSegment {
31
32
  protected createSplitSegmentAt(pos: number): PaddingSegment;
32
33
  }
33
34
  /**
34
- * @deprecated SparseMatrixItem is part of an abandoned prototype. Use SharedMatrix instead.
35
+ * @deprecated `SparseMatrixItem` is part of an abandoned prototype.
36
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
35
37
  */
36
38
  export declare type SparseMatrixItem = Serializable;
37
39
  /**
38
- * @deprecated RunSegment is part of an abandoned prototype. Use SharedMatrix instead.
40
+ * @deprecated `RunSegment` is part of an abandoned prototype.
41
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
39
42
  */
40
43
  export declare class RunSegment extends SubSequence<SparseMatrixItem> {
41
44
  items: SparseMatrixItem[];
@@ -53,42 +56,51 @@ export declare class RunSegment extends SubSequence<SparseMatrixItem> {
53
56
  protected createSplitSegmentAt(pos: number): RunSegment;
54
57
  }
55
58
  /**
56
- * @deprecated MatrixSegment is part of an abandoned prototype. Use SharedMatrix instead.
59
+ * @deprecated `MatrixSegment` is part of an abandoned prototype.
60
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
57
61
  */
58
62
  export declare type MatrixSegment = RunSegment | PaddingSegment;
59
63
  /**
60
- * @deprecated maxCol is part of an abandoned prototype. Use SharedMatrix instead.
64
+ * @deprecated `maxCol` is part of an abandoned prototype.
65
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
61
66
  */
62
67
  export declare const maxCol = 2097152;
63
68
  /**
64
- * @deprecated maxCols is part of an abandoned prototype. Use SharedMatrix instead.
69
+ * @deprecated `maxCols` is part of an abandoned prototype.
70
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
65
71
  */
66
72
  export declare const maxCols: number;
67
73
  /**
68
- * @deprecated maxRow is part of an abandoned prototype. Use SharedMatrix instead.
74
+ * @deprecated `maxRow` is part of an abandoned prototype.
75
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
69
76
  */
70
77
  export declare const maxRow = 4294967295;
71
78
  /**
72
- * @deprecated maxRows is part of an abandoned prototype. Use SharedMatrix instead.
79
+ * @deprecated `maxRows` is part of an abandoned prototype.
80
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
73
81
  */
74
82
  export declare const maxRows: number;
75
83
  /**
76
- * @deprecated maxCellPosition is part of an abandoned prototype. Use SharedMatrix instead.
84
+ * @deprecated `maxCellPosition` is part of an abandoned prototype.
85
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
77
86
  */
78
87
  export declare const maxCellPosition: number;
79
88
  /**
80
- * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.
89
+ * @deprecated `positionToRowCol` is part of an abandoned prototype.
90
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
81
91
  */
82
92
  export declare const rowColToPosition: (row: number, col: number) => number;
83
93
  /**
84
- * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.
94
+ * @deprecated `positionToRowCol` is part of an abandoned prototype.
95
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
85
96
  */
86
97
  export declare function positionToRowCol(position: number): {
87
98
  row: number;
88
99
  col: number;
89
100
  };
90
101
  /**
91
- * @deprecated SparseMatrix is an abandoned prototype. Use SharedMatrix instead.
102
+ * @deprecated `SparseMatrix` is an abandoned prototype.
103
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
92
104
  */
93
105
  export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
94
106
  id: string;
@@ -122,7 +134,8 @@ export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
122
134
  private getSegment;
123
135
  }
124
136
  /**
125
- * @deprecated SparseMatrixFactory is an abandoned prototype. Use SharedMatrixFactory instead.
137
+ * @deprecated `SparseMatrixFactory` is an abandoned prototype.
138
+ * Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.
126
139
  */
127
140
  export declare class SparseMatrixFactory implements IChannelFactory {
128
141
  static Type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sparsematrix.d.ts","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACH,WAAW,EAEX,YAAY,EACZ,QAAQ,EAER,WAAW,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,QAAQ,EACX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC3C,gBAAuB,UAAU,oBAAoB;WACvC,EAAE,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,IAAI,cAAc;WAGhD,cAAc,CAAC,IAAI,EAAE,GAAG;IAUtC,SAAgB,IAAI,oBAA6B;gBAErC,IAAI,EAAE,MAAM;IAKjB,YAAY;;;;IAIZ,KAAK,CAAC,KAAK,SAAI,EAAE,GAAG,CAAC,EAAE,MAAM;IA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AE,WAAW;IAK7D,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAOrD,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,UAAU;CAIrB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACvD,OAAc,IAAI,SAA+D;IAEjF,OAAc,UAAU,EAAE,kBAAkB,CAI1C;WAEY,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ;IAc3D,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,aAAa,CAAC;IAMlB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAK7E"}
@@ -9,10 +9,11 @@ const merge_tree_1 = require("@fluidframework/merge-tree");
9
9
  const packageVersion_1 = require("./packageVersion");
10
10
  const _1 = require("./");
11
11
  /**
12
- * An empty segment that occupies 'cachedLength' positions. SparseMatrix uses PaddingSegment
13
- * to "pad" a run of unoccupied cells.
12
+ * An empty segment that occupies 'cachedLength' positions.
13
+ * {@link SparseMatrix} uses `PaddingSegment` to "pad" a run of unoccupied cells.
14
14
  *
15
- * @deprecated PaddingSegment is part of an abandoned prototype. Use SharedMatrix instead.
15
+ * @deprecated `PaddingSegment` is part of an abandoned prototype.
16
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
16
17
  */
17
18
  class PaddingSegment extends merge_tree_1.BaseSegment {
18
19
  constructor(size) {
@@ -71,7 +72,8 @@ class PaddingSegment extends merge_tree_1.BaseSegment {
71
72
  exports.PaddingSegment = PaddingSegment;
72
73
  PaddingSegment.typeString = "PaddingSegment";
73
74
  /**
74
- * @deprecated RunSegment is part of an abandoned prototype. Use SharedMatrix instead.
75
+ * @deprecated `RunSegment` is part of an abandoned prototype.
76
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
75
77
  */
76
78
  class RunSegment extends _1.SubSequence {
77
79
  constructor(items) {
@@ -139,32 +141,39 @@ class RunSegment extends _1.SubSequence {
139
141
  exports.RunSegment = RunSegment;
140
142
  RunSegment.typeString = "RunSegment";
141
143
  /**
142
- * @deprecated maxCol is part of an abandoned prototype. Use SharedMatrix instead.
144
+ * @deprecated `maxCol` is part of an abandoned prototype.
145
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
143
146
  */
144
147
  exports.maxCol = 0x200000; // X128 Excel maximum of 16,384 columns
145
148
  /**
146
- * @deprecated maxCols is part of an abandoned prototype. Use SharedMatrix instead.
149
+ * @deprecated `maxCols` is part of an abandoned prototype.
150
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
147
151
  */
148
152
  exports.maxCols = exports.maxCol + 1;
149
153
  /**
150
- * @deprecated maxRow is part of an abandoned prototype. Use SharedMatrix instead.
154
+ * @deprecated `maxRow` is part of an abandoned prototype.
155
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
151
156
  */
152
157
  exports.maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows
153
158
  /**
154
- * @deprecated maxRows is part of an abandoned prototype. Use SharedMatrix instead.
159
+ * @deprecated `maxRows` is part of an abandoned prototype.
160
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
155
161
  */
156
162
  exports.maxRows = exports.maxRow + 1;
157
163
  /**
158
- * @deprecated maxCellPosition is part of an abandoned prototype. Use SharedMatrix instead.
164
+ * @deprecated `maxCellPosition` is part of an abandoned prototype.
165
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
159
166
  */
160
167
  exports.maxCellPosition = exports.maxCol * exports.maxRow;
161
168
  /**
162
- * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.
169
+ * @deprecated `positionToRowCol` is part of an abandoned prototype.
170
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
163
171
  */
164
172
  const rowColToPosition = (row, col) => row * exports.maxCols + col;
165
173
  exports.rowColToPosition = rowColToPosition;
166
174
  /**
167
- * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.
175
+ * @deprecated `positionToRowCol` is part of an abandoned prototype.
176
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
168
177
  */
169
178
  function positionToRowCol(position) {
170
179
  const row = Math.floor(position / exports.maxCols);
@@ -173,7 +182,8 @@ function positionToRowCol(position) {
173
182
  }
174
183
  exports.positionToRowCol = positionToRowCol;
175
184
  /**
176
- * @deprecated SparseMatrix is an abandoned prototype. Use SharedMatrix instead.
185
+ * @deprecated `SparseMatrix` is an abandoned prototype.
186
+ * Use {@link @fluidframework/matrix#SharedMatrix} instead.
177
187
  */
178
188
  class SparseMatrix extends _1.SharedSegmentSequence {
179
189
  constructor(document, id, attributes) {
@@ -288,7 +298,8 @@ class SparseMatrix extends _1.SharedSegmentSequence {
288
298
  }
289
299
  exports.SparseMatrix = SparseMatrix;
290
300
  /**
291
- * @deprecated SparseMatrixFactory is an abandoned prototype. Use SharedMatrixFactory instead.
301
+ * @deprecated `SparseMatrixFactory` is an abandoned prototype.
302
+ * Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.
292
303
  */
293
304
  class SparseMatrixFactory {
294
305
  static segmentFromSpec(spec) {
@@ -1 +1 @@
1
- {"version":3,"file":"sparsematrix.js","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAOoC;AAUpC,qDAA8C;AAC9C,yBAAwD;AAExD;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,wBAAW;IAiB3C,YAAY,IAAY;QACpB,KAAK,EAAE,CAAC;QAHI,SAAI,GAAG,cAAc,CAAC,UAAU,CAAC;QAI7C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAlBM,MAAM,CAAC,EAAE,CAAC,OAAiB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AAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC;IAED,IAAW,IAAI;QACX,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACpC,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,mBAAmB,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;QAC/D,MAAM,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,YAAY,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACtD,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACrE,YAAY,CAAC,eAAe,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACxB,CAAC;;AAjDL,kDAkDC;AAjDiB,wBAAI,GAAG,2DAA2D,CAAC;AAEnE,8BAAU,GAAuB;IAC3C,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n BaseSegment,\n createGroupOp,\n IJSONSegment,\n ISegment,\n LocalReferenceCollection,\n PropertySet,\n} from \"@fluidframework/merge-tree\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n Serializable,\n Jsonable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSegmentSequence, SubSequence } from \"./\";\n\n/**\n * An empty segment that occupies 'cachedLength' positions. SparseMatrix uses PaddingSegment\n * to \"pad\" a run of unoccupied cells.\n *\n * @deprecated PaddingSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport class PaddingSegment extends BaseSegment {\n public static readonly typeString = \"PaddingSegment\";\n public static is(segment: ISegment): segment is PaddingSegment {\n return segment.type === PaddingSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"pad\" in spec) {\n const segment = new PaddingSegment(spec.pad);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = PaddingSegment.typeString;\n\n constructor(size: number) {\n super();\n this.cachedLength = size;\n }\n\n public toJSONObject() {\n return { pad: this.cachedLength, props: this.properties };\n }\n\n public clone(start = 0, end?: number) {\n const b = new PaddingSegment(this.cachedLength);\n this.cloneInto(b);\n return b;\n }\n\n public canAppend(segment: ISegment) {\n return PaddingSegment.is(segment);\n }\n\n public toString() {\n return `[padding: ${this.cachedLength}]`;\n }\n\n public append(segment: ISegment) {\n if (!PaddingSegment.is(segment)) {\n throw new Error(\"can only append padding segment\");\n }\n\n // Note: Must call 'appendLocalRefs' before modifying this segment's length as\n // 'this.cachedLength' is used to adjust the offsets of the local refs.\n LocalReferenceCollection.append(this, segment);\n\n this.cachedLength += segment.cachedLength;\n }\n\n // Returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.cachedLength -= (end - start);\n return (this.cachedLength === 0);\n }\n\n protected createSplitSegmentAt(pos: number) {\n const leftLength = pos;\n const rightLength = this.cachedLength - pos;\n\n this.cachedLength = leftLength;\n return new PaddingSegment(rightLength);\n }\n}\n\n/**\n * @deprecated SparseMatrixItem is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport type SparseMatrixItem = Serializable;\n\n/**\n * @deprecated RunSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport class RunSegment extends SubSequence<SparseMatrixItem> {\n public static readonly typeString = \"RunSegment\";\n public static is(segment: ISegment): segment is RunSegment {\n return segment.type === RunSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"items\" in spec) {\n const segment = new RunSegment(spec.items);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = RunSegment.typeString;\n\n private tags: any[];\n\n constructor(public items: SparseMatrixItem[]) {\n super(items);\n this.tags = new Array(items.length).fill(undefined);\n }\n\n public clone(start = 0, end?: number) {\n const b = new RunSegment(this.items.slice(start, end));\n if (this.tags) {\n b.tags = this.tags.slice(start, end);\n }\n this.cloneInto(b);\n return b;\n }\n\n public append(segment: ISegment) {\n super.append(segment);\n\n const asRun = segment as RunSegment;\n if (asRun.tags) {\n if (this.tags) {\n this.tags.splice(this.items.length, 0, ...asRun.tags);\n }\n }\n\n return this;\n }\n\n // TODO: retain removed items for undo\n // returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.tags.splice(start, end - start);\n return super.removeRange(start, end);\n }\n\n public getTag(pos: number) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.tags[pos];\n }\n\n public setTag(pos: number, tag: any) {\n this.tags[pos] = tag;\n }\n\n protected createSplitSegmentAt(pos: number) {\n if (pos > 0) {\n const remainingItems = this.items.slice(pos);\n this.items = this.items.slice(0, pos);\n this.cachedLength = this.items.length;\n\n const leafSegment = new RunSegment(remainingItems);\n leafSegment.tags = this.tags.slice(pos);\n this.tags.length = pos;\n\n return leafSegment;\n }\n }\n}\n\n/**\n * @deprecated MatrixSegment is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport type MatrixSegment = RunSegment | PaddingSegment;\n\n/**\n * @deprecated maxCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCol = 0x200000; // X128 Excel maximum of 16,384 columns\n\n/**\n * @deprecated maxCols is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCols = maxCol + 1;\n\n/**\n * @deprecated maxRow is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows\n\n/**\n * @deprecated maxRows is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxRows = maxRow + 1;\n\n/**\n * @deprecated maxCellPosition is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const maxCellPosition = maxCol * maxRow;\n\n/**\n * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport const rowColToPosition = (row: number, col: number) => row * maxCols + col;\n\n/**\n * @deprecated positionToRowCol is part of an abandoned prototype. Use SharedMatrix instead.\n */\nexport function positionToRowCol(position: number) {\n const row = Math.floor(position / maxCols);\n const col = position - (row * maxCols);\n return { row, col };\n}\n\n/**\n * @deprecated SparseMatrix is an abandoned prototype. Use SharedMatrix instead.\n */\nexport class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {\n /**\n * Create a new sparse matrix\n *\n * @param runtime - data store runtime the new sparse matrix belongs to\n * @param id - optional name of the sparse matrix\n * @returns newly create sparse matrix (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SparseMatrixFactory.Type) as SparseMatrix;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n *\n * @returns a factory that creates and load SharedMap\n */\n public static getFactory(): IChannelFactory {\n return new SparseMatrixFactory();\n }\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SparseMatrixFactory.segmentFromSpec);\n }\n\n public get numRows() {\n return positionToRowCol(this.getLength()).row;\n }\n\n public setItems(\n row: number,\n col: number,\n values: SparseMatrixItem[],\n props?: PropertySet,\n ) {\n const start = rowColToPosition(row, col);\n const end = start + values.length;\n const segment = new RunSegment(values);\n if (props) {\n segment.addProperties(props);\n }\n\n this.replaceRange(start, end, segment);\n }\n\n public getItem(row: number, col: number):\n // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports\n Jsonable<string | number | boolean | IFluidHandle> {\n const pos = rowColToPosition(row, col);\n const { segment, offset } = this.getContainingSegment(pos);\n if (segment && RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.items[offset];\n } else if (segment && PaddingSegment.is(segment)) {\n return undefined;\n }\n\n throw new Error(`Unrecognized Segment type`);\n }\n\n public getTag(row: number, col: number) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.getTag(offset);\n }\n return undefined;\n }\n\n public setTag(row: number, col: number, tag: any) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n segment.setTag(offset, tag);\n } else if (tag !== undefined) {\n throw new Error(`Must not attempt to set tags on '${segment.constructor.name}'.`);\n }\n }\n\n public insertRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n const segment = new PaddingSegment(size);\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n public removeRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n this.removeRange(pos, pos + size);\n }\n\n public insertCols(col: number, numCols: number) {\n this.moveAsPadding(maxCol - numCols, col, numCols);\n }\n\n public removeCols(col: number, numCols: number) {\n this.moveAsPadding(col, maxCol - numCols, numCols);\n }\n\n public annotatePosition(row: number, col: number, props: PropertySet) {\n const pos = rowColToPosition(row, col);\n this.annotateRange(pos, pos + 1, props);\n }\n\n public getPositionProperties(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getPropertiesAtPosition(pos);\n }\n\n // For each row, moves 'numCols' items starting from 'srcCol' and inserts 'numCols' padding\n // at 'destCol'. Used by insertCols and removeCols.\n private moveAsPadding(srcCol: number, destCol: number, numCols: number) {\n const removeColStart = srcCol;\n const removeColEnd = srcCol + numCols;\n const ops = [];\n\n for (let r = 0, rowStart = 0; r < this.numRows; r++, rowStart += maxCols) {\n ops.push(this.client.removeRangeLocal(rowStart + removeColStart, rowStart + removeColEnd));\n const insertPos = rowStart + destCol;\n const segment = new PaddingSegment(numCols);\n ops.push(this.client.insertSegmentLocal(insertPos, segment));\n }\n\n this.submitSequenceMessage(createGroupOp(...ops));\n }\n\n private getSegment(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getContainingSegment(pos);\n }\n}\n\n/**\n * @deprecated SparseMatrixFactory is an abandoned prototype. Use SharedMatrixFactory instead.\n */\nexport class SparseMatrixFactory implements IChannelFactory {\n public static Type = \"https://graph.microsoft.com/types/mergeTree/sparse-matrix\";\n\n public static Attributes: IChannelAttributes = {\n type: SparseMatrixFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n public static segmentFromSpec(spec: IJSONSegment): ISegment {\n const maybePadding = PaddingSegment.fromJSONObject(spec);\n if (maybePadding) {\n return maybePadding;\n }\n\n const maybeRun = RunSegment.fromJSONObject(spec);\n if (maybeRun) {\n return maybeRun;\n }\n\n throw new Error(`Unrecognized IJSONObject: '${JSON.stringify(spec)}'`);\n }\n\n public get type() {\n return SparseMatrixFactory.Type;\n }\n\n public get attributes() {\n return SparseMatrixFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n ): Promise<ISharedObject> {\n const sharedObject = new SparseMatrix(runtime, id, attributes);\n await sharedObject.load(services);\n return sharedObject;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedObject = new SparseMatrix(document, id, this.attributes);\n sharedObject.initializeLocal();\n return sharedObject;\n }\n}\n"]}
1
+ {"version":3,"file":"sparsematrix.js","sourceRoot":"","sources":["../src/sparsematrix.ts"],"names":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served.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n BaseSegment,\n createGroupOp,\n IJSONSegment,\n ISegment,\n LocalReferenceCollection,\n PropertySet,\n} from \"@fluidframework/merge-tree\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n Serializable,\n Jsonable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSegmentSequence, SubSequence } from \"./\";\n\n/**\n * An empty segment that occupies 'cachedLength' positions.\n * {@link SparseMatrix} uses `PaddingSegment` to \"pad\" a run of unoccupied cells.\n *\n * @deprecated `PaddingSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class PaddingSegment extends BaseSegment {\n public static readonly typeString = \"PaddingSegment\";\n public static is(segment: ISegment): segment is PaddingSegment {\n return segment.type === PaddingSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"pad\" in spec) {\n const segment = new PaddingSegment(spec.pad);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = PaddingSegment.typeString;\n\n constructor(size: number) {\n super();\n this.cachedLength = size;\n }\n\n public toJSONObject() {\n return { pad: this.cachedLength, props: this.properties };\n }\n\n public clone(start = 0, end?: number) {\n const b = new PaddingSegment(this.cachedLength);\n this.cloneInto(b);\n return b;\n }\n\n public canAppend(segment: ISegment) {\n return PaddingSegment.is(segment);\n }\n\n public toString() {\n return `[padding: ${this.cachedLength}]`;\n }\n\n public append(segment: ISegment) {\n if (!PaddingSegment.is(segment)) {\n throw new Error(\"can only append padding segment\");\n }\n\n // Note: Must call 'appendLocalRefs' before modifying this segment's length as\n // 'this.cachedLength' is used to adjust the offsets of the local refs.\n LocalReferenceCollection.append(this, segment);\n\n this.cachedLength += segment.cachedLength;\n }\n\n // Returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.cachedLength -= (end - start);\n return (this.cachedLength === 0);\n }\n\n protected createSplitSegmentAt(pos: number) {\n const leftLength = pos;\n const rightLength = this.cachedLength - pos;\n\n this.cachedLength = leftLength;\n return new PaddingSegment(rightLength);\n }\n}\n\n/**\n * @deprecated `SparseMatrixItem` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport type SparseMatrixItem = Serializable;\n\n/**\n * @deprecated `RunSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class RunSegment extends SubSequence<SparseMatrixItem> {\n public static readonly typeString = \"RunSegment\";\n public static is(segment: ISegment): segment is RunSegment {\n return segment.type === RunSegment.typeString;\n }\n public static fromJSONObject(spec: any) {\n if (spec && typeof spec === \"object\" && \"items\" in spec) {\n const segment = new RunSegment(spec.items);\n if (spec.props) {\n segment.addProperties(spec.props);\n }\n return segment;\n }\n return undefined;\n }\n public readonly type = RunSegment.typeString;\n\n private tags: any[];\n\n constructor(public items: SparseMatrixItem[]) {\n super(items);\n this.tags = new Array(items.length).fill(undefined);\n }\n\n public clone(start = 0, end?: number) {\n const b = new RunSegment(this.items.slice(start, end));\n if (this.tags) {\n b.tags = this.tags.slice(start, end);\n }\n this.cloneInto(b);\n return b;\n }\n\n public append(segment: ISegment) {\n super.append(segment);\n\n const asRun = segment as RunSegment;\n if (asRun.tags) {\n if (this.tags) {\n this.tags.splice(this.items.length, 0, ...asRun.tags);\n }\n }\n\n return this;\n }\n\n // TODO: retain removed items for undo\n // returns true if entire run removed\n public removeRange(start: number, end: number) {\n this.tags.splice(start, end - start);\n return super.removeRange(start, end);\n }\n\n public getTag(pos: number) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.tags[pos];\n }\n\n public setTag(pos: number, tag: any) {\n this.tags[pos] = tag;\n }\n\n protected createSplitSegmentAt(pos: number) {\n if (pos > 0) {\n const remainingItems = this.items.slice(pos);\n this.items = this.items.slice(0, pos);\n this.cachedLength = this.items.length;\n\n const leafSegment = new RunSegment(remainingItems);\n leafSegment.tags = this.tags.slice(pos);\n this.tags.length = pos;\n\n return leafSegment;\n }\n }\n}\n\n/**\n * @deprecated `MatrixSegment` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport type MatrixSegment = RunSegment | PaddingSegment;\n\n/**\n * @deprecated `maxCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport const maxCol = 0x200000; // X128 Excel maximum of 16,384 columns\n\n/**\n * @deprecated `maxCols` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxCols = maxCol + 1;\n\n /**\n * @deprecated `maxRow` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxRow = 0xFFFFFFFF; // X4096 Excel maximum of 1,048,576 rows\n\n /**\n * @deprecated `maxRows` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxRows = maxRow + 1;\n\n /**\n * @deprecated `maxCellPosition` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const maxCellPosition = maxCol * maxRow;\n\n /**\n * @deprecated `positionToRowCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\n export const rowColToPosition = (row: number, col: number) => row * maxCols + col;\n\n /**\n * @deprecated `positionToRowCol` is part of an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport function positionToRowCol(position: number) {\n const row = Math.floor(position / maxCols);\n const col = position - (row * maxCols);\n return { row, col };\n}\n\n/**\n * @deprecated `SparseMatrix` is an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrix} instead.\n */\nexport class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {\n /**\n * Create a new sparse matrix\n *\n * @param runtime - data store runtime the new sparse matrix belongs to\n * @param id - optional name of the sparse matrix\n * @returns newly create sparse matrix (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SparseMatrixFactory.Type) as SparseMatrix;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n *\n * @returns a factory that creates and load SharedMap\n */\n public static getFactory(): IChannelFactory {\n return new SparseMatrixFactory();\n }\n\n constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {\n super(document, id, attributes, SparseMatrixFactory.segmentFromSpec);\n }\n\n public get numRows() {\n return positionToRowCol(this.getLength()).row;\n }\n\n public setItems(\n row: number,\n col: number,\n values: SparseMatrixItem[],\n props?: PropertySet,\n ) {\n const start = rowColToPosition(row, col);\n const end = start + values.length;\n const segment = new RunSegment(values);\n if (props) {\n segment.addProperties(props);\n }\n\n this.replaceRange(start, end, segment);\n }\n\n public getItem(row: number, col: number):\n // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports\n Jsonable<string | number | boolean | IFluidHandle> {\n const pos = rowColToPosition(row, col);\n const { segment, offset } = this.getContainingSegment(pos);\n if (segment && RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.items[offset];\n } else if (segment && PaddingSegment.is(segment)) {\n return undefined;\n }\n\n throw new Error(`Unrecognized Segment type`);\n }\n\n public getTag(row: number, col: number) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return segment.getTag(offset);\n }\n return undefined;\n }\n\n public setTag(row: number, col: number, tag: any) {\n const { segment, offset } = this.getSegment(row, col);\n if (RunSegment.is(segment)) {\n segment.setTag(offset, tag);\n } else if (tag !== undefined) {\n throw new Error(`Must not attempt to set tags on '${segment.constructor.name}'.`);\n }\n }\n\n public insertRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n const segment = new PaddingSegment(size);\n\n const insertOp = this.client.insertSegmentLocal(pos, segment);\n if (insertOp) {\n this.submitSequenceMessage(insertOp);\n }\n }\n\n public removeRows(row: number, numRows: number) {\n const pos = rowColToPosition(row, 0);\n const size = maxCols * numRows;\n this.removeRange(pos, pos + size);\n }\n\n public insertCols(col: number, numCols: number) {\n this.moveAsPadding(maxCol - numCols, col, numCols);\n }\n\n public removeCols(col: number, numCols: number) {\n this.moveAsPadding(col, maxCol - numCols, numCols);\n }\n\n public annotatePosition(row: number, col: number, props: PropertySet) {\n const pos = rowColToPosition(row, col);\n this.annotateRange(pos, pos + 1, props);\n }\n\n public getPositionProperties(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getPropertiesAtPosition(pos);\n }\n\n // For each row, moves 'numCols' items starting from 'srcCol' and inserts 'numCols' padding\n // at 'destCol'. Used by insertCols and removeCols.\n private moveAsPadding(srcCol: number, destCol: number, numCols: number) {\n const removeColStart = srcCol;\n const removeColEnd = srcCol + numCols;\n const ops = [];\n\n for (let r = 0, rowStart = 0; r < this.numRows; r++, rowStart += maxCols) {\n ops.push(this.client.removeRangeLocal(rowStart + removeColStart, rowStart + removeColEnd));\n const insertPos = rowStart + destCol;\n const segment = new PaddingSegment(numCols);\n ops.push(this.client.insertSegmentLocal(insertPos, segment));\n }\n\n this.submitSequenceMessage(createGroupOp(...ops));\n }\n\n private getSegment(row: number, col: number) {\n const pos = rowColToPosition(row, col);\n return this.getContainingSegment(pos);\n }\n}\n\n/**\n * @deprecated `SparseMatrixFactory` is an abandoned prototype.\n * Use {@link @fluidframework/matrix#SharedMatrixFactory} instead.\n */\nexport class SparseMatrixFactory implements IChannelFactory {\n public static Type = \"https://graph.microsoft.com/types/mergeTree/sparse-matrix\";\n\n public static Attributes: IChannelAttributes = {\n type: SparseMatrixFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n public static segmentFromSpec(spec: IJSONSegment): ISegment {\n const maybePadding = PaddingSegment.fromJSONObject(spec);\n if (maybePadding) {\n return maybePadding;\n }\n\n const maybeRun = RunSegment.fromJSONObject(spec);\n if (maybeRun) {\n return maybeRun;\n }\n\n throw new Error(`Unrecognized IJSONObject: '${JSON.stringify(spec)}'`);\n }\n\n public get type() {\n return SparseMatrixFactory.Type;\n }\n\n public get attributes() {\n return SparseMatrixFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n ): Promise<ISharedObject> {\n const sharedObject = new SparseMatrix(runtime, id, attributes);\n await sharedObject.load(services);\n return sharedObject;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedObject = new SparseMatrix(document, id, this.attributes);\n sharedObject.initializeLocal();\n return sharedObject;\n }\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Supports distributed data structures which are list-like.
7
7
  *
8
- * This package's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
8
+ * This library's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
9
9
  * text.
10
10
  *
11
11
  * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * @packageDocumentation
15
15
  */
16
- export { DeserializeCallback, IIntervalCollectionEvent, IIntervalHelpers, Interval, IntervalCollection, IntervalCollectionIterator, IntervalType, ISerializableInterval, ISerializedInterval, SequenceInterval, ISerializedIntervalCollectionV2, CompressedSerializedInterval, } from "./intervalCollection";
16
+ export { DeserializeCallback, IIntervalCollectionEvent, IIntervalHelpers, Interval, IntervalCollection, IntervalCollectionIterator, IntervalLocator, intervalLocatorFromEndpoint, IntervalType, ISerializableInterval, ISerializedInterval, SequenceInterval, ISerializedIntervalCollectionV2, CompressedSerializedInterval, } from "./intervalCollection";
17
17
  export { IMapMessageLocalMetadata, IValueOpEmitter, } from "./defaultMapInterfaces";
18
18
  export * from "./sharedString";
19
19
  export * from "./sequence";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACH,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,wBAAwB,EACxB,eAAe,GAClB,MAAM,wBAAwB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACH,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,2BAA2B,EAC3B,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,wBAAwB,EACxB,eAAe,GAClB,MAAM,wBAAwB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC"}
package/lib/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Supports distributed data structures which are list-like.
7
7
  *
8
- * This package's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
8
+ * This library's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
9
9
  * text.
10
10
  *
11
11
  * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * @packageDocumentation
15
15
  */
16
- export { Interval, IntervalCollection, IntervalCollectionIterator, IntervalType, SequenceInterval, } from "./intervalCollection";
16
+ export { Interval, IntervalCollection, IntervalCollectionIterator, intervalLocatorFromEndpoint, IntervalType, SequenceInterval, } from "./intervalCollection";
17
17
  export * from "./sharedString";
18
18
  export * from "./sequence";
19
19
  export * from "./sequenceFactory";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAIH,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EAGZ,gBAAgB,GAGnB,MAAM,sBAAsB,CAAC;AAK9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Supports distributed data structures which are list-like.\n *\n * This package's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of\n * text.\n *\n * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for\n * working with text.\n *\n * @packageDocumentation\n */\n\nexport {\n DeserializeCallback,\n IIntervalCollectionEvent,\n IIntervalHelpers,\n Interval,\n IntervalCollection,\n IntervalCollectionIterator,\n IntervalType,\n ISerializableInterval,\n ISerializedInterval,\n SequenceInterval,\n ISerializedIntervalCollectionV2,\n CompressedSerializedInterval,\n} from \"./intervalCollection\";\nexport {\n IMapMessageLocalMetadata,\n IValueOpEmitter,\n} from \"./defaultMapInterfaces\";\nexport * from \"./sharedString\";\nexport * from \"./sequence\";\nexport * from \"./sequenceFactory\";\nexport * from \"./sequenceDeltaEvent\";\nexport * from \"./sharedSequence\";\nexport * from \"./sharedObjectSequence\";\nexport * from \"./sharedNumberSequence\";\nexport * from \"./sparsematrix\";\nexport * from \"./sharedIntervalCollection\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAIH,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAE1B,2BAA2B,EAC3B,YAAY,EAGZ,gBAAgB,GAGnB,MAAM,sBAAsB,CAAC;AAK9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Supports distributed data structures which are list-like.\n *\n * This library's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of\n * text.\n *\n * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for\n * working with text.\n *\n * @packageDocumentation\n */\n\nexport {\n DeserializeCallback,\n IIntervalCollectionEvent,\n IIntervalHelpers,\n Interval,\n IntervalCollection,\n IntervalCollectionIterator,\n IntervalLocator,\n intervalLocatorFromEndpoint,\n IntervalType,\n ISerializableInterval,\n ISerializedInterval,\n SequenceInterval,\n ISerializedIntervalCollectionV2,\n CompressedSerializedInterval,\n} from \"./intervalCollection\";\nexport {\n IMapMessageLocalMetadata,\n IValueOpEmitter,\n} from \"./defaultMapInterfaces\";\nexport * from \"./sharedString\";\nexport * from \"./sequence\";\nexport * from \"./sequenceFactory\";\nexport * from \"./sequenceDeltaEvent\";\nexport * from \"./sharedSequence\";\nexport * from \"./sharedObjectSequence\";\nexport * from \"./sharedNumberSequence\";\nexport * from \"./sparsematrix\";\nexport * from \"./sharedIntervalCollection\";\n"]}