@fluidframework/map 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1
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/{.eslintrc.js → .eslintrc.cjs} +10 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +11 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/map.api.md +14 -57
- package/dist/directory.d.ts +10 -50
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +76 -164
- package/dist/directory.js.map +1 -1
- package/dist/index.d.ts +45 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -8
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/internalInterfaces.d.ts +2 -2
- package/dist/internalInterfaces.d.ts.map +1 -1
- package/dist/internalInterfaces.js.map +1 -1
- package/dist/localValues.d.ts +3 -5
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js +9 -8
- package/dist/localValues.js.map +1 -1
- package/dist/map-alpha.d.ts +31 -116
- package/dist/map-beta.d.ts +24 -105
- package/dist/map-public.d.ts +24 -105
- package/dist/map-untrimmed.d.ts +31 -116
- package/dist/map.d.ts +4 -23
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +6 -29
- package/dist/map.js.map +1 -1
- package/dist/mapKernel.d.ts +3 -4
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +30 -35
- package/dist/mapKernel.js.map +1 -1
- package/dist/package.json +3 -0
- 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/{directory.d.mts → directory.d.ts} +11 -51
- package/lib/directory.d.ts.map +1 -0
- package/lib/{directory.mjs → directory.js} +77 -165
- package/lib/directory.js.map +1 -0
- package/lib/index.d.ts +61 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +55 -0
- package/lib/index.js.map +1 -0
- package/lib/{interfaces.d.mts → interfaces.d.ts} +1 -1
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/{interfaces.mjs → interfaces.js} +1 -1
- package/lib/interfaces.js.map +1 -0
- package/lib/{internalInterfaces.d.mts → internalInterfaces.d.ts} +3 -3
- package/lib/internalInterfaces.d.ts.map +1 -0
- package/lib/{internalInterfaces.mjs → internalInterfaces.js} +1 -1
- package/lib/internalInterfaces.js.map +1 -0
- package/lib/{localValues.d.mts → localValues.d.ts} +4 -6
- package/lib/localValues.d.ts.map +1 -0
- package/lib/{localValues.mjs → localValues.js} +10 -9
- package/lib/localValues.js.map +1 -0
- package/lib/{map-alpha.d.mts → map-alpha.d.ts} +43 -116
- package/lib/{map-beta.d.mts → map-beta.d.ts} +36 -105
- package/lib/{map-public.d.mts → map-public.d.ts} +36 -105
- package/lib/{map-untrimmed.d.mts → map-untrimmed.d.ts} +43 -116
- package/lib/{map.d.mts → map.d.ts} +5 -24
- package/lib/map.d.ts.map +1 -0
- package/lib/{map.mjs → map.js} +5 -28
- package/lib/map.js.map +1 -0
- package/lib/{mapKernel.d.mts → mapKernel.d.ts} +4 -5
- package/lib/mapKernel.d.ts.map +1 -0
- package/lib/{mapKernel.mjs → mapKernel.js} +32 -37
- package/lib/mapKernel.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/test/memory/directory.spec.js +71 -0
- package/lib/test/memory/directory.spec.js.map +1 -0
- package/lib/test/memory/map.spec.js +71 -0
- package/lib/test/memory/map.spec.js.map +1 -0
- package/lib/test/mocha/directory.order.spec.js +422 -0
- package/lib/test/mocha/directory.order.spec.js.map +1 -0
- package/lib/test/mocha/directory.snapshot.spec.js +111 -0
- package/lib/test/mocha/directory.snapshot.spec.js.map +1 -0
- package/lib/test/mocha/directory.spec.js +1406 -0
- package/lib/test/mocha/directory.spec.js.map +1 -0
- package/lib/test/mocha/directoryEquivalenceUtils.js +36 -0
- package/lib/test/mocha/directoryEquivalenceUtils.js.map +1 -0
- package/lib/test/mocha/directoryFuzzTests.spec.js +337 -0
- package/lib/test/mocha/directoryFuzzTests.spec.js.map +1 -0
- package/lib/test/mocha/dirname.cjs +16 -0
- package/lib/test/mocha/dirname.cjs.map +1 -0
- package/lib/test/mocha/map.fuzz.spec.js +114 -0
- package/lib/test/mocha/map.fuzz.spec.js.map +1 -0
- package/lib/test/mocha/map.spec.js +685 -0
- package/lib/test/mocha/map.spec.js.map +1 -0
- package/lib/test/mocha/rebasing.spec.js +158 -0
- package/lib/test/mocha/rebasing.spec.js.map +1 -0
- package/lib/test/mocha/reconnection.spec.js +327 -0
- package/lib/test/mocha/reconnection.spec.js.map +1 -0
- package/lib/test/types/validateMapPrevious.generated.js +66 -0
- package/lib/test/types/validateMapPrevious.generated.js.map +1 -0
- package/package.json +55 -52
- package/src/directory.ts +122 -217
- package/src/index.ts +57 -4
- package/src/interfaces.ts +2 -2
- package/src/internalInterfaces.ts +2 -2
- package/src/localValues.ts +14 -9
- package/src/map.ts +7 -32
- package/src/mapKernel.ts +40 -42
- package/src/packageVersion.ts +1 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/directory.d.mts.map +0 -1
- package/lib/directory.mjs.map +0 -1
- package/lib/index.d.mts +0 -9
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -8
- package/lib/index.mjs.map +0 -1
- package/lib/interfaces.d.mts.map +0 -1
- package/lib/interfaces.mjs.map +0 -1
- package/lib/internalInterfaces.d.mts.map +0 -1
- package/lib/internalInterfaces.mjs.map +0 -1
- package/lib/localValues.d.mts.map +0 -1
- package/lib/localValues.mjs.map +0 -1
- package/lib/map.d.mts.map +0 -1
- package/lib/map.mjs.map +0 -1
- package/lib/mapKernel.d.mts.map +0 -1
- package/lib/mapKernel.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
package/dist/map-beta.d.ts
CHANGED
|
@@ -154,7 +154,12 @@ export declare interface IValueChanged {
|
|
|
154
154
|
* @public
|
|
155
155
|
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
156
156
|
*/
|
|
157
|
-
export declare
|
|
157
|
+
export declare const SharedMap: {
|
|
158
|
+
/**
|
|
159
|
+
* Get a factory for SharedMap to register with the data store.
|
|
160
|
+
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
161
|
+
*/
|
|
162
|
+
getFactory(): IChannelFactory<ISharedMap>;
|
|
158
163
|
/**
|
|
159
164
|
* Create a new shared map.
|
|
160
165
|
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
@@ -167,110 +172,24 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
167
172
|
* ```typescript
|
|
168
173
|
* const myMap = SharedMap.create(this.runtime, id);
|
|
169
174
|
* ```
|
|
175
|
+
* @privateRemarks
|
|
176
|
+
* TODO:
|
|
177
|
+
* Clarify how this differs from `MapFactory.create`.
|
|
178
|
+
* They are different since making this forward to MapFactory.create breaks some things,
|
|
179
|
+
* but the difference is unclear from the documentation.
|
|
170
180
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
private readonly kernel;
|
|
185
|
-
/**
|
|
186
|
-
* Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.
|
|
187
|
-
*
|
|
188
|
-
* @param id - String identifier.
|
|
189
|
-
* @param runtime - Data store runtime.
|
|
190
|
-
* @param attributes - The attributes for the map.
|
|
191
|
-
*/
|
|
192
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
193
|
-
/**
|
|
194
|
-
* Get an iterator over the keys in this map.
|
|
195
|
-
* @returns The iterator
|
|
196
|
-
*/
|
|
197
|
-
keys(): IterableIterator<string>;
|
|
198
|
-
/**
|
|
199
|
-
* Get an iterator over the entries in this map.
|
|
200
|
-
* @returns The iterator
|
|
201
|
-
*/
|
|
202
|
-
entries(): IterableIterator<[string, any]>;
|
|
203
|
-
/**
|
|
204
|
-
* Get an iterator over the values in this map.
|
|
205
|
-
* @returns The iterator
|
|
206
|
-
*/
|
|
207
|
-
values(): IterableIterator<any>;
|
|
208
|
-
/**
|
|
209
|
-
* Get an iterator over the entries in this map.
|
|
210
|
-
* @returns The iterator
|
|
211
|
-
*/
|
|
212
|
-
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
213
|
-
/**
|
|
214
|
-
* The number of key/value pairs stored in the map.
|
|
215
|
-
*/
|
|
216
|
-
get size(): number;
|
|
217
|
-
/**
|
|
218
|
-
* Executes the given callback on each entry in the map.
|
|
219
|
-
* @param callbackFn - Callback function
|
|
220
|
-
*/
|
|
221
|
-
forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
|
|
222
|
-
/**
|
|
223
|
-
* {@inheritDoc ISharedMap.get}
|
|
224
|
-
*/
|
|
225
|
-
get<T = any>(key: string): T | undefined;
|
|
226
|
-
/**
|
|
227
|
-
* Check if a key exists in the map.
|
|
228
|
-
* @param key - The key to check
|
|
229
|
-
* @returns True if the key exists, false otherwise
|
|
230
|
-
*/
|
|
231
|
-
has(key: string): boolean;
|
|
232
|
-
/**
|
|
233
|
-
* {@inheritDoc ISharedMap.set}
|
|
234
|
-
*/
|
|
235
|
-
set(key: string, value: unknown): this;
|
|
236
|
-
/**
|
|
237
|
-
* Delete a key from the map.
|
|
238
|
-
* @param key - Key to delete
|
|
239
|
-
* @returns True if the key existed and was deleted, false if it did not exist
|
|
240
|
-
*/
|
|
241
|
-
delete(key: string): boolean;
|
|
242
|
-
/**
|
|
243
|
-
* Clear all data from the map.
|
|
244
|
-
*/
|
|
245
|
-
clear(): void;
|
|
246
|
-
/**
|
|
247
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
248
|
-
*/
|
|
249
|
-
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
250
|
-
/**
|
|
251
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
252
|
-
*/
|
|
253
|
-
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
254
|
-
/**
|
|
255
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
256
|
-
*/
|
|
257
|
-
protected onDisconnect(): void;
|
|
258
|
-
/**
|
|
259
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
260
|
-
*/
|
|
261
|
-
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
262
|
-
/**
|
|
263
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
264
|
-
*/
|
|
265
|
-
protected applyStashedOp(content: unknown): unknown;
|
|
266
|
-
/**
|
|
267
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
268
|
-
*/
|
|
269
|
-
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
270
|
-
/**
|
|
271
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
272
|
-
*/
|
|
273
|
-
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
274
|
-
}
|
|
181
|
+
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* {@inheritDoc ISharedMap}
|
|
186
|
+
* @public
|
|
187
|
+
* @deprecated Use ISharedMap instead.
|
|
188
|
+
* @privateRemarks
|
|
189
|
+
* This alias is for legacy compat from when the SharedMap class was exported as public.
|
|
190
|
+
*/
|
|
191
|
+
export declare type SharedMap = ISharedMap;
|
|
192
|
+
|
|
193
|
+
/* Excluded from this release type: SharedObject */
|
|
275
194
|
|
|
276
195
|
export { }
|
package/dist/map-public.d.ts
CHANGED
|
@@ -154,7 +154,12 @@ export declare interface IValueChanged {
|
|
|
154
154
|
* @public
|
|
155
155
|
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
156
156
|
*/
|
|
157
|
-
export declare
|
|
157
|
+
export declare const SharedMap: {
|
|
158
|
+
/**
|
|
159
|
+
* Get a factory for SharedMap to register with the data store.
|
|
160
|
+
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
161
|
+
*/
|
|
162
|
+
getFactory(): IChannelFactory<ISharedMap>;
|
|
158
163
|
/**
|
|
159
164
|
* Create a new shared map.
|
|
160
165
|
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
@@ -167,110 +172,24 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
167
172
|
* ```typescript
|
|
168
173
|
* const myMap = SharedMap.create(this.runtime, id);
|
|
169
174
|
* ```
|
|
175
|
+
* @privateRemarks
|
|
176
|
+
* TODO:
|
|
177
|
+
* Clarify how this differs from `MapFactory.create`.
|
|
178
|
+
* They are different since making this forward to MapFactory.create breaks some things,
|
|
179
|
+
* but the difference is unclear from the documentation.
|
|
170
180
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
private readonly kernel;
|
|
185
|
-
/**
|
|
186
|
-
* Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.
|
|
187
|
-
*
|
|
188
|
-
* @param id - String identifier.
|
|
189
|
-
* @param runtime - Data store runtime.
|
|
190
|
-
* @param attributes - The attributes for the map.
|
|
191
|
-
*/
|
|
192
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
193
|
-
/**
|
|
194
|
-
* Get an iterator over the keys in this map.
|
|
195
|
-
* @returns The iterator
|
|
196
|
-
*/
|
|
197
|
-
keys(): IterableIterator<string>;
|
|
198
|
-
/**
|
|
199
|
-
* Get an iterator over the entries in this map.
|
|
200
|
-
* @returns The iterator
|
|
201
|
-
*/
|
|
202
|
-
entries(): IterableIterator<[string, any]>;
|
|
203
|
-
/**
|
|
204
|
-
* Get an iterator over the values in this map.
|
|
205
|
-
* @returns The iterator
|
|
206
|
-
*/
|
|
207
|
-
values(): IterableIterator<any>;
|
|
208
|
-
/**
|
|
209
|
-
* Get an iterator over the entries in this map.
|
|
210
|
-
* @returns The iterator
|
|
211
|
-
*/
|
|
212
|
-
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
213
|
-
/**
|
|
214
|
-
* The number of key/value pairs stored in the map.
|
|
215
|
-
*/
|
|
216
|
-
get size(): number;
|
|
217
|
-
/**
|
|
218
|
-
* Executes the given callback on each entry in the map.
|
|
219
|
-
* @param callbackFn - Callback function
|
|
220
|
-
*/
|
|
221
|
-
forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
|
|
222
|
-
/**
|
|
223
|
-
* {@inheritDoc ISharedMap.get}
|
|
224
|
-
*/
|
|
225
|
-
get<T = any>(key: string): T | undefined;
|
|
226
|
-
/**
|
|
227
|
-
* Check if a key exists in the map.
|
|
228
|
-
* @param key - The key to check
|
|
229
|
-
* @returns True if the key exists, false otherwise
|
|
230
|
-
*/
|
|
231
|
-
has(key: string): boolean;
|
|
232
|
-
/**
|
|
233
|
-
* {@inheritDoc ISharedMap.set}
|
|
234
|
-
*/
|
|
235
|
-
set(key: string, value: unknown): this;
|
|
236
|
-
/**
|
|
237
|
-
* Delete a key from the map.
|
|
238
|
-
* @param key - Key to delete
|
|
239
|
-
* @returns True if the key existed and was deleted, false if it did not exist
|
|
240
|
-
*/
|
|
241
|
-
delete(key: string): boolean;
|
|
242
|
-
/**
|
|
243
|
-
* Clear all data from the map.
|
|
244
|
-
*/
|
|
245
|
-
clear(): void;
|
|
246
|
-
/**
|
|
247
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
248
|
-
*/
|
|
249
|
-
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
250
|
-
/**
|
|
251
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
252
|
-
*/
|
|
253
|
-
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
254
|
-
/**
|
|
255
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
256
|
-
*/
|
|
257
|
-
protected onDisconnect(): void;
|
|
258
|
-
/**
|
|
259
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
260
|
-
*/
|
|
261
|
-
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
262
|
-
/**
|
|
263
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
264
|
-
*/
|
|
265
|
-
protected applyStashedOp(content: unknown): unknown;
|
|
266
|
-
/**
|
|
267
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
268
|
-
*/
|
|
269
|
-
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
270
|
-
/**
|
|
271
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
272
|
-
*/
|
|
273
|
-
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
274
|
-
}
|
|
181
|
+
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* {@inheritDoc ISharedMap}
|
|
186
|
+
* @public
|
|
187
|
+
* @deprecated Use ISharedMap instead.
|
|
188
|
+
* @privateRemarks
|
|
189
|
+
* This alias is for legacy compat from when the SharedMap class was exported as public.
|
|
190
|
+
*/
|
|
191
|
+
export declare type SharedMap = ISharedMap;
|
|
192
|
+
|
|
193
|
+
/* Excluded from this release type: SharedObject */
|
|
275
194
|
|
|
276
195
|
export { }
|
package/dist/map-untrimmed.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
|
|
|
34
34
|
* @sealed
|
|
35
35
|
* @alpha
|
|
36
36
|
*/
|
|
37
|
-
export declare class DirectoryFactory implements IChannelFactory {
|
|
37
|
+
export declare class DirectoryFactory implements IChannelFactory<ISharedDirectory> {
|
|
38
38
|
/**
|
|
39
39
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
40
40
|
*/
|
|
@@ -611,17 +611,15 @@ export declare interface IValueChanged {
|
|
|
611
611
|
* @alpha
|
|
612
612
|
*/
|
|
613
613
|
export declare class LocalValueMaker {
|
|
614
|
-
private readonly serializer;
|
|
615
614
|
/**
|
|
616
615
|
* Create a new LocalValueMaker.
|
|
617
|
-
* @param serializer - The serializer to serialize / parse handles.
|
|
618
616
|
*/
|
|
619
|
-
constructor(
|
|
617
|
+
constructor();
|
|
620
618
|
/**
|
|
621
619
|
* Create a new local value from an incoming serialized value.
|
|
622
620
|
* @param serializable - The serializable value to make local
|
|
623
621
|
*/
|
|
624
|
-
fromSerializable(serializable: ISerializableValue): ILocalValue;
|
|
622
|
+
fromSerializable(serializable: ISerializableValue, serializer: IFluidSerializer, bind: IFluidHandle): ILocalValue;
|
|
625
623
|
/**
|
|
626
624
|
* Create a new local value containing a given plain object.
|
|
627
625
|
* @param value - The value to store
|
|
@@ -631,12 +629,12 @@ export declare class LocalValueMaker {
|
|
|
631
629
|
}
|
|
632
630
|
|
|
633
631
|
/**
|
|
634
|
-
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link
|
|
632
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
|
|
635
633
|
*
|
|
636
634
|
* @sealed
|
|
637
635
|
* @alpha
|
|
638
636
|
*/
|
|
639
|
-
export declare class MapFactory implements IChannelFactory {
|
|
637
|
+
export declare class MapFactory implements IChannelFactory<ISharedMap> {
|
|
640
638
|
/**
|
|
641
639
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
642
640
|
*/
|
|
@@ -685,13 +683,13 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
685
683
|
* @param id - Optional name of the shared directory
|
|
686
684
|
* @returns Newly create shared directory (but not attached yet)
|
|
687
685
|
*/
|
|
688
|
-
static create(runtime: IFluidDataStoreRuntime, id?: string):
|
|
686
|
+
static create(runtime: IFluidDataStoreRuntime, id?: string): ISharedDirectory;
|
|
689
687
|
/**
|
|
690
688
|
* Get a factory for SharedDirectory to register with the data store.
|
|
691
689
|
*
|
|
692
690
|
* @returns A factory that creates and load SharedDirectory
|
|
693
691
|
*/
|
|
694
|
-
static getFactory(): IChannelFactory
|
|
692
|
+
static getFactory(): IChannelFactory<ISharedDirectory>;
|
|
695
693
|
/**
|
|
696
694
|
* String representation for the class.
|
|
697
695
|
*/
|
|
@@ -866,7 +864,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
866
864
|
/**
|
|
867
865
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
868
866
|
*/
|
|
869
|
-
protected applyStashedOp(op: unknown):
|
|
867
|
+
protected applyStashedOp(op: unknown): void;
|
|
870
868
|
private serializeDirectory;
|
|
871
869
|
}
|
|
872
870
|
|
|
@@ -875,7 +873,12 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
875
873
|
* @public
|
|
876
874
|
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
877
875
|
*/
|
|
878
|
-
export declare
|
|
876
|
+
export declare const SharedMap: {
|
|
877
|
+
/**
|
|
878
|
+
* Get a factory for SharedMap to register with the data store.
|
|
879
|
+
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
880
|
+
*/
|
|
881
|
+
getFactory(): IChannelFactory<ISharedMap>;
|
|
879
882
|
/**
|
|
880
883
|
* Create a new shared map.
|
|
881
884
|
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
@@ -888,110 +891,22 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
888
891
|
* ```typescript
|
|
889
892
|
* const myMap = SharedMap.create(this.runtime, id);
|
|
890
893
|
* ```
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
*
|
|
909
|
-
* @param id - String identifier.
|
|
910
|
-
* @param runtime - Data store runtime.
|
|
911
|
-
* @param attributes - The attributes for the map.
|
|
912
|
-
*/
|
|
913
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
914
|
-
/**
|
|
915
|
-
* Get an iterator over the keys in this map.
|
|
916
|
-
* @returns The iterator
|
|
917
|
-
*/
|
|
918
|
-
keys(): IterableIterator<string>;
|
|
919
|
-
/**
|
|
920
|
-
* Get an iterator over the entries in this map.
|
|
921
|
-
* @returns The iterator
|
|
922
|
-
*/
|
|
923
|
-
entries(): IterableIterator<[string, any]>;
|
|
924
|
-
/**
|
|
925
|
-
* Get an iterator over the values in this map.
|
|
926
|
-
* @returns The iterator
|
|
927
|
-
*/
|
|
928
|
-
values(): IterableIterator<any>;
|
|
929
|
-
/**
|
|
930
|
-
* Get an iterator over the entries in this map.
|
|
931
|
-
* @returns The iterator
|
|
932
|
-
*/
|
|
933
|
-
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
934
|
-
/**
|
|
935
|
-
* The number of key/value pairs stored in the map.
|
|
936
|
-
*/
|
|
937
|
-
get size(): number;
|
|
938
|
-
/**
|
|
939
|
-
* Executes the given callback on each entry in the map.
|
|
940
|
-
* @param callbackFn - Callback function
|
|
941
|
-
*/
|
|
942
|
-
forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
|
|
943
|
-
/**
|
|
944
|
-
* {@inheritDoc ISharedMap.get}
|
|
945
|
-
*/
|
|
946
|
-
get<T = any>(key: string): T | undefined;
|
|
947
|
-
/**
|
|
948
|
-
* Check if a key exists in the map.
|
|
949
|
-
* @param key - The key to check
|
|
950
|
-
* @returns True if the key exists, false otherwise
|
|
951
|
-
*/
|
|
952
|
-
has(key: string): boolean;
|
|
953
|
-
/**
|
|
954
|
-
* {@inheritDoc ISharedMap.set}
|
|
955
|
-
*/
|
|
956
|
-
set(key: string, value: unknown): this;
|
|
957
|
-
/**
|
|
958
|
-
* Delete a key from the map.
|
|
959
|
-
* @param key - Key to delete
|
|
960
|
-
* @returns True if the key existed and was deleted, false if it did not exist
|
|
961
|
-
*/
|
|
962
|
-
delete(key: string): boolean;
|
|
963
|
-
/**
|
|
964
|
-
* Clear all data from the map.
|
|
965
|
-
*/
|
|
966
|
-
clear(): void;
|
|
967
|
-
/**
|
|
968
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
969
|
-
*/
|
|
970
|
-
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
971
|
-
/**
|
|
972
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
973
|
-
*/
|
|
974
|
-
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
975
|
-
/**
|
|
976
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
977
|
-
*/
|
|
978
|
-
protected onDisconnect(): void;
|
|
979
|
-
/**
|
|
980
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
981
|
-
*/
|
|
982
|
-
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
983
|
-
/**
|
|
984
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
985
|
-
*/
|
|
986
|
-
protected applyStashedOp(content: unknown): unknown;
|
|
987
|
-
/**
|
|
988
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
989
|
-
*/
|
|
990
|
-
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
991
|
-
/**
|
|
992
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
993
|
-
*/
|
|
994
|
-
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
995
|
-
}
|
|
894
|
+
* @privateRemarks
|
|
895
|
+
* TODO:
|
|
896
|
+
* Clarify how this differs from `MapFactory.create`.
|
|
897
|
+
* They are different since making this forward to MapFactory.create breaks some things,
|
|
898
|
+
* but the difference is unclear from the documentation.
|
|
899
|
+
*/
|
|
900
|
+
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* {@inheritDoc ISharedMap}
|
|
905
|
+
* @public
|
|
906
|
+
* @deprecated Use ISharedMap instead.
|
|
907
|
+
* @privateRemarks
|
|
908
|
+
* This alias is for legacy compat from when the SharedMap class was exported as public.
|
|
909
|
+
*/
|
|
910
|
+
export declare type SharedMap = ISharedMap;
|
|
996
911
|
|
|
997
912
|
export { }
|
package/dist/map.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
|
|
|
6
6
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannelServices, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
7
|
import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
8
8
|
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
|
|
9
|
-
import { ISharedMap, ISharedMapEvents } from "./interfaces";
|
|
9
|
+
import { ISharedMap, ISharedMapEvents } from "./interfaces.js";
|
|
10
10
|
/**
|
|
11
|
-
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link
|
|
11
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
|
|
12
12
|
*
|
|
13
13
|
* @sealed
|
|
14
14
|
* @alpha
|
|
15
15
|
*/
|
|
16
|
-
export declare class MapFactory implements IChannelFactory {
|
|
16
|
+
export declare class MapFactory implements IChannelFactory<ISharedMap> {
|
|
17
17
|
/**
|
|
18
18
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
19
19
|
*/
|
|
@@ -45,25 +45,6 @@ export declare class MapFactory implements IChannelFactory {
|
|
|
45
45
|
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
46
46
|
*/
|
|
47
47
|
export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
|
|
48
|
-
/**
|
|
49
|
-
* Create a new shared map.
|
|
50
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
51
|
-
* @param id - Optional name of the shared map.
|
|
52
|
-
* @returns Newly created shared map.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* To create a `SharedMap`, call the static create method:
|
|
56
|
-
*
|
|
57
|
-
* ```typescript
|
|
58
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap;
|
|
62
|
-
/**
|
|
63
|
-
* Get a factory for SharedMap to register with the data store.
|
|
64
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
65
|
-
*/
|
|
66
|
-
static getFactory(): IChannelFactory;
|
|
67
48
|
/**
|
|
68
49
|
* String representation for the class.
|
|
69
50
|
*/
|
|
@@ -152,7 +133,7 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
152
133
|
/**
|
|
153
134
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
154
135
|
*/
|
|
155
|
-
protected applyStashedOp(content: unknown):
|
|
136
|
+
protected applyStashedOp(content: unknown): void;
|
|
156
137
|
/**
|
|
157
138
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
158
139
|
*/
|
package/dist/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe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AAI;IAUP;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;CAGpE"}
|
package/dist/map.js
CHANGED
|
@@ -10,11 +10,11 @@ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
|
10
10
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
11
11
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
12
12
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const mapKernel_js_1 = require("./mapKernel.js");
|
|
14
|
+
const packageVersion_js_1 = require("./packageVersion.js");
|
|
15
15
|
const snapshotFileName = "header";
|
|
16
16
|
/**
|
|
17
|
-
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link
|
|
17
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
|
|
18
18
|
*
|
|
19
19
|
* @sealed
|
|
20
20
|
* @alpha
|
|
@@ -60,7 +60,7 @@ MapFactory.Type = "https://graph.microsoft.com/types/map";
|
|
|
60
60
|
MapFactory.Attributes = {
|
|
61
61
|
type: MapFactory.Type,
|
|
62
62
|
snapshotFormatVersion: "0.2",
|
|
63
|
-
packageVersion:
|
|
63
|
+
packageVersion: packageVersion_js_1.pkgVersion,
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* {@inheritDoc ISharedMap}
|
|
@@ -68,29 +68,6 @@ MapFactory.Attributes = {
|
|
|
68
68
|
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
69
69
|
*/
|
|
70
70
|
class SharedMap extends shared_object_base_1.SharedObject {
|
|
71
|
-
/**
|
|
72
|
-
* Create a new shared map.
|
|
73
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
74
|
-
* @param id - Optional name of the shared map.
|
|
75
|
-
* @returns Newly created shared map.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* To create a `SharedMap`, call the static create method:
|
|
79
|
-
*
|
|
80
|
-
* ```typescript
|
|
81
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
static create(runtime, id) {
|
|
85
|
-
return runtime.createChannel(id, MapFactory.Type);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get a factory for SharedMap to register with the data store.
|
|
89
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
90
|
-
*/
|
|
91
|
-
static getFactory() {
|
|
92
|
-
return new MapFactory();
|
|
93
|
-
}
|
|
94
71
|
/**
|
|
95
72
|
* Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.
|
|
96
73
|
*
|
|
@@ -104,7 +81,7 @@ class SharedMap extends shared_object_base_1.SharedObject {
|
|
|
104
81
|
* String representation for the class.
|
|
105
82
|
*/
|
|
106
83
|
this[_a] = "SharedMap";
|
|
107
|
-
this.kernel = new
|
|
84
|
+
this.kernel = new mapKernel_js_1.MapKernel(this.serializer, this.handle, (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata), () => this.isAttached(), this);
|
|
108
85
|
}
|
|
109
86
|
/**
|
|
110
87
|
* Get an iterator over the keys in this map.
|
|
@@ -291,7 +268,7 @@ class SharedMap extends shared_object_base_1.SharedObject {
|
|
|
291
268
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
292
269
|
*/
|
|
293
270
|
applyStashedOp(content) {
|
|
294
|
-
|
|
271
|
+
this.kernel.tryApplyStashedOp(content);
|
|
295
272
|
}
|
|
296
273
|
/**
|
|
297
274
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|