@fluidframework/matrix 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
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 +52 -0
- package/api-extractor.json +13 -1
- package/api-report/matrix.api.md +121 -0
- package/dist/handletable.js +2 -2
- package/dist/handletable.js.map +1 -1
- 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-untrimmed.d.ts +143 -0
- package/dist/matrix.d.ts +3 -1
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +27 -23
- package/dist/matrix.js.map +1 -1
- package/dist/ops.js +1 -1
- package/dist/ops.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/permutationvector.d.ts.map +1 -1
- package/dist/permutationvector.js +17 -16
- package/dist/permutationvector.js.map +1 -1
- package/dist/sparsearray2d.d.ts +5 -5
- package/dist/sparsearray2d.d.ts.map +1 -1
- package/dist/sparsearray2d.js +3 -7
- package/dist/sparsearray2d.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/handletable.js +2 -2
- package/lib/handletable.js.map +1 -1
- package/lib/matrix.d.ts +3 -1
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +27 -23
- 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/permutationvector.d.ts.map +1 -1
- package/lib/permutationvector.js +17 -16
- package/lib/permutationvector.js.map +1 -1
- package/lib/sparsearray2d.d.ts +5 -5
- package/lib/sparsearray2d.d.ts.map +1 -1
- package/lib/sparsearray2d.js +3 -7
- package/lib/sparsearray2d.js.map +1 -1
- package/package.json +26 -27
- package/src/matrix.ts +17 -6
- package/src/packageVersion.ts +1 -1
- package/src/permutationvector.ts +1 -0
- package/src/sparsearray2d.ts +3 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @fluidframework/matrix
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.7.1.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.7.0.0
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
12
|
+
|
|
13
|
+
This included the following changes from the protocol-definitions release:
|
|
14
|
+
|
|
15
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
16
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
17
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
18
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
19
|
+
ISignalMessageBase interface that contains common members.
|
|
20
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
21
|
+
|
|
22
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
23
|
+
|
|
24
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
25
|
+
|
|
26
|
+
- @fluidframework/gitresources: 2.0.1
|
|
27
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
28
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
29
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
30
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
31
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
32
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
33
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
34
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
35
|
+
- @fluidframework/server-services: 2.0.1
|
|
36
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
37
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
38
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
39
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
40
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
41
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
42
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
43
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
44
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
45
|
+
- tinylicious: 2.0.1
|
|
46
|
+
|
|
47
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
48
|
+
|
|
49
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
50
|
+
|
|
51
|
+
## 2.0.0-internal.6.4.0
|
|
52
|
+
|
|
53
|
+
Dependency updates only.
|
|
54
|
+
|
|
3
55
|
## 2.0.0-internal.6.3.0
|
|
4
56
|
|
|
5
57
|
Dependency updates only.
|
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
|
+
```
|
package/dist/handletable.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.HandleTable = exports.isHandleValid = void 0;
|
|
8
|
-
const isHandleValid = (handle) => handle >= 1 /* valid */;
|
|
8
|
+
const isHandleValid = (handle) => handle >= 1 /* Handle.valid */;
|
|
9
9
|
exports.isHandleValid = isHandleValid;
|
|
10
10
|
/**
|
|
11
11
|
* A handle table provides a fast mapping from an integer `handle` to a value `T`.
|
|
@@ -38,7 +38,7 @@ class HandleTable {
|
|
|
38
38
|
// Out of paranoia, overwrite the contents of the newly allocated free slot with an
|
|
39
39
|
// invalid handle value. This may help catch/diagnose bugs in the event the free list
|
|
40
40
|
// becomes corrupted.
|
|
41
|
-
this.handles[free] = 0 /* none */;
|
|
41
|
+
this.handles[free] = 0 /* Handle.none */;
|
|
42
42
|
return free;
|
|
43
43
|
}
|
|
44
44
|
/**
|
package/dist/handletable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handletable.js","sourceRoot":"","sources":["../src/handletable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkBI,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"handletable.js","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,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,QAAQ;QACd,wCAAwC;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,mFAAmF;QACnF,uFAAuF;QACvF,qFAAqF;QACrF,sFAAsF;QACtF,6DAA6D;QAC7D,IAAI,CAAC,IAAI,GAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAY,IAAI,IAAI,GAAG,CAAC,CAAC;QAEvD,mFAAmF;QACnF,sFAAsF;QACtF,qBAAqB;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAc,CAAC;QAEjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAa;QAChC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC/B,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC7B;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAc;QACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAM,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,MAAc,EAAE,KAAQ;QAClC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,wFAAwF;IACxF,uBAAuB;IACvB,IAAY,IAAI;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAW,CAAC;IAClC,CAAC;IACD,IAAY,IAAI,CAAC,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"]}
|
|
@@ -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 { }
|