@fluidframework/fluid-static 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -2
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -3
- package/api-report/fluid-static.api.md +53 -25
- package/dist/fluid-static-alpha.d.ts +417 -0
- package/dist/fluid-static-beta.d.ts +99 -0
- package/dist/fluid-static-public.d.ts +99 -0
- package/dist/fluid-static-untrimmed.d.ts +619 -0
- package/dist/{fluidContainer.js → fluidContainer.cjs} +12 -4
- package/dist/fluidContainer.cjs.map +1 -0
- package/dist/fluidContainer.d.ts +26 -7
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/index.cjs +22 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/{rootDataObject.js → rootDataObject.cjs} +15 -4
- package/dist/rootDataObject.cjs.map +1 -0
- package/dist/rootDataObject.d.ts +9 -36
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/{serviceAudience.js → serviceAudience.cjs} +17 -2
- package/dist/serviceAudience.cjs.map +1 -0
- package/dist/serviceAudience.d.ts +9 -0
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/{types.js → types.cjs} +1 -1
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{utils.js → utils.cjs} +1 -1
- package/dist/utils.cjs.map +1 -0
- package/lib/fluid-static-alpha.d.ts +417 -0
- package/lib/fluid-static-beta.d.ts +99 -0
- package/lib/fluid-static-public.d.ts +99 -0
- package/lib/fluid-static-untrimmed.d.ts +619 -0
- package/lib/fluidContainer.d.ts +26 -11
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/{fluidContainer.js → fluidContainer.mjs} +10 -7
- package/lib/fluidContainer.mjs.map +1 -0
- package/lib/index.d.ts +4 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +8 -0
- package/lib/index.mjs.map +1 -0
- package/lib/rootDataObject.d.ts +9 -40
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/{rootDataObject.js → rootDataObject.mjs} +14 -7
- package/lib/rootDataObject.mjs.map +1 -0
- package/lib/serviceAudience.d.ts +10 -1
- package/lib/serviceAudience.d.ts.map +1 -1
- package/lib/{serviceAudience.js → serviceAudience.mjs} +15 -1
- package/lib/serviceAudience.mjs.map +1 -0
- package/lib/types.d.ts +21 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/{types.js → types.mjs} +1 -1
- package/lib/types.mjs.map +1 -0
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/{utils.js → utils.mjs} +1 -1
- package/lib/utils.mjs.map +1 -0
- package/package.json +53 -33
- package/src/fluidContainer.ts +44 -9
- package/src/index.ts +14 -4
- package/src/rootDataObject.ts +16 -1
- package/src/serviceAudience.ts +18 -0
- package/src/types.ts +22 -1
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +5 -3
- package/dist/fluidContainer.js.map +0 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/rootDataObject.js.map +0 -1
- package/dist/serviceAudience.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/lib/fluidContainer.js.map +0 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +0 -1
- package/lib/rootDataObject.js.map +0 -1
- package/lib/serviceAudience.js.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
package/lib/fluidContainer.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
1
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
2
|
import { IEvent, IEventProvider, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
7
3
|
import { AttachState, IContainer, ICriticalContainerError, ConnectionState } from "@fluidframework/container-definitions";
|
|
8
|
-
import type { IRootDataObject, LoadableObjectClass
|
|
4
|
+
import type { ContainerSchema, IRootDataObject, LoadableObjectClass } from "./types.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export type InitialObjects<T extends ContainerSchema> = {
|
|
10
|
+
[K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
|
|
11
|
+
};
|
|
9
12
|
/**
|
|
10
13
|
* Events emitted from {@link IFluidContainer}.
|
|
14
|
+
* @alpha
|
|
11
15
|
*/
|
|
12
16
|
export interface IFluidContainerEvents extends IEvent {
|
|
13
17
|
/**
|
|
@@ -64,9 +68,12 @@ export interface IFluidContainerEvents extends IEvent {
|
|
|
64
68
|
* Provides an entrypoint into the client side of collaborative Fluid data.
|
|
65
69
|
* Provides access to the data as well as status on the collaboration session.
|
|
66
70
|
*
|
|
71
|
+
* @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
|
|
72
|
+
*
|
|
67
73
|
* @remarks Note: external implementations of this interface are not supported.
|
|
74
|
+
* @alpha
|
|
68
75
|
*/
|
|
69
|
-
export interface IFluidContainer extends IEventProvider<IFluidContainerEvents> {
|
|
76
|
+
export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
|
|
70
77
|
/**
|
|
71
78
|
* Provides the current connected state of the container
|
|
72
79
|
*/
|
|
@@ -101,7 +108,7 @@ export interface IFluidContainer extends IEventProvider<IFluidContainerEvents> {
|
|
|
101
108
|
*
|
|
102
109
|
* @remarks These data objects and DDSes exist for the lifetime of the container.
|
|
103
110
|
*/
|
|
104
|
-
readonly initialObjects:
|
|
111
|
+
readonly initialObjects: InitialObjects<TContainerSchema>;
|
|
105
112
|
/**
|
|
106
113
|
* The current attachment state of the container.
|
|
107
114
|
*
|
|
@@ -168,15 +175,25 @@ export interface IFluidContainer extends IEventProvider<IFluidContainerEvents> {
|
|
|
168
175
|
*/
|
|
169
176
|
dispose(): void;
|
|
170
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
export declare function createFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema>(props: {
|
|
182
|
+
container: IContainer;
|
|
183
|
+
rootDataObject: IRootDataObject;
|
|
184
|
+
}): IFluidContainer<TContainerSchema>;
|
|
171
185
|
/**
|
|
172
186
|
* Base {@link IFluidContainer} implementation.
|
|
173
187
|
*
|
|
188
|
+
* @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
|
|
174
189
|
* @remarks
|
|
175
190
|
*
|
|
176
191
|
* Note: this implementation is not complete. Consumers who rely on {@link IFluidContainer.attach}
|
|
177
192
|
* will need to utilize or provide a service-specific implementation of this type that implements that method.
|
|
193
|
+
* @deprecated use {@link createFluidContainer} and {@link IFluidContainer} instead
|
|
194
|
+
* @internal
|
|
178
195
|
*/
|
|
179
|
-
export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer {
|
|
196
|
+
export declare class FluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer<TContainerSchema> {
|
|
180
197
|
private readonly container;
|
|
181
198
|
private readonly rootDataObject;
|
|
182
199
|
private readonly connectedHandler;
|
|
@@ -204,7 +221,7 @@ export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEve
|
|
|
204
221
|
/**
|
|
205
222
|
* {@inheritDoc IFluidContainer.initialObjects}
|
|
206
223
|
*/
|
|
207
|
-
get initialObjects():
|
|
224
|
+
get initialObjects(): InitialObjects<TContainerSchema>;
|
|
208
225
|
/**
|
|
209
226
|
* Incomplete base implementation of {@link IFluidContainer.attach}.
|
|
210
227
|
*
|
|
@@ -241,8 +258,6 @@ export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEve
|
|
|
241
258
|
* Gets the underlying {@link @fluidframework/container-definitions#IContainer}.
|
|
242
259
|
*
|
|
243
260
|
* @remarks Used to power debug tooling.
|
|
244
|
-
*
|
|
245
|
-
* @internal
|
|
246
261
|
*/
|
|
247
262
|
readonly INTERNAL_CONTAINER_DO_NOT_USE?: () => IContainer;
|
|
248
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"OAIO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B;OACzD,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC;OACjF,EACN,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,eAAe,EACf,MAAM,uCAAuC;OACvC,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE;AAErE;;;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;;;GAGG;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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IAI9F;;OAEG;IACI,OAAO;IASd;;;;;;;OAOG;IACH,SAAgB,6BAA6B,CAAC,EAAE,MAAM,UAAU,CAE9D;CACF"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
1
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
2
|
import { AttachState, } from "@fluidframework/container-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export function createFluidContainer(props) {
|
|
7
|
+
return new FluidContainer(props.container, props.rootDataObject);
|
|
8
|
+
}
|
|
7
9
|
/**
|
|
8
10
|
* Base {@link IFluidContainer} implementation.
|
|
9
11
|
*
|
|
12
|
+
* @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
|
|
10
13
|
* @remarks
|
|
11
14
|
*
|
|
12
15
|
* Note: this implementation is not complete. Consumers who rely on {@link IFluidContainer.attach}
|
|
13
16
|
* will need to utilize or provide a service-specific implementation of this type that implements that method.
|
|
17
|
+
* @deprecated use {@link createFluidContainer} and {@link IFluidContainer} instead
|
|
18
|
+
* @internal
|
|
14
19
|
*/
|
|
15
20
|
export class FluidContainer extends TypedEventEmitter {
|
|
16
21
|
constructor(container, rootDataObject) {
|
|
@@ -29,8 +34,6 @@ export class FluidContainer extends TypedEventEmitter {
|
|
|
29
34
|
* Gets the underlying {@link @fluidframework/container-definitions#IContainer}.
|
|
30
35
|
*
|
|
31
36
|
* @remarks Used to power debug tooling.
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
37
|
*/
|
|
35
38
|
this.INTERNAL_CONTAINER_DO_NOT_USE = () => {
|
|
36
39
|
return this.container;
|
|
@@ -119,4 +122,4 @@ export class FluidContainer extends TypedEventEmitter {
|
|
|
119
122
|
this.container.off("dirty", this.dirtyHandler);
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
//# sourceMappingURL=fluidContainer.
|
|
125
|
+
//# sourceMappingURL=fluidContainer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluidContainer.mjs","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"OAIO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B;OAEzD,EACN,WAAW,GAIX,MAAM,uCAAuC;AA0M9C;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAElC,KAGD;IACA,OAAO,IAAI,cAAc,CAAmB,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AACpF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,cACZ,SAAQ,iBAAwC;IAUhD,YACkB,SAAqB,EACrB,cAA+B;QAEhD,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAY;QACrB,mBAAc,GAAd,cAAc,CAAiB;QAThC,qBAAgB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,wBAAmB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,oBAAe,GAAG,CAAC,KAA+B,EAAE,EAAE,CACtE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACb,iBAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,iBAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAqGzD;;;;;;;WAOG;QACa,kCAA6B,GAAsB,GAAG,EAAE;YACvE,OAAO,IAAI,CAAC,SAAS,CAAC;QACvB,CAAC,CAAC;QAxGD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjD,SAAS,CAAC,EAAE,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AAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,OAAO;QACb,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;CAaD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IEvent, IEventProvider, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport {\n\tAttachState,\n\tIContainer,\n\tICriticalContainerError,\n\tConnectionState,\n} from \"@fluidframework/container-definitions\";\nimport type { ContainerSchema, IRootDataObject, LoadableObjectClass } from \"./types\";\n\n/**\n * Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.\n * @alpha\n */\nexport type InitialObjects<T extends ContainerSchema> = {\n\t// Construct a LoadableObjectRecord type by enumerating the keys of\n\t// 'ContainerSchema.initialObjects' and infering the value type of each key.\n\t//\n\t// The '? TChannel : never' is required because infer can only be used in\n\t// a conditional 'extends' expression.\n\t[K in keyof T[\"initialObjects\"]]: T[\"initialObjects\"][K] extends LoadableObjectClass<\n\t\tinfer TChannel\n\t>\n\t\t? TChannel\n\t\t: never;\n};\n\n/**\n * Events emitted from {@link IFluidContainer}.\n * @alpha\n */\nexport interface IFluidContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the {@link IFluidContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IFluidContainer.connectionState}\n\t *\n\t * - {@link IFluidContainer.connect}\n\t */\n\t(event: \"connected\", listener: () => void): void;\n\n\t/**\n\t * Emitted when the {@link IFluidContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IFluidContainer.connectionState}\n\t *\n\t * - {@link IFluidContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void): void;\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t *\n\t * @remarks \"dirty\" event will be emitted when the next local change has been made.\n\t *\n\t * @see {@link IFluidContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: () => void): void;\n\n\t/**\n\t * Emitted when the first local change has been made, following a \"saved\" event.\n\t *\n\t * @remarks \"saved\" event will be emitted once all local changes have been acknowledged by the service.\n\t *\n\t * @see {@link IFluidContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: () => void): void;\n\n\t/**\n\t * Emitted when the {@link IFluidContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error (as opposed to an explicit call to\n\t * {@link IFluidContainer.dispose}), this will contain details about the error that caused it.\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n}\n\n/**\n * Provides an entrypoint into the client side of collaborative Fluid data.\n * Provides access to the data as well as status on the collaboration session.\n *\n * @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.\n *\n * @remarks Note: external implementations of this interface are not supported.\n * @alpha\n */\nexport interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema>\n\textends IEventProvider<IFluidContainerEvents> {\n\t/**\n\t * Provides the current connected state of the container\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * A container is considered **dirty** if it has local changes that have not yet been acknowledged by the service.\n\t *\n\t * @remarks\n\t *\n\t * You should always check the `isDirty` flag before closing the container or navigating away from the page.\n\t * Closing the container while `isDirty === true` may result in the loss of operations that have not yet been\n\t * acknowledged by the service.\n\t *\n\t * A container is considered dirty in the following cases:\n\t *\n\t * 1. The container has been created in the detached state, and either it has not been attached yet or it is\n\t * in the process of being attached (container is in `attaching` state). If container is closed prior to being\n\t * attached, host may never know if the file was created or not.\n\t *\n\t * 2. The container was attached, but it has local changes that have not yet been saved to service endpoint.\n\t * This occurs as part of normal op flow where pending operation (changes) are awaiting acknowledgement from the\n\t * service. In some cases this can be due to lack of network connection. If the network connection is down,\n\t * it needs to be restored for the pending changes to be acknowledged.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Whether or not the container is disposed, which permanently disables it.\n\t */\n\treadonly disposed: boolean;\n\n\t/**\n\t * The collection of data objects and Distributed Data Stores (DDSes) that were specified by the schema.\n\t *\n\t * @remarks These data objects and DDSes exist for the lifetime of the container.\n\t */\n\treadonly initialObjects: InitialObjects<TContainerSchema>;\n\n\t/**\n\t * The current attachment state of the container.\n\t *\n\t * @remarks\n\t *\n\t * Once a container has been attached, it remains attached.\n\t * When loading an existing container, it will already be attached.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * A newly created container starts detached from the collaborative service.\n\t * Calling `attach()` uploads the new container to the service and connects to the collaborative service.\n\t *\n\t * @remarks\n\t *\n\t * This should only be called when the container is in the\n\t * {@link @fluidframework/container-definitions#AttachState.Detatched} state.\n\t *\n\t * This can be determined by observing {@link IFluidContainer.attachState}.\n\t *\n\t * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n\t */\n\tattach(): Promise<string>;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process operations.\n\t *\n\t * @throws Will throw an error if connection is unsuccessful.\n\t *\n\t * @remarks\n\t *\n\t * This should only be called when the container is in the\n\t * {@link @fluidframework/container-definitions#ConnectionState.Disconnected} state.\n\t *\n\t * This can be determined by observing {@link IFluidContainer.connectionState}.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing operations.\n\t *\n\t * @remarks\n\t *\n\t * This should only be called when the container is in the\n\t * {@link @fluidframework/container-definitions#ConnectionState.Connected} state.\n\t *\n\t * This can be determined by observing {@link IFluidContainer.connectionState}.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * Create a new data object or Distributed Data Store (DDS) of the specified type.\n\t *\n\t * @remarks\n\t *\n\t * In order to share the data object or DDS with other\n\t * collaborators and retrieve it later, store its handle in a collection like a SharedDirectory from your\n\t * initialObjects.\n\t *\n\t * @param objectClass - The class of the `DataObject` or `SharedObject` to create.\n\t *\n\t * @typeParam T - The class of the `DataObject` or `SharedObject`.\n\t */\n\tcreate<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n\n\t/**\n\t * Dispose of the container instance, permanently disabling it.\n\t */\n\tdispose(): void;\n}\n\n/**\n * @internal\n */\nexport function createFluidContainer<\n\tTContainerSchema extends ContainerSchema = ContainerSchema,\n>(props: {\n\tcontainer: IContainer;\n\trootDataObject: IRootDataObject;\n}): IFluidContainer<TContainerSchema> {\n\treturn new FluidContainer<TContainerSchema>(props.container, props.rootDataObject);\n}\n\n/**\n * Base {@link IFluidContainer} implementation.\n *\n * @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.\n * @remarks\n *\n * Note: this implementation is not complete. Consumers who rely on {@link IFluidContainer.attach}\n * will need to utilize or provide a service-specific implementation of this type that implements that method.\n * @deprecated use {@link createFluidContainer} and {@link IFluidContainer} instead\n * @internal\n */\nexport class FluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema>\n\textends TypedEventEmitter<IFluidContainerEvents>\n\timplements IFluidContainer<TContainerSchema>\n{\n\tprivate readonly connectedHandler = () => this.emit(\"connected\");\n\tprivate readonly disconnectedHandler = () => this.emit(\"disconnected\");\n\tprivate readonly disposedHandler = (error?: ICriticalContainerError) =>\n\t\tthis.emit(\"disposed\", error);\n\tprivate readonly savedHandler = () => this.emit(\"saved\");\n\tprivate readonly dirtyHandler = () => this.emit(\"dirty\");\n\n\tpublic constructor(\n\t\tprivate readonly container: IContainer,\n\t\tprivate readonly rootDataObject: IRootDataObject,\n\t) {\n\t\tsuper();\n\t\tcontainer.on(\"connected\", this.connectedHandler);\n\t\tcontainer.on(\"closed\", this.disposedHandler);\n\t\tcontainer.on(\"disconnected\", this.disconnectedHandler);\n\t\tcontainer.on(\"saved\", this.savedHandler);\n\t\tcontainer.on(\"dirty\", this.dirtyHandler);\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.isDirty}\n\t */\n\tpublic get isDirty(): boolean {\n\t\treturn this.container.isDirty;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.attachState}\n\t */\n\tpublic get attachState(): AttachState {\n\t\treturn this.container.attachState;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.disposed}\n\t */\n\tpublic get disposed() {\n\t\treturn this.container.closed;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.connectionState}\n\t */\n\tpublic get connectionState(): ConnectionState {\n\t\treturn this.container.connectionState;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.initialObjects}\n\t */\n\tpublic get initialObjects(): InitialObjects<TContainerSchema> {\n\t\treturn this.rootDataObject.initialObjects as InitialObjects<TContainerSchema>;\n\t}\n\n\t/**\n\t * Incomplete base implementation of {@link IFluidContainer.attach}.\n\t *\n\t * @remarks\n\t *\n\t * Note: this implementation will unconditionally throw.\n\t * Consumers who rely on this will need to utilize or provide a service specific implementation of this base type\n\t * that provides an implementation of this method.\n\t *\n\t * The reason is because externally we are presenting a separation between the service and the `FluidContainer`,\n\t * but internally this separation is not there.\n\t */\n\tpublic async attach(): Promise<string> {\n\t\tif (this.container.attachState !== AttachState.Detached) {\n\t\t\tthrow new Error(\"Cannot attach container. Container is not in detached state.\");\n\t\t}\n\t\tthrow new Error(\"Cannot attach container. Attach method not provided.\");\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.connect}\n\t */\n\tpublic async connect(): Promise<void> {\n\t\tthis.container.connect?.();\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.connect}\n\t */\n\tpublic async disconnect(): Promise<void> {\n\t\tthis.container.disconnect?.();\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\treturn this.rootDataObject.create(objectClass);\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidContainer.dispose}\n\t */\n\tpublic dispose() {\n\t\tthis.container.close();\n\t\tthis.container.off(\"connected\", this.connectedHandler);\n\t\tthis.container.off(\"closed\", this.disposedHandler);\n\t\tthis.container.off(\"disconnected\", this.disconnectedHandler);\n\t\tthis.container.off(\"saved\", this.savedHandler);\n\t\tthis.container.off(\"dirty\", this.dirtyHandler);\n\t}\n\n\t/**\n\t * FOR INTERNAL USE ONLY. NOT FOR EXTERNAL USE.\n\t * We make no stability guarantees here whatsoever.\n\t *\n\t * Gets the underlying {@link @fluidframework/container-definitions#IContainer}.\n\t *\n\t * @remarks Used to power debug tooling.\n\t */\n\tpublic readonly INTERNAL_CONTAINER_DO_NOT_USE?: () => IContainer = () => {\n\t\treturn this.container;\n\t};\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export { FluidContainer, IFluidContainer, IFluidContainerEvents } from "./fluidContainer";
|
|
11
|
-
export { DOProviderContainerRuntimeFactory } from "./rootDataObject";
|
|
12
|
-
export { ServiceAudience } from "./serviceAudience";
|
|
13
|
-
export { ContainerSchema, DataObjectClass, IConnection, IMember, IRootDataObject, IServiceAudience, IServiceAudienceEvents, LoadableObjectClass, LoadableObjectClassRecord, LoadableObjectCtor, LoadableObjectRecord, MemberChangedListener, SharedObjectClass, Myself, } from "./types";
|
|
5
|
+
export { FluidContainer, createFluidContainer, IFluidContainer, IFluidContainerEvents, InitialObjects, } from "./fluidContainer.mjs";
|
|
6
|
+
export { DOProviderContainerRuntimeFactory, createDOProviderContainerRuntimeFactory, } from "./rootDataObject.mjs";
|
|
7
|
+
export { ServiceAudience, createServiceAudience } from "./serviceAudience.mjs";
|
|
8
|
+
export { ContainerSchema, DataObjectClass, IConnection, IMember, IRootDataObject, IServiceAudience, IServiceAudienceEvents, LoadableObjectClass, LoadableObjectClassRecord, LoadableObjectCtor, LoadableObjectRecord, MemberChangedListener, Myself, SharedObjectClass, IProvideRootDataObject, } from "./types.mjs";
|
|
14
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EACN,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,cAAc,GACd;OACM,EACN,iCAAiC,EACjC,uCAAuC,GACvC;OACM,EAAE,eAAe,EAAE,qBAAqB,EAAE;OAC1C,EACN,eAAe,EACf,eAAe,EACf,WAAW,EACX,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,sBAAsB,GACtB"}
|
package/lib/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { FluidContainer, createFluidContainer, } from "./fluidContainer.mjs";
|
|
6
|
+
export { DOProviderContainerRuntimeFactory, createDOProviderContainerRuntimeFactory, } from "./rootDataObject.mjs";
|
|
7
|
+
export { ServiceAudience, createServiceAudience } from "./serviceAudience.mjs";
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EACN,cAAc,EACd,oBAAoB,GAIpB;OACM,EACN,iCAAiC,EACjC,uCAAuC,GACvC;OACM,EAAE,eAAe,EAAE,qBAAqB,EAAE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Provides a simple and powerful way to consume collaborative Fluid data.\n *\n * @packageDocumentation\n */\n\nexport {\n\tFluidContainer,\n\tcreateFluidContainer,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tInitialObjects,\n} from \"./fluidContainer\";\nexport {\n\tDOProviderContainerRuntimeFactory,\n\tcreateDOProviderContainerRuntimeFactory,\n} from \"./rootDataObject\";\nexport { ServiceAudience, createServiceAudience } from \"./serviceAudience\";\nexport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIConnection,\n\tIMember,\n\tIRootDataObject,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectCtor,\n\tLoadableObjectRecord,\n\tMemberChangedListener,\n\tMyself,\n\tSharedObjectClass,\n\tIProvideRootDataObject,\n} from \"./types\";\n"]}
|
package/lib/rootDataObject.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { BaseContainerRuntimeFactory, DataObject } from "@fluidframework/aqueduct";
|
|
1
|
+
import { BaseContainerRuntimeFactory } from "@fluidframework/aqueduct";
|
|
6
2
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
-
import {
|
|
8
|
-
import { ContainerSchema,
|
|
3
|
+
import { IRuntimeFactory } from "@fluidframework/container-definitions";
|
|
4
|
+
import { ContainerSchema, LoadableObjectClassRecord } from "./types.mjs";
|
|
9
5
|
/**
|
|
10
6
|
* Input props for {@link RootDataObject.initializingFirstTime}.
|
|
11
7
|
*/
|
|
@@ -18,40 +14,11 @@ export interface RootDataObjectProps {
|
|
|
18
14
|
initialObjects: LoadableObjectClassRecord;
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
|
-
*
|
|
22
|
-
* Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.
|
|
17
|
+
* @internal
|
|
23
18
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
private readonly initialObjectsDirKey;
|
|
28
|
-
private readonly _initialObjects;
|
|
29
|
-
private get initialObjectsDir();
|
|
30
|
-
/**
|
|
31
|
-
* The first time this object is initialized, creates each object identified in
|
|
32
|
-
* {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.
|
|
33
|
-
*
|
|
34
|
-
* @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}
|
|
35
|
-
*/
|
|
36
|
-
protected initializingFirstTime(props: RootDataObjectProps): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Every time an instance is initialized, loads all of the initial objects in the root directory so they can be
|
|
39
|
-
* accessed immediately.
|
|
40
|
-
*
|
|
41
|
-
* @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}
|
|
42
|
-
*/
|
|
43
|
-
protected hasInitialized(): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* {@inheritDoc IRootDataObject.initialObjects}
|
|
46
|
-
*/
|
|
47
|
-
get initialObjects(): LoadableObjectRecord;
|
|
48
|
-
/**
|
|
49
|
-
* {@inheritDoc IRootDataObject.create}
|
|
50
|
-
*/
|
|
51
|
-
create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
|
|
52
|
-
private createDataObject;
|
|
53
|
-
private createSharedObject;
|
|
54
|
-
}
|
|
19
|
+
export declare function createDOProviderContainerRuntimeFactory(props: {
|
|
20
|
+
schema: ContainerSchema;
|
|
21
|
+
}): IRuntimeFactory;
|
|
55
22
|
/**
|
|
56
23
|
* Container code that provides a single {@link IRootDataObject}.
|
|
57
24
|
*
|
|
@@ -59,6 +26,8 @@ export declare class RootDataObject extends DataObject<{
|
|
|
59
26
|
*
|
|
60
27
|
* This data object is dynamically customized (registry and initial objects) based on the schema provided.
|
|
61
28
|
* to the container runtime factory.
|
|
29
|
+
* @deprecated use {@link createDOProviderContainerRuntimeFactory} instead
|
|
30
|
+
* @internal
|
|
62
31
|
*/
|
|
63
32
|
export declare class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {
|
|
64
33
|
private readonly rootDataObjectFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootDataObject.d.ts","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rootDataObject.d.ts","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"OAIO,EACN,2BAA2B,EAK3B,MAAM,0BAA0B;OAC1B,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAG1E,EAAE,eAAe,EAAE,MAAM,uCAAuC;OAChE,EACN,eAAe,EAIf,yBAAyB,EAGzB;AAGD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,cAAc,EAAE,yBAAyB,CAAC;CAC1C;AA6GD;;GAEG;AACH,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC9D,MAAM,EAAE,eAAe,CAAC;CACxB,GAAG,eAAe,CAElB;AAED;;;;;;;;;GASG;AACH,qBAAa,iCAAkC,SAAQ,2BAA2B;IACjF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAKpC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA4B;gBAE/C,MAAM,EAAE,eAAe;IA6BnC;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAMzE"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
1
|
import { BaseContainerRuntimeFactory, DataObject, DataObjectFactory,
|
|
6
2
|
// eslint-disable-next-line import/no-deprecated
|
|
7
3
|
defaultRouteRequestHandler, } from "@fluidframework/aqueduct";
|
|
8
4
|
import { FlushMode } from "@fluidframework/runtime-definitions";
|
|
9
|
-
import { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from "./utils";
|
|
5
|
+
import { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from "./utils.mjs";
|
|
10
6
|
/**
|
|
11
7
|
* The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.
|
|
12
8
|
* Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.
|
|
13
9
|
*/
|
|
14
|
-
|
|
10
|
+
class RootDataObject extends DataObject {
|
|
15
11
|
constructor() {
|
|
16
12
|
super(...arguments);
|
|
17
13
|
this.initialObjectsDirKey = "initial-objects-key";
|
|
18
14
|
this._initialObjects = {};
|
|
19
15
|
}
|
|
16
|
+
get IRootDataObject() {
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
20
19
|
get initialObjectsDir() {
|
|
21
20
|
const dir = this.root.getSubDirectory(this.initialObjectsDirKey);
|
|
22
21
|
if (dir === undefined) {
|
|
@@ -96,6 +95,12 @@ export class RootDataObject extends DataObject {
|
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
const rootDataStoreId = "rootDOId";
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export function createDOProviderContainerRuntimeFactory(props) {
|
|
102
|
+
return new DOProviderContainerRuntimeFactory(props.schema);
|
|
103
|
+
}
|
|
99
104
|
/**
|
|
100
105
|
* Container code that provides a single {@link IRootDataObject}.
|
|
101
106
|
*
|
|
@@ -103,6 +108,8 @@ const rootDataStoreId = "rootDOId";
|
|
|
103
108
|
*
|
|
104
109
|
* This data object is dynamically customized (registry and initial objects) based on the schema provided.
|
|
105
110
|
* to the container runtime factory.
|
|
111
|
+
* @deprecated use {@link createDOProviderContainerRuntimeFactory} instead
|
|
112
|
+
* @internal
|
|
106
113
|
*/
|
|
107
114
|
export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {
|
|
108
115
|
constructor(schema) {
|
|
@@ -136,4 +143,4 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto
|
|
|
136
143
|
});
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
|
-
//# sourceMappingURL=rootDataObject.
|
|
146
|
+
//# sourceMappingURL=rootDataObject.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootDataObject.mjs","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"OAIO,EACN,2BAA2B,EAC3B,UAAU,EACV,iBAAiB;AACjB,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0BAA0B;OAG1B,EAAE,SAAS,EAAE,MAAM,qCAAqC;OAWxD,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iCAAiC,EAAE;AAcpF;;;GAGG;AACH,MAAM,cACL,SAAQ,UAAiD;IAD1D;;QAIkB,yBAAoB,GAAG,qBAAqB,CAAC;QAC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UAAU,CAAC,GAAG,EAAE,CAAC;YACzB,CAAC;SACD,CAAC,CAAC;QACH,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,sEAAsE;QACtE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,eAAe,EAAE,OAAO,EAAE;YAC7E,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tBaseContainerRuntimeFactory,\n\tDataObject,\n\tDataObjectFactory,\n\t// eslint-disable-next-line import/no-deprecated\n\tdefaultRouteRequestHandler,\n} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport { IRuntimeFactory } from \"@fluidframework/container-definitions\";\nimport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from \"./utils\";\n\n/**\n * Input props for {@link RootDataObject.initializingFirstTime}.\n */\nexport interface RootDataObjectProps {\n\t/**\n\t * Initial object structure with which the {@link RootDataObject} will be first-time initialized.\n\t *\n\t * @see {@link RootDataObject.initializingFirstTime}\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n}\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nclass RootDataObject\n\textends DataObject<{ InitialState: RootDataObjectProps }>\n\timplements IRootDataObject\n{\n\tprivate readonly initialObjectsDirKey = \"initial-objects-key\";\n\tprivate readonly _initialObjects: LoadableObjectRecord = {};\n\tpublic get IRootDataObject() {\n\t\treturn this;\n\t}\n\n\tprivate get initialObjectsDir() {\n\t\tconst dir = this.root.getSubDirectory(this.initialObjectsDirKey);\n\t\tif (dir === undefined) {\n\t\t\tthrow new Error(\"InitialObjects sub-directory was not initialized\");\n\t\t}\n\t\treturn dir;\n\t}\n\n\t/**\n\t * The first time this object is initialized, creates each object identified in\n\t * {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}\n\t */\n\tprotected async initializingFirstTime(props: RootDataObjectProps) {\n\t\tthis.root.createSubDirectory(this.initialObjectsDirKey);\n\n\t\t// Create initial objects provided by the developer\n\t\tconst initialObjectsP: Promise<void>[] = [];\n\t\tObject.entries(props.initialObjects).forEach(([id, objectClass]) => {\n\t\t\tconst createObject = async () => {\n\t\t\t\tconst obj = await this.create(objectClass);\n\t\t\t\tthis.initialObjectsDir.set(id, obj.handle);\n\t\t\t};\n\t\t\tinitialObjectsP.push(createObject());\n\t\t});\n\n\t\tawait Promise.all(initialObjectsP);\n\t}\n\n\t/**\n\t * Every time an instance is initialized, loads all of the initial objects in the root directory so they can be\n\t * accessed immediately.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}\n\t */\n\tprotected async hasInitialized() {\n\t\t// We will always load the initial objects so they are available to the developer\n\t\tconst loadInitialObjectsP: Promise<void>[] = [];\n\t\tfor (const [key, value] of Array.from(this.initialObjectsDir.entries())) {\n\t\t\tconst loadDir = async () => {\n\t\t\t\tconst obj = await value.get();\n\t\t\t\tObject.assign(this._initialObjects, { [key]: obj });\n\t\t\t};\n\t\t\tloadInitialObjectsP.push(loadDir());\n\t\t}\n\n\t\tawait Promise.all(loadInitialObjectsP);\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.initialObjects}\n\t */\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\tif (Object.keys(this._initialObjects).length === 0) {\n\t\t\tthrow new Error(\"Initial Objects were not correctly initialized\");\n\t\t}\n\t\treturn this._initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\tif (isDataObjectClass(objectClass)) {\n\t\t\treturn this.createDataObject<T>(objectClass);\n\t\t} else if (isSharedObjectClass(objectClass)) {\n\t\t\treturn this.createSharedObject<T>(objectClass);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tprivate async createDataObject<T extends IFluidLoadable>(\n\t\tdataObjectClass: DataObjectClass<T>,\n\t): Promise<T> {\n\t\tconst factory = dataObjectClass.factory;\n\t\tconst packagePath = [...this.context.packagePath, factory.type];\n\t\tconst dataStore = await this.context.containerRuntime.createDataStore(packagePath);\n\t\tconst entryPoint = await dataStore.entryPoint.get();\n\t\treturn entryPoint as unknown as T;\n\t}\n\n\tprivate createSharedObject<T extends IFluidLoadable>(\n\t\tsharedObjectClass: SharedObjectClass<T>,\n\t): T {\n\t\tconst factory = sharedObjectClass.getFactory();\n\t\tconst obj = this.runtime.createChannel(undefined, factory.type);\n\t\treturn obj as unknown as T;\n\t}\n}\n\nconst rootDataStoreId = \"rootDOId\";\n\n/**\n * @internal\n */\nexport function createDOProviderContainerRuntimeFactory(props: {\n\tschema: ContainerSchema;\n}): IRuntimeFactory {\n\treturn new DOProviderContainerRuntimeFactory(props.schema);\n}\n\n/**\n * Container code that provides a single {@link IRootDataObject}.\n *\n * @remarks\n *\n * This data object is dynamically customized (registry and initial objects) based on the schema provided.\n * to the container runtime factory.\n * @deprecated use {@link createDOProviderContainerRuntimeFactory} instead\n * @internal\n */\nexport class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\tprivate readonly rootDataObjectFactory: DataObjectFactory<\n\t\tRootDataObject,\n\t\t{\n\t\t\tInitialState: RootDataObjectProps;\n\t\t}\n\t>;\n\n\tprivate readonly initialObjects: LoadableObjectClassRecord;\n\n\tconstructor(schema: ContainerSchema) {\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\t\tconst rootDataObjectFactory = new DataObjectFactory(\n\t\t\t\"rootDO\",\n\t\t\tRootDataObject,\n\t\t\tsharedObjects,\n\t\t\t{},\n\t\t\tregistryEntries,\n\t\t);\n\t\tsuper({\n\t\t\tregistryEntries: [rootDataObjectFactory.registryEntry],\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandlers: [defaultRouteRequestHandler(rootDataStoreId)],\n\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\truntimeOptions: { flushMode: FlushMode.Immediate },\n\t\t\tprovideEntryPoint: async (containerRuntime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint =\n\t\t\t\t\tawait containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(`default dataStore [${rootDataStoreId}] must exist`);\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t},\n\t\t});\n\t\tthis.rootDataObjectFactory = rootDataObjectFactory;\n\t\tthis.initialObjects = schema.initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/aqueduct#BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.rootDataObjectFactory.createRootInstance(rootDataStoreId, runtime, {\n\t\t\tinitialObjects: this.initialObjects,\n\t\t});\n\t}\n}\n"]}
|
package/lib/serviceAudience.d.ts
CHANGED
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
6
|
import { IAudience, IContainer } from "@fluidframework/container-definitions";
|
|
7
7
|
import { IClient } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { IServiceAudience, IServiceAudienceEvents, IMember, Myself } from "./types";
|
|
8
|
+
import { IServiceAudience, IServiceAudienceEvents, IMember, Myself } from "./types.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function createServiceAudience<M extends IMember = IMember>(props: {
|
|
13
|
+
container: IContainer;
|
|
14
|
+
createServiceMember: (audienceMember: IClient) => M;
|
|
15
|
+
}): IServiceAudience<M>;
|
|
9
16
|
/**
|
|
10
17
|
* Base class for providing audience information for sessions interacting with {@link IFluidContainer}
|
|
11
18
|
*
|
|
@@ -15,6 +22,8 @@ import { IServiceAudience, IServiceAudienceEvents, IMember, Myself } from "./typ
|
|
|
15
22
|
* the user and client details returned in {@link IMember}.
|
|
16
23
|
*
|
|
17
24
|
* @typeParam M - A service-specific {@link IMember} implementation.
|
|
25
|
+
* @deprecated use {@link createServiceAudience} and {@link IServiceAudience} instead
|
|
26
|
+
* @internal
|
|
18
27
|
*/
|
|
19
28
|
export declare abstract class ServiceAudience<M extends IMember = IMember> extends TypedEventEmitter<IServiceAudienceEvents<M>> implements IServiceAudience<M> {
|
|
20
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceAudience.d.ts","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"serviceAudience.d.ts","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,iBAAiB,EAAE,MAAM,8BAA8B;OACzD,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uCAAuC;OACtE,EAAE,OAAO,EAAE,MAAM,sCAAsC;OACvD,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE;AAEpE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE;IACzE,SAAS,EAAE,UAAU,CAAC;IACtB,mBAAmB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,CAAC,CAAC;CACpD,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAQtB;AAED;;;;;;;;;;;GAWG;AACH,8BAAsB,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAChE,SAAQ,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CACnD,YAAW,gBAAgB,CAAC,CAAC,CAAC;IA2B7B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU;IA5BzC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAEvC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,WAAW,iBAAwB;;IAG5C;;OAEG;IACgB,SAAS,EAAE,UAAU;IA2BzC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,GAAG,CAAC;IAElE;;OAEG;IACI,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAuBnC;;OAEG;IACI,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS;IAgBzC,OAAO,CAAC,SAAS;IAiBjB;;;;;OAKG;IACH,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CAIzD"}
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export function createServiceAudience(props) {
|
|
10
|
+
// todo: once ServiceAudience isn't exported, we can remove abstract from it, and just use that here
|
|
11
|
+
const c = class NewServiceAudience extends ServiceAudience {
|
|
12
|
+
createServiceMember(audienceMember) {
|
|
13
|
+
return props.createServiceMember(audienceMember);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return new c(props.container);
|
|
17
|
+
}
|
|
6
18
|
/**
|
|
7
19
|
* Base class for providing audience information for sessions interacting with {@link IFluidContainer}
|
|
8
20
|
*
|
|
@@ -12,6 +24,8 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
|
12
24
|
* the user and client details returned in {@link IMember}.
|
|
13
25
|
*
|
|
14
26
|
* @typeParam M - A service-specific {@link IMember} implementation.
|
|
27
|
+
* @deprecated use {@link createServiceAudience} and {@link IServiceAudience} instead
|
|
28
|
+
* @internal
|
|
15
29
|
*/
|
|
16
30
|
export class ServiceAudience extends TypedEventEmitter {
|
|
17
31
|
constructor(
|
|
@@ -122,4 +136,4 @@ export class ServiceAudience extends TypedEventEmitter {
|
|
|
122
136
|
return member.details.capabilities.interactive;
|
|
123
137
|
}
|
|
124
138
|
}
|
|
125
|
-
//# sourceMappingURL=serviceAudience.
|
|
139
|
+
//# sourceMappingURL=serviceAudience.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceAudience.mjs","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,iBAAiB,EAAE,MAAM,8BAA8B;AAKhE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAA8B,KAGlE;IACA,oGAAoG;IACpG,MAAM,CAAC,GAAG,MAAM,kBAAmB,SAAQ,eAAkB;QAClD,mBAAmB,CAAC,cAAuB;YACpD,OAAO,KAAK,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAClD,CAAC;KACD,CAAC;IACF,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAC/B,CA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AiB,EAAE,QAAQ,EAAE,CAAC;QAErE,OAAO,MAAM,CAAC;IACf,CAAC;IAEO,SAAS,CAAC,QAAgB;QACjC,oEAAoE;QACpE,MAAM,sBAAsB,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAI,sBAAsB,KAAK,SAAS,EAAE;YACzC,OAAO,SAAS,CAAC;SACjB;QACD,2EAA2E;QAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,IAAI,MAAM,KAAK,SAAS,EAAE;YACzB,MAAM,KAAK,CACV,6BAA6B,QAAQ,8CAA8C,CACnF,CAAC;SACF;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACO,qBAAqB,CAAC,MAAe;QAC9C,6BAA6B;QAC7B,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC;IAChD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IAudience, IContainer } from \"@fluidframework/container-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { IServiceAudience, IServiceAudienceEvents, IMember, Myself } from \"./types\";\n\n/**\n * @internal\n */\nexport function createServiceAudience<M extends IMember = IMember>(props: {\n\tcontainer: IContainer;\n\tcreateServiceMember: (audienceMember: IClient) => M;\n}): IServiceAudience<M> {\n\t// todo: once ServiceAudience isn't exported, we can remove abstract from it, and just use that here\n\tconst c = class NewServiceAudience extends ServiceAudience<M> {\n\t\tprotected createServiceMember(audienceMember: IClient) {\n\t\t\treturn props.createServiceMember(audienceMember);\n\t\t}\n\t};\n\treturn new c(props.container);\n}\n\n/**\n * Base class for providing audience information for sessions interacting with {@link IFluidContainer}\n *\n * @remarks\n *\n * This can be extended by different service-specific client packages to additional parameters to\n * the user and client details returned in {@link IMember}.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @deprecated use {@link createServiceAudience} and {@link IServiceAudience} instead\n * @internal\n */\nexport abstract class ServiceAudience<M extends IMember = IMember>\n\textends TypedEventEmitter<IServiceAudienceEvents<M>>\n\timplements IServiceAudience<M>\n{\n\t/**\n\t * Audience object which includes all the existing members of the {@link IFluidContainer | container}.\n\t */\n\tprotected readonly audience: IAudience;\n\n\t/**\n\t * Retain the most recent member list.\n\t *\n\t * @remarks\n\t *\n\t * This is so we have more information about a member leaving the audience in the `removeMember` event.\n\t *\n\t * It allows us to match the behavior of the `addMember` event where it only fires on a change to the members this\n\t * class exposes (and would actually produce a change in what `getMembers` returns).\n\t *\n\t * It also allows us to provide the client details in the event which makes it easier to find that client connection\n\t * in a map keyed on the `userId` and not `clientId`.\n\t *\n\t * This map will always be up-to-date in a `removeMember` event because it is set once at construction and in\n\t * every `addMember` event. It is mapped `clientId` to `M` to be better work with what the {@link IServiceAudience}\n\t * events provide.\n\t */\n\tprotected lastMembers = new Map<string, M>();\n\n\tconstructor(\n\t\t/**\n\t\t * Fluid Container to read the audience from.\n\t\t */\n\t\tprotected readonly container: IContainer,\n\t) {\n\t\tsuper();\n\t\tthis.audience = container.audience;\n\n\t\t// getMembers will assign lastMembers so the removeMember event has what it needs\n\t\t// in case it would fire before getMembers otherwise gets called the first time\n\t\tthis.getMembers();\n\n\t\tthis.audience.on(\"addMember\", (clientId: string, details: IClient) => {\n\t\t\tif (this.shouldIncludeAsMember(details)) {\n\t\t\t\tconst member = this.getMember(clientId);\n\t\t\t\tthis.emit(\"memberAdded\", clientId, member);\n\t\t\t\tthis.emit(\"membersChanged\");\n\t\t\t}\n\t\t});\n\n\t\tthis.audience.on(\"removeMember\", (clientId: string) => {\n\t\t\tif (this.lastMembers.has(clientId)) {\n\t\t\t\tthis.emit(\"memberRemoved\", clientId, this.lastMembers.get(clientId));\n\t\t\t\tthis.emit(\"membersChanged\");\n\t\t\t}\n\t\t});\n\n\t\tthis.container.on(\"connected\", () => this.emit(\"membersChanged\"));\n\t}\n\n\t/**\n\t * Provides ability for inheriting class to modify/extend the audience object.\n\t *\n\t * @param audienceMember - Record of a specific audience member.\n\t */\n\tprotected abstract createServiceMember(audienceMember: IClient): M;\n\n\t/**\n\t * {@inheritDoc IServiceAudience.getMembers}\n\t */\n\tpublic getMembers(): Map<string, M> {\n\t\tconst users = new Map<string, M>();\n\t\tconst clientMemberMap = new Map<string, M>();\n\t\t// Iterate through the members and get the user specifics.\n\t\tthis.audience.getMembers().forEach((member: IClient, clientId: string) => {\n\t\t\tif (this.shouldIncludeAsMember(member)) {\n\t\t\t\tconst userId = member.user.id;\n\t\t\t\t// Ensure we're tracking the user\n\t\t\t\tlet user = users.get(userId);\n\t\t\t\tif (user === undefined) {\n\t\t\t\t\tuser = this.createServiceMember(member);\n\t\t\t\t\tusers.set(userId, user);\n\t\t\t\t}\n\n\t\t\t\t// Add this connection to their collection\n\t\t\t\tuser.connections.push({ id: clientId, mode: member.mode });\n\t\t\t\tclientMemberMap.set(clientId, user);\n\t\t\t}\n\t\t});\n\t\tthis.lastMembers = clientMemberMap;\n\t\treturn users;\n\t}\n\n\t/**\n\t * {@inheritDoc IServiceAudience.getMyself}\n\t */\n\tpublic getMyself(): Myself<M> | undefined {\n\t\tconst clientId = this.container.clientId;\n\t\tif (clientId === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst member = this.getMember(clientId);\n\t\tif (member === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst myself: Myself<M> = { ...member, currentConnection: clientId };\n\n\t\treturn myself;\n\t}\n\n\tprivate getMember(clientId: string): M | undefined {\n\t\t// Fetch the user ID assoicated with this client ID from the runtime\n\t\tconst internalAudienceMember = this.audience.getMember(clientId);\n\t\tif (internalAudienceMember === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Return the member object with any other clients associated for this user\n\t\tconst allMembers = this.getMembers();\n\t\tconst member = allMembers.get(internalAudienceMember?.user.id);\n\t\tif (member === undefined) {\n\t\t\tthrow Error(\n\t\t\t\t`Attempted to fetch client ${clientId} that is not part of the current member list`,\n\t\t\t);\n\t\t}\n\t\treturn member;\n\t}\n\n\t/**\n\t * Provides ability for the inheriting class to include/omit specific members.\n\t * An example use case is omitting the summarizer client.\n\t *\n\t * @param member - Member to be included/omitted.\n\t */\n\tprotected shouldIncludeAsMember(member: IClient): boolean {\n\t\t// Include only human members\n\t\treturn member.details.capabilities.interactive;\n\t}\n}\n"]}
|
package/lib/types.d.ts
CHANGED
|
@@ -7,17 +7,20 @@ import { IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
|
7
7
|
import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
|
|
8
8
|
/**
|
|
9
9
|
* A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
|
|
10
|
+
* @alpha
|
|
10
11
|
*/
|
|
11
12
|
export type LoadableObjectRecord = Record<string, IFluidLoadable>;
|
|
12
13
|
/**
|
|
13
14
|
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
14
15
|
* or `SharedObject` in a {@link LoadableObjectRecord}.
|
|
16
|
+
* @alpha
|
|
15
17
|
*/
|
|
16
18
|
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
|
|
17
19
|
/**
|
|
18
20
|
* A class object of `DataObject` or `SharedObject`.
|
|
19
21
|
*
|
|
20
22
|
* @typeParam T - The class of the `DataObject` or `SharedObject`.
|
|
23
|
+
* @alpha
|
|
21
24
|
*/
|
|
22
25
|
export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
|
|
23
26
|
/**
|
|
@@ -25,6 +28,7 @@ export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> |
|
|
|
25
28
|
* constructor that will return the type of the `DataObject`.
|
|
26
29
|
*
|
|
27
30
|
* @typeParam T - The class of the `DataObject`.
|
|
31
|
+
* @alpha
|
|
28
32
|
*/
|
|
29
33
|
export type DataObjectClass<T extends IFluidLoadable> = {
|
|
30
34
|
readonly factory: IFluidDataStoreFactory;
|
|
@@ -34,6 +38,7 @@ export type DataObjectClass<T extends IFluidLoadable> = {
|
|
|
34
38
|
* constructor that will return the type of the `DataObject`.
|
|
35
39
|
*
|
|
36
40
|
* @typeParam T - The class of the `SharedObject`.
|
|
41
|
+
* @alpha
|
|
37
42
|
*/
|
|
38
43
|
export type SharedObjectClass<T extends IFluidLoadable> = {
|
|
39
44
|
readonly getFactory: () => IChannelFactory;
|
|
@@ -42,6 +47,7 @@ export type SharedObjectClass<T extends IFluidLoadable> = {
|
|
|
42
47
|
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
43
48
|
*
|
|
44
49
|
* @typeParam T - The class of the loadable object.
|
|
50
|
+
* @alpha
|
|
45
51
|
*/
|
|
46
52
|
export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
47
53
|
/**
|
|
@@ -51,6 +57,7 @@ export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[])
|
|
|
51
57
|
*
|
|
52
58
|
* It includes both the instances of objects that are initially available upon `Container` creation, as well
|
|
53
59
|
* as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
|
|
60
|
+
* @alpha
|
|
54
61
|
*/
|
|
55
62
|
export interface ContainerSchema {
|
|
56
63
|
/**
|
|
@@ -84,11 +91,18 @@ export interface ContainerSchema {
|
|
|
84
91
|
*/
|
|
85
92
|
dynamicObjectTypes?: LoadableObjectClass<any>[];
|
|
86
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export interface IProvideRootDataObject {
|
|
98
|
+
readonly IRootDataObject?: IRootDataObject;
|
|
99
|
+
}
|
|
87
100
|
/**
|
|
88
101
|
* Holds the collection of objects that the container was initially created with, as well as provides the ability
|
|
89
102
|
* to dynamically create further objects during usage.
|
|
103
|
+
* @internal
|
|
90
104
|
*/
|
|
91
|
-
export interface IRootDataObject {
|
|
105
|
+
export interface IRootDataObject extends IProvideRootDataObject {
|
|
92
106
|
/**
|
|
93
107
|
* Provides a record of the initial objects defined on creation.
|
|
94
108
|
*/
|
|
@@ -109,6 +123,7 @@ export interface IRootDataObject {
|
|
|
109
123
|
* @param member - The service-specific member object for the client.
|
|
110
124
|
*
|
|
111
125
|
* @see See {@link IServiceAudienceEvents} for usage details.
|
|
126
|
+
* @alpha
|
|
112
127
|
*/
|
|
113
128
|
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
114
129
|
/**
|
|
@@ -120,6 +135,7 @@ export type MemberChangedListener<M extends IMember> = (clientId: string, member
|
|
|
120
135
|
* {@link IServiceAudience.getMembers} method will emit events.
|
|
121
136
|
*
|
|
122
137
|
* @typeParam M - A service-specific {@link IMember} implementation.
|
|
138
|
+
* @alpha
|
|
123
139
|
*/
|
|
124
140
|
export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
125
141
|
/**
|
|
@@ -150,6 +166,7 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
|
150
166
|
* details about the connecting client, such as device information, environment, or a username.
|
|
151
167
|
*
|
|
152
168
|
* @typeParam M - A service-specific {@link IMember} type.
|
|
169
|
+
* @alpha
|
|
153
170
|
*/
|
|
154
171
|
export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
|
|
155
172
|
/**
|
|
@@ -167,6 +184,7 @@ export interface IServiceAudience<M extends IMember> extends IEventProvider<ISer
|
|
|
167
184
|
* Base interface for information for each connection made to the Fluid session.
|
|
168
185
|
*
|
|
169
186
|
* @remarks This interface can be extended to provide additional information specific to each service.
|
|
187
|
+
* @alpha
|
|
170
188
|
*/
|
|
171
189
|
export interface IConnection {
|
|
172
190
|
/**
|
|
@@ -182,6 +200,7 @@ export interface IConnection {
|
|
|
182
200
|
* Base interface to be implemented to fetch each service's member.
|
|
183
201
|
*
|
|
184
202
|
* @remarks This interface can be extended by each service to provide additional service-specific user metadata.
|
|
203
|
+
* @alpha
|
|
185
204
|
*/
|
|
186
205
|
export interface IMember {
|
|
187
206
|
/**
|
|
@@ -195,6 +214,7 @@ export interface IMember {
|
|
|
195
214
|
}
|
|
196
215
|
/**
|
|
197
216
|
* An extended member object that includes currentConnection
|
|
217
|
+
* @alpha
|
|
198
218
|
*/
|
|
199
219
|
export type Myself<M extends IMember = IMember> = M & {
|
|
200
220
|
currentConnection: string;
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC;OACjF,EAAE,eAAe,EAAE,MAAM,uCAAuC;OAChE,EAAE,sBAAsB,EAAE,MAAM,qCAAqC;AAE5E;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,cAAc,IACrD,eAAe,CAAC,CAAC,CAAC,GAClB,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IACvD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CACzC,GAAG,kBAAkB,CAAC,CAAC,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