@fluidframework/fluid-static 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463
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-static.api.md +13 -21
- package/dist/fluid-static-alpha.d.ts +14 -35
- package/dist/fluid-static-beta.d.ts +14 -35
- package/dist/fluid-static-public.d.ts +14 -35
- package/dist/fluid-static-untrimmed.d.ts +14 -35
- package/dist/fluidContainer.d.ts +3 -2
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/fluidContainer.js +1 -0
- package/dist/fluidContainer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/rootDataObject.d.ts +1 -1
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/rootDataObject.js +11 -9
- package/dist/rootDataObject.js.map +1 -1
- package/dist/serviceAudience.d.ts +2 -2
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/serviceAudience.js.map +1 -1
- package/dist/types.d.ts +12 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +6 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -9
- package/dist/utils.js.map +1 -1
- package/lib/fluid-static-alpha.d.ts +14 -35
- package/lib/fluid-static-beta.d.ts +14 -35
- package/lib/fluid-static-public.d.ts +14 -35
- package/lib/fluid-static-untrimmed.d.ts +14 -35
- package/lib/fluidContainer.d.ts +3 -2
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/fluidContainer.js +1 -0
- package/lib/fluidContainer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/rootDataObject.d.ts +1 -1
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/rootDataObject.js +7 -5
- package/lib/rootDataObject.js.map +1 -1
- package/lib/serviceAudience.d.ts +2 -2
- package/lib/serviceAudience.d.ts.map +1 -1
- package/lib/serviceAudience.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/lib/types.d.ts +12 -31
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +6 -5
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +14 -7
- package/lib/utils.js.map +1 -1
- package/package.json +32 -31
- package/src/fluidContainer.ts +9 -7
- package/src/index.ts +0 -2
- package/src/rootDataObject.ts +15 -13
- package/src/serviceAudience.ts +4 -2
- package/src/types.ts +13 -34
- package/src/utils.ts +32 -19
- package/lib/test/fluidContainer.spec.js +0 -21
- package/lib/test/fluidContainer.spec.js.map +0 -1
- package/lib/test/types/validateFluidStaticPrevious.generated.js +0 -46
- package/lib/test/types/validateFluidStaticPrevious.generated.js.map +0 -1
- package/lib/test/utils.spec.js +0 -86
- package/lib/test/utils.spec.js.map +0 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
12
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
13
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
16
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
// @public
|
|
19
19
|
export type ContainerAttachProps<T = unknown> = T;
|
|
@@ -42,16 +42,16 @@ export function createServiceAudience<TMember extends IMember = IMember>(props:
|
|
|
42
42
|
}): IServiceAudience<TMember>;
|
|
43
43
|
|
|
44
44
|
// @public
|
|
45
|
-
export type DataObjectClass<T extends IFluidLoadable> = {
|
|
45
|
+
export type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
46
46
|
readonly factory: {
|
|
47
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
47
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
48
48
|
};
|
|
49
|
-
} &
|
|
49
|
+
} & (new (...args: any[]) => T);
|
|
50
50
|
|
|
51
51
|
// @public
|
|
52
52
|
export interface IConnection {
|
|
53
|
-
id: string;
|
|
54
|
-
mode: "write" | "read";
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly mode: "write" | "read";
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// @public @sealed
|
|
@@ -79,8 +79,8 @@ export interface IFluidContainerEvents extends IEvent {
|
|
|
79
79
|
|
|
80
80
|
// @public
|
|
81
81
|
export interface IMember {
|
|
82
|
-
connections: IConnection[];
|
|
83
|
-
userId: string;
|
|
82
|
+
readonly connections: IConnection[];
|
|
83
|
+
readonly userId: string;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// @public
|
|
@@ -102,7 +102,7 @@ export interface IRootDataObject extends IProvideRootDataObject {
|
|
|
102
102
|
|
|
103
103
|
// @public
|
|
104
104
|
export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
|
|
105
|
-
getMembers():
|
|
105
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
106
106
|
getMyself(): Myself<M> | undefined;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -117,14 +117,11 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// @public
|
|
120
|
-
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
120
|
+
export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
121
121
|
|
|
122
122
|
// @public
|
|
123
123
|
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
124
124
|
|
|
125
|
-
// @public
|
|
126
|
-
export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
127
|
-
|
|
128
125
|
// @internal
|
|
129
126
|
export type LoadableObjectRecord = Record<string, IFluidLoadable>;
|
|
130
127
|
|
|
@@ -133,12 +130,7 @@ export type MemberChangedListener<M extends IMember> = (clientId: string, member
|
|
|
133
130
|
|
|
134
131
|
// @public
|
|
135
132
|
export type Myself<M extends IMember = IMember> = M & {
|
|
136
|
-
currentConnection: string;
|
|
133
|
+
readonly currentConnection: string;
|
|
137
134
|
};
|
|
138
135
|
|
|
139
|
-
// @public
|
|
140
|
-
export interface SharedObjectClass<T extends IFluidLoadable> {
|
|
141
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
136
|
```
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
12
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
13
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
16
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Represents properties that can be attached to a container.
|
|
@@ -76,11 +76,11 @@ export declare interface ContainerSchema {
|
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
79
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
80
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
81
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
82
|
};
|
|
83
|
-
} &
|
|
83
|
+
} & (new (...args: any[]) => T);
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Base interface for information for each connection made to the Fluid session.
|
|
@@ -92,11 +92,11 @@ export declare interface IConnection {
|
|
|
92
92
|
/**
|
|
93
93
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
94
|
*/
|
|
95
|
-
id: string;
|
|
95
|
+
readonly id: string;
|
|
96
96
|
/**
|
|
97
97
|
* Whether the connection is in read or read/write mode.
|
|
98
98
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
99
|
+
readonly mode: "write" | "read";
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -282,11 +282,11 @@ export declare interface IMember {
|
|
|
282
282
|
/**
|
|
283
283
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
284
284
|
*/
|
|
285
|
-
userId: string;
|
|
285
|
+
readonly userId: string;
|
|
286
286
|
/**
|
|
287
287
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
288
288
|
*/
|
|
289
|
-
connections: IConnection[];
|
|
289
|
+
readonly connections: IConnection[];
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/**
|
|
@@ -318,7 +318,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
318
318
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
319
319
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
320
320
|
*/
|
|
321
|
-
getMembers():
|
|
321
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
322
322
|
/**
|
|
323
323
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
324
324
|
*/
|
|
@@ -367,10 +367,10 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
|
|
|
367
367
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
368
368
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
369
369
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
370
|
-
* In this case placing
|
|
370
|
+
* 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.
|
|
371
371
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
372
372
|
*/
|
|
373
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
373
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -379,14 +379,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
379
379
|
*/
|
|
380
380
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
381
381
|
|
|
382
|
-
/**
|
|
383
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
384
|
-
*
|
|
385
|
-
* @typeParam T - The class of the loadable object.
|
|
386
|
-
* @public
|
|
387
|
-
*/
|
|
388
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
389
|
-
|
|
390
382
|
/* Excluded from this release type: LoadableObjectRecord */
|
|
391
383
|
|
|
392
384
|
/**
|
|
@@ -405,20 +397,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
405
397
|
* @public
|
|
406
398
|
*/
|
|
407
399
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
408
|
-
currentConnection: string;
|
|
400
|
+
readonly currentConnection: string;
|
|
409
401
|
};
|
|
410
402
|
|
|
411
|
-
/**
|
|
412
|
-
* A factory that produces a factory that can create a DDSes (`SharedObject`s).
|
|
413
|
-
*
|
|
414
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
415
|
-
* @public
|
|
416
|
-
*/
|
|
417
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
418
|
-
/**
|
|
419
|
-
* Gets the factory this factory is a wrapper for.
|
|
420
|
-
*/
|
|
421
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
403
|
export { }
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
12
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
13
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
16
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Represents properties that can be attached to a container.
|
|
@@ -76,11 +76,11 @@ export declare interface ContainerSchema {
|
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
79
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
80
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
81
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
82
|
};
|
|
83
|
-
} &
|
|
83
|
+
} & (new (...args: any[]) => T);
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Base interface for information for each connection made to the Fluid session.
|
|
@@ -92,11 +92,11 @@ export declare interface IConnection {
|
|
|
92
92
|
/**
|
|
93
93
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
94
|
*/
|
|
95
|
-
id: string;
|
|
95
|
+
readonly id: string;
|
|
96
96
|
/**
|
|
97
97
|
* Whether the connection is in read or read/write mode.
|
|
98
98
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
99
|
+
readonly mode: "write" | "read";
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/* Excluded from this release type: IContainer */
|
|
@@ -284,11 +284,11 @@ export declare interface IMember {
|
|
|
284
284
|
/**
|
|
285
285
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
286
286
|
*/
|
|
287
|
-
userId: string;
|
|
287
|
+
readonly userId: string;
|
|
288
288
|
/**
|
|
289
289
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
290
290
|
*/
|
|
291
|
-
connections: IConnection[];
|
|
291
|
+
readonly connections: IConnection[];
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -322,7 +322,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
322
322
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
323
323
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
324
324
|
*/
|
|
325
|
-
getMembers():
|
|
325
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
326
326
|
/**
|
|
327
327
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
328
328
|
*/
|
|
@@ -371,10 +371,10 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
|
|
|
371
371
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
372
372
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
373
373
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
374
|
-
* In this case placing
|
|
374
|
+
* 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.
|
|
375
375
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
376
376
|
*/
|
|
377
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
377
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
380
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -383,14 +383,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
383
383
|
*/
|
|
384
384
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
385
385
|
|
|
386
|
-
/**
|
|
387
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
388
|
-
*
|
|
389
|
-
* @typeParam T - The class of the loadable object.
|
|
390
|
-
* @public
|
|
391
|
-
*/
|
|
392
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
393
|
-
|
|
394
386
|
/* Excluded from this release type: LoadableObjectRecord */
|
|
395
387
|
|
|
396
388
|
/**
|
|
@@ -409,20 +401,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
409
401
|
* @public
|
|
410
402
|
*/
|
|
411
403
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
412
|
-
currentConnection: string;
|
|
404
|
+
readonly currentConnection: string;
|
|
413
405
|
};
|
|
414
406
|
|
|
415
|
-
/**
|
|
416
|
-
* A factory that produces a factory that can create a DDSes (`SharedObject`s).
|
|
417
|
-
*
|
|
418
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
419
|
-
* @public
|
|
420
|
-
*/
|
|
421
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
422
|
-
/**
|
|
423
|
-
* Gets the factory this factory is a wrapper for.
|
|
424
|
-
*/
|
|
425
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
407
|
export { }
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
12
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
13
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
16
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Represents properties that can be attached to a container.
|
|
@@ -76,11 +76,11 @@ export declare interface ContainerSchema {
|
|
|
76
76
|
* @typeParam T - The class of the `DataObject`.
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
79
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
80
80
|
readonly factory: {
|
|
81
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
81
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
82
82
|
};
|
|
83
|
-
} &
|
|
83
|
+
} & (new (...args: any[]) => T);
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Base interface for information for each connection made to the Fluid session.
|
|
@@ -92,11 +92,11 @@ export declare interface IConnection {
|
|
|
92
92
|
/**
|
|
93
93
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
94
94
|
*/
|
|
95
|
-
id: string;
|
|
95
|
+
readonly id: string;
|
|
96
96
|
/**
|
|
97
97
|
* Whether the connection is in read or read/write mode.
|
|
98
98
|
*/
|
|
99
|
-
mode: "write" | "read";
|
|
99
|
+
readonly mode: "write" | "read";
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/* Excluded from this release type: IContainer */
|
|
@@ -284,11 +284,11 @@ export declare interface IMember {
|
|
|
284
284
|
/**
|
|
285
285
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
286
286
|
*/
|
|
287
|
-
userId: string;
|
|
287
|
+
readonly userId: string;
|
|
288
288
|
/**
|
|
289
289
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
290
290
|
*/
|
|
291
|
-
connections: IConnection[];
|
|
291
|
+
readonly connections: IConnection[];
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -322,7 +322,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
322
322
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
323
323
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
324
324
|
*/
|
|
325
|
-
getMembers():
|
|
325
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
326
326
|
/**
|
|
327
327
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
328
328
|
*/
|
|
@@ -371,10 +371,10 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
|
|
|
371
371
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
372
372
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
373
373
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
374
|
-
* In this case placing
|
|
374
|
+
* 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.
|
|
375
375
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
376
376
|
*/
|
|
377
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
377
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
380
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -383,14 +383,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
383
383
|
*/
|
|
384
384
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
385
385
|
|
|
386
|
-
/**
|
|
387
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
388
|
-
*
|
|
389
|
-
* @typeParam T - The class of the loadable object.
|
|
390
|
-
* @public
|
|
391
|
-
*/
|
|
392
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
393
|
-
|
|
394
386
|
/* Excluded from this release type: LoadableObjectRecord */
|
|
395
387
|
|
|
396
388
|
/**
|
|
@@ -409,20 +401,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
409
401
|
* @public
|
|
410
402
|
*/
|
|
411
403
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
412
|
-
currentConnection: string;
|
|
404
|
+
readonly currentConnection: string;
|
|
413
405
|
};
|
|
414
406
|
|
|
415
|
-
/**
|
|
416
|
-
* A factory that produces a factory that can create a DDSes (`SharedObject`s).
|
|
417
|
-
*
|
|
418
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
419
|
-
* @public
|
|
420
|
-
*/
|
|
421
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
422
|
-
/**
|
|
423
|
-
* Gets the factory this factory is a wrapper for.
|
|
424
|
-
*/
|
|
425
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
407
|
export { }
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
8
|
import { ConnectionState } from '@fluidframework/container-definitions';
|
|
9
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
10
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
10
|
+
import { IContainer } from '@fluidframework/container-definitions/internal';
|
|
12
11
|
import { ICriticalContainerError } from '@fluidframework/container-definitions';
|
|
13
12
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
14
13
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
14
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
16
|
-
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
15
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions/internal';
|
|
16
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Represents properties that can be attached to a container.
|
|
@@ -105,11 +105,11 @@ export declare function createServiceAudience<TMember extends IMember = IMember>
|
|
|
105
105
|
* @typeParam T - The class of the `DataObject`.
|
|
106
106
|
* @public
|
|
107
107
|
*/
|
|
108
|
-
export declare type DataObjectClass<T extends IFluidLoadable> = {
|
|
108
|
+
export declare type DataObjectClass<T extends IFluidLoadable = IFluidLoadable> = {
|
|
109
109
|
readonly factory: {
|
|
110
|
-
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
110
|
+
readonly IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
111
111
|
};
|
|
112
|
-
} &
|
|
112
|
+
} & (new (...args: any[]) => T);
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Base interface for information for each connection made to the Fluid session.
|
|
@@ -121,11 +121,11 @@ export declare interface IConnection {
|
|
|
121
121
|
/**
|
|
122
122
|
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
123
123
|
*/
|
|
124
|
-
id: string;
|
|
124
|
+
readonly id: string;
|
|
125
125
|
/**
|
|
126
126
|
* Whether the connection is in read or read/write mode.
|
|
127
127
|
*/
|
|
128
|
-
mode: "write" | "read";
|
|
128
|
+
readonly mode: "write" | "read";
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
@@ -311,11 +311,11 @@ export declare interface IMember {
|
|
|
311
311
|
/**
|
|
312
312
|
* An ID for the user, unique among each individual user connecting to the session.
|
|
313
313
|
*/
|
|
314
|
-
userId: string;
|
|
314
|
+
readonly userId: string;
|
|
315
315
|
/**
|
|
316
316
|
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
317
317
|
*/
|
|
318
|
-
connections: IConnection[];
|
|
318
|
+
readonly connections: IConnection[];
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
/**
|
|
@@ -370,7 +370,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
|
|
|
370
370
|
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
371
371
|
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
372
372
|
*/
|
|
373
|
-
getMembers():
|
|
373
|
+
getMembers(): ReadonlyMap<string, M>;
|
|
374
374
|
/**
|
|
375
375
|
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
376
376
|
*/
|
|
@@ -419,10 +419,10 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
|
|
|
419
419
|
* There are some edge cases in TypeScript where the order of the members in a union matter.
|
|
420
420
|
* Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
|
|
421
421
|
* In this case, its better to have the desired match and/or the simpler type first.
|
|
422
|
-
* In this case placing
|
|
422
|
+
* 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.
|
|
423
423
|
* This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
|
|
424
424
|
*/
|
|
425
|
-
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> =
|
|
425
|
+
export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = ISharedObjectKind<T> | DataObjectClass<T>;
|
|
426
426
|
|
|
427
427
|
/**
|
|
428
428
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
@@ -431,14 +431,6 @@ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadabl
|
|
|
431
431
|
*/
|
|
432
432
|
export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
|
|
433
433
|
|
|
434
|
-
/**
|
|
435
|
-
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
436
|
-
*
|
|
437
|
-
* @typeParam T - The class of the loadable object.
|
|
438
|
-
* @public
|
|
439
|
-
*/
|
|
440
|
-
export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
441
|
-
|
|
442
434
|
/**
|
|
443
435
|
* A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
|
|
444
436
|
* @internal
|
|
@@ -461,20 +453,7 @@ export declare type MemberChangedListener<M extends IMember> = (clientId: string
|
|
|
461
453
|
* @public
|
|
462
454
|
*/
|
|
463
455
|
export declare type Myself<M extends IMember = IMember> = M & {
|
|
464
|
-
currentConnection: string;
|
|
456
|
+
readonly currentConnection: string;
|
|
465
457
|
};
|
|
466
458
|
|
|
467
|
-
/**
|
|
468
|
-
* A factory that produces a factory that can create a DDSes (`SharedObject`s).
|
|
469
|
-
*
|
|
470
|
-
* @typeParam T - The class of the `SharedObject`.
|
|
471
|
-
* @public
|
|
472
|
-
*/
|
|
473
|
-
export declare interface SharedObjectClass<T extends IFluidLoadable> {
|
|
474
|
-
/**
|
|
475
|
-
* Gets the factory this factory is a wrapper for.
|
|
476
|
-
*/
|
|
477
|
-
readonly getFactory: () => IChannelFactory<T>;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
459
|
export { }
|
package/dist/fluidContainer.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { AttachState, type ConnectionState, type ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
+
import { type IContainer } from "@fluidframework/container-definitions/internal";
|
|
5
7
|
import { type IEvent, type IEventProvider, type IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
|
-
import {
|
|
7
|
-
import type { ContainerSchema, ContainerAttachProps, IRootDataObject, LoadableObjectClass } from "./types.js";
|
|
8
|
+
import type { ContainerAttachProps, ContainerSchema, IRootDataObject, LoadableObjectClass } from "./types.js";
|
|
8
9
|
/**
|
|
9
10
|
* Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
|
|
10
11
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,
|
|
1
|
+
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,IAAI;KAMtD,CAAC,IAAI,MAAM,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,mBAAmB,CACnF,MAAM,QAAQ,CACd,GACE,QAAQ,GACR,KAAK;CACR,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACpD;;;;;;;;;;OAUG;IACH,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAEjD;;;;;;;;;;OAUG;IACH,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAEpD;;;;;;OAMG;IACH,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAE7C;;;;;;OAMG;IACH,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAE7C;;;;;;;OAOG;IACH,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,OAAE;CACzE;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe,CAAC,gBAAgB,SAAS,eAAe,GAAG,eAAe,CAC1F,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE1C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtD;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;;;;;OASG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAElF;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,EACzD,KAAK,EAAE;IACR,SAAS,EAAE,UAAU,CAAC;IACtB,cAAc,EAAE,eAAe,CAAC;CAChC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAEpC"}
|
package/dist/fluidContainer.js
CHANGED
|
@@ -97,6 +97,7 @@ class FluidContainer extends client_utils_1.TypedEventEmitter {
|
|
|
97
97
|
* but internally this separation is not there.
|
|
98
98
|
*/
|
|
99
99
|
async attach(props) {
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- AB#7608
|
|
100
101
|
if (this.container.attachState !== container_definitions_1.AttachState.Detached) {
|
|
101
102
|
throw new Error("Cannot attach container. Container is not in detached state.");
|
|
102
103
|
}
|