fluid-framework 2.0.0-dev-rc.2.0.0.245554 → 2.0.0-dev-rc.3.0.0.250606
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/api-report/fluid-framework.api.md +7 -21
- package/dist/fluid-framework-alpha.d.ts +10 -68
- package/dist/fluid-framework-beta.d.ts +10 -68
- package/dist/fluid-framework-public.d.ts +10 -68
- package/dist/fluid-framework-untrimmed.d.ts +10 -68
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/lib/fluid-framework-alpha.d.ts +10 -68
- package/lib/fluid-framework-beta.d.ts +10 -68
- package/lib/fluid-framework-public.d.ts +10 -68
- package/lib/fluid-framework-untrimmed.d.ts +10 -68
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +16 -13
- package/src/index.ts +0 -2
|
@@ -6,16 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
8
8
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import type { IErrorBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
12
11
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
14
|
-
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
15
13
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
16
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
17
15
|
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
18
16
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
17
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
19
18
|
|
|
20
19
|
// @public
|
|
21
20
|
export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
|
|
@@ -88,11 +87,11 @@ export interface ContainerSchema {
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
// @public
|
|
91
|
-
export type DataObjectClass<T extends IFluidLoadable> = {
|
|
90
|
+
export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
92
91
|
readonly factory: {
|
|
93
92
|
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
94
93
|
};
|
|
95
|
-
} &
|
|
94
|
+
} & (new (...args: any[]) => T);
|
|
96
95
|
|
|
97
96
|
// @public
|
|
98
97
|
export const disposeSymbol: unique symbol;
|
|
@@ -278,14 +277,11 @@ export interface IValueChanged {
|
|
|
278
277
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
279
278
|
|
|
280
279
|
// @public
|
|
281
|
-
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
280
|
+
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
282
281
|
|
|
283
282
|
// @public
|
|
284
283
|
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
285
284
|
|
|
286
|
-
// @public
|
|
287
|
-
export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
288
|
-
|
|
289
285
|
// @public
|
|
290
286
|
export interface MakeNominal {
|
|
291
287
|
}
|
|
@@ -366,23 +362,13 @@ export interface SchemaIncompatible {
|
|
|
366
362
|
export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
367
363
|
|
|
368
364
|
// @public @deprecated
|
|
369
|
-
export const SharedMap:
|
|
370
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
371
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
372
|
-
};
|
|
365
|
+
export const SharedMap: ISharedObjectKind<ISharedMap>;
|
|
373
366
|
|
|
374
367
|
// @public @deprecated
|
|
375
368
|
export type SharedMap = ISharedMap;
|
|
376
369
|
|
|
377
370
|
// @public
|
|
378
|
-
export
|
|
379
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// @public
|
|
383
|
-
export const SharedTree: {
|
|
384
|
-
getFactory(): IChannelFactory<ITree>;
|
|
385
|
-
};
|
|
371
|
+
export const SharedTree: ISharedObjectKind<ITree>;
|
|
386
372
|
|
|
387
373
|
// @public
|
|
388
374
|
export const Tree: TreeApi;
|
|
@@ -394,7 +380,7 @@ export interface TreeApi extends TreeNodeApi {
|
|
|
394
380
|
}
|
|
395
381
|
|
|
396
382
|
// @public
|
|
397
|
-
export interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends
|
|
383
|
+
export interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeArrayNodeBase<TreeNodeFromImplicitAllowedTypes<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>, TreeArrayNode> {
|
|
398
384
|
}
|
|
399
385
|
|
|
400
386
|
// @public
|
|
@@ -7,16 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
9
9
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
11
10
|
import type { IErrorBase } from '@fluidframework/core-interfaces';
|
|
12
11
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
|
-
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
14
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
17
15
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
18
16
|
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
19
17
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
18
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Types for use in fields.
|
|
@@ -230,11 +229,11 @@ export declare interface ContainerSchema {
|
|
|
230
229
|
* @typeParam T - The class of the `DataObject`.
|
|
231
230
|
* @public
|
|
232
231
|
*/
|
|
233
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
232
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
234
233
|
readonly factory: {
|
|
235
234
|
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
236
235
|
};
|
|
237
|
-
} &
|
|
236
|
+
} & (new (...args: any[]) => T);
|
|
238
237
|
|
|
239
238
|
/**
|
|
240
239
|
* Placeholder for `Symbol.dispose`.
|
|
@@ -968,10 +967,10 @@ export declare type LazyItem<Item = unknown> = Item | (() => Item);
|
|
|
968
967
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
969
968
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
970
969
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
971
|
-
* In this case placing
|
|
970
|
+
* In this case placing ISharedObjectKind fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
|
|
972
971
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
973
972
|
*/
|
|
974
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
973
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
975
974
|
|
|
976
975
|
/**
|
|
977
976
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -980,14 +979,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
980
979
|
*/
|
|
981
980
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
982
981
|
|
|
983
|
-
/**
|
|
984
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
985
|
-
*
|
|
986
|
-
* @typeParam T - The class of the loadable object.
|
|
987
|
-
* @public
|
|
988
|
-
*/
|
|
989
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
990
|
-
|
|
991
982
|
/**
|
|
992
983
|
* Utilities for manipulating the typescript typechecker.
|
|
993
984
|
*
|
|
@@ -1471,34 +1462,9 @@ export declare type ScopedSchemaName<TScope extends string | undefined, TName ex
|
|
|
1471
1462
|
/**
|
|
1472
1463
|
* {@inheritDoc ISharedMap}
|
|
1473
1464
|
* @public
|
|
1474
|
-
* @deprecated Please use SharedTree for new containers.
|
|
1465
|
+
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
1475
1466
|
*/
|
|
1476
|
-
export declare const SharedMap:
|
|
1477
|
-
/**
|
|
1478
|
-
* Get a factory for SharedMap to register with the data store.
|
|
1479
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
1480
|
-
*/
|
|
1481
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
1482
|
-
/**
|
|
1483
|
-
* Create a new shared map.
|
|
1484
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
1485
|
-
* @param id - Optional name of the shared map.
|
|
1486
|
-
* @returns Newly created shared map.
|
|
1487
|
-
*
|
|
1488
|
-
* @example
|
|
1489
|
-
* To create a `SharedMap`, call the static create method:
|
|
1490
|
-
*
|
|
1491
|
-
* ```typescript
|
|
1492
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
1493
|
-
* ```
|
|
1494
|
-
* @privateRemarks
|
|
1495
|
-
* TODO:
|
|
1496
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
1497
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
1498
|
-
* but the difference is unclear from the documentation.
|
|
1499
|
-
*/
|
|
1500
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
1501
|
-
};
|
|
1467
|
+
export declare const SharedMap: ISharedObjectKind<ISharedMap>;
|
|
1502
1468
|
|
|
1503
1469
|
/**
|
|
1504
1470
|
* {@inheritDoc ISharedMap}
|
|
@@ -1510,35 +1476,11 @@ export declare const SharedMap: {
|
|
|
1510
1476
|
export declare type SharedMap = ISharedMap;
|
|
1511
1477
|
|
|
1512
1478
|
/**
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
1516
|
-
* @public
|
|
1517
|
-
*/
|
|
1518
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
1519
|
-
/**
|
|
1520
|
-
* Gets the factory this factory is a wrapper for.
|
|
1521
|
-
*/
|
|
1522
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* SharedTree is a hierarchical data structure for collaboratively editing JSON-like trees
|
|
1479
|
+
* SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
|
|
1527
1480
|
* of objects, arrays, and other data types.
|
|
1528
|
-
*
|
|
1529
|
-
* @remarks
|
|
1530
|
-
* This implements {@link @fluidframework/fluid-static#SharedObjectClass}.
|
|
1531
|
-
* @privateRemarks
|
|
1532
|
-
* Due to the dependency structure and the placement of that interface SharedObjectClass,
|
|
1533
|
-
* this interface implementation can not be recorded in the type here.
|
|
1534
1481
|
* @public
|
|
1535
1482
|
*/
|
|
1536
|
-
export declare const SharedTree:
|
|
1537
|
-
/**
|
|
1538
|
-
* Gets the factory this factory is a wrapper for.
|
|
1539
|
-
*/
|
|
1540
|
-
getFactory(): IChannelFactory<ITree>;
|
|
1541
|
-
};
|
|
1483
|
+
export declare const SharedTree: ISharedObjectKind<ITree>;
|
|
1542
1484
|
|
|
1543
1485
|
/**
|
|
1544
1486
|
* The `Tree` object holds various functions for interacting with {@link TreeNode}s.
|
|
@@ -1595,7 +1537,7 @@ export declare interface TreeApi extends TreeNodeApi {
|
|
|
1595
1537
|
*
|
|
1596
1538
|
* @public
|
|
1597
1539
|
*/
|
|
1598
|
-
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends
|
|
1540
|
+
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeArrayNodeBase<TreeNodeFromImplicitAllowedTypes<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>, TreeArrayNode> {
|
|
1599
1541
|
}
|
|
1600
1542
|
|
|
1601
1543
|
/**
|
|
@@ -7,16 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
9
9
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
11
10
|
import type { IErrorBase } from '@fluidframework/core-interfaces';
|
|
12
11
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
|
-
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
14
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
17
15
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
18
16
|
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
19
17
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
18
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Types for use in fields.
|
|
@@ -209,11 +208,11 @@ export declare interface ContainerSchema {
|
|
|
209
208
|
* @typeParam T - The class of the `DataObject`.
|
|
210
209
|
* @public
|
|
211
210
|
*/
|
|
212
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
211
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
213
212
|
readonly factory: {
|
|
214
213
|
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
215
214
|
};
|
|
216
|
-
} &
|
|
215
|
+
} & (new (...args: any[]) => T);
|
|
217
216
|
|
|
218
217
|
/**
|
|
219
218
|
* Placeholder for `Symbol.dispose`.
|
|
@@ -947,10 +946,10 @@ export declare type LazyItem<Item = unknown> = Item | (() => Item);
|
|
|
947
946
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
948
947
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
949
948
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
950
|
-
* In this case placing
|
|
949
|
+
* In this case placing ISharedObjectKind fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
|
|
951
950
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
952
951
|
*/
|
|
953
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
952
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
954
953
|
|
|
955
954
|
/**
|
|
956
955
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -959,14 +958,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
959
958
|
*/
|
|
960
959
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
961
960
|
|
|
962
|
-
/**
|
|
963
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
964
|
-
*
|
|
965
|
-
* @typeParam T - The class of the loadable object.
|
|
966
|
-
* @public
|
|
967
|
-
*/
|
|
968
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
969
|
-
|
|
970
961
|
/**
|
|
971
962
|
* Utilities for manipulating the typescript typechecker.
|
|
972
963
|
*
|
|
@@ -1450,34 +1441,9 @@ export declare type ScopedSchemaName<TScope extends string | undefined, TName ex
|
|
|
1450
1441
|
/**
|
|
1451
1442
|
* {@inheritDoc ISharedMap}
|
|
1452
1443
|
* @public
|
|
1453
|
-
* @deprecated Please use SharedTree for new containers.
|
|
1444
|
+
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
1454
1445
|
*/
|
|
1455
|
-
export declare const SharedMap:
|
|
1456
|
-
/**
|
|
1457
|
-
* Get a factory for SharedMap to register with the data store.
|
|
1458
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
1459
|
-
*/
|
|
1460
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
1461
|
-
/**
|
|
1462
|
-
* Create a new shared map.
|
|
1463
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
1464
|
-
* @param id - Optional name of the shared map.
|
|
1465
|
-
* @returns Newly created shared map.
|
|
1466
|
-
*
|
|
1467
|
-
* @example
|
|
1468
|
-
* To create a `SharedMap`, call the static create method:
|
|
1469
|
-
*
|
|
1470
|
-
* ```typescript
|
|
1471
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
1472
|
-
* ```
|
|
1473
|
-
* @privateRemarks
|
|
1474
|
-
* TODO:
|
|
1475
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
1476
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
1477
|
-
* but the difference is unclear from the documentation.
|
|
1478
|
-
*/
|
|
1479
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
1480
|
-
};
|
|
1446
|
+
export declare const SharedMap: ISharedObjectKind<ISharedMap>;
|
|
1481
1447
|
|
|
1482
1448
|
/**
|
|
1483
1449
|
* {@inheritDoc ISharedMap}
|
|
@@ -1489,35 +1455,11 @@ export declare const SharedMap: {
|
|
|
1489
1455
|
export declare type SharedMap = ISharedMap;
|
|
1490
1456
|
|
|
1491
1457
|
/**
|
|
1492
|
-
*
|
|
1493
|
-
*
|
|
1494
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
1495
|
-
* @public
|
|
1496
|
-
*/
|
|
1497
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
1498
|
-
/**
|
|
1499
|
-
* Gets the factory this factory is a wrapper for.
|
|
1500
|
-
*/
|
|
1501
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
/**
|
|
1505
|
-
* SharedTree is a hierarchical data structure for collaboratively editing JSON-like trees
|
|
1458
|
+
* SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
|
|
1506
1459
|
* of objects, arrays, and other data types.
|
|
1507
|
-
*
|
|
1508
|
-
* @remarks
|
|
1509
|
-
* This implements {@link @fluidframework/fluid-static#SharedObjectClass}.
|
|
1510
|
-
* @privateRemarks
|
|
1511
|
-
* Due to the dependency structure and the placement of that interface SharedObjectClass,
|
|
1512
|
-
* this interface implementation can not be recorded in the type here.
|
|
1513
1460
|
* @public
|
|
1514
1461
|
*/
|
|
1515
|
-
export declare const SharedTree:
|
|
1516
|
-
/**
|
|
1517
|
-
* Gets the factory this factory is a wrapper for.
|
|
1518
|
-
*/
|
|
1519
|
-
getFactory(): IChannelFactory<ITree>;
|
|
1520
|
-
};
|
|
1462
|
+
export declare const SharedTree: ISharedObjectKind<ITree>;
|
|
1521
1463
|
|
|
1522
1464
|
/**
|
|
1523
1465
|
* The `Tree` object holds various functions for interacting with {@link TreeNode}s.
|
|
@@ -1574,7 +1516,7 @@ export declare interface TreeApi extends TreeNodeApi {
|
|
|
1574
1516
|
*
|
|
1575
1517
|
* @public
|
|
1576
1518
|
*/
|
|
1577
|
-
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends
|
|
1519
|
+
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeArrayNodeBase<TreeNodeFromImplicitAllowedTypes<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>, TreeArrayNode> {
|
|
1578
1520
|
}
|
|
1579
1521
|
|
|
1580
1522
|
/**
|
|
@@ -7,16 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
9
9
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
11
10
|
import type { IErrorBase } from '@fluidframework/core-interfaces';
|
|
12
11
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
|
-
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
14
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
17
15
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
18
16
|
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
19
17
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
18
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Types for use in fields.
|
|
@@ -209,11 +208,11 @@ export declare interface ContainerSchema {
|
|
|
209
208
|
* @typeParam T - The class of the `DataObject`.
|
|
210
209
|
* @public
|
|
211
210
|
*/
|
|
212
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
211
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
213
212
|
readonly factory: {
|
|
214
213
|
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
215
214
|
};
|
|
216
|
-
} &
|
|
215
|
+
} & (new (...args: any[]) => T);
|
|
217
216
|
|
|
218
217
|
/**
|
|
219
218
|
* Placeholder for `Symbol.dispose`.
|
|
@@ -947,10 +946,10 @@ export declare type LazyItem<Item = unknown> = Item | (() => Item);
|
|
|
947
946
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
948
947
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
949
948
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
950
|
-
* In this case placing
|
|
949
|
+
* In this case placing ISharedObjectKind fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
|
|
951
950
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
952
951
|
*/
|
|
953
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
952
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
954
953
|
|
|
955
954
|
/**
|
|
956
955
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -959,14 +958,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
959
958
|
*/
|
|
960
959
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
961
960
|
|
|
962
|
-
/**
|
|
963
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
964
|
-
*
|
|
965
|
-
* @typeParam T - The class of the loadable object.
|
|
966
|
-
* @public
|
|
967
|
-
*/
|
|
968
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
969
|
-
|
|
970
961
|
/**
|
|
971
962
|
* Utilities for manipulating the typescript typechecker.
|
|
972
963
|
*
|
|
@@ -1450,34 +1441,9 @@ export declare type ScopedSchemaName<TScope extends string | undefined, TName ex
|
|
|
1450
1441
|
/**
|
|
1451
1442
|
* {@inheritDoc ISharedMap}
|
|
1452
1443
|
* @public
|
|
1453
|
-
* @deprecated Please use SharedTree for new containers.
|
|
1444
|
+
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
1454
1445
|
*/
|
|
1455
|
-
export declare const SharedMap:
|
|
1456
|
-
/**
|
|
1457
|
-
* Get a factory for SharedMap to register with the data store.
|
|
1458
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
1459
|
-
*/
|
|
1460
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
1461
|
-
/**
|
|
1462
|
-
* Create a new shared map.
|
|
1463
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
1464
|
-
* @param id - Optional name of the shared map.
|
|
1465
|
-
* @returns Newly created shared map.
|
|
1466
|
-
*
|
|
1467
|
-
* @example
|
|
1468
|
-
* To create a `SharedMap`, call the static create method:
|
|
1469
|
-
*
|
|
1470
|
-
* ```typescript
|
|
1471
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
1472
|
-
* ```
|
|
1473
|
-
* @privateRemarks
|
|
1474
|
-
* TODO:
|
|
1475
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
1476
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
1477
|
-
* but the difference is unclear from the documentation.
|
|
1478
|
-
*/
|
|
1479
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
1480
|
-
};
|
|
1446
|
+
export declare const SharedMap: ISharedObjectKind<ISharedMap>;
|
|
1481
1447
|
|
|
1482
1448
|
/**
|
|
1483
1449
|
* {@inheritDoc ISharedMap}
|
|
@@ -1489,35 +1455,11 @@ export declare const SharedMap: {
|
|
|
1489
1455
|
export declare type SharedMap = ISharedMap;
|
|
1490
1456
|
|
|
1491
1457
|
/**
|
|
1492
|
-
*
|
|
1493
|
-
*
|
|
1494
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
1495
|
-
* @public
|
|
1496
|
-
*/
|
|
1497
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
1498
|
-
/**
|
|
1499
|
-
* Gets the factory this factory is a wrapper for.
|
|
1500
|
-
*/
|
|
1501
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
/**
|
|
1505
|
-
* SharedTree is a hierarchical data structure for collaboratively editing JSON-like trees
|
|
1458
|
+
* SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
|
|
1506
1459
|
* of objects, arrays, and other data types.
|
|
1507
|
-
*
|
|
1508
|
-
* @remarks
|
|
1509
|
-
* This implements {@link @fluidframework/fluid-static#SharedObjectClass}.
|
|
1510
|
-
* @privateRemarks
|
|
1511
|
-
* Due to the dependency structure and the placement of that interface SharedObjectClass,
|
|
1512
|
-
* this interface implementation can not be recorded in the type here.
|
|
1513
1460
|
* @public
|
|
1514
1461
|
*/
|
|
1515
|
-
export declare const SharedTree:
|
|
1516
|
-
/**
|
|
1517
|
-
* Gets the factory this factory is a wrapper for.
|
|
1518
|
-
*/
|
|
1519
|
-
getFactory(): IChannelFactory<ITree>;
|
|
1520
|
-
};
|
|
1462
|
+
export declare const SharedTree: ISharedObjectKind<ITree>;
|
|
1521
1463
|
|
|
1522
1464
|
/**
|
|
1523
1465
|
* The `Tree` object holds various functions for interacting with {@link TreeNode}s.
|
|
@@ -1574,7 +1516,7 @@ export declare interface TreeApi extends TreeNodeApi {
|
|
|
1574
1516
|
*
|
|
1575
1517
|
* @public
|
|
1576
1518
|
*/
|
|
1577
|
-
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends
|
|
1519
|
+
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeArrayNodeBase<TreeNodeFromImplicitAllowedTypes<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>, TreeArrayNode> {
|
|
1578
1520
|
}
|
|
1579
1521
|
|
|
1580
1522
|
/**
|
|
@@ -7,16 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
9
9
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
11
10
|
import type { IErrorBase } from '@fluidframework/core-interfaces';
|
|
12
11
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
12
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
|
-
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
14
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
17
15
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
18
16
|
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
19
17
|
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
18
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Types for use in fields.
|
|
@@ -230,11 +229,11 @@ export declare interface ContainerSchema {
|
|
|
230
229
|
* @typeParam T - The class of the `DataObject`.
|
|
231
230
|
* @public
|
|
232
231
|
*/
|
|
233
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
232
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
234
233
|
readonly factory: {
|
|
235
234
|
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
236
235
|
};
|
|
237
|
-
} &
|
|
236
|
+
} & (new (...args: any[]) => T);
|
|
238
237
|
|
|
239
238
|
/**
|
|
240
239
|
* Placeholder for `Symbol.dispose`.
|
|
@@ -968,10 +967,10 @@ export declare type LazyItem<Item = unknown> = Item | (() => Item);
|
|
|
968
967
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
969
968
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
970
969
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
971
|
-
* In this case placing
|
|
970
|
+
* In this case placing ISharedObjectKind fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
|
|
972
971
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
973
972
|
*/
|
|
974
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
973
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
975
974
|
|
|
976
975
|
/**
|
|
977
976
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -980,14 +979,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
980
979
|
*/
|
|
981
980
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
982
981
|
|
|
983
|
-
/**
|
|
984
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
985
|
-
*
|
|
986
|
-
* @typeParam T - The class of the loadable object.
|
|
987
|
-
* @public
|
|
988
|
-
*/
|
|
989
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
990
|
-
|
|
991
982
|
/**
|
|
992
983
|
* Utilities for manipulating the typescript typechecker.
|
|
993
984
|
*
|
|
@@ -1471,34 +1462,9 @@ export declare type ScopedSchemaName<TScope extends string | undefined, TName ex
|
|
|
1471
1462
|
/**
|
|
1472
1463
|
* {@inheritDoc ISharedMap}
|
|
1473
1464
|
* @public
|
|
1474
|
-
* @deprecated Please use SharedTree for new containers.
|
|
1465
|
+
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
1475
1466
|
*/
|
|
1476
|
-
export declare const SharedMap:
|
|
1477
|
-
/**
|
|
1478
|
-
* Get a factory for SharedMap to register with the data store.
|
|
1479
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
1480
|
-
*/
|
|
1481
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
1482
|
-
/**
|
|
1483
|
-
* Create a new shared map.
|
|
1484
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
1485
|
-
* @param id - Optional name of the shared map.
|
|
1486
|
-
* @returns Newly created shared map.
|
|
1487
|
-
*
|
|
1488
|
-
* @example
|
|
1489
|
-
* To create a `SharedMap`, call the static create method:
|
|
1490
|
-
*
|
|
1491
|
-
* ```typescript
|
|
1492
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
1493
|
-
* ```
|
|
1494
|
-
* @privateRemarks
|
|
1495
|
-
* TODO:
|
|
1496
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
1497
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
1498
|
-
* but the difference is unclear from the documentation.
|
|
1499
|
-
*/
|
|
1500
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
1501
|
-
};
|
|
1467
|
+
export declare const SharedMap: ISharedObjectKind<ISharedMap>;
|
|
1502
1468
|
|
|
1503
1469
|
/**
|
|
1504
1470
|
* {@inheritDoc ISharedMap}
|
|
@@ -1510,35 +1476,11 @@ export declare const SharedMap: {
|
|
|
1510
1476
|
export declare type SharedMap = ISharedMap;
|
|
1511
1477
|
|
|
1512
1478
|
/**
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
1516
|
-
* @public
|
|
1517
|
-
*/
|
|
1518
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
1519
|
-
/**
|
|
1520
|
-
* Gets the factory this factory is a wrapper for.
|
|
1521
|
-
*/
|
|
1522
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* SharedTree is a hierarchical data structure for collaboratively editing JSON-like trees
|
|
1479
|
+
* SharedTree is a hierarchical data structure for collaboratively editing strongly typed JSON-like trees
|
|
1527
1480
|
* of objects, arrays, and other data types.
|
|
1528
|
-
*
|
|
1529
|
-
* @remarks
|
|
1530
|
-
* This implements {@link @fluidframework/fluid-static#SharedObjectClass}.
|
|
1531
|
-
* @privateRemarks
|
|
1532
|
-
* Due to the dependency structure and the placement of that interface SharedObjectClass,
|
|
1533
|
-
* this interface implementation can not be recorded in the type here.
|
|
1534
1481
|
* @public
|
|
1535
1482
|
*/
|
|
1536
|
-
export declare const SharedTree:
|
|
1537
|
-
/**
|
|
1538
|
-
* Gets the factory this factory is a wrapper for.
|
|
1539
|
-
*/
|
|
1540
|
-
getFactory(): IChannelFactory<ITree>;
|
|
1541
|
-
};
|
|
1483
|
+
export declare const SharedTree: ISharedObjectKind<ITree>;
|
|
1542
1484
|
|
|
1543
1485
|
/**
|
|
1544
1486
|
* The `Tree` object holds various functions for interacting with {@link TreeNode}s.
|
|
@@ -1595,7 +1537,7 @@ export declare interface TreeApi extends TreeNodeApi {
|
|
|
1595
1537
|
*
|
|
1596
1538
|
* @public
|
|
1597
1539
|
*/
|
|
1598
|
-
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends
|
|
1540
|
+
export declare interface TreeArrayNode<TAllowedTypes extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends TreeArrayNodeBase<TreeNodeFromImplicitAllowedTypes<TAllowedTypes>, InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes>, TreeArrayNode> {
|
|
1599
1541
|
}
|
|
1600
1542
|
|
|
1601
1543
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ ICriticalContainerError, } from "@fluidframework/container-definitions";
|
|
|
13
13
|
export { AttachState, ContainerErrorTypes } from "@fluidframework/container-definitions";
|
|
14
14
|
export { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
15
15
|
export { ConnectionState } from "@fluidframework/container-loader";
|
|
16
|
-
export type { ContainerAttachProps, ContainerSchema, DataObjectClass, IConnection, IFluidContainer, IFluidContainerEvents, IMember, InitialObjects, IServiceAudience, IServiceAudienceEvents, LoadableObjectClass, LoadableObjectClassRecord,
|
|
16
|
+
export type { ContainerAttachProps, ContainerSchema, DataObjectClass, IConnection, IFluidContainer, IFluidContainerEvents, IMember, InitialObjects, IServiceAudience, IServiceAudienceEvents, LoadableObjectClass, LoadableObjectClassRecord, MemberChangedListener, Myself, } from "@fluidframework/fluid-static";
|
|
17
17
|
export type { ISharedMap, ISharedMapEvents, IValueChanged } from "@fluidframework/map";
|
|
18
18
|
export { SharedMap } from "@fluidframework/map";
|
|
19
19
|
export * from "@fluidframework/tree";
|