@fluidframework/matrix 2.0.0-dev-rc.3.0.0.254866 → 2.0.0-dev-rc.4.0.0.261659
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.
- package/CHANGELOG.md +23 -0
- package/api-report/matrix.api.md +9 -73
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/{alpha.d.ts → legacy.d.ts} +2 -1
- package/dist/matrix.d.ts +64 -15
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +8 -19
- package/dist/matrix.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +3 -0
- package/dist/runtime.d.ts +16 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +9 -2
- package/dist/runtime.js.map +1 -1
- package/{dist/beta.d.ts → internal.d.ts} +2 -0
- package/{lib/beta.d.ts → legacy.d.ts} +2 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/{alpha.d.ts → legacy.d.ts} +2 -1
- package/lib/matrix.d.ts +64 -15
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +8 -19
- package/lib/matrix.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +3 -0
- package/lib/runtime.d.ts +16 -1
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js +11 -4
- package/lib/runtime.js.map +1 -1
- package/package.json +37 -30
- package/src/index.ts +2 -2
- package/src/matrix.ts +80 -22
- package/src/packageVersion.ts +1 -1
- package/src/runtime.ts +23 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @fluidframework/matrix
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
|
|
8
|
+
|
|
9
|
+
Fluid Framework packages have been updated to use the [package.json "exports"
|
|
10
|
+
field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
|
|
11
|
+
TypeScript types and implementation code.
|
|
12
|
+
|
|
13
|
+
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
14
|
+
|
|
15
|
+
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
16
|
+
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
17
|
+
|
|
18
|
+
We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
|
|
19
|
+
for use with modern versions of Node.js _and_ Bundlers.
|
|
20
|
+
[See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
|
|
21
|
+
regarding the module and moduleResolution options.
|
|
22
|
+
|
|
23
|
+
**Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
|
|
24
|
+
to distinguish stable APIs from those that are in development.**
|
|
25
|
+
|
|
3
26
|
## 2.0.0-rc.2.0.0
|
|
4
27
|
|
|
5
28
|
Dependency updates only.
|
package/api-report/matrix.api.md
CHANGED
|
@@ -8,22 +8,15 @@ import { IChannel } from '@fluidframework/datastore-definitions';
|
|
|
8
8
|
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
9
9
|
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
10
|
import { IChannelServices } from '@fluidframework/datastore-definitions';
|
|
11
|
-
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
12
11
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
|
-
import { IFluidSerializer } from '@fluidframework/shared-object-base';
|
|
17
|
-
import { IJSONSegment } from '@fluidframework/merge-tree/internal';
|
|
18
|
-
import { IMatrixConsumer } from '@tiny-calc/nano';
|
|
19
15
|
import { IMatrixProducer } from '@tiny-calc/nano';
|
|
20
16
|
import { IMatrixReader } from '@tiny-calc/nano';
|
|
21
17
|
import { IMatrixWriter } from '@tiny-calc/nano';
|
|
22
|
-
import {
|
|
23
|
-
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
24
|
-
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
18
|
+
import type { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
25
19
|
import { Serializable } from '@fluidframework/datastore-definitions/internal';
|
|
26
|
-
import { SharedObject } from '@fluidframework/shared-object-base/internal';
|
|
27
20
|
|
|
28
21
|
// @alpha (undocumented)
|
|
29
22
|
export interface IRevertible {
|
|
@@ -34,17 +27,15 @@ export interface IRevertible {
|
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
// @alpha (undocumented)
|
|
37
|
-
export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T
|
|
38
|
-
// (undocumented)
|
|
30
|
+
export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>>, IChannel {
|
|
39
31
|
insertCols(colStart: number, count: number): void;
|
|
40
|
-
// (undocumented)
|
|
41
32
|
insertRows(rowStart: number, count: number): void;
|
|
42
|
-
|
|
33
|
+
isSetCellConflictResolutionPolicyFWW(): boolean;
|
|
43
34
|
openUndo(consumer: IUndoConsumer): void;
|
|
44
|
-
// (undocumented)
|
|
45
35
|
removeCols(colStart: number, count: number): void;
|
|
46
|
-
// (undocumented)
|
|
47
36
|
removeRows(rowStart: number, count: number): void;
|
|
37
|
+
setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
|
|
38
|
+
switchSetCellPolicy(): void;
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
// @alpha
|
|
@@ -62,67 +53,12 @@ export interface IUndoConsumer {
|
|
|
62
53
|
export type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
|
|
63
54
|
|
|
64
55
|
// @alpha
|
|
65
|
-
export
|
|
66
|
-
constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, _isSetCellConflictResolutionPolicyFWW?: boolean);
|
|
67
|
-
protected applyStashedOp(_content: unknown): void;
|
|
68
|
-
// (undocumented)
|
|
69
|
-
closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
|
|
70
|
-
// (undocumented)
|
|
71
|
-
get colCount(): number;
|
|
72
|
-
static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
|
|
73
|
-
// (undocumented)
|
|
74
|
-
protected didAttach(): void;
|
|
75
|
-
// (undocumented)
|
|
76
|
-
getCell(row: number, col: number): MatrixItem<T>;
|
|
77
|
-
// (undocumented)
|
|
78
|
-
static getFactory(): SharedMatrixFactory;
|
|
79
|
-
// (undocumented)
|
|
80
|
-
id: string;
|
|
81
|
-
// (undocumented)
|
|
82
|
-
insertCols(colStart: number, count: number): void;
|
|
83
|
-
// (undocumented)
|
|
84
|
-
insertRows(rowStart: number, count: number): void;
|
|
85
|
-
// (undocumented)
|
|
86
|
-
isSetCellConflictResolutionPolicyFWW(): boolean;
|
|
87
|
-
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
88
|
-
// (undocumented)
|
|
89
|
-
get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
|
|
90
|
-
// (undocumented)
|
|
91
|
-
protected onConnect(): void;
|
|
92
|
-
// (undocumented)
|
|
93
|
-
protected onDisconnect(): void;
|
|
94
|
-
// (undocumented)
|
|
95
|
-
openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
|
|
96
|
-
openUndo(consumer: IUndoConsumer): void;
|
|
97
|
-
// (undocumented)
|
|
98
|
-
protected processCore(msg: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
99
|
-
protected processGCDataCore(serializer: IFluidSerializer): void;
|
|
100
|
-
// (undocumented)
|
|
101
|
-
removeCols(colStart: number, count: number): void;
|
|
102
|
-
// (undocumented)
|
|
103
|
-
removeRows(rowStart: number, count: number): void;
|
|
104
|
-
// (undocumented)
|
|
105
|
-
protected reSubmitCore(incoming: unknown, localOpMetadata: unknown): void;
|
|
106
|
-
// (undocumented)
|
|
107
|
-
get rowCount(): number;
|
|
108
|
-
// (undocumented)
|
|
109
|
-
setCell(row: number, col: number, value: MatrixItem<T>): void;
|
|
110
|
-
// (undocumented)
|
|
111
|
-
setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
|
|
112
|
-
// (undocumented)
|
|
113
|
-
protected submitLocalMessage(message: any, localOpMetadata?: any): void;
|
|
114
|
-
// (undocumented)
|
|
115
|
-
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
116
|
-
switchSetCellPolicy(): void;
|
|
117
|
-
// (undocumented)
|
|
118
|
-
toString(): string;
|
|
119
|
-
// (undocumented)
|
|
120
|
-
_undoRemoveCols(colStart: number, spec: IJSONSegment): void;
|
|
121
|
-
// (undocumented)
|
|
122
|
-
_undoRemoveRows(rowStart: number, spec: IJSONSegment): void;
|
|
123
|
-
}
|
|
56
|
+
export const SharedMatrix: ISharedObjectKind<ISharedMatrix>;
|
|
124
57
|
|
|
125
58
|
// @alpha
|
|
59
|
+
export type SharedMatrix<T = any> = ISharedMatrix<T>;
|
|
60
|
+
|
|
61
|
+
// @alpha @deprecated
|
|
126
62
|
export class SharedMatrixFactory implements IChannelFactory<ISharedMatrix> {
|
|
127
63
|
// (undocumented)
|
|
128
64
|
static readonly Attributes: IChannelAttributes;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ISharedMatrixEvents,
|
|
5
|
+
export { ISharedMatrixEvents, ISharedMatrix } from "./matrix.js";
|
|
6
6
|
export { MatrixItem } from "./ops.js";
|
|
7
|
-
export { SharedMatrixFactory } from "./runtime.js";
|
|
7
|
+
export { SharedMatrixFactory, SharedMatrix } from "./runtime.js";
|
|
8
8
|
export { IUndoConsumer, IRevertible } from "./types.js";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
var matrix_js_1 = require("./matrix.js");
|
|
9
|
-
Object.defineProperty(exports, "SharedMatrix", { enumerable: true, get: function () { return matrix_js_1.SharedMatrix; } });
|
|
7
|
+
exports.SharedMatrix = exports.SharedMatrixFactory = void 0;
|
|
10
8
|
var runtime_js_1 = require("./runtime.js");
|
|
11
9
|
Object.defineProperty(exports, "SharedMatrixFactory", { enumerable: true, get: function () { return runtime_js_1.SharedMatrixFactory; } });
|
|
10
|
+
Object.defineProperty(exports, "SharedMatrix", { enumerable: true, get: function () { return runtime_js_1.SharedMatrix; } });
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2CAAiE;AAAxD,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedMatrixEvents, ISharedMatrix } from \"./matrix.js\";\nexport { MatrixItem } from \"./ops.js\";\nexport { SharedMatrixFactory, SharedMatrix } from \"./runtime.js\";\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.js\";\n"]}
|
package/dist/matrix.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IEvent,
|
|
6
|
-
import { IChannelAttributes, IChannelStorageService, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
5
|
+
import { IEvent, IEventThisPlaceHolder, type IEventProvider } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IChannelAttributes, IChannelStorageService, IFluidDataStoreRuntime, type IChannel } from "@fluidframework/datastore-definitions";
|
|
7
7
|
import { IJSONSegment } from "@fluidframework/merge-tree/internal";
|
|
8
8
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
9
9
|
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
@@ -11,7 +11,6 @@ import { IFluidSerializer, ISharedObjectEvents } from "@fluidframework/shared-ob
|
|
|
11
11
|
import { SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
12
12
|
import { IMatrixConsumer, IMatrixProducer, IMatrixReader, IMatrixWriter } from "@tiny-calc/nano";
|
|
13
13
|
import { MatrixItem } from "./ops.js";
|
|
14
|
-
import { SharedMatrixFactory } from "./runtime.js";
|
|
15
14
|
import { IUndoConsumer } from "./types.js";
|
|
16
15
|
/**
|
|
17
16
|
* Events emitted by Shared Matrix.
|
|
@@ -35,17 +34,76 @@ export interface ISharedMatrixEvents<T> extends IEvent {
|
|
|
35
34
|
*
|
|
36
35
|
* - `conflictingValue` - The value that this client tried to set in the cell and got ignored due to conflict.
|
|
37
36
|
*
|
|
38
|
-
* - `target` - The {@link
|
|
37
|
+
* - `target` - The {@link ISharedMatrix} itself.
|
|
39
38
|
*/
|
|
40
39
|
(event: "conflict", listener: (row: number, col: number, currentValue: MatrixItem<T>, conflictingValue: MatrixItem<T>, target: IEventThisPlaceHolder) => void): void;
|
|
41
40
|
}
|
|
42
41
|
/** @alpha */
|
|
43
|
-
export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T
|
|
42
|
+
export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>>, IChannel {
|
|
43
|
+
/**
|
|
44
|
+
* Inserts columns into the matrix.
|
|
45
|
+
* @param colStart - Index of the first column to insert.
|
|
46
|
+
* @param count - Number of columns to insert.
|
|
47
|
+
* @remarks
|
|
48
|
+
* Inserting 0 columns is a noop.
|
|
49
|
+
*/
|
|
44
50
|
insertCols(colStart: number, count: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Removes columns from the matrix.
|
|
53
|
+
* @param colStart - Index of the first column to remove.
|
|
54
|
+
* @param count - Number of columns to remove.
|
|
55
|
+
* @remarks
|
|
56
|
+
* Removing 0 columns is a noop.
|
|
57
|
+
*/
|
|
45
58
|
removeCols(colStart: number, count: number): void;
|
|
59
|
+
/**
|
|
60
|
+
* Inserts rows into the matrix.
|
|
61
|
+
* @param rowStart - Index of the first row to insert.
|
|
62
|
+
* @param count - Number of rows to insert.
|
|
63
|
+
* @remarks
|
|
64
|
+
* Inserting 0 rows is a noop.
|
|
65
|
+
*/
|
|
46
66
|
insertRows(rowStart: number, count: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* Removes rows from the matrix.
|
|
69
|
+
* @param rowStart - Index of the first row to remove.
|
|
70
|
+
* @param count - Number of rows to remove.
|
|
71
|
+
* @remarks
|
|
72
|
+
* Removing 0 rows is a noop.
|
|
73
|
+
*/
|
|
47
74
|
removeRows(rowStart: number, count: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* Sets a range of cells in the matrix.
|
|
77
|
+
* Cells are set in consecutive columns between `colStart` and `colStart + colCount - 1`.
|
|
78
|
+
* When `values` has larger size than `colCount`, the extra values are inserted in subsequent rows
|
|
79
|
+
* a la text-wrapping.
|
|
80
|
+
* @param rowStart - Index of the row to start setting cells.
|
|
81
|
+
* @param colStart - Index of the column to start setting cells.
|
|
82
|
+
* @param colCount - Number of columns to set before wrapping to subsequent rows (if `values` has more items)
|
|
83
|
+
* @param values - Values to insert.
|
|
84
|
+
* @remarks
|
|
85
|
+
* This is not currently more efficient than calling `setCell` for each cell.
|
|
86
|
+
*/
|
|
87
|
+
setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
|
|
88
|
+
/**
|
|
89
|
+
* Attach an {@link IUndoConsumer} to the matrix.
|
|
90
|
+
* @param consumer - Undo consumer which will receive revertibles from the matrix.
|
|
91
|
+
*/
|
|
48
92
|
openUndo(consumer: IUndoConsumer): void;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the current conflict resolution policy is first-write win (FWW).
|
|
95
|
+
* See {@link ISharedMatrix.switchSetCellPolicy} for more details.
|
|
96
|
+
*/
|
|
97
|
+
isSetCellConflictResolutionPolicyFWW(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Change the conflict resolution policy for setCell operations to first-write win (FWW).
|
|
100
|
+
*
|
|
101
|
+
* This API only switches from LWW to FWW and not from FWW to LWW.
|
|
102
|
+
*
|
|
103
|
+
* @privateRemarks
|
|
104
|
+
* The next SetOp which is sent will communicate this policy to other clients.
|
|
105
|
+
*/
|
|
106
|
+
switchSetCellPolicy(): void;
|
|
49
107
|
}
|
|
50
108
|
/**
|
|
51
109
|
* A SharedMatrix holds a rectangular 2D array of values. Supported operations
|
|
@@ -63,7 +121,6 @@ export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEven
|
|
|
63
121
|
export declare class SharedMatrix<T = any> extends SharedObject<ISharedMatrixEvents<T> & ISharedObjectEvents> implements ISharedMatrix<T> {
|
|
64
122
|
id: string;
|
|
65
123
|
private readonly consumers;
|
|
66
|
-
static getFactory(): SharedMatrixFactory;
|
|
67
124
|
/**
|
|
68
125
|
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
69
126
|
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
@@ -90,7 +147,7 @@ export declare class SharedMatrix<T = any> extends SharedObject<ISharedMatrixEve
|
|
|
90
147
|
* @param _isSetCellConflictResolutionPolicyFWW - Conflict resolution for Matrix set op is First Writer Win in case of
|
|
91
148
|
* race condition. Client can still overwrite values in case of no race.
|
|
92
149
|
*/
|
|
93
|
-
constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes
|
|
150
|
+
constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
|
|
94
151
|
private undo?;
|
|
95
152
|
/**
|
|
96
153
|
* Subscribes the given IUndoConsumer to the matrix.
|
|
@@ -98,10 +155,6 @@ export declare class SharedMatrix<T = any> extends SharedObject<ISharedMatrixEve
|
|
|
98
155
|
openUndo(consumer: IUndoConsumer): void;
|
|
99
156
|
private get rowHandles();
|
|
100
157
|
private get colHandles();
|
|
101
|
-
/**
|
|
102
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
103
|
-
*/
|
|
104
|
-
static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
|
|
105
158
|
openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
|
|
106
159
|
closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
|
|
107
160
|
get rowCount(): number;
|
|
@@ -165,10 +218,6 @@ export declare class SharedMatrix<T = any> extends SharedObject<ISharedMatrixEve
|
|
|
165
218
|
private readonly onColDelta;
|
|
166
219
|
private readonly onRowHandlesRecycled;
|
|
167
220
|
private readonly onColHandlesRecycled;
|
|
168
|
-
/**
|
|
169
|
-
* Api to switch Set Op policy from Last Writer Win to First Writer Win. It only switches from LWW to FWW
|
|
170
|
-
* and not from FWW to LWW. The next SetOp which is sent will communicate this policy to other clients.
|
|
171
|
-
*/
|
|
172
221
|
switchSetCellPolicy(): void;
|
|
173
222
|
/**
|
|
174
223
|
* Returns true if the latest pending write to the cell indicated by the given row/col handles
|
package/dist/matrix.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../src/matrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,O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IAGF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAQzB;IAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAMnC;IAEF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAMnC;IAEK,mBAAmB;IAU1B;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAiBrB,QAAQ;IAoBf;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;CAiBjD"}
|
package/dist/matrix.js
CHANGED
|
@@ -18,7 +18,6 @@ const handletable_js_1 = require("./handletable.js");
|
|
|
18
18
|
const ops_js_1 = require("./ops.js");
|
|
19
19
|
const permutationvector_js_1 = require("./permutationvector.js");
|
|
20
20
|
const range_js_1 = require("./range.js");
|
|
21
|
-
const runtime_js_1 = require("./runtime.js");
|
|
22
21
|
const serialization_js_1 = require("./serialization.js");
|
|
23
22
|
const sparsearray2d_js_1 = require("./sparsearray2d.js");
|
|
24
23
|
const undoprovider_js_1 = require("./undoprovider.js");
|
|
@@ -36,9 +35,6 @@ const undoprovider_js_1 = require("./undoprovider.js");
|
|
|
36
35
|
* @alpha
|
|
37
36
|
*/
|
|
38
37
|
class SharedMatrix extends internal_4.SharedObject {
|
|
39
|
-
static getFactory() {
|
|
40
|
-
return new runtime_js_1.SharedMatrixFactory();
|
|
41
|
-
}
|
|
42
38
|
/**
|
|
43
39
|
* Constructor for the Shared Matrix
|
|
44
40
|
* @param runtime - DataStore runtime.
|
|
@@ -47,7 +43,7 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
47
43
|
* @param _isSetCellConflictResolutionPolicyFWW - Conflict resolution for Matrix set op is First Writer Win in case of
|
|
48
44
|
* race condition. Client can still overwrite values in case of no race.
|
|
49
45
|
*/
|
|
50
|
-
constructor(runtime, id, attributes
|
|
46
|
+
constructor(runtime, id, attributes) {
|
|
51
47
|
super(id, runtime, attributes, "fluid_matrix_");
|
|
52
48
|
this.id = id;
|
|
53
49
|
this.consumers = new Set();
|
|
@@ -93,8 +89,7 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
93
89
|
this.cellLastWriteTracker.clearCols(/* colStart: */ colHandle, /* colCount: */ 1);
|
|
94
90
|
}
|
|
95
91
|
};
|
|
96
|
-
this.setCellLwwToFwwPolicySwitchOpSeqNumber =
|
|
97
|
-
_isSetCellConflictResolutionPolicyFWW === true ? 0 : -1;
|
|
92
|
+
this.setCellLwwToFwwPolicySwitchOpSeqNumber = -1;
|
|
98
93
|
const getMinInFlightRefSeq = () => this.inFlightRefSeqs.get(0);
|
|
99
94
|
this.rows = new permutationvector_js_1.PermutationVector(ops_js_1.SnapshotPath.rows, this.logger, runtime, this.onRowDelta, this.onRowHandlesRecycled, getMinInFlightRefSeq);
|
|
100
95
|
this.cols = new permutationvector_js_1.PermutationVector(ops_js_1.SnapshotPath.cols, this.logger, runtime, this.onColDelta, this.onColHandlesRecycled, getMinInFlightRefSeq);
|
|
@@ -113,12 +108,6 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
113
108
|
get colHandles() {
|
|
114
109
|
return this.cols.handleCache;
|
|
115
110
|
}
|
|
116
|
-
/**
|
|
117
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
118
|
-
*/
|
|
119
|
-
static create(runtime, id) {
|
|
120
|
-
return runtime.createChannel(id, runtime_js_1.SharedMatrixFactory.Type);
|
|
121
|
-
}
|
|
122
111
|
// #region IMatrixProducer
|
|
123
112
|
openMatrix(consumer) {
|
|
124
113
|
this.consumers.add(consumer);
|
|
@@ -469,10 +458,14 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
469
458
|
else {
|
|
470
459
|
switch (content.target) {
|
|
471
460
|
case ops_js_1.SnapshotPath.cols:
|
|
472
|
-
this.submitColMessage(this.cols.regeneratePendingOp(content,
|
|
461
|
+
this.submitColMessage(this.cols.regeneratePendingOp(content,
|
|
462
|
+
// eslint-disable-next-line import/no-deprecated
|
|
463
|
+
localOpMetadata));
|
|
473
464
|
break;
|
|
474
465
|
case ops_js_1.SnapshotPath.rows:
|
|
475
|
-
this.submitRowMessage(this.rows.regeneratePendingOp(content,
|
|
466
|
+
this.submitRowMessage(this.rows.regeneratePendingOp(content,
|
|
467
|
+
// eslint-disable-next-line import/no-deprecated
|
|
468
|
+
localOpMetadata));
|
|
476
469
|
break;
|
|
477
470
|
default: {
|
|
478
471
|
(0, internal_1.unreachableCase)(content);
|
|
@@ -618,10 +611,6 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
618
611
|
(0, internal_1.unreachableCase)(target, "unknown target");
|
|
619
612
|
}
|
|
620
613
|
}
|
|
621
|
-
/**
|
|
622
|
-
* Api to switch Set Op policy from Last Writer Win to First Writer Win. It only switches from LWW to FWW
|
|
623
|
-
* and not from FWW to LWW. The next SetOp which is sent will communicate this policy to other clients.
|
|
624
|
-
*/
|
|
625
614
|
switchSetCellPolicy() {
|
|
626
615
|
if (this.setCellLwwToFwwPolicySwitchOpSeqNumber === -1) {
|
|
627
616
|
if (this.isAttached()) {
|