@fluidframework/matrix 2.0.0-dev.7.2.0.204906 → 2.0.0-dev.7.2.0.205722

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.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/matrix";
8
- export declare const pkgVersion = "2.0.0-dev.7.2.0.204906";
8
+ export declare const pkgVersion = "2.0.0-dev.7.2.0.205722";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/matrix";
11
- exports.pkgVersion = "2.0.0-dev.7.2.0.204906";
11
+ exports.pkgVersion = "2.0.0-dev.7.2.0.205722";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wBAAwB,CAAC;AACnC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/matrix\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.204906\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wBAAwB,CAAC;AACnC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/matrix\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.205722\";\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/matrix";
8
- export declare const pkgVersion = "2.0.0-dev.7.2.0.204906";
8
+ export declare const pkgVersion = "2.0.0-dev.7.2.0.205722";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/matrix";
8
- export const pkgVersion = "2.0.0-dev.7.2.0.204906";
8
+ export const pkgVersion = "2.0.0-dev.7.2.0.205722";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/matrix\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.204906\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/matrix\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.205722\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/matrix",
3
- "version": "2.0.0-dev.7.2.0.204906",
3
+ "version": "2.0.0-dev.7.2.0.205722",
4
4
  "description": "Distributed matrix",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -31,31 +31,31 @@
31
31
  "temp-directory": "nyc/.nyc_output"
32
32
  },
33
33
  "dependencies": {
34
- "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.204906",
35
- "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.204906",
36
- "@fluidframework/core-utils": "2.0.0-dev.7.2.0.204906",
37
- "@fluidframework/datastore-definitions": "2.0.0-dev.7.2.0.204906",
38
- "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.204906",
39
- "@fluidframework/merge-tree": "2.0.0-dev.7.2.0.204906",
34
+ "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.205722",
35
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.205722",
36
+ "@fluidframework/core-utils": "2.0.0-dev.7.2.0.205722",
37
+ "@fluidframework/datastore-definitions": "2.0.0-dev.7.2.0.205722",
38
+ "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.205722",
39
+ "@fluidframework/merge-tree": "2.0.0-dev.7.2.0.205722",
40
40
  "@fluidframework/protocol-definitions": "^3.0.0",
41
- "@fluidframework/runtime-definitions": "2.0.0-dev.7.2.0.204906",
42
- "@fluidframework/runtime-utils": "2.0.0-dev.7.2.0.204906",
43
- "@fluidframework/shared-object-base": "2.0.0-dev.7.2.0.204906",
44
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.204906",
41
+ "@fluidframework/runtime-definitions": "2.0.0-dev.7.2.0.205722",
42
+ "@fluidframework/runtime-utils": "2.0.0-dev.7.2.0.205722",
43
+ "@fluidframework/shared-object-base": "2.0.0-dev.7.2.0.205722",
44
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.205722",
45
45
  "@tiny-calc/nano": "0.0.0-alpha.5",
46
46
  "events": "^3.1.0",
47
47
  "tslib": "^1.10.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@fluid-internal/test-dds-utils": "2.0.0-dev.7.2.0.204906",
50
+ "@fluid-internal/test-dds-utils": "2.0.0-dev.7.2.0.205722",
51
51
  "@fluid-tools/benchmark": "^0.48.0",
52
- "@fluid-tools/build-cli": "0.26.0-203096",
53
- "@fluidframework/build-common": "^2.0.2",
54
- "@fluidframework/build-tools": "0.26.0-203096",
52
+ "@fluid-tools/build-cli": "^0.26.1",
53
+ "@fluidframework/build-common": "^2.0.3",
54
+ "@fluidframework/build-tools": "^0.26.1",
55
55
  "@fluidframework/eslint-config-fluid": "^3.0.0",
56
56
  "@fluidframework/matrix-previous": "npm:@fluidframework/matrix@2.0.0-internal.7.1.0",
57
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.204906",
58
- "@fluidframework/test-runtime-utils": "2.0.0-dev.7.2.0.204906",
57
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.205722",
58
+ "@fluidframework/test-runtime-utils": "2.0.0-dev.7.2.0.205722",
59
59
  "@microsoft/api-extractor": "^7.37.0",
60
60
  "@tiny-calc/micro": "0.0.0-alpha.5",
61
61
  "@types/mocha": "^9.1.1",
@@ -89,7 +89,7 @@
89
89
  "build:genver": "gen-version",
90
90
  "build:test": "tsc --project ./src/test/tsconfig.json",
91
91
  "ci:build:docs": "api-extractor run",
92
- "clean": "rimraf --glob 'dist' 'lib' 'bench/dist' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
92
+ "clean": "rimraf --glob dist lib bench/dist \"*.tsbuildinfo\" \"*.build.log\" _api-extractor-temp nyc",
93
93
  "eslint": "eslint --format stylish src",
94
94
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
95
95
  "format": "npm run prettier:fix",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/matrix";
9
- export const pkgVersion = "2.0.0-dev.7.2.0.204906";
9
+ export const pkgVersion = "2.0.0-dev.7.2.0.205722";
@@ -1,143 +0,0 @@
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
- export declare interface IRevertible {
20
- revert(): any;
21
- discard(): any;
22
- }
23
-
24
- export declare interface IUndoConsumer {
25
- pushToCurrentOperation(revertible: IRevertible): any;
26
- }
27
-
28
- /**
29
- * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
30
- * excluding null. (However, nulls may be embedded inside objects and arrays.)
31
- */
32
- export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
33
-
34
- /**
35
- * A SharedMatrix holds a rectangular 2D array of values. Supported operations
36
- * include setting values and inserting/removing rows and columns.
37
- *
38
- * Matrix values may be any Fluid serializable type, which is the set of JSON
39
- * serializable types extended to include IFluidHandles.
40
- *
41
- * Fluid's SharedMatrix implementation works equally well for dense and sparse
42
- * matrix data and physically stores data in Z-order to leverage CPU caches and
43
- * prefetching when reading in either row or column major order. (See README.md
44
- * for more details.)
45
- *
46
- * @public
47
- */
48
- export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
49
- id: string;
50
- private readonly consumers;
51
- static getFactory(): SharedMatrixFactory;
52
- private readonly rows;
53
- private readonly cols;
54
- private cells;
55
- private pending;
56
- constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
57
- private undo?;
58
- /**
59
- * Subscribes the given IUndoConsumer to the matrix.
60
- */
61
- openUndo(consumer: IUndoConsumer): void;
62
- private get rowHandles();
63
- private get colHandles();
64
- /**
65
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
66
- */
67
- static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
68
- openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
69
- closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
70
- get rowCount(): number;
71
- get colCount(): number;
72
- getCell(row: number, col: number): MatrixItem<T>;
73
- get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
74
- setCell(row: number, col: number, value: MatrixItem<T>): void;
75
- setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
76
- private setCellCore;
77
- private sendSetCellOp;
78
- private submitVectorMessage;
79
- private submitColMessage;
80
- insertCols(colStart: number, count: number): void;
81
- removeCols(colStart: number, count: number): void;
82
- private submitRowMessage;
83
- insertRows(rowStart: number, count: number): void;
84
- removeRows(rowStart: number, count: number): void;
85
- /* Excluded from this release type: _undoRemoveRows */
86
- /* Excluded from this release type: _undoRemoveCols */
87
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
88
- /**
89
- * Runs serializer on the GC data for this SharedMatrix.
90
- * All the IFluidHandle's stored in the cells represent routes to other objects.
91
- */
92
- protected processGCDataCore(serializer: SummarySerializer): void;
93
- /**
94
- * Advances the 'localSeq' counter for the cell data operation currently being queued.
95
- *
96
- * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
97
- * automatically advance 'localSeq'.
98
- */
99
- private nextLocalSeq;
100
- protected submitLocalMessage(message: any, localOpMetadata?: any): void;
101
- protected didAttach(): void;
102
- protected onConnect(): void;
103
- private rebasePosition;
104
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
105
- protected onDisconnect(): void;
106
- /**
107
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
108
- */
109
- protected loadCore(storage: IChannelStorageService): Promise<void>;
110
- protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
111
- private readonly onRowDelta;
112
- private readonly onColDelta;
113
- private readonly onRowHandlesRecycled;
114
- private readonly onColHandlesRecycled;
115
- /**
116
- * Returns true if the latest pending write to the cell indicated by the given row/col handles
117
- * matches the given 'localSeq'.
118
- *
119
- * A return value of `true` indicates that there are no later local operations queued that will
120
- * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
121
- * with a different value as well as row/col removals that might recycled the given row/col handles.
122
- */
123
- private isLatestPendingWrite;
124
- toString(): string;
125
- /**
126
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
127
- */
128
- protected applyStashedOp(content: any): unknown;
129
- }
130
-
131
- export declare class SharedMatrixFactory implements IChannelFactory {
132
- static Type: string;
133
- static readonly Attributes: IChannelAttributes;
134
- get type(): string;
135
- get attributes(): IChannelAttributes;
136
- /**
137
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
138
- */
139
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
140
- create(document: IFluidDataStoreRuntime, id: string): IChannel;
141
- }
142
-
143
- export { }
@@ -1,143 +0,0 @@
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
- export declare interface IRevertible {
20
- revert(): any;
21
- discard(): any;
22
- }
23
-
24
- export declare interface IUndoConsumer {
25
- pushToCurrentOperation(revertible: IRevertible): any;
26
- }
27
-
28
- /**
29
- * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
30
- * excluding null. (However, nulls may be embedded inside objects and arrays.)
31
- */
32
- export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
33
-
34
- /**
35
- * A SharedMatrix holds a rectangular 2D array of values. Supported operations
36
- * include setting values and inserting/removing rows and columns.
37
- *
38
- * Matrix values may be any Fluid serializable type, which is the set of JSON
39
- * serializable types extended to include IFluidHandles.
40
- *
41
- * Fluid's SharedMatrix implementation works equally well for dense and sparse
42
- * matrix data and physically stores data in Z-order to leverage CPU caches and
43
- * prefetching when reading in either row or column major order. (See README.md
44
- * for more details.)
45
- *
46
- * @public
47
- */
48
- export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
49
- id: string;
50
- private readonly consumers;
51
- static getFactory(): SharedMatrixFactory;
52
- private readonly rows;
53
- private readonly cols;
54
- private cells;
55
- private pending;
56
- constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
57
- private undo?;
58
- /**
59
- * Subscribes the given IUndoConsumer to the matrix.
60
- */
61
- openUndo(consumer: IUndoConsumer): void;
62
- private get rowHandles();
63
- private get colHandles();
64
- /**
65
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
66
- */
67
- static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
68
- openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
69
- closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
70
- get rowCount(): number;
71
- get colCount(): number;
72
- getCell(row: number, col: number): MatrixItem<T>;
73
- get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
74
- setCell(row: number, col: number, value: MatrixItem<T>): void;
75
- setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
76
- private setCellCore;
77
- private sendSetCellOp;
78
- private submitVectorMessage;
79
- private submitColMessage;
80
- insertCols(colStart: number, count: number): void;
81
- removeCols(colStart: number, count: number): void;
82
- private submitRowMessage;
83
- insertRows(rowStart: number, count: number): void;
84
- removeRows(rowStart: number, count: number): void;
85
- /* Excluded from this release type: _undoRemoveRows */
86
- /* Excluded from this release type: _undoRemoveCols */
87
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
88
- /**
89
- * Runs serializer on the GC data for this SharedMatrix.
90
- * All the IFluidHandle's stored in the cells represent routes to other objects.
91
- */
92
- protected processGCDataCore(serializer: SummarySerializer): void;
93
- /**
94
- * Advances the 'localSeq' counter for the cell data operation currently being queued.
95
- *
96
- * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
97
- * automatically advance 'localSeq'.
98
- */
99
- private nextLocalSeq;
100
- protected submitLocalMessage(message: any, localOpMetadata?: any): void;
101
- protected didAttach(): void;
102
- protected onConnect(): void;
103
- private rebasePosition;
104
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
105
- protected onDisconnect(): void;
106
- /**
107
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
108
- */
109
- protected loadCore(storage: IChannelStorageService): Promise<void>;
110
- protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
111
- private readonly onRowDelta;
112
- private readonly onColDelta;
113
- private readonly onRowHandlesRecycled;
114
- private readonly onColHandlesRecycled;
115
- /**
116
- * Returns true if the latest pending write to the cell indicated by the given row/col handles
117
- * matches the given 'localSeq'.
118
- *
119
- * A return value of `true` indicates that there are no later local operations queued that will
120
- * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
121
- * with a different value as well as row/col removals that might recycled the given row/col handles.
122
- */
123
- private isLatestPendingWrite;
124
- toString(): string;
125
- /**
126
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
127
- */
128
- protected applyStashedOp(content: any): unknown;
129
- }
130
-
131
- export declare class SharedMatrixFactory implements IChannelFactory {
132
- static Type: string;
133
- static readonly Attributes: IChannelAttributes;
134
- get type(): string;
135
- get attributes(): IChannelAttributes;
136
- /**
137
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
138
- */
139
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
140
- create(document: IFluidDataStoreRuntime, id: string): IChannel;
141
- }
142
-
143
- export { }
@@ -1,143 +0,0 @@
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
- export declare interface IRevertible {
20
- revert(): any;
21
- discard(): any;
22
- }
23
-
24
- export declare interface IUndoConsumer {
25
- pushToCurrentOperation(revertible: IRevertible): any;
26
- }
27
-
28
- /**
29
- * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
30
- * excluding null. (However, nulls may be embedded inside objects and arrays.)
31
- */
32
- export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
33
-
34
- /**
35
- * A SharedMatrix holds a rectangular 2D array of values. Supported operations
36
- * include setting values and inserting/removing rows and columns.
37
- *
38
- * Matrix values may be any Fluid serializable type, which is the set of JSON
39
- * serializable types extended to include IFluidHandles.
40
- *
41
- * Fluid's SharedMatrix implementation works equally well for dense and sparse
42
- * matrix data and physically stores data in Z-order to leverage CPU caches and
43
- * prefetching when reading in either row or column major order. (See README.md
44
- * for more details.)
45
- *
46
- * @public
47
- */
48
- export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
49
- id: string;
50
- private readonly consumers;
51
- static getFactory(): SharedMatrixFactory;
52
- private readonly rows;
53
- private readonly cols;
54
- private cells;
55
- private pending;
56
- constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
57
- private undo?;
58
- /**
59
- * Subscribes the given IUndoConsumer to the matrix.
60
- */
61
- openUndo(consumer: IUndoConsumer): void;
62
- private get rowHandles();
63
- private get colHandles();
64
- /**
65
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
66
- */
67
- static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
68
- openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
69
- closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
70
- get rowCount(): number;
71
- get colCount(): number;
72
- getCell(row: number, col: number): MatrixItem<T>;
73
- get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
74
- setCell(row: number, col: number, value: MatrixItem<T>): void;
75
- setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
76
- private setCellCore;
77
- private sendSetCellOp;
78
- private submitVectorMessage;
79
- private submitColMessage;
80
- insertCols(colStart: number, count: number): void;
81
- removeCols(colStart: number, count: number): void;
82
- private submitRowMessage;
83
- insertRows(rowStart: number, count: number): void;
84
- removeRows(rowStart: number, count: number): void;
85
- /* Excluded from this release type: _undoRemoveRows */
86
- /* Excluded from this release type: _undoRemoveCols */
87
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
88
- /**
89
- * Runs serializer on the GC data for this SharedMatrix.
90
- * All the IFluidHandle's stored in the cells represent routes to other objects.
91
- */
92
- protected processGCDataCore(serializer: SummarySerializer): void;
93
- /**
94
- * Advances the 'localSeq' counter for the cell data operation currently being queued.
95
- *
96
- * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
97
- * automatically advance 'localSeq'.
98
- */
99
- private nextLocalSeq;
100
- protected submitLocalMessage(message: any, localOpMetadata?: any): void;
101
- protected didAttach(): void;
102
- protected onConnect(): void;
103
- private rebasePosition;
104
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
105
- protected onDisconnect(): void;
106
- /**
107
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
108
- */
109
- protected loadCore(storage: IChannelStorageService): Promise<void>;
110
- protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
111
- private readonly onRowDelta;
112
- private readonly onColDelta;
113
- private readonly onRowHandlesRecycled;
114
- private readonly onColHandlesRecycled;
115
- /**
116
- * Returns true if the latest pending write to the cell indicated by the given row/col handles
117
- * matches the given 'localSeq'.
118
- *
119
- * A return value of `true` indicates that there are no later local operations queued that will
120
- * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
121
- * with a different value as well as row/col removals that might recycled the given row/col handles.
122
- */
123
- private isLatestPendingWrite;
124
- toString(): string;
125
- /**
126
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
127
- */
128
- protected applyStashedOp(content: any): unknown;
129
- }
130
-
131
- export declare class SharedMatrixFactory implements IChannelFactory {
132
- static Type: string;
133
- static readonly Attributes: IChannelAttributes;
134
- get type(): string;
135
- get attributes(): IChannelAttributes;
136
- /**
137
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
138
- */
139
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
140
- create(document: IFluidDataStoreRuntime, id: string): IChannel;
141
- }
142
-
143
- export { }
@@ -1,143 +0,0 @@
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
- export declare interface IRevertible {
20
- revert(): any;
21
- discard(): any;
22
- }
23
-
24
- export declare interface IUndoConsumer {
25
- pushToCurrentOperation(revertible: IRevertible): any;
26
- }
27
-
28
- /**
29
- * A matrix cell value may be undefined (indicating an empty cell) or any serializable type,
30
- * excluding null. (However, nulls may be embedded inside objects and arrays.)
31
- */
32
- export declare type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
33
-
34
- /**
35
- * A SharedMatrix holds a rectangular 2D array of values. Supported operations
36
- * include setting values and inserting/removing rows and columns.
37
- *
38
- * Matrix values may be any Fluid serializable type, which is the set of JSON
39
- * serializable types extended to include IFluidHandles.
40
- *
41
- * Fluid's SharedMatrix implementation works equally well for dense and sparse
42
- * matrix data and physically stores data in Z-order to leverage CPU caches and
43
- * prefetching when reading in either row or column major order. (See README.md
44
- * for more details.)
45
- *
46
- * @public
47
- */
48
- export declare class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
49
- id: string;
50
- private readonly consumers;
51
- static getFactory(): SharedMatrixFactory;
52
- private readonly rows;
53
- private readonly cols;
54
- private cells;
55
- private pending;
56
- constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
57
- private undo?;
58
- /**
59
- * Subscribes the given IUndoConsumer to the matrix.
60
- */
61
- openUndo(consumer: IUndoConsumer): void;
62
- private get rowHandles();
63
- private get colHandles();
64
- /**
65
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
66
- */
67
- static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
68
- openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
69
- closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
70
- get rowCount(): number;
71
- get colCount(): number;
72
- getCell(row: number, col: number): MatrixItem<T>;
73
- get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
74
- setCell(row: number, col: number, value: MatrixItem<T>): void;
75
- setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
76
- private setCellCore;
77
- private sendSetCellOp;
78
- private submitVectorMessage;
79
- private submitColMessage;
80
- insertCols(colStart: number, count: number): void;
81
- removeCols(colStart: number, count: number): void;
82
- private submitRowMessage;
83
- insertRows(rowStart: number, count: number): void;
84
- removeRows(rowStart: number, count: number): void;
85
- /** @internal */ _undoRemoveRows(rowStart: number, spec: IJSONSegment): void;
86
- /** @internal */ _undoRemoveCols(colStart: number, spec: IJSONSegment): void;
87
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
88
- /**
89
- * Runs serializer on the GC data for this SharedMatrix.
90
- * All the IFluidHandle's stored in the cells represent routes to other objects.
91
- */
92
- protected processGCDataCore(serializer: SummarySerializer): void;
93
- /**
94
- * Advances the 'localSeq' counter for the cell data operation currently being queued.
95
- *
96
- * Do not use with 'submitColMessage()/submitRowMessage()' as these helpers + the MergeTree will
97
- * automatically advance 'localSeq'.
98
- */
99
- private nextLocalSeq;
100
- protected submitLocalMessage(message: any, localOpMetadata?: any): void;
101
- protected didAttach(): void;
102
- protected onConnect(): void;
103
- private rebasePosition;
104
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
105
- protected onDisconnect(): void;
106
- /**
107
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
108
- */
109
- protected loadCore(storage: IChannelStorageService): Promise<void>;
110
- protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
111
- private readonly onRowDelta;
112
- private readonly onColDelta;
113
- private readonly onRowHandlesRecycled;
114
- private readonly onColHandlesRecycled;
115
- /**
116
- * Returns true if the latest pending write to the cell indicated by the given row/col handles
117
- * matches the given 'localSeq'.
118
- *
119
- * A return value of `true` indicates that there are no later local operations queued that will
120
- * clobber the write op at the given 'localSeq'. This includes later ops that overwrite the cell
121
- * with a different value as well as row/col removals that might recycled the given row/col handles.
122
- */
123
- private isLatestPendingWrite;
124
- toString(): string;
125
- /**
126
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
127
- */
128
- protected applyStashedOp(content: any): unknown;
129
- }
130
-
131
- export declare class SharedMatrixFactory implements IChannelFactory {
132
- static Type: string;
133
- static readonly Attributes: IChannelAttributes;
134
- get type(): string;
135
- get attributes(): IChannelAttributes;
136
- /**
137
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
138
- */
139
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
140
- create(document: IFluidDataStoreRuntime, id: string): IChannel;
141
- }
142
-
143
- export { }