@fluidframework/fluid-static 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +3 -3
  4. package/api-report/fluid-static.api.md +45 -61
  5. package/dist/fluid-static-alpha.d.ts +408 -0
  6. package/dist/fluid-static-beta.d.ts +78 -0
  7. package/dist/fluid-static-public.d.ts +78 -0
  8. package/dist/fluid-static-untrimmed.d.ts +448 -0
  9. package/dist/fluidContainer.cjs +10 -4
  10. package/dist/fluidContainer.cjs.map +1 -1
  11. package/dist/fluidContainer.d.ts +8 -82
  12. package/dist/fluidContainer.d.ts.map +1 -1
  13. package/dist/index.cjs +4 -4
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/rootDataObject.cjs +34 -12
  18. package/dist/rootDataObject.cjs.map +1 -1
  19. package/dist/rootDataObject.d.ts +6 -58
  20. package/dist/rootDataObject.d.ts.map +1 -1
  21. package/dist/serviceAudience.cjs +11 -3
  22. package/dist/serviceAudience.cjs.map +1 -1
  23. package/dist/serviceAudience.d.ts +7 -66
  24. package/dist/serviceAudience.d.ts.map +1 -1
  25. package/dist/types.cjs.map +1 -1
  26. package/dist/types.d.ts +24 -3
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/utils.cjs +3 -1
  29. package/dist/utils.cjs.map +1 -1
  30. package/dist/utils.d.ts +10 -2
  31. package/dist/utils.d.ts.map +1 -1
  32. package/lib/fluid-static-alpha.d.ts +408 -0
  33. package/lib/fluid-static-beta.d.ts +78 -0
  34. package/lib/fluid-static-public.d.ts +78 -0
  35. package/lib/fluid-static-untrimmed.d.ts +448 -0
  36. package/lib/fluidContainer.d.ts +9 -83
  37. package/lib/fluidContainer.d.ts.map +1 -1
  38. package/lib/fluidContainer.mjs +9 -3
  39. package/lib/fluidContainer.mjs.map +1 -1
  40. package/lib/index.d.ts +4 -9
  41. package/lib/index.d.ts.map +1 -1
  42. package/lib/index.mjs +3 -3
  43. package/lib/index.mjs.map +1 -1
  44. package/lib/rootDataObject.d.ts +6 -58
  45. package/lib/rootDataObject.d.ts.map +1 -1
  46. package/lib/rootDataObject.mjs +36 -15
  47. package/lib/rootDataObject.mjs.map +1 -1
  48. package/lib/serviceAudience.d.ts +7 -66
  49. package/lib/serviceAudience.d.ts.map +1 -1
  50. package/lib/serviceAudience.mjs +10 -2
  51. package/lib/serviceAudience.mjs.map +1 -1
  52. package/lib/types.d.ts +24 -3
  53. package/lib/types.d.ts.map +1 -1
  54. package/lib/types.mjs.map +1 -1
  55. package/lib/utils.d.ts +11 -3
  56. package/lib/utils.d.ts.map +1 -1
  57. package/lib/utils.mjs +3 -1
  58. package/lib/utils.mjs.map +1 -1
  59. package/package.json +56 -32
  60. package/src/fluidContainer.ts +18 -3
  61. package/src/index.ts +4 -3
  62. package/src/rootDataObject.ts +48 -18
  63. package/src/serviceAudience.ts +17 -12
  64. package/src/types.ts +23 -3
  65. package/src/utils.ts +20 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @fluidframework/fluid-static
2
2
 
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - azure-client: Removed deprecated FluidStatic classes [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ Several FluidStatic classes were unnecessarily exposed and were deprecated in an earlier release. They have been replaced with creation functions. This helps us
10
+ keep implementations decoupled from usage which is easier to maintain and extend. It has very minimal impact on the
11
+ public surface area of downstream packages. The removed classes are as follows:
12
+
13
+ - `AzureAudience` (use `IAzureAudience` instead)
14
+ - `TinyliciousAudience` (use `ITinyliciousAudience` instead)
15
+ - `DOProviderContainerRuntimeFactory`
16
+ - `FluidContainer`
17
+ - `ServiceAudience`
18
+
19
+ ## 2.0.0-internal.7.4.0
20
+
21
+ ### Minor Changes
22
+
23
+ - azure-client: Deprecated FluidStatic Classes ([#18402](https://github.com/microsoft/FluidFramework/issues/18402)) [589ec39de5](https://github.com/microsoft/FluidFramework/commits/589ec39de52116c7f782319e6f6aa61bc5aa9964)
24
+
25
+ Several FluidStatic classes were unnecessarily exposed. They have been replaced with creation functions. This helps us
26
+ keep implementations decoupled from usage which is easier to maintain and extend. It has very minimal impact on the
27
+ public surface area of downstream packages. The deprecated classes are as follows:
28
+
29
+ - `AzureAudience` (use `IAzureAudience` instead)
30
+ - `TinyliciousAudience` (use `ITinyliciousAudience` instead)
31
+ - `DOProviderContainerRuntimeFactory`
32
+ - `FluidContainer`
33
+ - `ServiceAudience`
34
+
3
35
  ## 2.0.0-internal.7.3.0
4
36
 
5
37
  Dependency updates only.
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ // TODO: remove once base config has this enabled as an error
7
+ "ae-incompatible-release-tags": {
8
+ "logLevel": "error",
9
+ "addToApiReportFile": false
10
+ }
11
+ }
12
+ }
13
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-base.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json",
4
4
  "messages": {
5
5
  "extractorMessageReporting": {
6
- "ae-missing-release-tag": {
7
- // TODO: Fix violations and remove this rule override
6
+ // TODO: Add missing documentation and remove this rule override
7
+ "ae-undocumented": {
8
8
  "logLevel": "none"
9
9
  }
10
10
  }
@@ -5,62 +5,53 @@
5
5
  ```ts
6
6
 
7
7
  import { AttachState } from '@fluidframework/container-definitions';
8
- import { BaseContainerRuntimeFactory } from '@fluidframework/aqueduct';
9
8
  import { ConnectionState } from '@fluidframework/container-definitions';
10
- import { IAudience } from '@fluidframework/container-definitions';
11
9
  import { IChannelFactory } from '@fluidframework/datastore-definitions';
12
10
  import { IClient } from '@fluidframework/protocol-definitions';
13
11
  import { IContainer } from '@fluidframework/container-definitions';
14
- import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
15
12
  import { ICriticalContainerError } from '@fluidframework/container-definitions';
16
13
  import { IEvent } from '@fluidframework/core-interfaces';
17
14
  import { IEventProvider } from '@fluidframework/core-interfaces';
18
- import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
19
15
  import { IFluidLoadable } from '@fluidframework/core-interfaces';
20
- import { TypedEventEmitter } from '@fluid-internal/client-utils';
16
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
21
17
 
22
- // @public
18
+ // @alpha
23
19
  export interface ContainerSchema {
24
20
  dynamicObjectTypes?: LoadableObjectClass<any>[];
25
21
  initialObjects: LoadableObjectClassRecord;
26
22
  }
27
23
 
28
- // @public
29
- export type DataObjectClass<T extends IFluidLoadable> = {
30
- readonly factory: IFluidDataStoreFactory;
31
- } & LoadableObjectCtor<T>;
24
+ // @internal (undocumented)
25
+ export function createDOProviderContainerRuntimeFactory(props: {
26
+ schema: ContainerSchema;
27
+ }): IRuntimeFactory;
32
28
 
33
- // @public
34
- export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {
35
- constructor(schema: ContainerSchema);
36
- // (undocumented)
37
- protected containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void>;
38
- }
29
+ // @internal (undocumented)
30
+ export function createFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema>(props: {
31
+ container: IContainer;
32
+ rootDataObject: IRootDataObject;
33
+ }): IFluidContainer<TContainerSchema>;
39
34
 
40
- // @public
41
- export class FluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer<TContainerSchema> {
42
- constructor(container: IContainer, rootDataObject: IRootDataObject);
43
- attach(): Promise<string>;
44
- get attachState(): AttachState;
45
- connect(): Promise<void>;
46
- get connectionState(): ConnectionState;
47
- create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
48
- disconnect(): Promise<void>;
49
- dispose(): void;
50
- get disposed(): boolean;
51
- get initialObjects(): InitialObjects<TContainerSchema>;
52
- // @internal
53
- readonly INTERNAL_CONTAINER_DO_NOT_USE?: () => IContainer;
54
- get isDirty(): boolean;
55
- }
35
+ // @internal (undocumented)
36
+ export function createServiceAudience<M extends IMember = IMember>(props: {
37
+ container: IContainer;
38
+ createServiceMember: (audienceMember: IClient) => M;
39
+ }): IServiceAudience<M>;
40
+
41
+ // @alpha
42
+ export type DataObjectClass<T extends IFluidLoadable> = {
43
+ readonly factory: {
44
+ IFluidDataStoreFactory: DataObjectClass<T>["factory"];
45
+ };
46
+ } & LoadableObjectCtor<T>;
56
47
 
57
- // @public
48
+ // @alpha
58
49
  export interface IConnection {
59
50
  id: string;
60
51
  mode: "write" | "read";
61
52
  }
62
53
 
63
- // @public
54
+ // @alpha
64
55
  export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
65
56
  attach(): Promise<string>;
66
57
  readonly attachState: AttachState;
@@ -74,7 +65,7 @@ export interface IFluidContainer<TContainerSchema extends ContainerSchema = Cont
74
65
  readonly isDirty: boolean;
75
66
  }
76
67
 
77
- // @public
68
+ // @alpha
78
69
  export interface IFluidContainerEvents extends IEvent {
79
70
  (event: "connected", listener: () => void): void;
80
71
  (event: "disconnected", listener: () => void): void;
@@ -83,30 +74,36 @@ export interface IFluidContainerEvents extends IEvent {
83
74
  (event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
84
75
  }
85
76
 
86
- // @public
77
+ // @alpha
87
78
  export interface IMember {
88
79
  connections: IConnection[];
89
80
  userId: string;
90
81
  }
91
82
 
92
- // @public
83
+ // @alpha
93
84
  export type InitialObjects<T extends ContainerSchema> = {
94
85
  [K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
95
86
  };
96
87
 
97
- // @public
98
- export interface IRootDataObject {
88
+ // @internal (undocumented)
89
+ export interface IProvideRootDataObject {
90
+ // (undocumented)
91
+ readonly IRootDataObject: IRootDataObject;
92
+ }
93
+
94
+ // @internal
95
+ export interface IRootDataObject extends IProvideRootDataObject {
99
96
  create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
100
97
  readonly initialObjects: LoadableObjectRecord;
101
98
  }
102
99
 
103
- // @public
100
+ // @alpha
104
101
  export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
105
102
  getMembers(): Map<string, M>;
106
103
  getMyself(): Myself<M> | undefined;
107
104
  }
108
105
 
109
- // @public
106
+ // @alpha
110
107
  export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
111
108
  // @eventProperty
112
109
  (event: "membersChanged", listener: () => void): void;
@@ -116,40 +113,27 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
116
113
  (event: "memberRemoved", listener: MemberChangedListener<M>): void;
117
114
  }
118
115
 
119
- // @public
116
+ // @alpha
120
117
  export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
121
118
 
122
- // @public
119
+ // @alpha
123
120
  export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
124
121
 
125
- // @public
122
+ // @alpha
126
123
  export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
127
124
 
128
- // @public
125
+ // @alpha
129
126
  export type LoadableObjectRecord = Record<string, IFluidLoadable>;
130
127
 
131
- // @public
128
+ // @alpha
132
129
  export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
133
130
 
134
- // @public
131
+ // @alpha
135
132
  export type Myself<M extends IMember = IMember> = M & {
136
133
  currentConnection: string;
137
134
  };
138
135
 
139
- // @public
140
- export abstract class ServiceAudience<M extends IMember = IMember> extends TypedEventEmitter<IServiceAudienceEvents<M>> implements IServiceAudience<M> {
141
- constructor(
142
- container: IContainer);
143
- protected readonly audience: IAudience;
144
- protected readonly container: IContainer;
145
- protected abstract createServiceMember(audienceMember: IClient): M;
146
- getMembers(): Map<string, M>;
147
- getMyself(): Myself<M> | undefined;
148
- protected lastMembers: Map<string, M>;
149
- protected shouldIncludeAsMember(member: IClient): boolean;
150
- }
151
-
152
- // @public
136
+ // @alpha
153
137
  export type SharedObjectClass<T extends IFluidLoadable> = {
154
138
  readonly getFactory: () => IChannelFactory;
155
139
  } & LoadableObjectCtor<T>;
@@ -0,0 +1,408 @@
1
+ /**
2
+ * Provides a simple and powerful way to consume collaborative Fluid data.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+
7
+ import { AttachState } from '@fluidframework/container-definitions';
8
+ import { ConnectionState } from '@fluidframework/container-definitions';
9
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
10
+ import { IClient } from '@fluidframework/protocol-definitions';
11
+ import { IContainer } from '@fluidframework/container-definitions';
12
+ import { ICriticalContainerError } from '@fluidframework/container-definitions';
13
+ import { IEvent } from '@fluidframework/core-interfaces';
14
+ import { IEventProvider } from '@fluidframework/core-interfaces';
15
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
16
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
17
+
18
+ /**
19
+ * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.
20
+ *
21
+ * @remarks
22
+ *
23
+ * It includes both the instances of objects that are initially available upon `Container` creation, as well
24
+ * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
25
+ * @alpha
26
+ */
27
+ export declare interface ContainerSchema {
28
+ /**
29
+ * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.
30
+ *
31
+ * @remarks It uses the key as the id and the value as the loadable object to create.
32
+ *
33
+ * @example
34
+ *
35
+ * In the example below two objects will be created when the `Container` is first
36
+ * created. One with id "map1" that will return a `SharedMap` and the other with
37
+ * id "pair1" that will return a `KeyValueDataObject`.
38
+ *
39
+ * ```typescript
40
+ * {
41
+ * map1: SharedMap,
42
+ * pair1: KeyValueDataObject,
43
+ * }
44
+ * ```
45
+ */
46
+ initialObjects: LoadableObjectClassRecord;
47
+ /**
48
+ * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
49
+ *
50
+ * @remarks
51
+ *
52
+ * Types defined in `initialObjects` will always be available and are not required to be provided here.
53
+ *
54
+ * For best practice it's recommended to define all the dynamic types you create even if they are
55
+ * included via initialObjects.
56
+ */
57
+ dynamicObjectTypes?: LoadableObjectClass<any>[];
58
+ }
59
+
60
+ /* Excluded from this release type: createDOProviderContainerRuntimeFactory */
61
+
62
+ /* Excluded from this release type: createFluidContainer */
63
+
64
+ /* Excluded from this release type: createServiceAudience */
65
+
66
+ /**
67
+ * A class that has a factory that can create a `DataObject` and a
68
+ * constructor that will return the type of the `DataObject`.
69
+ *
70
+ * @typeParam T - The class of the `DataObject`.
71
+ * @alpha
72
+ */
73
+ export declare type DataObjectClass<T extends IFluidLoadable> = {
74
+ readonly factory: {
75
+ IFluidDataStoreFactory: DataObjectClass<T>["factory"];
76
+ };
77
+ } & LoadableObjectCtor<T>;
78
+
79
+ /**
80
+ * Base interface for information for each connection made to the Fluid session.
81
+ *
82
+ * @remarks This interface can be extended to provide additional information specific to each service.
83
+ * @alpha
84
+ */
85
+ export declare interface IConnection {
86
+ /**
87
+ * A unique ID for the connection. A single user may have multiple connections, each with a different ID.
88
+ */
89
+ id: string;
90
+ /**
91
+ * Whether the connection is in read or read/write mode.
92
+ */
93
+ mode: "write" | "read";
94
+ }
95
+
96
+ /**
97
+ * Provides an entrypoint into the client side of collaborative Fluid data.
98
+ * Provides access to the data as well as status on the collaboration session.
99
+ *
100
+ * @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
101
+ *
102
+ * @remarks Note: external implementations of this interface are not supported.
103
+ * @alpha
104
+ */
105
+ export declare interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
106
+ /**
107
+ * Provides the current connected state of the container
108
+ */
109
+ readonly connectionState: ConnectionState;
110
+ /**
111
+ * A container is considered **dirty** if it has local changes that have not yet been acknowledged by the service.
112
+ *
113
+ * @remarks
114
+ *
115
+ * You should always check the `isDirty` flag before closing the container or navigating away from the page.
116
+ * Closing the container while `isDirty === true` may result in the loss of operations that have not yet been
117
+ * acknowledged by the service.
118
+ *
119
+ * A container is considered dirty in the following cases:
120
+ *
121
+ * 1. The container has been created in the detached state, and either it has not been attached yet or it is
122
+ * in the process of being attached (container is in `attaching` state). If container is closed prior to being
123
+ * attached, host may never know if the file was created or not.
124
+ *
125
+ * 2. The container was attached, but it has local changes that have not yet been saved to service endpoint.
126
+ * This occurs as part of normal op flow where pending operation (changes) are awaiting acknowledgement from the
127
+ * service. In some cases this can be due to lack of network connection. If the network connection is down,
128
+ * it needs to be restored for the pending changes to be acknowledged.
129
+ */
130
+ readonly isDirty: boolean;
131
+ /**
132
+ * Whether or not the container is disposed, which permanently disables it.
133
+ */
134
+ readonly disposed: boolean;
135
+ /**
136
+ * The collection of data objects and Distributed Data Stores (DDSes) that were specified by the schema.
137
+ *
138
+ * @remarks These data objects and DDSes exist for the lifetime of the container.
139
+ */
140
+ readonly initialObjects: InitialObjects<TContainerSchema>;
141
+ /**
142
+ * The current attachment state of the container.
143
+ *
144
+ * @remarks
145
+ *
146
+ * Once a container has been attached, it remains attached.
147
+ * When loading an existing container, it will already be attached.
148
+ */
149
+ readonly attachState: AttachState;
150
+ /**
151
+ * A newly created container starts detached from the collaborative service.
152
+ * Calling `attach()` uploads the new container to the service and connects to the collaborative service.
153
+ *
154
+ * @remarks
155
+ *
156
+ * This should only be called when the container is in the
157
+ * {@link @fluidframework/container-definitions#AttachState.Detatched} state.
158
+ *
159
+ * This can be determined by observing {@link IFluidContainer.attachState}.
160
+ *
161
+ * @returns A promise which resolves when the attach is complete, with the string identifier of the container.
162
+ */
163
+ attach(): Promise<string>;
164
+ /**
165
+ * Attempts to connect the container to the delta stream and process operations.
166
+ *
167
+ * @throws Will throw an error if connection is unsuccessful.
168
+ *
169
+ * @remarks
170
+ *
171
+ * This should only be called when the container is in the
172
+ * {@link @fluidframework/container-definitions#ConnectionState.Disconnected} state.
173
+ *
174
+ * This can be determined by observing {@link IFluidContainer.connectionState}.
175
+ */
176
+ connect(): void;
177
+ /**
178
+ * Disconnects the container from the delta stream and stops processing operations.
179
+ *
180
+ * @remarks
181
+ *
182
+ * This should only be called when the container is in the
183
+ * {@link @fluidframework/container-definitions#ConnectionState.Connected} state.
184
+ *
185
+ * This can be determined by observing {@link IFluidContainer.connectionState}.
186
+ */
187
+ disconnect(): void;
188
+ /**
189
+ * Create a new data object or Distributed Data Store (DDS) of the specified type.
190
+ *
191
+ * @remarks
192
+ *
193
+ * In order to share the data object or DDS with other
194
+ * collaborators and retrieve it later, store its handle in a collection like a SharedDirectory from your
195
+ * initialObjects.
196
+ *
197
+ * @param objectClass - The class of the `DataObject` or `SharedObject` to create.
198
+ *
199
+ * @typeParam T - The class of the `DataObject` or `SharedObject`.
200
+ */
201
+ create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
202
+ /**
203
+ * Dispose of the container instance, permanently disabling it.
204
+ */
205
+ dispose(): void;
206
+ }
207
+
208
+ /**
209
+ * Events emitted from {@link IFluidContainer}.
210
+ * @alpha
211
+ */
212
+ export declare interface IFluidContainerEvents extends IEvent {
213
+ /**
214
+ * Emitted when the {@link IFluidContainer} completes connecting to the Fluid service.
215
+ *
216
+ * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
217
+ *
218
+ * @see
219
+ *
220
+ * - {@link IFluidContainer.connectionState}
221
+ *
222
+ * - {@link IFluidContainer.connect}
223
+ */
224
+ (event: "connected", listener: () => void): void;
225
+ /**
226
+ * Emitted when the {@link IFluidContainer} becomes disconnected from the Fluid service.
227
+ *
228
+ * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
229
+ *
230
+ * @see
231
+ *
232
+ * - {@link IFluidContainer.connectionState}
233
+ *
234
+ * - {@link IFluidContainer.disconnect}
235
+ */
236
+ (event: "disconnected", listener: () => void): void;
237
+ /**
238
+ * Emitted when all local changes/edits have been acknowledged by the service.
239
+ *
240
+ * @remarks "dirty" event will be emitted when the next local change has been made.
241
+ *
242
+ * @see {@link IFluidContainer.isDirty}
243
+ */
244
+ (event: "saved", listener: () => void): void;
245
+ /**
246
+ * Emitted when the first local change has been made, following a "saved" event.
247
+ *
248
+ * @remarks "saved" event will be emitted once all local changes have been acknowledged by the service.
249
+ *
250
+ * @see {@link IFluidContainer.isDirty}
251
+ */
252
+ (event: "dirty", listener: () => void): void;
253
+ /**
254
+ * Emitted when the {@link IFluidContainer} is closed, which permanently disables it.
255
+ *
256
+ * @remarks Listener parameters:
257
+ *
258
+ * - `error`: If the container was closed due to error (as opposed to an explicit call to
259
+ * {@link IFluidContainer.dispose}), this will contain details about the error that caused it.
260
+ */
261
+ (event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
262
+ }
263
+
264
+ /**
265
+ * Base interface to be implemented to fetch each service's member.
266
+ *
267
+ * @remarks This interface can be extended by each service to provide additional service-specific user metadata.
268
+ * @alpha
269
+ */
270
+ export declare interface IMember {
271
+ /**
272
+ * An ID for the user, unique among each individual user connecting to the session.
273
+ */
274
+ userId: string;
275
+ /**
276
+ * The set of connections the user has made, e.g. from multiple tabs or devices.
277
+ */
278
+ connections: IConnection[];
279
+ }
280
+
281
+ /**
282
+ * Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
283
+ * @alpha
284
+ */
285
+ export declare type InitialObjects<T extends ContainerSchema> = {
286
+ [K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
287
+ };
288
+
289
+ /* Excluded from this release type: IProvideRootDataObject */
290
+
291
+ /* Excluded from this release type: IRootDataObject */
292
+
293
+ /**
294
+ * Base interface to be implemented to fetch each service's audience.
295
+ *
296
+ * @remarks
297
+ *
298
+ * The type parameter `M` allows consumers to further extend the client object with service-specific
299
+ * details about the connecting client, such as device information, environment, or a username.
300
+ *
301
+ * @typeParam M - A service-specific {@link IMember} type.
302
+ * @alpha
303
+ */
304
+ export declare interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
305
+ /**
306
+ * Returns an map of all users currently in the Fluid session where key is the userId and the value is the
307
+ * member object. The implementation may choose to exclude certain connections from the returned map.
308
+ * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
309
+ */
310
+ getMembers(): Map<string, M>;
311
+ /**
312
+ * Returns the current active user on this client once they are connected. Otherwise, returns undefined.
313
+ */
314
+ getMyself(): Myself<M> | undefined;
315
+ }
316
+
317
+ /**
318
+ * Events that trigger when the roster of members in the Fluid session change.
319
+ *
320
+ * @remarks
321
+ *
322
+ * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s
323
+ * {@link IServiceAudience.getMembers} method will emit events.
324
+ *
325
+ * @typeParam M - A service-specific {@link IMember} implementation.
326
+ * @alpha
327
+ */
328
+ export declare interface IServiceAudienceEvents<M extends IMember> extends IEvent {
329
+ /**
330
+ * Emitted when a {@link IMember | member}(s) are either added or removed.
331
+ *
332
+ * @eventProperty
333
+ */
334
+ (event: "membersChanged", listener: () => void): void;
335
+ /**
336
+ * Emitted when a {@link IMember | member} joins the audience.
337
+ *
338
+ * @eventProperty
339
+ */
340
+ (event: "memberAdded", listener: MemberChangedListener<M>): void;
341
+ /**
342
+ * Emitted when a {@link IMember | member} leaves the audience.
343
+ *
344
+ * @eventProperty
345
+ */
346
+ (event: "memberRemoved", listener: MemberChangedListener<M>): void;
347
+ }
348
+
349
+ /**
350
+ * A class object of `DataObject` or `SharedObject`.
351
+ *
352
+ * @typeParam T - The class of the `DataObject` or `SharedObject`.
353
+ * @alpha
354
+ */
355
+ export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
356
+
357
+ /**
358
+ * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
359
+ * or `SharedObject` in a {@link LoadableObjectRecord}.
360
+ * @alpha
361
+ */
362
+ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
363
+
364
+ /**
365
+ * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
366
+ *
367
+ * @typeParam T - The class of the loadable object.
368
+ * @alpha
369
+ */
370
+ export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
371
+
372
+ /**
373
+ * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
374
+ * @alpha
375
+ */
376
+ export declare type LoadableObjectRecord = Record<string, IFluidLoadable>;
377
+
378
+ /**
379
+ * Signature for {@link IMember} change events.
380
+ *
381
+ * @param clientId - A unique identifier for the client.
382
+ * @param member - The service-specific member object for the client.
383
+ *
384
+ * @see See {@link IServiceAudienceEvents} for usage details.
385
+ * @alpha
386
+ */
387
+ export declare type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
388
+
389
+ /**
390
+ * An extended member object that includes currentConnection
391
+ * @alpha
392
+ */
393
+ export declare type Myself<M extends IMember = IMember> = M & {
394
+ currentConnection: string;
395
+ };
396
+
397
+ /**
398
+ * A class that has a factory that can create a DDSes (`SharedObject`s) and a
399
+ * constructor that will return the type of the `DataObject`.
400
+ *
401
+ * @typeParam T - The class of the `SharedObject`.
402
+ * @alpha
403
+ */
404
+ export declare type SharedObjectClass<T extends IFluidLoadable> = {
405
+ readonly getFactory: () => IChannelFactory;
406
+ } & LoadableObjectCtor<T>;
407
+
408
+ export { }