@fluid-experimental/sequence-deprecated 2.0.0-dev.2.2.0.111723
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/.editorconfig +7 -0
- package/.eslintrc.js +17 -0
- package/.vscode/launch.json +14 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/api-extractor.json +12 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/packageVersion.d.ts +9 -0
- package/dist/packageVersion.d.ts.map +1 -0
- package/dist/packageVersion.js +12 -0
- package/dist/packageVersion.js.map +1 -0
- package/dist/sequenceFactory.d.ts +95 -0
- package/dist/sequenceFactory.d.ts.map +1 -0
- package/dist/sequenceFactory.js +152 -0
- package/dist/sequenceFactory.js.map +1 -0
- package/dist/sharedNumberSequence.d.ts +50 -0
- package/dist/sharedNumberSequence.d.ts.map +1 -0
- package/dist/sharedNumberSequence.js +67 -0
- package/dist/sharedNumberSequence.js.map +1 -0
- package/dist/sharedObjectSequence.d.ts +50 -0
- package/dist/sharedObjectSequence.d.ts.map +1 -0
- package/dist/sharedObjectSequence.js +61 -0
- package/dist/sharedObjectSequence.js.map +1 -0
- package/dist/sparsematrix.d.ts +152 -0
- package/dist/sparsematrix.d.ts.map +1 -0
- package/dist/sparsematrix.js +345 -0
- package/dist/sparsematrix.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/packageVersion.d.ts +9 -0
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/packageVersion.js +9 -0
- package/lib/packageVersion.js.map +1 -0
- package/lib/sequenceFactory.d.ts +95 -0
- package/lib/sequenceFactory.d.ts.map +1 -0
- package/lib/sequenceFactory.js +147 -0
- package/lib/sequenceFactory.js.map +1 -0
- package/lib/sharedNumberSequence.d.ts +50 -0
- package/lib/sharedNumberSequence.d.ts.map +1 -0
- package/lib/sharedNumberSequence.js +63 -0
- package/lib/sharedNumberSequence.js.map +1 -0
- package/lib/sharedObjectSequence.d.ts +50 -0
- package/lib/sharedObjectSequence.d.ts.map +1 -0
- package/lib/sharedObjectSequence.js +57 -0
- package/lib/sharedObjectSequence.js.map +1 -0
- package/lib/sparsematrix.d.ts +152 -0
- package/lib/sparsematrix.d.ts.map +1 -0
- package/lib/sparsematrix.js +336 -0
- package/lib/sparsematrix.js.map +1 -0
- package/package.json +97 -0
- package/src/index.ts +22 -0
- package/src/packageVersion.ts +9 -0
- package/src/sequenceFactory.ts +181 -0
- package/src/sharedNumberSequence.ts +68 -0
- package/src/sharedObjectSequence.ts +62 -0
- package/src/sparsematrix.ts +434 -0
- package/tsconfig.esnext.json +7 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const pkgName = "@fluid-experimental/sequence-deprecated";
|
|
9
|
+
export const pkgVersion = "2.0.0-dev.2.2.0.111723";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
IChannelAttributes,
|
|
8
|
+
IFluidDataStoreRuntime,
|
|
9
|
+
IChannelServices,
|
|
10
|
+
IChannelFactory,
|
|
11
|
+
} from "@fluidframework/datastore-definitions";
|
|
12
|
+
import {
|
|
13
|
+
IJSONSegment,
|
|
14
|
+
} from "@fluidframework/merge-tree";
|
|
15
|
+
import { ISharedObject } from "@fluidframework/shared-object-base";
|
|
16
|
+
import { IJSONRunSegment, SubSequence } from "@fluidframework/sequence";
|
|
17
|
+
import { pkgVersion } from "./packageVersion";
|
|
18
|
+
import { SharedNumberSequence } from "./sharedNumberSequence";
|
|
19
|
+
import { SharedObjectSequence } from "./sharedObjectSequence";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
23
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
24
|
+
*/
|
|
25
|
+
export class SharedObjectSequenceFactory implements IChannelFactory {
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
28
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
29
|
+
*/
|
|
30
|
+
public static Type = "https://graph.microsoft.com/types/mergeTree/object-sequence";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
34
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
35
|
+
*/
|
|
36
|
+
public static readonly Attributes: IChannelAttributes = {
|
|
37
|
+
type: SharedObjectSequenceFactory.Type,
|
|
38
|
+
snapshotFormatVersion: "0.1",
|
|
39
|
+
packageVersion: pkgVersion,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
44
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
45
|
+
*/
|
|
46
|
+
public static segmentFromSpec(segSpec: IJSONSegment): SubSequence<object> {
|
|
47
|
+
const runSegment = segSpec as IJSONRunSegment<object>;
|
|
48
|
+
if (runSegment.items) {
|
|
49
|
+
const seg = new SubSequence<object>(runSegment.items);
|
|
50
|
+
if (runSegment.props) {
|
|
51
|
+
seg.addProperties(runSegment.props);
|
|
52
|
+
}
|
|
53
|
+
return seg;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
throw new Error(`Unrecognized IJSONObject`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
61
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
62
|
+
*/
|
|
63
|
+
public get type() {
|
|
64
|
+
return SharedObjectSequenceFactory.Type;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
69
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
70
|
+
*/
|
|
71
|
+
public get attributes() {
|
|
72
|
+
return SharedObjectSequenceFactory.Attributes;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
77
|
+
*
|
|
78
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
79
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
80
|
+
*/
|
|
81
|
+
public async load(
|
|
82
|
+
runtime: IFluidDataStoreRuntime,
|
|
83
|
+
id: string,
|
|
84
|
+
services: IChannelServices,
|
|
85
|
+
attributes: IChannelAttributes): Promise<ISharedObject> {
|
|
86
|
+
const sharedSeq = new SharedObjectSequence<object>(runtime, id, attributes);
|
|
87
|
+
await sharedSeq.load(services);
|
|
88
|
+
return sharedSeq;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
93
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
94
|
+
*/
|
|
95
|
+
public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {
|
|
96
|
+
const sharedString = new SharedObjectSequence(document, id, this.attributes);
|
|
97
|
+
sharedString.initializeLocal();
|
|
98
|
+
return sharedString;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
104
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
105
|
+
*/
|
|
106
|
+
export class SharedNumberSequenceFactory implements IChannelFactory {
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
109
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
110
|
+
*/
|
|
111
|
+
public static Type = "https://graph.microsoft.com/types/mergeTree/number-sequence";
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
115
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
116
|
+
*/
|
|
117
|
+
public static readonly Attributes: IChannelAttributes = {
|
|
118
|
+
type: SharedNumberSequenceFactory.Type,
|
|
119
|
+
snapshotFormatVersion: "0.1",
|
|
120
|
+
packageVersion: pkgVersion,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
125
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
126
|
+
*/
|
|
127
|
+
public static segmentFromSpec(segSpec: IJSONSegment): SubSequence<number> {
|
|
128
|
+
const runSegment = segSpec as IJSONRunSegment<number>;
|
|
129
|
+
if (runSegment.items) {
|
|
130
|
+
const seg = new SubSequence<number>(runSegment.items);
|
|
131
|
+
if (runSegment.props) {
|
|
132
|
+
seg.addProperties(runSegment.props);
|
|
133
|
+
}
|
|
134
|
+
return seg;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
throw new Error(`Unrecognized IJSONObject`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
142
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
143
|
+
*/
|
|
144
|
+
public get type() {
|
|
145
|
+
return SharedNumberSequenceFactory.Type;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
150
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
151
|
+
*/
|
|
152
|
+
public get attributes() {
|
|
153
|
+
return SharedNumberSequenceFactory.Attributes;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
158
|
+
*
|
|
159
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
160
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
161
|
+
*/
|
|
162
|
+
public async load(
|
|
163
|
+
runtime: IFluidDataStoreRuntime,
|
|
164
|
+
id: string,
|
|
165
|
+
services: IChannelServices,
|
|
166
|
+
attributes: IChannelAttributes): Promise<ISharedObject> {
|
|
167
|
+
const sharedSeq = new SharedNumberSequence(runtime, id, attributes);
|
|
168
|
+
await sharedSeq.load(services);
|
|
169
|
+
return sharedSeq;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
174
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
175
|
+
*/
|
|
176
|
+
public create(document: IFluidDataStoreRuntime, id: string): ISharedObject {
|
|
177
|
+
const sharedString = new SharedNumberSequence(document, id, this.attributes);
|
|
178
|
+
sharedString.initializeLocal();
|
|
179
|
+
return sharedString;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { IFluidDataStoreRuntime, IChannelAttributes } from "@fluidframework/datastore-definitions";
|
|
7
|
+
import { SharedSequence } from "@fluidframework/sequence";
|
|
8
|
+
import { SharedNumberSequenceFactory } from "./sequenceFactory";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The SharedNumberSequence holds a sequence of numbers. Each number will be stored
|
|
12
|
+
* at a position within the sequence. See the
|
|
13
|
+
* {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}
|
|
14
|
+
* for details on working with sequences.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
17
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
18
|
+
*/
|
|
19
|
+
export class SharedNumberSequence extends SharedSequence<number> {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new shared number sequence
|
|
22
|
+
*
|
|
23
|
+
* @param runtime - data store runtime the new shared number sequence belongs to
|
|
24
|
+
* @param id - optional name of the shared number sequence
|
|
25
|
+
* @returns newly create shared number sequence (but not attached yet)
|
|
26
|
+
*
|
|
27
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
28
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
29
|
+
*/
|
|
30
|
+
public static create(runtime: IFluidDataStoreRuntime, id?: string) {
|
|
31
|
+
return runtime.createChannel(id,
|
|
32
|
+
SharedNumberSequenceFactory.Type) as SharedNumberSequence;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get a factory for SharedNumberSequence to register with the data store.
|
|
37
|
+
*
|
|
38
|
+
* @returns a factory that creates and load SharedNumberSequence
|
|
39
|
+
*
|
|
40
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
41
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
42
|
+
*/
|
|
43
|
+
public static getFactory() {
|
|
44
|
+
return new SharedNumberSequenceFactory();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
49
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
50
|
+
*/
|
|
51
|
+
constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {
|
|
52
|
+
super(document, id, attributes, (spec) => {
|
|
53
|
+
const segment = SharedNumberSequenceFactory.segmentFromSpec(spec);
|
|
54
|
+
if (!segment) {
|
|
55
|
+
throw new Error("expected `spec` to be valid `ISegment`");
|
|
56
|
+
}
|
|
57
|
+
return segment;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated SharedNumberSequence is not recommended for use and will be removed in an upcoming release.
|
|
63
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
64
|
+
*/
|
|
65
|
+
public getRange(start: number, end?: number) {
|
|
66
|
+
return this.getItems(start, end);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { IFluidDataStoreRuntime, IChannelAttributes, Serializable } from "@fluidframework/datastore-definitions";
|
|
7
|
+
import { SharedSequence } from "@fluidframework/sequence";
|
|
8
|
+
import { SharedObjectSequenceFactory } from "./sequenceFactory";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The SharedObjectSequence holds a sequence of serializable objects. Each object will be stored
|
|
12
|
+
* at a position within the sequence. See the
|
|
13
|
+
* {@link https://fluidframework.com/docs/data-structures/sequences/ | sequence documentation}
|
|
14
|
+
* for details on working with sequences.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
17
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
18
|
+
*/
|
|
19
|
+
export class SharedObjectSequence<T> extends SharedSequence<T> {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new shared object sequence
|
|
22
|
+
*
|
|
23
|
+
* @param runtime - data store runtime the new shared object sequence belongs to
|
|
24
|
+
* @param id - optional name of the shared object sequence
|
|
25
|
+
* @returns newly create shared object sequence (but not attached yet)
|
|
26
|
+
*
|
|
27
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
28
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
public static create<T>(runtime: IFluidDataStoreRuntime, id?: string) {
|
|
32
|
+
return runtime.createChannel(id, SharedObjectSequenceFactory.Type) as SharedObjectSequence<T>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get a factory for SharedObjectSequence to register with the data store.
|
|
37
|
+
*
|
|
38
|
+
* @returns a factory that creates and load SharedObjectSequence
|
|
39
|
+
*
|
|
40
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
41
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
42
|
+
*/
|
|
43
|
+
public static getFactory() {
|
|
44
|
+
return new SharedObjectSequenceFactory();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
49
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
50
|
+
*/
|
|
51
|
+
constructor(document: IFluidDataStoreRuntime, public id: string, attributes: IChannelAttributes) {
|
|
52
|
+
super(document, id, attributes, SharedObjectSequenceFactory.segmentFromSpec as any);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
57
|
+
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
58
|
+
*/
|
|
59
|
+
public getRange(start: number, end?: number): Serializable<T>[] {
|
|
60
|
+
return this.getItems(start, end);
|
|
61
|
+
}
|
|
62
|
+
}
|