@fluidframework/matrix 2.0.0-internal.7.2.2 → 2.0.0-internal.7.3.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 (116) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor.json +2 -11
  3. package/api-report/matrix.api.md +1 -1
  4. package/dist/{handlecache.js → handlecache.cjs} +3 -3
  5. package/dist/handlecache.cjs.map +1 -0
  6. package/dist/{handletable.js → handletable.cjs} +1 -1
  7. package/dist/handletable.cjs.map +1 -0
  8. package/dist/{index.js → index.cjs} +3 -3
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/matrix-alpha.d.ts +154 -0
  11. package/dist/matrix-beta.d.ts +154 -0
  12. package/dist/matrix-public.d.ts +154 -0
  13. package/dist/matrix-untrimmed.d.ts +154 -0
  14. package/dist/{matrix.js → matrix.cjs} +10 -9
  15. package/dist/matrix.cjs.map +1 -0
  16. package/dist/matrix.d.ts +1 -0
  17. package/dist/matrix.d.ts.map +1 -1
  18. package/dist/{ops.js → ops.cjs} +1 -1
  19. package/dist/ops.cjs.map +1 -0
  20. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  21. package/dist/packageVersion.cjs.map +1 -0
  22. package/dist/packageVersion.d.ts +1 -1
  23. package/dist/{permutationvector.js → permutationvector.cjs} +5 -4
  24. package/dist/permutationvector.cjs.map +1 -0
  25. package/dist/permutationvector.d.ts.map +1 -1
  26. package/dist/{range.js → range.cjs} +1 -1
  27. package/dist/range.cjs.map +1 -0
  28. package/dist/{runtime.js → runtime.cjs} +7 -3
  29. package/dist/runtime.cjs.map +1 -0
  30. package/dist/runtime.d.ts +4 -0
  31. package/dist/runtime.d.ts.map +1 -1
  32. package/dist/{serialization.js → serialization.cjs} +1 -1
  33. package/dist/serialization.cjs.map +1 -0
  34. package/dist/{sparsearray2d.js → sparsearray2d.cjs} +1 -1
  35. package/dist/sparsearray2d.cjs.map +1 -0
  36. package/dist/tsdoc-metadata.json +1 -1
  37. package/dist/{types.js → types.cjs} +1 -1
  38. package/dist/types.cjs.map +1 -0
  39. package/dist/types.d.ts +6 -0
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/{undoprovider.js → undoprovider.cjs} +2 -2
  42. package/dist/undoprovider.cjs.map +1 -0
  43. package/lib/{handlecache.js → handlecache.mjs} +3 -4
  44. package/lib/handlecache.mjs.map +1 -0
  45. package/lib/{handletable.js → handletable.mjs} +1 -1
  46. package/lib/handletable.mjs.map +1 -0
  47. package/lib/index.mjs +7 -0
  48. package/lib/index.mjs.map +1 -0
  49. package/lib/matrix-alpha.d.ts +154 -0
  50. package/lib/matrix-beta.d.ts +154 -0
  51. package/lib/matrix-public.d.ts +154 -0
  52. package/lib/matrix-untrimmed.d.ts +154 -0
  53. package/lib/matrix.d.ts +1 -0
  54. package/lib/matrix.d.ts.map +1 -1
  55. package/lib/{matrix.js → matrix.mjs} +9 -9
  56. package/lib/matrix.mjs.map +1 -0
  57. package/lib/{ops.js → ops.mjs} +1 -1
  58. package/lib/ops.mjs.map +1 -0
  59. package/lib/packageVersion.d.ts +1 -1
  60. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  61. package/lib/packageVersion.mjs.map +1 -0
  62. package/lib/permutationvector.d.ts.map +1 -1
  63. package/lib/{permutationvector.js → permutationvector.mjs} +4 -4
  64. package/lib/permutationvector.mjs.map +1 -0
  65. package/lib/{range.js → range.mjs} +1 -1
  66. package/lib/range.mjs.map +1 -0
  67. package/lib/runtime.d.ts +4 -0
  68. package/lib/runtime.d.ts.map +1 -1
  69. package/lib/{runtime.js → runtime.mjs} +7 -3
  70. package/lib/runtime.mjs.map +1 -0
  71. package/lib/{serialization.js → serialization.mjs} +1 -1
  72. package/lib/serialization.mjs.map +1 -0
  73. package/lib/{sparsearray2d.js → sparsearray2d.mjs} +1 -1
  74. package/lib/sparsearray2d.mjs.map +1 -0
  75. package/lib/types.d.ts +6 -0
  76. package/lib/types.d.ts.map +1 -1
  77. package/lib/{types.js → types.mjs} +1 -1
  78. package/lib/types.mjs.map +1 -0
  79. package/lib/{undoprovider.js → undoprovider.mjs} +2 -2
  80. package/lib/undoprovider.mjs.map +1 -0
  81. package/package.json +59 -30
  82. package/src/matrix.ts +3 -0
  83. package/src/packageVersion.ts +1 -1
  84. package/src/permutationvector.ts +2 -0
  85. package/src/runtime.ts +4 -0
  86. package/src/types.ts +6 -0
  87. package/tsc-multi.test.json +4 -0
  88. package/tsconfig.json +6 -4
  89. package/dist/handlecache.js.map +0 -1
  90. package/dist/handletable.js.map +0 -1
  91. package/dist/index.js.map +0 -1
  92. package/dist/matrix.js.map +0 -1
  93. package/dist/ops.js.map +0 -1
  94. package/dist/packageVersion.js.map +0 -1
  95. package/dist/permutationvector.js.map +0 -1
  96. package/dist/range.js.map +0 -1
  97. package/dist/runtime.js.map +0 -1
  98. package/dist/serialization.js.map +0 -1
  99. package/dist/sparsearray2d.js.map +0 -1
  100. package/dist/types.js.map +0 -1
  101. package/dist/undoprovider.js.map +0 -1
  102. package/lib/handlecache.js.map +0 -1
  103. package/lib/handletable.js.map +0 -1
  104. package/lib/index.js +0 -7
  105. package/lib/index.js.map +0 -1
  106. package/lib/matrix.js.map +0 -1
  107. package/lib/ops.js.map +0 -1
  108. package/lib/packageVersion.js.map +0 -1
  109. package/lib/permutationvector.js.map +0 -1
  110. package/lib/range.js.map +0 -1
  111. package/lib/runtime.js.map +0 -1
  112. package/lib/serialization.js.map +0 -1
  113. package/lib/sparsearray2d.js.map +0 -1
  114. package/lib/types.js.map +0 -1
  115. package/lib/undoprovider.js.map +0 -1
  116. package/tsconfig.esnext.json +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/matrix
2
2
 
3
+ ## 2.0.0-internal.7.3.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.2.0
4
8
 
5
9
  Dependency updates only.
@@ -1,16 +1,7 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
3
  "extends": "@fluidframework/build-common/api-extractor-base.json",
4
-
5
- // TODO: Fix violations and remove these rule overrides
6
- "messages": {
7
- "extractorMessageReporting": {
8
- "ae-missing-release-tag": {
9
- "logLevel": "none"
10
- },
11
- "ae-forgotten-export": {
12
- "logLevel": "none"
13
- }
14
- }
4
+ "dtsRollup": {
5
+ "enabled": true
15
6
  }
16
7
  }
@@ -100,7 +100,7 @@ export class SharedMatrix<T = any> extends SharedObject implements IMatrixProduc
100
100
  _undoRemoveRows(rowStart: number, spec: IJSONSegment): void;
101
101
  }
102
102
 
103
- // @public (undocumented)
103
+ // @public
104
104
  export class SharedMatrixFactory implements IChannelFactory {
105
105
  // (undocumented)
106
106
  static readonly Attributes: IChannelAttributes;
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.HandleCache = void 0;
8
8
  /* eslint-disable no-bitwise */
9
9
  const core_utils_1 = require("@fluidframework/core-utils");
10
- const handletable_1 = require("./handletable");
11
- const range_1 = require("./range");
10
+ const handletable_1 = require("./handletable.cjs");
11
+ const range_1 = require("./range.cjs");
12
12
  /**
13
13
  * Used by PermutationVector to cache position -\> handle lookups.
14
14
  *
@@ -108,4 +108,4 @@ class HandleCache {
108
108
  }
109
109
  }
110
110
  exports.HandleCache = HandleCache;
111
- //# sourceMappingURL=handlecache.js.map
111
+ //# sourceMappingURL=handlecache.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlecache.cjs","sourceRoot":"","sources":["../src/handlecache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B,2DAAoD;AAEpD,mDAAsD;AAEtD,uCAAsC;AAEtC;;;;;GAKG;AACH,MAAa,WAAW;IAIvB,YAA4B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;QAH7C,YAAO,GAAa,EAAE,CAAC;QACvB,UAAK,GAAG,CAAC,CAAC;IAEs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ACb,EAAE;QACF,4EAA4E;QAC5E,wBAAwB;QACxB,EAAE;QACF,6FAA6F;QAC7F,2EAA2E;QAC3E,EAAE;QACF,gFAAgF;QAEhF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAChC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;SAC5B;IACF,CAAC;CAGD;AAnHD,kCAmHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IVectorConsumer } from \"@tiny-calc/nano\";\nimport { Handle, isHandleValid } from \"./handletable\";\nimport { PermutationVector, PermutationSegment } from \"./permutationvector\";\nimport { ensureRange } from \"./range\";\n\n/**\n * Used by PermutationVector to cache position -\\> handle lookups.\n *\n * Perf: Possibly, this should eventually be inlined into PermutationVector itself, but\n * so far there's no measurable perf penalty for being a separate object (node 12 x64)\n */\nexport class HandleCache implements IVectorConsumer<Handle> {\n\tprivate handles: Handle[] = [];\n\tprivate start = 0;\n\n\tconstructor(public readonly vector: PermutationVector) {}\n\n\t/**\n\t * Returns the index of the given position in the 'handles' array as a Uint32.\n\t * (If the position is not in the array, returns an integer greater than 'handles.length').\n\t */\n\tprivate getIndex(position: number) {\n\t\treturn (position - this.start) >>> 0;\n\t}\n\n\t/**\n\t * Returns the handle currently assigned to the given 'position' (if any). Check\n\t * the result with 'isValidHandle(..)' to see if a handle has been allocated for\n\t * the given position.\n\t *\n\t * Throws a 'RangeError' if the provided 'position' is out-of-bounds wrt. the\n\t * PermutationVector's length.\n\t */\n\tpublic getHandle(position: number) {\n\t\tconst index = this.getIndex(position);\n\n\t\t// Perf: To encourage inlining, handling of the 'cacheMiss(..)' case has been extracted\n\t\t// to a separate method.\n\n\t\t// Perf: A cache hit implies that 'position' was in bounds. Therefore, we can defer\n\t\t// checking that 'position' is in bounds until 'cacheMiss(..)'. This yields an\n\t\t// ~40% speedup when the position is in the cache (node v12 x64).\n\n\t\treturn index < this.handles.length ? this.handles[index] : this.cacheMiss(position);\n\t}\n\n\t/** Update the cache when a handle has been allocated for a given position. */\n\tpublic addHandle(position: number, handle: Handle) {\n\t\tassert(isHandleValid(handle), 0x017 /* \"Trying to add invalid handle!\" */);\n\n\t\tconst index = this.getIndex(position);\n\t\tif (index < this.handles.length) {\n\t\t\tassert(\n\t\t\t\t!isHandleValid(this.handles[index]),\n\t\t\t\t0x018 /* \"Trying to insert handle into position with already valid handle!\" */,\n\t\t\t);\n\t\t\tthis.handles[index] = handle;\n\t\t}\n\t}\n\n\t/** Used by 'CacheMiss()' to retrieve handles for a range of positions. */\n\tprivate getHandles(start: number, end: number) {\n\t\t// TODO: This can be accelerated substantially using 'walkSegments()'. The only catch\n\t\t// is that\n\n\t\tconst handles: Handle[] = [];\n\t\tconst { vector } = this;\n\n\t\tfor (let pos = start; pos < end; pos++) {\n\t\t\tconst { segment, offset } = vector.getContainingSegment(pos);\n\t\t\tconst asPerm = segment as PermutationSegment;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\thandles.push(asPerm.start + offset!);\n\t\t}\n\n\t\treturn handles;\n\t}\n\n\tprivate cacheMiss(position: number) {\n\t\t// Coercing 'position' to an Uint32 allows us to handle a negative 'position' value\n\t\t// with the same logic that handles 'position' >= length.\n\t\tconst _position = position >>> 0;\n\n\t\t// TODO: To bound memory usage, there should be a limit on the maximum size of\n\t\t// handle[].\n\n\t\t// TODO: To reduce MergeTree lookups, this code should opportunistically grow\n\t\t// the cache to the next MergeTree segment boundary (within the limits of\n\t\t// the handle cache).\n\n\t\tif (_position < this.start) {\n\t\t\tthis.handles = this.getHandles(_position, this.start).concat(this.handles);\n\t\t\tthis.start = _position;\n\t\t\treturn this.handles[0];\n\t\t} else {\n\t\t\tensureRange(_position, this.vector.getLength());\n\n\t\t\tthis.handles = this.handles.concat(\n\t\t\t\tthis.getHandles(this.start + this.handles.length, _position + 1),\n\t\t\t);\n\t\t\treturn this.handles[this.handles.length - 1];\n\t\t}\n\t}\n\n\t// #region IVectorConsumer\n\n\titemsChanged(start: number, removedCount: number, insertedCount: number): void {\n\t\t// If positions were inserted/removed, our current policy is to trim the array\n\t\t// at the beginning of the invalidate range and lazily repopulate the handles\n\t\t// on demand.\n\t\t//\n\t\t// Some alternatives to consider that preserve the previously cached handles\n\t\t// that are still valid:\n\t\t//\n\t\t// * Eagerly populate the 'handles[]' with the newly insert values (currently guaranteed\n\t\t// to be Handle.unallocated, so we don't even need to look them up.)\n\t\t//\n\t\t// * Use a sentinel value or other mechanism to allow \"holes\" in the cache.\n\n\t\tconst index = this.getIndex(start);\n\t\tif (index < this.handles.length) {\n\t\t\tthis.handles.length = index;\n\t\t}\n\t}\n\n\t// #endregion IVectorConsumer\n}\n"]}
@@ -86,4 +86,4 @@ class HandleTable {
86
86
  }
87
87
  }
88
88
  exports.HandleTable = HandleTable;
89
- //# sourceMappingURL=handletable.js.map
89
+ //# sourceMappingURL=handletable.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handletable.cjs","sourceRoot":"","sources":["../src/handletable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkBI,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,wBAAgB,CAAC;AAA3D,QAAA,aAAa,iBAA8C;AAExE;;GAEG;AACH,MAAa,WAAW;IACvB,4FAA4F;IAC5F,2FAA2F;IAC3F,sFAAsF;IACtF,YAAoC,UAA0B,CAAC,CAAC,CAAC;QAA7B,YAAO,GAAP,OAAO,CAAsB;IAAG,CAAC;IAE9D,KAAK;QACX,qFAAqF;QACrF,uFAAuF;QACvF,oBAAoB;QACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM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AAC,MAAc;QAC9B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAC1B,CAAC;IAEM,iBAAiB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,IAAI,CAAI,IAAoB;QACzC,OAAO,IAAI,WAAW,CAAI,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AApFD,kCAoFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const enum Handle {\n\t/**\n\t * Sentinel representing the absence of a valid handle.\n\t */\n\tnone = 0,\n\n\t/** Minimum valid handle. */\n\tvalid = 1,\n\n\t/**\n\t * Sentinel representing an unallocated Handle. Used by PermutationVector\n\t * to delay allocate handles when previously empty row/cols become populated.\n\t */\n\tunallocated = -0x80000000,\n}\n\nexport const isHandleValid = (handle: Handle) => handle >= Handle.valid;\n\n/**\n * A handle table provides a fast mapping from an integer `handle` to a value `T`.\n */\nexport class HandleTable<T> {\n\t// Note: the first slot of the 'handles' array is reserved to store the pointer to the first\n\t// free handle. We initialize this slot with a pointer to slot '1', which will cause\n\t// us to delay allocate the following slot in the array on the first allocation.\n\tpublic constructor(private readonly handles: (Handle | T)[] = [1]) {}\n\n\tpublic clear() {\n\t\t// Restore the HandleTable's initial state by deleting all items in the handles array\n\t\t// and then re-inserting the value '1' in the 0th slot. (See comment at `handles` decl\n\t\t// for explanation.)\n\t\tthis.handles.splice(0, this.handles.length, 1);\n\t}\n\n\t/**\n\t * Allocates and returns the next available handle. Note that freed handles are recycled.\n\t */\n\tpublic allocate(): Handle {\n\t\t// Get the handle to the next free slot.\n\t\tconst free = this.next;\n\n\t\t// Update 'next' to point to the new head of the free list. We use the contents of\n\t\t// recycled slots to store the free list. The contents of the handles[free] will point\n\t\t// to the next available slot. If there are no free slots (i.e., 'handles' is full),\n\t\t// the slot will point to 'handles.length'. In this case, the handles array will grow\n\t\t// and we update 'next' to point to the new end of the array.\n\t\tthis.next = (this.handles[free] as Handle) ?? free + 1;\n\n\t\t// Out of paranoia, overwrite the contents of the newly allocated free slot with an\n\t\t// invalid handle value. This may help catch/diagnose bugs in the event the free list\n\t\t// becomes corrupted.\n\t\tthis.handles[free] = Handle.none;\n\n\t\treturn free;\n\t}\n\n\t/**\n\t * Allocates and returns the next available `count` handles.\n\t */\n\tpublic allocateMany(count: Handle) {\n\t\tconst handles = new Uint32Array(count);\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\thandles[i] = this.allocate();\n\t\t}\n\t\treturn handles;\n\t}\n\n\t/**\n\t * Returns the given handle to the free list.\n\t */\n\tpublic free(handle: Handle) {\n\t\tthis.handles[handle] = this.next;\n\t\tthis.next = handle;\n\t}\n\n\t/**\n\t * Get the value `T` associated with the given handle, if any.\n\t */\n\tpublic get(handle: Handle): T {\n\t\treturn this.handles[handle] as T;\n\t}\n\n\t/**\n\t * Set the value `T` associated with the given handle.\n\t */\n\tpublic set(handle: Handle, value: T) {\n\t\tthis.handles[handle] = value;\n\t}\n\n\t// Private helpers to get/set the head of the free list, which is stored in the 0th slot\n\t// of the handle array.\n\tprivate get next() {\n\t\treturn this.handles[0] as Handle;\n\t}\n\tprivate set next(handle: Handle) {\n\t\tthis.handles[0] = handle;\n\t}\n\n\tpublic getSummaryContent() {\n\t\treturn this.handles;\n\t}\n\n\tpublic static load<T>(data: (Handle | T)[]) {\n\t\treturn new HandleTable<T>(data);\n\t}\n}\n"]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedMatrixFactory = exports.SharedMatrix = void 0;
8
- var matrix_1 = require("./matrix");
8
+ var matrix_1 = require("./matrix.cjs");
9
9
  Object.defineProperty(exports, "SharedMatrix", { enumerable: true, get: function () { return matrix_1.SharedMatrix; } });
10
- var runtime_1 = require("./runtime");
10
+ var runtime_1 = require("./runtime.cjs");
11
11
  Object.defineProperty(exports, "SharedMatrixFactory", { enumerable: true, get: function () { return runtime_1.SharedMatrixFactory; } });
12
- //# sourceMappingURL=index.js.map
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,yCAAgD;AAAvC,8GAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SharedMatrix, MatrixItem } from \"./matrix\";\nexport { SharedMatrixFactory } from \"./runtime\";\n\n// TODO: We temporarily duplicate these contracts from 'framework/undo-redo' to unblock development\n// of SharedMatrix undo while we decide on the correct layering for undo.\nexport { IUndoConsumer, IRevertible } from \"./types\";\n"]}
@@ -0,0 +1,154 @@
1
+ import { IChannel } from '@fluidframework/datastore-definitions';
2
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
3
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
4
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
5
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
6
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
7
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
8
+ import { IJSONSegment } from '@fluidframework/merge-tree';
9
+ import { IMatrixConsumer } from '@tiny-calc/nano';
10
+ import { IMatrixProducer } from '@tiny-calc/nano';
11
+ import { IMatrixReader } from '@tiny-calc/nano';
12
+ import { IMatrixWriter } from '@tiny-calc/nano';
13
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
14
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
15
+ import { Serializable } from '@fluidframework/datastore-definitions';
16
+ import { SharedObject } from '@fluidframework/shared-object-base';
17
+ import { SummarySerializer } from '@fluidframework/shared-object-base';
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare interface IRevertible {
23
+ revert(): any;
24
+ discard(): any;
25
+ }
26
+
27
+ /**
28
+ * @public
29
+ */
30
+ export declare interface IUndoConsumer {
31
+ pushToCurrentOperation(revertible: IRevertible): any;
32
+ }
33
+
34
+ /**
35
+ * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
36
+ * excluding null. (However, nulls may be embedded inside objects and arrays.)
37
+ * @public
38
+ */
39
+ export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
40
+
41
+ /**
42
+ * A SharedMatrix holds a rectangular 2D array of values. Supported operations
43
+ * include setting values and inserting/removing rows and columns.
44
+ *
45
+ * Matrix values may be any Fluid serializable type, which is the set of JSON
46
+ * serializable types extended to include IFluidHandles.
47
+ *
48
+ * Fluid's SharedMatrix implementation works equally well for dense and sparse
49
+ * matrix data and physically stores data in Z-order to leverage CPU caches and
50
+ * prefetching when reading in either row or column major order. (See README.md
51
+ * for more details.)
52
+ *
53
+ * @public
54
+ */
55
+ export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
56
+ id: string;
57
+ private readonly consumers;
58
+ static getFactory(): SharedMatrixFactory;
59
+ private readonly rows;
60
+ private readonly cols;
61
+ private cells;
62
+ private pending;
63
+ constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
64
+ private undo?;
65
+ /**
66
+ * Subscribes the given IUndoConsumer to the matrix.
67
+ */
68
+ openUndo(consumer: IUndoConsumer): void;
69
+ private get rowHandles();
70
+ private get colHandles();
71
+ /**
72
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
73
+ */
74
+ static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
75
+ openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
76
+ closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
77
+ get rowCount(): number;
78
+ get colCount(): number;
79
+ getCell(row: number, col: number): MatrixItem<T>;
80
+ get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
81
+ setCell(row: number, col: number, value: MatrixItem<T>): void;
82
+ setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
83
+ private setCellCore;
84
+ private sendSetCellOp;
85
+ private submitVectorMessage;
86
+ private submitColMessage;
87
+ insertCols(colStart: number, count: number): void;
88
+ removeCols(colStart: number, count: number): void;
89
+ private submitRowMessage;
90
+ insertRows(rowStart: number, count: number): void;
91
+ removeRows(rowStart: number, count: number): void;
92
+ /* Excluded from this release type: _undoRemoveRows */
93
+ /* Excluded from this release type: _undoRemoveCols */
94
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
95
+ /**
96
+ * Runs serializer on the GC data for this SharedMatrix.
97
+ * All the IFluidHandle's stored in the cells represent routes to other objects.
98
+ */
99
+ protected processGCDataCore(serializer: SummarySerializer): void;
100
+ /**
101
+ * Advances the 'localSeq' counter for the cell data operation currently being queued.
102
+ *
103
+ * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
104
+ * automatically advance 'localSeq'.
105
+ */
106
+ private nextLocalSeq;
107
+ protected submitLocalMessage(message: any, localOpMetadata?: any): void;
108
+ protected didAttach(): void;
109
+ protected onConnect(): void;
110
+ private rebasePosition;
111
+ protected reSubmitCore(content: any, localOpMetadata: unknown): void;
112
+ protected onDisconnect(): void;
113
+ /**
114
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
115
+ */
116
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
117
+ protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
118
+ private readonly onRowDelta;
119
+ private readonly onColDelta;
120
+ private readonly onRowHandlesRecycled;
121
+ private readonly onColHandlesRecycled;
122
+ /**
123
+ * Returns true if the latest pending write to the cell indicated by the given row/col handles
124
+ * matches the given 'localSeq'.
125
+ *
126
+ * A return value of `true` indicates that there are no later local operations queued that will
127
+ * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
128
+ * with a different value as well as row/col removals that might recycled the given row/col handles.
129
+ */
130
+ private isLatestPendingWrite;
131
+ toString(): string;
132
+ /**
133
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
134
+ */
135
+ protected applyStashedOp(content: any): unknown;
136
+ }
137
+
138
+ /**
139
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMatrix}.
140
+ * @public
141
+ */
142
+ export declare class SharedMatrixFactory implements IChannelFactory {
143
+ static Type: string;
144
+ static readonly Attributes: IChannelAttributes;
145
+ get type(): string;
146
+ get attributes(): IChannelAttributes;
147
+ /**
148
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
149
+ */
150
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
151
+ create(document: IFluidDataStoreRuntime, id: string): IChannel;
152
+ }
153
+
154
+ export { }
@@ -0,0 +1,154 @@
1
+ import { IChannel } from '@fluidframework/datastore-definitions';
2
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
3
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
4
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
5
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
6
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
7
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
8
+ import { IJSONSegment } from '@fluidframework/merge-tree';
9
+ import { IMatrixConsumer } from '@tiny-calc/nano';
10
+ import { IMatrixProducer } from '@tiny-calc/nano';
11
+ import { IMatrixReader } from '@tiny-calc/nano';
12
+ import { IMatrixWriter } from '@tiny-calc/nano';
13
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
14
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
15
+ import { Serializable } from '@fluidframework/datastore-definitions';
16
+ import { SharedObject } from '@fluidframework/shared-object-base';
17
+ import { SummarySerializer } from '@fluidframework/shared-object-base';
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare interface IRevertible {
23
+ revert(): any;
24
+ discard(): any;
25
+ }
26
+
27
+ /**
28
+ * @public
29
+ */
30
+ export declare interface IUndoConsumer {
31
+ pushToCurrentOperation(revertible: IRevertible): any;
32
+ }
33
+
34
+ /**
35
+ * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
36
+ * excluding null. (However, nulls may be embedded inside objects and arrays.)
37
+ * @public
38
+ */
39
+ export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
40
+
41
+ /**
42
+ * A SharedMatrix holds a rectangular 2D array of values. Supported operations
43
+ * include setting values and inserting/removing rows and columns.
44
+ *
45
+ * Matrix values may be any Fluid serializable type, which is the set of JSON
46
+ * serializable types extended to include IFluidHandles.
47
+ *
48
+ * Fluid's SharedMatrix implementation works equally well for dense and sparse
49
+ * matrix data and physically stores data in Z-order to leverage CPU caches and
50
+ * prefetching when reading in either row or column major order. (See README.md
51
+ * for more details.)
52
+ *
53
+ * @public
54
+ */
55
+ export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
56
+ id: string;
57
+ private readonly consumers;
58
+ static getFactory(): SharedMatrixFactory;
59
+ private readonly rows;
60
+ private readonly cols;
61
+ private cells;
62
+ private pending;
63
+ constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
64
+ private undo?;
65
+ /**
66
+ * Subscribes the given IUndoConsumer to the matrix.
67
+ */
68
+ openUndo(consumer: IUndoConsumer): void;
69
+ private get rowHandles();
70
+ private get colHandles();
71
+ /**
72
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
73
+ */
74
+ static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
75
+ openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
76
+ closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
77
+ get rowCount(): number;
78
+ get colCount(): number;
79
+ getCell(row: number, col: number): MatrixItem<T>;
80
+ get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
81
+ setCell(row: number, col: number, value: MatrixItem<T>): void;
82
+ setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
83
+ private setCellCore;
84
+ private sendSetCellOp;
85
+ private submitVectorMessage;
86
+ private submitColMessage;
87
+ insertCols(colStart: number, count: number): void;
88
+ removeCols(colStart: number, count: number): void;
89
+ private submitRowMessage;
90
+ insertRows(rowStart: number, count: number): void;
91
+ removeRows(rowStart: number, count: number): void;
92
+ /* Excluded from this release type: _undoRemoveRows */
93
+ /* Excluded from this release type: _undoRemoveCols */
94
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
95
+ /**
96
+ * Runs serializer on the GC data for this SharedMatrix.
97
+ * All the IFluidHandle's stored in the cells represent routes to other objects.
98
+ */
99
+ protected processGCDataCore(serializer: SummarySerializer): void;
100
+ /**
101
+ * Advances the 'localSeq' counter for the cell data operation currently being queued.
102
+ *
103
+ * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
104
+ * automatically advance 'localSeq'.
105
+ */
106
+ private nextLocalSeq;
107
+ protected submitLocalMessage(message: any, localOpMetadata?: any): void;
108
+ protected didAttach(): void;
109
+ protected onConnect(): void;
110
+ private rebasePosition;
111
+ protected reSubmitCore(content: any, localOpMetadata: unknown): void;
112
+ protected onDisconnect(): void;
113
+ /**
114
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
115
+ */
116
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
117
+ protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
118
+ private readonly onRowDelta;
119
+ private readonly onColDelta;
120
+ private readonly onRowHandlesRecycled;
121
+ private readonly onColHandlesRecycled;
122
+ /**
123
+ * Returns true if the latest pending write to the cell indicated by the given row/col handles
124
+ * matches the given 'localSeq'.
125
+ *
126
+ * A return value of `true` indicates that there are no later local operations queued that will
127
+ * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
128
+ * with a different value as well as row/col removals that might recycled the given row/col handles.
129
+ */
130
+ private isLatestPendingWrite;
131
+ toString(): string;
132
+ /**
133
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
134
+ */
135
+ protected applyStashedOp(content: any): unknown;
136
+ }
137
+
138
+ /**
139
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMatrix}.
140
+ * @public
141
+ */
142
+ export declare class SharedMatrixFactory implements IChannelFactory {
143
+ static Type: string;
144
+ static readonly Attributes: IChannelAttributes;
145
+ get type(): string;
146
+ get attributes(): IChannelAttributes;
147
+ /**
148
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
149
+ */
150
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
151
+ create(document: IFluidDataStoreRuntime, id: string): IChannel;
152
+ }
153
+
154
+ export { }
@@ -0,0 +1,154 @@
1
+ import { IChannel } from '@fluidframework/datastore-definitions';
2
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
3
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
4
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
5
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
6
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
7
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
8
+ import { IJSONSegment } from '@fluidframework/merge-tree';
9
+ import { IMatrixConsumer } from '@tiny-calc/nano';
10
+ import { IMatrixProducer } from '@tiny-calc/nano';
11
+ import { IMatrixReader } from '@tiny-calc/nano';
12
+ import { IMatrixWriter } from '@tiny-calc/nano';
13
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
14
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
15
+ import { Serializable } from '@fluidframework/datastore-definitions';
16
+ import { SharedObject } from '@fluidframework/shared-object-base';
17
+ import { SummarySerializer } from '@fluidframework/shared-object-base';
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare interface IRevertible {
23
+ revert(): any;
24
+ discard(): any;
25
+ }
26
+
27
+ /**
28
+ * @public
29
+ */
30
+ export declare interface IUndoConsumer {
31
+ pushToCurrentOperation(revertible: IRevertible): any;
32
+ }
33
+
34
+ /**
35
+ * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
36
+ * excluding null. (However, nulls may be embedded inside objects and arrays.)
37
+ * @public
38
+ */
39
+ export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
40
+
41
+ /**
42
+ * A SharedMatrix holds a rectangular 2D array of values. Supported operations
43
+ * include setting values and inserting/removing rows and columns.
44
+ *
45
+ * Matrix values may be any Fluid serializable type, which is the set of JSON
46
+ * serializable types extended to include IFluidHandles.
47
+ *
48
+ * Fluid's SharedMatrix implementation works equally well for dense and sparse
49
+ * matrix data and physically stores data in Z-order to leverage CPU caches and
50
+ * prefetching when reading in either row or column major order. (See README.md
51
+ * for more details.)
52
+ *
53
+ * @public
54
+ */
55
+ export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
56
+ id: string;
57
+ private readonly consumers;
58
+ static getFactory(): SharedMatrixFactory;
59
+ private readonly rows;
60
+ private readonly cols;
61
+ private cells;
62
+ private pending;
63
+ constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
64
+ private undo?;
65
+ /**
66
+ * Subscribes the given IUndoConsumer to the matrix.
67
+ */
68
+ openUndo(consumer: IUndoConsumer): void;
69
+ private get rowHandles();
70
+ private get colHandles();
71
+ /**
72
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
73
+ */
74
+ static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
75
+ openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
76
+ closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
77
+ get rowCount(): number;
78
+ get colCount(): number;
79
+ getCell(row: number, col: number): MatrixItem<T>;
80
+ get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
81
+ setCell(row: number, col: number, value: MatrixItem<T>): void;
82
+ setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
83
+ private setCellCore;
84
+ private sendSetCellOp;
85
+ private submitVectorMessage;
86
+ private submitColMessage;
87
+ insertCols(colStart: number, count: number): void;
88
+ removeCols(colStart: number, count: number): void;
89
+ private submitRowMessage;
90
+ insertRows(rowStart: number, count: number): void;
91
+ removeRows(rowStart: number, count: number): void;
92
+ /* Excluded from this release type: _undoRemoveRows */
93
+ /* Excluded from this release type: _undoRemoveCols */
94
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
95
+ /**
96
+ * Runs serializer on the GC data for this SharedMatrix.
97
+ * All the IFluidHandle's stored in the cells represent routes to other objects.
98
+ */
99
+ protected processGCDataCore(serializer: SummarySerializer): void;
100
+ /**
101
+ * Advances the 'localSeq' counter for the cell data operation currently being queued.
102
+ *
103
+ * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
104
+ * automatically advance 'localSeq'.
105
+ */
106
+ private nextLocalSeq;
107
+ protected submitLocalMessage(message: any, localOpMetadata?: any): void;
108
+ protected didAttach(): void;
109
+ protected onConnect(): void;
110
+ private rebasePosition;
111
+ protected reSubmitCore(content: any, localOpMetadata: unknown): void;
112
+ protected onDisconnect(): void;
113
+ /**
114
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
115
+ */
116
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
117
+ protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
118
+ private readonly onRowDelta;
119
+ private readonly onColDelta;
120
+ private readonly onRowHandlesRecycled;
121
+ private readonly onColHandlesRecycled;
122
+ /**
123
+ * Returns true if the latest pending write to the cell indicated by the given row/col handles
124
+ * matches the given 'localSeq'.
125
+ *
126
+ * A return value of `true` indicates that there are no later local operations queued that will
127
+ * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
128
+ * with a different value as well as row/col removals that might recycled the given row/col handles.
129
+ */
130
+ private isLatestPendingWrite;
131
+ toString(): string;
132
+ /**
133
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
134
+ */
135
+ protected applyStashedOp(content: any): unknown;
136
+ }
137
+
138
+ /**
139
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMatrix}.
140
+ * @public
141
+ */
142
+ export declare class SharedMatrixFactory implements IChannelFactory {
143
+ static Type: string;
144
+ static readonly Attributes: IChannelAttributes;
145
+ get type(): string;
146
+ get attributes(): IChannelAttributes;
147
+ /**
148
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
149
+ */
150
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
151
+ create(document: IFluidDataStoreRuntime, id: string): IChannel;
152
+ }
153
+
154
+ export { }