@fluidframework/fluid-static 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +0 -6
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/fluid-static.api.md +16 -16
  7. package/dist/fluid-static-alpha.d.ts +20 -20
  8. package/dist/fluid-static-beta.d.ts +363 -29
  9. package/dist/fluid-static-public.d.ts +363 -29
  10. package/dist/fluid-static-untrimmed.d.ts +20 -16
  11. package/dist/fluidContainer.d.ts +7 -3
  12. package/dist/fluidContainer.d.ts.map +1 -1
  13. package/dist/{fluidContainer.cjs → fluidContainer.js} +1 -1
  14. package/dist/fluidContainer.js.map +1 -0
  15. package/dist/{index.cjs → index.js} +4 -4
  16. package/dist/index.js.map +1 -0
  17. package/dist/{rootDataObject.cjs → rootDataObject.js} +9 -5
  18. package/dist/rootDataObject.js.map +1 -0
  19. package/dist/{serviceAudience.cjs → serviceAudience.js} +1 -1
  20. package/dist/serviceAudience.js.map +1 -0
  21. package/dist/types.d.ts +13 -13
  22. package/dist/{types.cjs → types.js} +1 -1
  23. package/dist/types.js.map +1 -0
  24. package/dist/{utils.cjs → utils.js} +1 -1
  25. package/dist/utils.js.map +1 -0
  26. package/lib/fluid-static-alpha.d.mts +402 -0
  27. package/lib/{fluid-static-alpha.d.ts → fluid-static-beta.d.mts} +24 -26
  28. package/lib/fluid-static-public.d.mts +406 -0
  29. package/lib/{fluid-static-untrimmed.d.ts → fluid-static-untrimmed.d.mts} +20 -22
  30. package/lib/{fluidContainer.d.ts → fluidContainer.d.mts} +8 -4
  31. package/lib/fluidContainer.d.mts.map +1 -0
  32. package/lib/fluidContainer.mjs.map +1 -1
  33. package/lib/{index.d.ts → index.d.mts} +1 -1
  34. package/lib/index.d.mts.map +1 -0
  35. package/lib/{rootDataObject.d.ts → rootDataObject.d.mts} +1 -1
  36. package/lib/rootDataObject.d.mts.map +1 -0
  37. package/lib/rootDataObject.mjs +7 -3
  38. package/lib/rootDataObject.mjs.map +1 -1
  39. package/lib/{serviceAudience.d.ts → serviceAudience.d.mts} +1 -1
  40. package/lib/serviceAudience.d.mts.map +1 -0
  41. package/lib/{types.d.ts → types.d.mts} +14 -14
  42. package/lib/types.d.mts.map +1 -0
  43. package/lib/types.mjs.map +1 -1
  44. package/lib/{utils.d.ts → utils.d.mts} +1 -1
  45. package/lib/utils.d.mts.map +1 -0
  46. package/package.json +84 -48
  47. package/src/fluidContainer.ts +7 -3
  48. package/src/rootDataObject.ts +7 -3
  49. package/src/types.ts +13 -13
  50. package/dist/fluidContainer.cjs.map +0 -1
  51. package/dist/index.cjs.map +0 -1
  52. package/dist/rootDataObject.cjs.map +0 -1
  53. package/dist/serviceAudience.cjs.map +0 -1
  54. package/dist/types.cjs.map +0 -1
  55. package/dist/utils.cjs.map +0 -1
  56. package/lib/fluid-static-beta.d.ts +0 -78
  57. package/lib/fluid-static-public.d.ts +0 -78
  58. package/lib/fluidContainer.d.ts.map +0 -1
  59. package/lib/index.d.ts.map +0 -1
  60. package/lib/rootDataObject.d.ts.map +0 -1
  61. package/lib/serviceAudience.d.ts.map +0 -1
  62. package/lib/types.d.ts.map +0 -1
  63. package/lib/utils.d.ts.map +0 -1
  64. package/tsc-multi.test.json +0 -4
@@ -1,9 +1,3 @@
1
- /**
2
- * Provides a simple and powerful way to consume collaborative Fluid data.
3
- *
4
- * @packageDocumentation
5
- */
6
-
7
1
  import { AttachState } from '@fluidframework/container-definitions';
8
2
  import { ConnectionState } from '@fluidframework/container-definitions';
9
3
  import { IChannelFactory } from '@fluidframework/datastore-definitions';
@@ -22,7 +16,7 @@ import { IRuntimeFactory } from '@fluidframework/container-definitions';
22
16
  *
23
17
  * It includes both the instances of objects that are initially available upon `Container` creation, as well
24
18
  * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
25
- * @alpha
19
+ * @public
26
20
  */
27
21
  export declare interface ContainerSchema {
28
22
  /**
@@ -85,7 +79,7 @@ export declare function createServiceAudience<M extends IMember = IMember>(props
85
79
  * constructor that will return the type of the `DataObject`.
86
80
  *
87
81
  * @typeParam T - The class of the `DataObject`.
88
- * @alpha
82
+ * @public
89
83
  */
90
84
  export declare type DataObjectClass<T extends IFluidLoadable> = {
91
85
  readonly factory: {
@@ -97,7 +91,7 @@ export declare type DataObjectClass<T extends IFluidLoadable> = {
97
91
  * Base interface for information for each connection made to the Fluid session.
98
92
  *
99
93
  * @remarks This interface can be extended to provide additional information specific to each service.
100
- * @alpha
94
+ * @public
101
95
  */
102
96
  export declare interface IConnection {
103
97
  /**
@@ -117,7 +111,8 @@ export declare interface IConnection {
117
111
  * @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
118
112
  *
119
113
  * @remarks Note: external implementations of this interface are not supported.
120
- * @alpha
114
+ * @sealed
115
+ * @public
121
116
  */
122
117
  export declare interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
123
118
  /**
@@ -224,7 +219,10 @@ export declare interface IFluidContainer<TContainerSchema extends ContainerSchem
224
219
 
225
220
  /**
226
221
  * Events emitted from {@link IFluidContainer}.
227
- * @alpha
222
+ *
223
+ * @remarks Note: external implementations of this interface are not supported.
224
+ * @sealed
225
+ * @public
228
226
  */
229
227
  export declare interface IFluidContainerEvents extends IEvent {
230
228
  /**
@@ -282,7 +280,7 @@ export declare interface IFluidContainerEvents extends IEvent {
282
280
  * Base interface to be implemented to fetch each service's member.
283
281
  *
284
282
  * @remarks This interface can be extended by each service to provide additional service-specific user metadata.
285
- * @alpha
283
+ * @public
286
284
  */
287
285
  export declare interface IMember {
288
286
  /**
@@ -297,7 +295,7 @@ export declare interface IMember {
297
295
 
298
296
  /**
299
297
  * Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
300
- * @alpha
298
+ * @public
301
299
  */
302
300
  export declare type InitialObjects<T extends ContainerSchema> = {
303
301
  [K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
@@ -339,7 +337,7 @@ export declare interface IRootDataObject extends IProvideRootDataObject {
339
337
  * details about the connecting client, such as device information, environment, or a username.
340
338
  *
341
339
  * @typeParam M - A service-specific {@link IMember} type.
342
- * @alpha
340
+ * @public
343
341
  */
344
342
  export declare interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
345
343
  /**
@@ -363,7 +361,7 @@ export declare interface IServiceAudience<M extends IMember> extends IEventProvi
363
361
  * {@link IServiceAudience.getMembers} method will emit events.
364
362
  *
365
363
  * @typeParam M - A service-specific {@link IMember} implementation.
366
- * @alpha
364
+ * @public
367
365
  */
368
366
  export declare interface IServiceAudienceEvents<M extends IMember> extends IEvent {
369
367
  /**
@@ -390,14 +388,14 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
390
388
  * A class object of `DataObject` or `SharedObject`.
391
389
  *
392
390
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
393
- * @alpha
391
+ * @public
394
392
  */
395
393
  export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
396
394
 
397
395
  /**
398
396
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
399
397
  * or `SharedObject` in a {@link LoadableObjectRecord}.
400
- * @alpha
398
+ * @public
401
399
  */
402
400
  export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
403
401
 
@@ -405,13 +403,13 @@ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectCla
405
403
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
406
404
  *
407
405
  * @typeParam T - The class of the loadable object.
408
- * @alpha
406
+ * @public
409
407
  */
410
408
  export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
411
409
 
412
410
  /**
413
411
  * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
414
- * @alpha
412
+ * @internal
415
413
  */
416
414
  export declare type LoadableObjectRecord = Record<string, IFluidLoadable>;
417
415
 
@@ -422,13 +420,13 @@ export declare type LoadableObjectRecord = Record<string, IFluidLoadable>;
422
420
  * @param member - The service-specific member object for the client.
423
421
  *
424
422
  * @see See {@link IServiceAudienceEvents} for usage details.
425
- * @alpha
423
+ * @public
426
424
  */
427
425
  export declare type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
428
426
 
429
427
  /**
430
428
  * An extended member object that includes currentConnection
431
- * @alpha
429
+ * @public
432
430
  */
433
431
  export declare type Myself<M extends IMember = IMember> = M & {
434
432
  currentConnection: string;
@@ -439,7 +437,7 @@ export declare type Myself<M extends IMember = IMember> = M & {
439
437
  * constructor that will return the type of the `DataObject`.
440
438
  *
441
439
  * @typeParam T - The class of the `SharedObject`.
442
- * @alpha
440
+ * @public
443
441
  */
444
442
  export declare type SharedObjectClass<T extends IFluidLoadable> = {
445
443
  readonly getFactory: () => IChannelFactory;
@@ -3,14 +3,17 @@ import { AttachState, IContainer, ICriticalContainerError, ConnectionState } fro
3
3
  import type { ContainerSchema, IRootDataObject, LoadableObjectClass } from "./types.mjs";
4
4
  /**
5
5
  * Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
6
- * @alpha
6
+ * @public
7
7
  */
8
8
  export type InitialObjects<T extends ContainerSchema> = {
9
9
  [K in keyof T["initialObjects"]]: T["initialObjects"][K] extends LoadableObjectClass<infer TChannel> ? TChannel : never;
10
10
  };
11
11
  /**
12
12
  * Events emitted from {@link IFluidContainer}.
13
- * @alpha
13
+ *
14
+ * @remarks Note: external implementations of this interface are not supported.
15
+ * @sealed
16
+ * @public
14
17
  */
15
18
  export interface IFluidContainerEvents extends IEvent {
16
19
  /**
@@ -70,7 +73,8 @@ export interface IFluidContainerEvents extends IEvent {
70
73
  * @typeparam TContainerSchema - Used to determine the type of 'initialObjects'.
71
74
  *
72
75
  * @remarks Note: external implementations of this interface are not supported.
73
- * @alpha
76
+ * @sealed
77
+ * @public
74
78
  */
75
79
  export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> {
76
80
  /**
@@ -181,4 +185,4 @@ export declare function createFluidContainer<TContainerSchema extends ContainerS
181
185
  container: IContainer;
182
186
  rootDataObject: IRootDataObject;
183
187
  }): IFluidContainer<TContainerSchema>;
184
- //# sourceMappingURL=fluidContainer.d.ts.map
188
+ //# sourceMappingURL=fluidContainer.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidContainer.d.mts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"OAKO,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;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACpD;;;;;;;;;;OAUG;IACH,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAEjD;;;;;;;;;;OAUG;IACH,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAEpD;;;;;;OAMG;IACH,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,I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,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 */\nclass 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"]}
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;AA8M9C;;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,cACL,SAAQ,iBAAwC;IAUhD,YACkB,SAAqB,EACrB,cAA+B;QAEh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AAG,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 * @public\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 *\n * @remarks Note: external implementations of this interface are not supported.\n * @sealed\n * @public\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 * @sealed\n * @public\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 */\nclass 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"]}
@@ -6,4 +6,4 @@ export { createFluidContainer, IFluidContainer, IFluidContainerEvents, InitialOb
6
6
  export { createDOProviderContainerRuntimeFactory } from "./rootDataObject.mjs";
7
7
  export { createServiceAudience } from "./serviceAudience.mjs";
8
8
  export { ContainerSchema, DataObjectClass, IConnection, IMember, IRootDataObject, IServiceAudience, IServiceAudienceEvents, LoadableObjectClass, LoadableObjectClassRecord, LoadableObjectCtor, LoadableObjectRecord, MemberChangedListener, Myself, SharedObjectClass, IProvideRootDataObject, } from "./types.mjs";
9
- //# sourceMappingURL=index.d.ts.map
9
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EACN,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,cAAc,GACd;OACM,EAAE,uCAAuC,EAAE;OAC3C,EAAE,qBAAqB,EAAE;OACzB,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"}
@@ -17,4 +17,4 @@ export interface RootDataObjectProps {
17
17
  export declare function createDOProviderContainerRuntimeFactory(props: {
18
18
  schema: ContainerSchema;
19
19
  }): IRuntimeFactory;
20
- //# sourceMappingURL=rootDataObject.d.ts.map
20
+ //# sourceMappingURL=rootDataObject.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootDataObject.d.mts","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"OAYO,EAAE,eAAe,EAAE,MAAM,uCAAuC;OAGhE,EACN,eAAe,EAGf,yBAAyB,EAGzB;AAQD;;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"}
@@ -135,9 +135,13 @@ class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {
135
135
  super({
136
136
  registryEntries: [rootDataObjectFactory.registryEntry],
137
137
  requestHandlers: [getDefaultObject],
138
- // temporary workaround to disable message batching until the message batch size issue is resolved
139
- // resolution progress is tracked by the Feature 465 work item in AzDO
140
- runtimeOptions: { flushMode: FlushMode.Immediate },
138
+ runtimeOptions: {
139
+ // temporary workaround to disable message batching until the message batch size issue is resolved
140
+ // resolution progress is tracked by the Feature 465 work item in AzDO
141
+ flushMode: FlushMode.Immediate,
142
+ // The runtime compressor is required to be on to use @fluidframework/tree.
143
+ enableRuntimeIdCompressor: true,
144
+ },
141
145
  provideEntryPoint,
142
146
  });
143
147
  this.rootDataObjectFactory = rootDataObjectFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"rootDataObject.mjs","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"OAIO,EACN,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,GACjB,MAAM,0BAA0B;OAG1B,EAAE,SAAS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CAAC;QACzB,CAAC,CAAC;QACF,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;YAChF,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAClC,gFAAgF;gBAChF,OAAQ,OAA4B,CAAC,aAAa,CAAC;oBAClD,GAAG,EAAE,IAAI,eAAe,GAAG,MAAM,CAAC,KAAK,EAAE;oBACzC,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC,CAAC;aACH;YACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;QACrC,CAAC,CAAC;QACF,KAAK,CAAC;YACL,eAAe,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC;YACtD,eAAe,EAAE,CAAC,gBAAgB,CAAC;YACnC,kGAAkG;YAClG,sEAAsE;YACtE,cAAc,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE;YAClD,iBAAiB;SACjB,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} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable, IRequest } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport { IRuntimeFactory } from \"@fluidframework/container-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime\";\nimport {\n\tContainerSchema,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport {\n\tInternalDataObjectClass,\n\tisDataObjectClass,\n\tisSharedObjectClass,\n\tparseDataObjectsFromSharedObjects,\n} 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: InternalDataObjectClass<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 *\n * @internal\n */\nclass 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\tconst provideEntryPoint = async (containerRuntime: IContainerRuntime) => {\n\t\t\tconst entryPoint =\n\t\t\t\tawait containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tif (entryPoint === undefined) {\n\t\t\t\tthrow new Error(`default dataStore [${rootDataStoreId}] must exist`);\n\t\t\t}\n\t\t\treturn entryPoint.get();\n\t\t};\n\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t// This cast is safe as ContainerRuntime.loadRuntime is called in the base class\n\t\t\t\treturn (runtime as ContainerRuntime).resolveHandle({\n\t\t\t\t\turl: `/${rootDataStoreId}${parser.query}`,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined; // continue search\n\t\t};\n\t\tsuper({\n\t\t\tregistryEntries: [rootDataObjectFactory.registryEntry],\n\t\t\trequestHandlers: [getDefaultObject],\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,\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"]}
1
+ {"version":3,"file":"rootDataObject.mjs","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"OAIO,EACN,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,GACjB,MAAM,0BAA0B;OAG1B,EAAE,SAAS,EAAE,MAAM,qCAAqC;OAExD,EAAE,aAAa,EAAE,MAAM,+BAA+B;OAUtD,EAEN,iBAAiB,EACjB,mBAAmB,EACnB,iCAAiC,GACjC;AAcD;;;GAGG;AACH,MAAM,cACL,SAAQ,UAAiD;IAD1D;;QAIkB,yBAAoB,GAAG,qBAAqB,CAAC;QAC7C,oBAAe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E;gBAClC,gFAAgF;gBAChF,OAAQ,OAA4B,CAAC,aAAa,CAAC;oBAClD,GAAG,EAAE,IAAI,eAAe,GAAG,MAAM,CAAC,KAAK,EAAE;oBACzC,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC,CAAC;aACH;YACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;QACrC,CAAC,CAAC;QACF,KAAK,CAAC;YACL,eAAe,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC;YACtD,eAAe,EAAE,CAAC,gBAAgB,CAAC;YACnC,cAAc,EAAE;gBACf,kGAAkG;gBAClG,sEAAsE;gBACtE,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,2EAA2E;gBAC3E,yBAAyB,EAAE,IAAI;aAC/B;YACD,iBAAiB;SACjB,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} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable, IRequest } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport { IRuntimeFactory } from \"@fluidframework/container-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime\";\nimport {\n\tContainerSchema,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport {\n\tInternalDataObjectClass,\n\tisDataObjectClass,\n\tisSharedObjectClass,\n\tparseDataObjectsFromSharedObjects,\n} 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: InternalDataObjectClass<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 *\n * @internal\n */\nclass 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\tconst provideEntryPoint = async (containerRuntime: IContainerRuntime) => {\n\t\t\tconst entryPoint =\n\t\t\t\tawait containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tif (entryPoint === undefined) {\n\t\t\t\tthrow new Error(`default dataStore [${rootDataStoreId}] must exist`);\n\t\t\t}\n\t\t\treturn entryPoint.get();\n\t\t};\n\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t// This cast is safe as ContainerRuntime.loadRuntime is called in the base class\n\t\t\t\treturn (runtime as ContainerRuntime).resolveHandle({\n\t\t\t\t\turl: `/${rootDataStoreId}${parser.query}`,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined; // continue search\n\t\t};\n\t\tsuper({\n\t\t\tregistryEntries: [rootDataObjectFactory.registryEntry],\n\t\t\trequestHandlers: [getDefaultObject],\n\t\t\truntimeOptions: {\n\t\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\t\tflushMode: FlushMode.Immediate,\n\t\t\t\t// The runtime compressor is required to be on to use @fluidframework/tree.\n\t\t\t\tenableRuntimeIdCompressor: true,\n\t\t\t},\n\t\t\tprovideEntryPoint,\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"]}
@@ -12,4 +12,4 @@ export declare function createServiceAudience<M extends IMember = IMember>(props
12
12
  container: IContainer;
13
13
  createServiceMember: (audienceMember: IClient) => M;
14
14
  }): IServiceAudience<M>;
15
- //# sourceMappingURL=serviceAudience.d.ts.map
15
+ //# sourceMappingURL=serviceAudience.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceAudience.d.mts","sourceRoot":"","sources":["../src/serviceAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAa,UAAU,EAAE,MAAM,uCAAuC;OACtE,EAAE,OAAO,EAAE,MAAM,sCAAsC;OACvD,EAAE,gBAAgB,EAA0B,OAAO,EAAU;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,CAEtB"}
@@ -6,20 +6,20 @@ import { IEvent, IEventProvider, IFluidLoadable } from "@fluidframework/core-int
6
6
  import { IChannelFactory } from "@fluidframework/datastore-definitions";
7
7
  /**
8
8
  * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
9
- * @alpha
9
+ * @internal
10
10
  */
11
11
  export type LoadableObjectRecord = Record<string, IFluidLoadable>;
12
12
  /**
13
13
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
14
14
  * or `SharedObject` in a {@link LoadableObjectRecord}.
15
- * @alpha
15
+ * @public
16
16
  */
17
17
  export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
18
18
  /**
19
19
  * A class object of `DataObject` or `SharedObject`.
20
20
  *
21
21
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
22
- * @alpha
22
+ * @public
23
23
  */
24
24
  export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
25
25
  /**
@@ -27,7 +27,7 @@ export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> |
27
27
  * constructor that will return the type of the `DataObject`.
28
28
  *
29
29
  * @typeParam T - The class of the `DataObject`.
30
- * @alpha
30
+ * @public
31
31
  */
32
32
  export type DataObjectClass<T extends IFluidLoadable> = {
33
33
  readonly factory: {
@@ -39,7 +39,7 @@ export type DataObjectClass<T extends IFluidLoadable> = {
39
39
  * constructor that will return the type of the `DataObject`.
40
40
  *
41
41
  * @typeParam T - The class of the `SharedObject`.
42
- * @alpha
42
+ * @public
43
43
  */
44
44
  export type SharedObjectClass<T extends IFluidLoadable> = {
45
45
  readonly getFactory: () => IChannelFactory;
@@ -48,7 +48,7 @@ export type SharedObjectClass<T extends IFluidLoadable> = {
48
48
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
49
49
  *
50
50
  * @typeParam T - The class of the loadable object.
51
- * @alpha
51
+ * @public
52
52
  */
53
53
  export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
54
54
  /**
@@ -58,7 +58,7 @@ export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[])
58
58
  *
59
59
  * It includes both the instances of objects that are initially available upon `Container` creation, as well
60
60
  * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
61
- * @alpha
61
+ * @public
62
62
  */
63
63
  export interface ContainerSchema {
64
64
  /**
@@ -124,7 +124,7 @@ export interface IRootDataObject extends IProvideRootDataObject {
124
124
  * @param member - The service-specific member object for the client.
125
125
  *
126
126
  * @see See {@link IServiceAudienceEvents} for usage details.
127
- * @alpha
127
+ * @public
128
128
  */
129
129
  export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
130
130
  /**
@@ -136,7 +136,7 @@ export type MemberChangedListener<M extends IMember> = (clientId: string, member
136
136
  * {@link IServiceAudience.getMembers} method will emit events.
137
137
  *
138
138
  * @typeParam M - A service-specific {@link IMember} implementation.
139
- * @alpha
139
+ * @public
140
140
  */
141
141
  export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
142
142
  /**
@@ -167,7 +167,7 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
167
167
  * details about the connecting client, such as device information, environment, or a username.
168
168
  *
169
169
  * @typeParam M - A service-specific {@link IMember} type.
170
- * @alpha
170
+ * @public
171
171
  */
172
172
  export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
173
173
  /**
@@ -185,7 +185,7 @@ export interface IServiceAudience<M extends IMember> extends IEventProvider<ISer
185
185
  * Base interface for information for each connection made to the Fluid session.
186
186
  *
187
187
  * @remarks This interface can be extended to provide additional information specific to each service.
188
- * @alpha
188
+ * @public
189
189
  */
190
190
  export interface IConnection {
191
191
  /**
@@ -201,7 +201,7 @@ export interface IConnection {
201
201
  * Base interface to be implemented to fetch each service's member.
202
202
  *
203
203
  * @remarks This interface can be extended by each service to provide additional service-specific user metadata.
204
- * @alpha
204
+ * @public
205
205
  */
206
206
  export interface IMember {
207
207
  /**
@@ -215,9 +215,9 @@ export interface IMember {
215
215
  }
216
216
  /**
217
217
  * An extended member object that includes currentConnection
218
- * @alpha
218
+ * @public
219
219
  */
220
220
  export type Myself<M extends IMember = IMember> = M & {
221
221
  currentConnection: string;
222
222
  };
223
- //# sourceMappingURL=types.d.ts.map
223
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","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;AAEvE;;;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;QAAE,sBAAsB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,CAAC;CAC5E,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS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G;IACH,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACnE;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAClD,SAAQ,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IACjD;;;;OAIG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC"}
package/lib/types.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\n\n/**\n * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.\n * @alpha\n */\nexport type LoadableObjectRecord = Record<string, IFluidLoadable>;\n\n/**\n * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`\n * or `SharedObject` in a {@link LoadableObjectRecord}.\n * @alpha\n */\nexport type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;\n\n/**\n * A class object of `DataObject` or `SharedObject`.\n *\n * @typeParam T - The class of the `DataObject` or `SharedObject`.\n * @alpha\n */\nexport type LoadableObjectClass<T extends IFluidLoadable> =\n\t| DataObjectClass<T>\n\t| SharedObjectClass<T>;\n\n/**\n * A class that has a factory that can create a `DataObject` and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `DataObject`.\n * @alpha\n */\nexport type DataObjectClass<T extends IFluidLoadable> = {\n\treadonly factory: { IFluidDataStoreFactory: DataObjectClass<T>[\"factory\"] };\n} & LoadableObjectCtor<T>;\n\n/**\n * A class that has a factory that can create a DDSes (`SharedObject`s) and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `SharedObject`.\n * @alpha\n */\nexport type SharedObjectClass<T extends IFluidLoadable> = {\n\treadonly getFactory: () => IChannelFactory;\n} & LoadableObjectCtor<T>;\n\n/**\n * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.\n *\n * @typeParam T - The class of the loadable object.\n * @alpha\n */\nexport type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;\n\n/**\n * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.\n *\n * @remarks\n *\n * It includes both the instances of objects that are initially available upon `Container` creation, as well\n * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.\n * @alpha\n */\nexport interface ContainerSchema {\n\t/**\n\t * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.\n\t *\n\t * @remarks It uses the key as the id and the value as the loadable object to create.\n\t *\n\t * @example\n\t *\n\t * In the example below two objects will be created when the `Container` is first\n\t * created. One with id \"map1\" that will return a `SharedMap` and the other with\n\t * id \"pair1\" that will return a `KeyValueDataObject`.\n\t *\n\t * ```typescript\n\t * {\n\t * map1: SharedMap,\n\t * pair1: KeyValueDataObject,\n\t * }\n\t * ```\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n\n\t/**\n\t * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.\n\t *\n\t * @remarks\n\t *\n\t * Types defined in `initialObjects` will always be available and are not required to be provided here.\n\t *\n\t * For best practice it's recommended to define all the dynamic types you create even if they are\n\t * included via initialObjects.\n\t */\n\tdynamicObjectTypes?: LoadableObjectClass<any>[];\n}\n\n/**\n * @internal\n */\nexport interface IProvideRootDataObject {\n\treadonly IRootDataObject: IRootDataObject;\n}\n\n/**\n * Holds the collection of objects that the container was initially created with, as well as provides the ability\n * to dynamically create further objects during usage.\n * @internal\n */\nexport interface IRootDataObject extends IProvideRootDataObject {\n\t/**\n\t * Provides a record of the initial objects defined on creation.\n\t */\n\treadonly initialObjects: LoadableObjectRecord;\n\n\t/**\n\t * Dynamically creates a new detached collaborative object (DDS/DataObject).\n\t *\n\t * @param objectClass - Type of the collaborative object to be created.\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\n/**\n * Signature for {@link IMember} change events.\n *\n * @param clientId - A unique identifier for the client.\n * @param member - The service-specific member object for the client.\n *\n * @see See {@link IServiceAudienceEvents} for usage details.\n * @alpha\n */\nexport type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;\n\n/**\n * Events that trigger when the roster of members in the Fluid session change.\n *\n * @remarks\n *\n * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s\n * {@link IServiceAudience.getMembers} method will emit events.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @alpha\n */\nexport interface IServiceAudienceEvents<M extends IMember> extends IEvent {\n\t/**\n\t * Emitted when a {@link IMember | member}(s) are either added or removed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"membersChanged\", listener: () => void): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} joins the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberAdded\", listener: MemberChangedListener<M>): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} leaves the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberRemoved\", listener: MemberChangedListener<M>): void;\n}\n\n/**\n * Base interface to be implemented to fetch each service's audience.\n *\n * @remarks\n *\n * The type parameter `M` allows consumers to further extend the client object with service-specific\n * details about the connecting client, such as device information, environment, or a username.\n *\n * @typeParam M - A service-specific {@link IMember} type.\n * @alpha\n */\nexport interface IServiceAudience<M extends IMember>\n\textends IEventProvider<IServiceAudienceEvents<M>> {\n\t/**\n\t * Returns an map of all users currently in the Fluid session where key is the userId and the value is the\n\t * member object. The implementation may choose to exclude certain connections from the returned map.\n\t * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.\n\t */\n\tgetMembers(): Map<string, M>;\n\n\t/**\n\t * Returns the current active user on this client once they are connected. Otherwise, returns undefined.\n\t */\n\tgetMyself(): Myself<M> | undefined;\n}\n\n/**\n * Base interface for information for each connection made to the Fluid session.\n *\n * @remarks This interface can be extended to provide additional information specific to each service.\n * @alpha\n */\nexport interface IConnection {\n\t/**\n\t * A unique ID for the connection. A single user may have multiple connections, each with a different ID.\n\t */\n\tid: string;\n\n\t/**\n\t * Whether the connection is in read or read/write mode.\n\t */\n\tmode: \"write\" | \"read\";\n}\n\n/**\n * Base interface to be implemented to fetch each service's member.\n *\n * @remarks This interface can be extended by each service to provide additional service-specific user metadata.\n * @alpha\n */\nexport interface IMember {\n\t/**\n\t * An ID for the user, unique among each individual user connecting to the session.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The set of connections the user has made, e.g. from multiple tabs or devices.\n\t */\n\tconnections: IConnection[];\n}\n\n/**\n * An extended member object that includes currentConnection\n * @alpha\n */\nexport type Myself<M extends IMember = IMember> = M & { currentConnection: string };\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\n\n/**\n * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.\n * @internal\n */\nexport type LoadableObjectRecord = Record<string, IFluidLoadable>;\n\n/**\n * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`\n * or `SharedObject` in a {@link LoadableObjectRecord}.\n * @public\n */\nexport type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;\n\n/**\n * A class object of `DataObject` or `SharedObject`.\n *\n * @typeParam T - The class of the `DataObject` or `SharedObject`.\n * @public\n */\nexport type LoadableObjectClass<T extends IFluidLoadable> =\n\t| DataObjectClass<T>\n\t| SharedObjectClass<T>;\n\n/**\n * A class that has a factory that can create a `DataObject` and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `DataObject`.\n * @public\n */\nexport type DataObjectClass<T extends IFluidLoadable> = {\n\treadonly factory: { IFluidDataStoreFactory: DataObjectClass<T>[\"factory\"] };\n} & LoadableObjectCtor<T>;\n\n/**\n * A class that has a factory that can create a DDSes (`SharedObject`s) and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `SharedObject`.\n * @public\n */\nexport type SharedObjectClass<T extends IFluidLoadable> = {\n\treadonly getFactory: () => IChannelFactory;\n} & LoadableObjectCtor<T>;\n\n/**\n * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.\n *\n * @typeParam T - The class of the loadable object.\n * @public\n */\nexport type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;\n\n/**\n * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.\n *\n * @remarks\n *\n * It includes both the instances of objects that are initially available upon `Container` creation, as well\n * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.\n * @public\n */\nexport interface ContainerSchema {\n\t/**\n\t * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.\n\t *\n\t * @remarks It uses the key as the id and the value as the loadable object to create.\n\t *\n\t * @example\n\t *\n\t * In the example below two objects will be created when the `Container` is first\n\t * created. One with id \"map1\" that will return a `SharedMap` and the other with\n\t * id \"pair1\" that will return a `KeyValueDataObject`.\n\t *\n\t * ```typescript\n\t * {\n\t * map1: SharedMap,\n\t * pair1: KeyValueDataObject,\n\t * }\n\t * ```\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n\n\t/**\n\t * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.\n\t *\n\t * @remarks\n\t *\n\t * Types defined in `initialObjects` will always be available and are not required to be provided here.\n\t *\n\t * For best practice it's recommended to define all the dynamic types you create even if they are\n\t * included via initialObjects.\n\t */\n\tdynamicObjectTypes?: LoadableObjectClass<any>[];\n}\n\n/**\n * @internal\n */\nexport interface IProvideRootDataObject {\n\treadonly IRootDataObject: IRootDataObject;\n}\n\n/**\n * Holds the collection of objects that the container was initially created with, as well as provides the ability\n * to dynamically create further objects during usage.\n * @internal\n */\nexport interface IRootDataObject extends IProvideRootDataObject {\n\t/**\n\t * Provides a record of the initial objects defined on creation.\n\t */\n\treadonly initialObjects: LoadableObjectRecord;\n\n\t/**\n\t * Dynamically creates a new detached collaborative object (DDS/DataObject).\n\t *\n\t * @param objectClass - Type of the collaborative object to be created.\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\n/**\n * Signature for {@link IMember} change events.\n *\n * @param clientId - A unique identifier for the client.\n * @param member - The service-specific member object for the client.\n *\n * @see See {@link IServiceAudienceEvents} for usage details.\n * @public\n */\nexport type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;\n\n/**\n * Events that trigger when the roster of members in the Fluid session change.\n *\n * @remarks\n *\n * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s\n * {@link IServiceAudience.getMembers} method will emit events.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @public\n */\nexport interface IServiceAudienceEvents<M extends IMember> extends IEvent {\n\t/**\n\t * Emitted when a {@link IMember | member}(s) are either added or removed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"membersChanged\", listener: () => void): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} joins the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberAdded\", listener: MemberChangedListener<M>): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} leaves the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberRemoved\", listener: MemberChangedListener<M>): void;\n}\n\n/**\n * Base interface to be implemented to fetch each service's audience.\n *\n * @remarks\n *\n * The type parameter `M` allows consumers to further extend the client object with service-specific\n * details about the connecting client, such as device information, environment, or a username.\n *\n * @typeParam M - A service-specific {@link IMember} type.\n * @public\n */\nexport interface IServiceAudience<M extends IMember>\n\textends IEventProvider<IServiceAudienceEvents<M>> {\n\t/**\n\t * Returns an map of all users currently in the Fluid session where key is the userId and the value is the\n\t * member object. The implementation may choose to exclude certain connections from the returned map.\n\t * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.\n\t */\n\tgetMembers(): Map<string, M>;\n\n\t/**\n\t * Returns the current active user on this client once they are connected. Otherwise, returns undefined.\n\t */\n\tgetMyself(): Myself<M> | undefined;\n}\n\n/**\n * Base interface for information for each connection made to the Fluid session.\n *\n * @remarks This interface can be extended to provide additional information specific to each service.\n * @public\n */\nexport interface IConnection {\n\t/**\n\t * A unique ID for the connection. A single user may have multiple connections, each with a different ID.\n\t */\n\tid: string;\n\n\t/**\n\t * Whether the connection is in read or read/write mode.\n\t */\n\tmode: \"write\" | \"read\";\n}\n\n/**\n * Base interface to be implemented to fetch each service's member.\n *\n * @remarks This interface can be extended by each service to provide additional service-specific user metadata.\n * @public\n */\nexport interface IMember {\n\t/**\n\t * An ID for the user, unique among each individual user connecting to the session.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The set of connections the user has made, e.g. from multiple tabs or devices.\n\t */\n\tconnections: IConnection[];\n}\n\n/**\n * An extended member object that includes currentConnection\n * @public\n */\nexport type Myself<M extends IMember = IMember> = M & { currentConnection: string };\n"]}
@@ -27,4 +27,4 @@ export declare const isSharedObjectClass: (obj: any) => obj is SharedObjectClass
27
27
  * of DataObject types and an array of SharedObjects.
28
28
  */
29
29
  export declare const parseDataObjectsFromSharedObjects: (schema: ContainerSchema) => [NamedFluidDataStoreRegistryEntry[], IChannelFactory[]];
30
- //# sourceMappingURL=utils.d.ts.map
30
+ //# sourceMappingURL=utils.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,eAAe,EAAE,MAAM,uCAAuC;OAChE,EACN,sBAAsB,EACtB,gCAAgC,EAChC,MAAM,qCAAqC;OACrC,EAAE,cAAc,EAAE,MAAM,iCAAiC;OACzD,EAAE,eAAe,EAAE,eAAe,EAAuB,iBAAiB,EAAE;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI,eAAe,CAAC,CAAC,CAAC,GACjF,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAS,GAAG,mDAMzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,GAAG,kCAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,WACrC,eAAe,KACrB,CAAC,gCAAgC,EAAE,EAAE,eAAe,EAAE,CA0BxD,CAAC"}