@fluidframework/matrix 2.0.0-internal.7.0.0 → 2.0.0-internal.7.1.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.
- package/CHANGELOG.md +4 -0
- package/api-extractor.json +13 -1
- package/api-report/matrix.api.md +121 -0
- package/dist/matrix-alpha.d.ts +143 -0
- package/dist/matrix-beta.d.ts +143 -0
- package/dist/matrix-public.d.ts +143 -0
- package/dist/matrix.d.ts +143 -112
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +2 -0
- 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/tsdoc-metadata.json +1 -1
- package/lib/matrix.d.ts +2 -0
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +2 -0
- 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/package.json +23 -23
- package/src/matrix.ts +2 -0
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-
|
|
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
|
+
}
|
|
15
|
+
}
|
|
4
16
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/matrix"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
8
|
+
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
9
|
+
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
|
+
import { IChannelServices } from '@fluidframework/datastore-definitions';
|
|
11
|
+
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
12
|
+
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
13
|
+
import { IFluidSerializer } from '@fluidframework/shared-object-base';
|
|
14
|
+
import { IJSONSegment } from '@fluidframework/merge-tree';
|
|
15
|
+
import { IMatrixConsumer } from '@tiny-calc/nano';
|
|
16
|
+
import { IMatrixProducer } from '@tiny-calc/nano';
|
|
17
|
+
import { IMatrixReader } from '@tiny-calc/nano';
|
|
18
|
+
import { IMatrixWriter } from '@tiny-calc/nano';
|
|
19
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
+
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
21
|
+
import { Serializable } from '@fluidframework/datastore-definitions';
|
|
22
|
+
import { SharedObject } from '@fluidframework/shared-object-base';
|
|
23
|
+
import { SummarySerializer } from '@fluidframework/shared-object-base';
|
|
24
|
+
|
|
25
|
+
// @public (undocumented)
|
|
26
|
+
export interface IRevertible {
|
|
27
|
+
// (undocumented)
|
|
28
|
+
discard(): any;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
revert(): any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
export interface IUndoConsumer {
|
|
35
|
+
// (undocumented)
|
|
36
|
+
pushToCurrentOperation(revertible: IRevertible): any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// @public
|
|
40
|
+
export type MatrixItem<T> = Serializable<Exclude<T, null>> | undefined;
|
|
41
|
+
|
|
42
|
+
// @public
|
|
43
|
+
export class SharedMatrix<T = any> extends SharedObject implements IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>> {
|
|
44
|
+
constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
|
|
45
|
+
// (undocumented)
|
|
46
|
+
protected applyStashedOp(content: any): unknown;
|
|
47
|
+
// (undocumented)
|
|
48
|
+
closeMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): void;
|
|
49
|
+
// (undocumented)
|
|
50
|
+
get colCount(): number;
|
|
51
|
+
// (undocumented)
|
|
52
|
+
static create<T>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
|
|
53
|
+
// (undocumented)
|
|
54
|
+
protected didAttach(): void;
|
|
55
|
+
// (undocumented)
|
|
56
|
+
getCell(row: number, col: number): MatrixItem<T>;
|
|
57
|
+
// (undocumented)
|
|
58
|
+
static getFactory(): SharedMatrixFactory;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
id: string;
|
|
61
|
+
// (undocumented)
|
|
62
|
+
insertCols(colStart: number, count: number): void;
|
|
63
|
+
// (undocumented)
|
|
64
|
+
insertRows(rowStart: number, count: number): void;
|
|
65
|
+
// (undocumented)
|
|
66
|
+
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
67
|
+
// (undocumented)
|
|
68
|
+
get matrixProducer(): IMatrixProducer<MatrixItem<T>>;
|
|
69
|
+
// (undocumented)
|
|
70
|
+
protected onConnect(): void;
|
|
71
|
+
// (undocumented)
|
|
72
|
+
protected onDisconnect(): void;
|
|
73
|
+
// (undocumented)
|
|
74
|
+
openMatrix(consumer: IMatrixConsumer<MatrixItem<T>>): IMatrixReader<MatrixItem<T>>;
|
|
75
|
+
openUndo(consumer: IUndoConsumer): void;
|
|
76
|
+
// (undocumented)
|
|
77
|
+
protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
78
|
+
protected processGCDataCore(serializer: SummarySerializer): void;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
removeCols(colStart: number, count: number): void;
|
|
81
|
+
// (undocumented)
|
|
82
|
+
removeRows(rowStart: number, count: number): void;
|
|
83
|
+
// (undocumented)
|
|
84
|
+
protected reSubmitCore(content: any, localOpMetadata: unknown): void;
|
|
85
|
+
// (undocumented)
|
|
86
|
+
get rowCount(): number;
|
|
87
|
+
// (undocumented)
|
|
88
|
+
setCell(row: number, col: number, value: MatrixItem<T>): void;
|
|
89
|
+
// (undocumented)
|
|
90
|
+
setCells(rowStart: number, colStart: number, colCount: number, values: readonly MatrixItem<T>[]): void;
|
|
91
|
+
// (undocumented)
|
|
92
|
+
protected submitLocalMessage(message: any, localOpMetadata?: any): void;
|
|
93
|
+
// (undocumented)
|
|
94
|
+
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
95
|
+
// (undocumented)
|
|
96
|
+
toString(): string;
|
|
97
|
+
// @internal (undocumented)
|
|
98
|
+
_undoRemoveCols(colStart: number, spec: IJSONSegment): void;
|
|
99
|
+
// @internal (undocumented)
|
|
100
|
+
_undoRemoveRows(rowStart: number, spec: IJSONSegment): void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// @public (undocumented)
|
|
104
|
+
export class SharedMatrixFactory implements IChannelFactory {
|
|
105
|
+
// (undocumented)
|
|
106
|
+
static readonly Attributes: IChannelAttributes;
|
|
107
|
+
// (undocumented)
|
|
108
|
+
get attributes(): IChannelAttributes;
|
|
109
|
+
// (undocumented)
|
|
110
|
+
create(document: IFluidDataStoreRuntime, id: string): IChannel;
|
|
111
|
+
// (undocumented)
|
|
112
|
+
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IChannel>;
|
|
113
|
+
// (undocumented)
|
|
114
|
+
static Type: string;
|
|
115
|
+
// (undocumented)
|
|
116
|
+
get type(): string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// (No @packageDocumentation comment for this package)
|
|
120
|
+
|
|
121
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { }
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { }
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { }
|