@fluidframework/fluid-static 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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 (89) hide show
  1. package/{.mocharc.js → .mocharc.cjs} +1 -1
  2. package/CHANGELOG.md +10 -0
  3. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  4. package/api-extractor.json +1 -1
  5. package/api-report/fluid-static.api.md +7 -7
  6. package/dist/fluid-static-alpha.d.ts +18 -9
  7. package/dist/fluid-static-beta.d.ts +18 -9
  8. package/dist/fluid-static-public.d.ts +18 -9
  9. package/dist/fluid-static-untrimmed.d.ts +18 -9
  10. package/dist/fluidContainer.d.ts +5 -1
  11. package/dist/fluidContainer.d.ts.map +1 -1
  12. package/dist/fluidContainer.js +2 -2
  13. package/dist/fluidContainer.js.map +1 -1
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +6 -6
  17. package/dist/index.js.map +1 -1
  18. package/dist/package.json +3 -0
  19. package/dist/rootDataObject.d.ts +5 -1
  20. package/dist/rootDataObject.d.ts.map +1 -1
  21. package/dist/rootDataObject.js +7 -7
  22. package/dist/rootDataObject.js.map +1 -1
  23. package/dist/serviceAudience.d.ts +1 -1
  24. package/dist/serviceAudience.d.ts.map +1 -1
  25. package/dist/serviceAudience.js.map +1 -1
  26. package/dist/tsdoc-metadata.json +1 -1
  27. package/dist/types.d.ts +18 -9
  28. package/dist/types.d.ts.map +1 -1
  29. package/dist/types.js.map +1 -1
  30. package/dist/utils.d.ts +9 -5
  31. package/dist/utils.d.ts.map +1 -1
  32. package/dist/utils.js +5 -5
  33. package/dist/utils.js.map +1 -1
  34. package/lib/{fluid-static-alpha.d.mts → fluid-static-alpha.d.ts} +24 -9
  35. package/lib/{fluid-static-public.d.mts → fluid-static-beta.d.ts} +24 -9
  36. package/lib/{fluid-static-beta.d.mts → fluid-static-public.d.ts} +24 -9
  37. package/lib/{fluid-static-untrimmed.d.mts → fluid-static-untrimmed.d.ts} +24 -9
  38. package/lib/{fluidContainer.d.mts → fluidContainer.d.ts} +6 -2
  39. package/lib/fluidContainer.d.ts.map +1 -0
  40. package/lib/{fluidContainer.mjs → fluidContainer.js} +5 -1
  41. package/lib/fluidContainer.js.map +1 -0
  42. package/lib/{index.d.mts → index.d.ts} +10 -5
  43. package/lib/index.d.ts.map +1 -0
  44. package/lib/index.js +13 -0
  45. package/lib/index.js.map +1 -0
  46. package/lib/{rootDataObject.d.mts → rootDataObject.d.ts} +6 -2
  47. package/lib/rootDataObject.d.ts.map +1 -0
  48. package/lib/{rootDataObject.mjs → rootDataObject.js} +7 -3
  49. package/lib/rootDataObject.js.map +1 -0
  50. package/lib/{serviceAudience.d.mts → serviceAudience.d.ts} +2 -2
  51. package/lib/serviceAudience.d.ts.map +1 -0
  52. package/lib/{serviceAudience.mjs → serviceAudience.js} +1 -1
  53. package/lib/serviceAudience.js.map +1 -0
  54. package/lib/test/fluidContainer.spec.js +21 -0
  55. package/lib/test/fluidContainer.spec.js.map +1 -0
  56. package/lib/test/types/validateFluidStaticPrevious.generated.js +46 -0
  57. package/lib/test/types/validateFluidStaticPrevious.generated.js.map +1 -0
  58. package/lib/test/utils.spec.js +86 -0
  59. package/lib/test/utils.spec.js.map +1 -0
  60. package/lib/{types.d.mts → types.d.ts} +19 -10
  61. package/lib/types.d.ts.map +1 -0
  62. package/lib/{types.mjs → types.js} +1 -1
  63. package/lib/types.js.map +1 -0
  64. package/lib/{utils.d.mts → utils.d.ts} +10 -6
  65. package/lib/utils.d.ts.map +1 -0
  66. package/lib/{utils.mjs → utils.js} +5 -5
  67. package/lib/utils.js.map +1 -0
  68. package/package.json +45 -58
  69. package/src/fluidContainer.ts +3 -2
  70. package/src/index.ts +4 -4
  71. package/src/rootDataObject.ts +4 -3
  72. package/src/serviceAudience.ts +1 -1
  73. package/src/types.ts +20 -13
  74. package/src/utils.ts +23 -6
  75. package/tsconfig.cjs.json +7 -0
  76. package/tsconfig.json +4 -8
  77. package/lib/fluidContainer.d.mts.map +0 -1
  78. package/lib/fluidContainer.mjs.map +0 -1
  79. package/lib/index.d.mts.map +0 -1
  80. package/lib/index.mjs +0 -8
  81. package/lib/index.mjs.map +0 -1
  82. package/lib/rootDataObject.d.mts.map +0 -1
  83. package/lib/rootDataObject.mjs.map +0 -1
  84. package/lib/serviceAudience.d.mts.map +0 -1
  85. package/lib/serviceAudience.mjs.map +0 -1
  86. package/lib/types.d.mts.map +0 -1
  87. package/lib/types.mjs.map +0 -1
  88. package/lib/utils.d.mts.map +0 -1
  89. package/lib/utils.mjs.map +0 -1
@@ -5,7 +5,7 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
8
+ const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
9
9
 
10
10
  const packageDir = __dirname;
11
11
  const config = getFluidTestMochaConfig(packageDir);
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @fluidframework/fluid-static
2
2
 
3
+ ## 2.0.0-rc.2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fluid-framework: ContainerSchema is now readonly ([#19717](https://github.com/microsoft/FluidFramework/issues/19717)) [ae1d0be26d](https://github.com/microsoft/FluidFramework/commits/ae1d0be26d61453cff316b3f622a9f3647149167)
8
+
9
+ The `ContainerSchema` type is intended for defining input to these packages. This should make the APIs more tolerant and
10
+ thus be non-breaking, however its possible for some users of `ContainerSchema` to use it in ways where this could be a
11
+ breaking change: any such users should remove their mutations and/or use a different type.
12
+
3
13
  ## 2.0.0-rc.1.0.0
4
14
 
5
15
  ### Minor Changes
@@ -1,4 +1,8 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
+ // CJS is actually secondary; so, no report.
5
+ "apiReport": {
6
+ "enabled": false
7
+ }
4
8
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.esm.primary.json"
4
4
  }
@@ -20,8 +20,8 @@ export type ContainerAttachProps<T = unknown> = T;
20
20
 
21
21
  // @public
22
22
  export interface ContainerSchema {
23
- dynamicObjectTypes?: LoadableObjectClass<any>[];
24
- initialObjects: LoadableObjectClassRecord;
23
+ readonly dynamicObjectTypes?: readonly LoadableObjectClass[];
24
+ readonly initialObjects: LoadableObjectClassRecord;
25
25
  }
26
26
 
27
27
  // @internal
@@ -117,10 +117,10 @@ export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
117
117
  }
118
118
 
119
119
  // @public
120
- export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
120
+ export type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = SharedObjectClass<T> | DataObjectClass<T>;
121
121
 
122
122
  // @public
123
- export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
123
+ export type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
124
124
 
125
125
  // @public
126
126
  export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
@@ -137,8 +137,8 @@ export type Myself<M extends IMember = IMember> = M & {
137
137
  };
138
138
 
139
139
  // @public
140
- export type SharedObjectClass<T extends IFluidLoadable> = {
141
- readonly getFactory: () => IChannelFactory;
142
- } & LoadableObjectCtor<T>;
140
+ export interface SharedObjectClass<T extends IFluidLoadable> {
141
+ readonly getFactory: () => IChannelFactory<T>;
142
+ }
143
143
 
144
144
  ```
@@ -49,7 +49,7 @@ export declare interface ContainerSchema {
49
49
  * }
50
50
  * ```
51
51
  */
52
- initialObjects: LoadableObjectClassRecord;
52
+ readonly initialObjects: LoadableObjectClassRecord;
53
53
  /**
54
54
  * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
55
55
  *
@@ -60,7 +60,7 @@ export declare interface ContainerSchema {
60
60
  * For best practice it's recommended to define all the dynamic types you create even if they are
61
61
  * included via initialObjects.
62
62
  */
63
- dynamicObjectTypes?: LoadableObjectClass<any>[];
63
+ readonly dynamicObjectTypes?: readonly LoadableObjectClass[];
64
64
  }
65
65
 
66
66
  /* Excluded from this release type: createDOProviderContainerRuntimeFactory */
@@ -362,15 +362,22 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
362
362
  *
363
363
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
364
364
  * @public
365
+ *
366
+ * @privateRemarks
367
+ * There are some edge cases in TypeScript where the order of the members in a union matter.
368
+ * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
369
+ * In this case, its better to have the desired match and/or the simpler type first.
370
+ * In this case placing SharedObjectClass fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
371
+ * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
365
372
  */
366
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
373
+ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = SharedObjectClass<T> | DataObjectClass<T>;
367
374
 
368
375
  /**
369
376
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
370
377
  * or `SharedObject`.
371
378
  * @public
372
379
  */
373
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
380
+ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
374
381
 
375
382
  /**
376
383
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
@@ -402,14 +409,16 @@ export declare type Myself<M extends IMember = IMember> = M & {
402
409
  };
403
410
 
404
411
  /**
405
- * A class that has a factory that can create a DDSes (`SharedObject`s) and a
406
- * constructor that will return the type of the `DataObject`.
412
+ * A factory that produces a factory that can create a DDSes (`SharedObject`s).
407
413
  *
408
414
  * @typeParam T - The class of the `SharedObject`.
409
415
  * @public
410
416
  */
411
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
412
- readonly getFactory: () => IChannelFactory;
413
- } & LoadableObjectCtor<T>;
417
+ export declare interface SharedObjectClass<T extends IFluidLoadable> {
418
+ /**
419
+ * Gets the factory this factory is a wrapper for.
420
+ */
421
+ readonly getFactory: () => IChannelFactory<T>;
422
+ }
414
423
 
415
424
  export { }
@@ -49,7 +49,7 @@ export declare interface ContainerSchema {
49
49
  * }
50
50
  * ```
51
51
  */
52
- initialObjects: LoadableObjectClassRecord;
52
+ readonly initialObjects: LoadableObjectClassRecord;
53
53
  /**
54
54
  * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
55
55
  *
@@ -60,7 +60,7 @@ export declare interface ContainerSchema {
60
60
  * For best practice it's recommended to define all the dynamic types you create even if they are
61
61
  * included via initialObjects.
62
62
  */
63
- dynamicObjectTypes?: LoadableObjectClass<any>[];
63
+ readonly dynamicObjectTypes?: readonly LoadableObjectClass[];
64
64
  }
65
65
 
66
66
  /* Excluded from this release type: createDOProviderContainerRuntimeFactory */
@@ -366,15 +366,22 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
366
366
  *
367
367
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
368
368
  * @public
369
+ *
370
+ * @privateRemarks
371
+ * There are some edge cases in TypeScript where the order of the members in a union matter.
372
+ * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
373
+ * In this case, its better to have the desired match and/or the simpler type first.
374
+ * In this case placing SharedObjectClass fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
375
+ * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
369
376
  */
370
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
377
+ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = SharedObjectClass<T> | DataObjectClass<T>;
371
378
 
372
379
  /**
373
380
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
374
381
  * or `SharedObject`.
375
382
  * @public
376
383
  */
377
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
384
+ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
378
385
 
379
386
  /**
380
387
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
@@ -406,14 +413,16 @@ export declare type Myself<M extends IMember = IMember> = M & {
406
413
  };
407
414
 
408
415
  /**
409
- * A class that has a factory that can create a DDSes (`SharedObject`s) and a
410
- * constructor that will return the type of the `DataObject`.
416
+ * A factory that produces a factory that can create a DDSes (`SharedObject`s).
411
417
  *
412
418
  * @typeParam T - The class of the `SharedObject`.
413
419
  * @public
414
420
  */
415
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
416
- readonly getFactory: () => IChannelFactory;
417
- } & LoadableObjectCtor<T>;
421
+ export declare interface SharedObjectClass<T extends IFluidLoadable> {
422
+ /**
423
+ * Gets the factory this factory is a wrapper for.
424
+ */
425
+ readonly getFactory: () => IChannelFactory<T>;
426
+ }
418
427
 
419
428
  export { }
@@ -49,7 +49,7 @@ export declare interface ContainerSchema {
49
49
  * }
50
50
  * ```
51
51
  */
52
- initialObjects: LoadableObjectClassRecord;
52
+ readonly initialObjects: LoadableObjectClassRecord;
53
53
  /**
54
54
  * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
55
55
  *
@@ -60,7 +60,7 @@ export declare interface ContainerSchema {
60
60
  * For best practice it's recommended to define all the dynamic types you create even if they are
61
61
  * included via initialObjects.
62
62
  */
63
- dynamicObjectTypes?: LoadableObjectClass<any>[];
63
+ readonly dynamicObjectTypes?: readonly LoadableObjectClass[];
64
64
  }
65
65
 
66
66
  /* Excluded from this release type: createDOProviderContainerRuntimeFactory */
@@ -366,15 +366,22 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
366
366
  *
367
367
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
368
368
  * @public
369
+ *
370
+ * @privateRemarks
371
+ * There are some edge cases in TypeScript where the order of the members in a union matter.
372
+ * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
373
+ * In this case, its better to have the desired match and/or the simpler type first.
374
+ * In this case placing SharedObjectClass fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
375
+ * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
369
376
  */
370
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
377
+ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = SharedObjectClass<T> | DataObjectClass<T>;
371
378
 
372
379
  /**
373
380
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
374
381
  * or `SharedObject`.
375
382
  * @public
376
383
  */
377
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
384
+ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
378
385
 
379
386
  /**
380
387
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
@@ -406,14 +413,16 @@ export declare type Myself<M extends IMember = IMember> = M & {
406
413
  };
407
414
 
408
415
  /**
409
- * A class that has a factory that can create a DDSes (`SharedObject`s) and a
410
- * constructor that will return the type of the `DataObject`.
416
+ * A factory that produces a factory that can create a DDSes (`SharedObject`s).
411
417
  *
412
418
  * @typeParam T - The class of the `SharedObject`.
413
419
  * @public
414
420
  */
415
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
416
- readonly getFactory: () => IChannelFactory;
417
- } & LoadableObjectCtor<T>;
421
+ export declare interface SharedObjectClass<T extends IFluidLoadable> {
422
+ /**
423
+ * Gets the factory this factory is a wrapper for.
424
+ */
425
+ readonly getFactory: () => IChannelFactory<T>;
426
+ }
418
427
 
419
428
  export { }
@@ -49,7 +49,7 @@ export declare interface ContainerSchema {
49
49
  * }
50
50
  * ```
51
51
  */
52
- initialObjects: LoadableObjectClassRecord;
52
+ readonly initialObjects: LoadableObjectClassRecord;
53
53
  /**
54
54
  * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
55
55
  *
@@ -60,7 +60,7 @@ export declare interface ContainerSchema {
60
60
  * For best practice it's recommended to define all the dynamic types you create even if they are
61
61
  * included via initialObjects.
62
62
  */
63
- dynamicObjectTypes?: LoadableObjectClass<any>[];
63
+ readonly dynamicObjectTypes?: readonly LoadableObjectClass[];
64
64
  }
65
65
 
66
66
  /**
@@ -414,15 +414,22 @@ export declare interface IServiceAudienceEvents<M extends IMember> extends IEven
414
414
  *
415
415
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
416
416
  * @public
417
+ *
418
+ * @privateRemarks
419
+ * There are some edge cases in TypeScript where the order of the members in a union matter.
420
+ * Once such edge case is when multiple members of a generic union partially match, and the type parameter is being inferred.
421
+ * In this case, its better to have the desired match and/or the simpler type first.
422
+ * In this case placing SharedObjectClass fixed one usage and didn't break anything, and generally seems more likely to work than the reverse, so this is the order being used.
423
+ * This is likely (a bug in TypeScript)[https://github.com/microsoft/TypeScript/issues/45809].
417
424
  */
418
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
425
+ export declare type LoadableObjectClass<T extends IFluidLoadable = IFluidLoadable> = SharedObjectClass<T> | DataObjectClass<T>;
419
426
 
420
427
  /**
421
428
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
422
429
  * or `SharedObject`.
423
430
  * @public
424
431
  */
425
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
432
+ export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass>;
426
433
 
427
434
  /**
428
435
  * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
@@ -458,14 +465,16 @@ export declare type Myself<M extends IMember = IMember> = M & {
458
465
  };
459
466
 
460
467
  /**
461
- * A class that has a factory that can create a DDSes (`SharedObject`s) and a
462
- * constructor that will return the type of the `DataObject`.
468
+ * A factory that produces a factory that can create a DDSes (`SharedObject`s).
463
469
  *
464
470
  * @typeParam T - The class of the `SharedObject`.
465
471
  * @public
466
472
  */
467
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
468
- readonly getFactory: () => IChannelFactory;
469
- } & LoadableObjectCtor<T>;
473
+ export declare interface SharedObjectClass<T extends IFluidLoadable> {
474
+ /**
475
+ * Gets the factory this factory is a wrapper for.
476
+ */
477
+ readonly getFactory: () => IChannelFactory<T>;
478
+ }
470
479
 
471
480
  export { }
@@ -1,6 +1,10 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
1
5
  import { type IEvent, type IEventProvider, type IFluidLoadable } from "@fluidframework/core-interfaces";
2
6
  import { AttachState, type IContainer, type ICriticalContainerError, type ConnectionState } from "@fluidframework/container-definitions";
3
- import type { ContainerSchema, ContainerAttachProps, IRootDataObject, LoadableObjectClass } from "./types";
7
+ import type { ContainerSchema, ContainerAttachProps, IRootDataObject, LoadableObjectClass } from "./types.js";
4
8
  /**
5
9
  * Extract the type of 'initialObjects' from the given {@link ContainerSchema} type.
6
10
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACX,eAAe,EACf,oBAAoB,EACpB,eAAe,EAC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;;;OAWG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;;;;;OASG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAElF;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,EACzD,KAAK,EAAE;IACR,SAAS,EAAE,UAAU,CAAC;IACtB,cAAc,EAAE,eAAe,CAAC;CAChC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAEpC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFluidContainer = void 0;
4
2
  /*!
5
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
6
4
  * Licensed under the MIT License.
7
5
  */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createFluidContainer = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const container_definitions_1 = require("@fluidframework/container-definitions");
10
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fluidContainer.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAAiE;AAMjE,iFAK+C;AAoN/C;;;;GAIG;AACH,SAAgB,oBAAoB,CAElC,KAGD;IACA,OAAO,IAAI,cAAc,CAAmB,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AACpF,CAAC;AAPD,oDAOC;AAED;;;;;;;;;;GAUG;AACH,MAAM,cACL,SAAQ,gCAAwC;IAUhD,YACkB,SAAqB,EACrB,cAA+B;QAEhD,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAY;QACrB,m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,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 {\n\ttype IEvent,\n\ttype IEventProvider,\n\ttype IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tAttachState,\n\ttype IContainer,\n\ttype ICriticalContainerError,\n\ttype ConnectionState,\n} from \"@fluidframework/container-definitions\";\nimport type {\n\tContainerSchema,\n\tContainerAttachProps,\n\tIRootDataObject,\n\tLoadableObjectClass,\n} 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 *\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(props?: ContainerAttachProps): 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:namespace).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:namespace).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 * Creates an {@link IFluidContainer} from the provided `container` and `rootDataObject`.\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 = (): boolean => this.emit(\"connected\");\n\tprivate readonly disconnectedHandler = (): boolean => this.emit(\"disconnected\");\n\tprivate readonly disposedHandler = (error?: ICriticalContainerError): boolean =>\n\t\tthis.emit(\"disposed\", error);\n\tprivate readonly savedHandler = (): boolean => this.emit(\"saved\");\n\tprivate readonly dirtyHandler = (): boolean => 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(): boolean {\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(props?: ContainerAttachProps): 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(): void {\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.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAMjE,iFAK+C;AAoN/C;;;;GAIG;AACH,SAAgB,oBAAoB,CAElC,KAGD;IACA,OAAO,IAAI,cAAc,CAAmB,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AACpF,CAAC;AAPD,oDAOC;AAED;;;;;;;;;;GAUG;AACH,MAAM,cACL,SAAQ,gCAAwC;IAUhD,YACkB,SAAqB,EACrB,cAA+B;QAEhD,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAY;QACrB,mBAAc,GAAd,cAAc,CAAiB;QAThC,qBAAgB,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzD,wBAAmB,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/D,oBAAe,GAAG,C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AAC,KAA4B;QAC/C,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,EAAE;YACxD,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;SAChF;QACD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU;QACtB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM,CAA2B,WAAmC;QAChF,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,OAAO;QACb,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;CAaD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\ttype IEvent,\n\ttype IEventProvider,\n\ttype IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tAttachState,\n\ttype IContainer,\n\ttype ICriticalContainerError,\n\ttype ConnectionState,\n} from \"@fluidframework/container-definitions\";\nimport type {\n\tContainerSchema,\n\tContainerAttachProps,\n\tIRootDataObject,\n\tLoadableObjectClass,\n} from \"./types.js\";\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 inferring 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 *\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(props?: ContainerAttachProps): 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:namespace).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:namespace).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 * Creates an {@link IFluidContainer} from the provided `container` and `rootDataObject`.\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 = (): boolean => this.emit(\"connected\");\n\tprivate readonly disconnectedHandler = (): boolean => this.emit(\"disconnected\");\n\tprivate readonly disposedHandler = (error?: ICriticalContainerError): boolean =>\n\t\tthis.emit(\"disposed\", error);\n\tprivate readonly savedHandler = (): boolean => this.emit(\"saved\");\n\tprivate readonly dirtyHandler = (): boolean => 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(): boolean {\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(props?: ContainerAttachProps): 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(): void {\n\t\tthis.container.close();\n\t\tthis.container.off(\"connected\", this.connectedHandler);\n\t\tthis.container.off(\"closed\", this.disposedHandler);\n\t\tthis.container.off(\"disconnected\", this.disconnectedHandler);\n\t\tthis.container.off(\"saved\", this.savedHandler);\n\t\tthis.container.off(\"dirty\", this.dirtyHandler);\n\t}\n\n\t/**\n\t * FOR INTERNAL USE ONLY. NOT FOR EXTERNAL USE.\n\t * We make no stability guarantees here whatsoever.\n\t *\n\t * Gets the underlying {@link @fluidframework/container-definitions#IContainer}.\n\t *\n\t * @remarks Used to power debug tooling.\n\t */\n\tpublic readonly INTERNAL_CONTAINER_DO_NOT_USE?: () => IContainer = () => {\n\t\treturn this.container;\n\t};\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @packageDocumentation
9
9
  */
10
- export { createFluidContainer, type IFluidContainer, type IFluidContainerEvents, type InitialObjects, } from "./fluidContainer";
11
- export { createDOProviderContainerRuntimeFactory } from "./rootDataObject";
12
- export { createServiceAudience } from "./serviceAudience";
13
- export { type ContainerSchema, type ContainerAttachProps, type DataObjectClass, type IConnection, type IMember, type IRootDataObject, type IServiceAudience, type IServiceAudienceEvents, type LoadableObjectClass, type LoadableObjectClassRecord, type LoadableObjectCtor, type LoadableObjectRecord, type MemberChangedListener, type Myself, type SharedObjectClass, type IProvideRootDataObject, } from "./types";
10
+ export { createFluidContainer, type IFluidContainer, type IFluidContainerEvents, type InitialObjects, } from "./fluidContainer.js";
11
+ export { createDOProviderContainerRuntimeFactory } from "./rootDataObject.js";
12
+ export { createServiceAudience } from "./serviceAudience.js";
13
+ export { type ContainerSchema, type ContainerAttachProps, type DataObjectClass, type IConnection, type IMember, type IRootDataObject, type IServiceAudience, type IServiceAudienceEvents, type LoadableObjectClass, type LoadableObjectClassRecord, type LoadableObjectCtor, type LoadableObjectRecord, type MemberChangedListener, type Myself, type SharedObjectClass, type IProvideRootDataObject, } from "./types.js";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACN,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uCAAuC,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC3B,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACN,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uCAAuC,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC3B,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -10,10 +10,10 @@ exports.createServiceAudience = exports.createDOProviderContainerRuntimeFactory
10
10
  *
11
11
  * @packageDocumentation
12
12
  */
13
- var fluidContainer_1 = require("./fluidContainer");
14
- Object.defineProperty(exports, "createFluidContainer", { enumerable: true, get: function () { return fluidContainer_1.createFluidContainer; } });
15
- var rootDataObject_1 = require("./rootDataObject");
16
- Object.defineProperty(exports, "createDOProviderContainerRuntimeFactory", { enumerable: true, get: function () { return rootDataObject_1.createDOProviderContainerRuntimeFactory; } });
17
- var serviceAudience_1 = require("./serviceAudience");
18
- Object.defineProperty(exports, "createServiceAudience", { enumerable: true, get: function () { return serviceAudience_1.createServiceAudience; } });
13
+ var fluidContainer_js_1 = require("./fluidContainer.js");
14
+ Object.defineProperty(exports, "createFluidContainer", { enumerable: true, get: function () { return fluidContainer_js_1.createFluidContainer; } });
15
+ var rootDataObject_js_1 = require("./rootDataObject.js");
16
+ Object.defineProperty(exports, "createDOProviderContainerRuntimeFactory", { enumerable: true, get: function () { return rootDataObject_js_1.createDOProviderContainerRuntimeFactory; } });
17
+ var serviceAudience_js_1 = require("./serviceAudience.js");
18
+ Object.defineProperty(exports, "createServiceAudience", { enumerable: true, get: function () { return serviceAudience_js_1.createServiceAudience; } });
19
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,mDAK0B;AAJzB,sHAAA,oBAAoB,OAAA;AAKrB,mDAA2E;AAAlE,yIAAA,uCAAuC,OAAA;AAChD,qDAA0D;AAAjD,wHAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Provides a simple and powerful way to consume collaborative Fluid data.\n *\n * @packageDocumentation\n */\n\nexport {\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IFluidContainerEvents,\n\ttype InitialObjects,\n} from \"./fluidContainer\";\nexport { createDOProviderContainerRuntimeFactory } from \"./rootDataObject\";\nexport { createServiceAudience } from \"./serviceAudience\";\nexport {\n\ttype ContainerSchema,\n\ttype ContainerAttachProps,\n\ttype DataObjectClass,\n\ttype IConnection,\n\ttype IMember,\n\ttype IRootDataObject,\n\ttype IServiceAudience,\n\ttype IServiceAudienceEvents,\n\ttype LoadableObjectClass,\n\ttype LoadableObjectClassRecord,\n\ttype LoadableObjectCtor,\n\ttype LoadableObjectRecord,\n\ttype MemberChangedListener,\n\ttype Myself,\n\ttype SharedObjectClass,\n\ttype IProvideRootDataObject,\n} from \"./types\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,yDAK6B;AAJ5B,yHAAA,oBAAoB,OAAA;AAKrB,yDAA8E;AAArE,4IAAA,uCAAuC,OAAA;AAChD,2DAA6D;AAApD,2HAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Provides a simple and powerful way to consume collaborative Fluid data.\n *\n * @packageDocumentation\n */\n\nexport {\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IFluidContainerEvents,\n\ttype InitialObjects,\n} from \"./fluidContainer.js\";\nexport { createDOProviderContainerRuntimeFactory } from \"./rootDataObject.js\";\nexport { createServiceAudience } from \"./serviceAudience.js\";\nexport {\n\ttype ContainerSchema,\n\ttype ContainerAttachProps,\n\ttype DataObjectClass,\n\ttype IConnection,\n\ttype IMember,\n\ttype IRootDataObject,\n\ttype IServiceAudience,\n\ttype IServiceAudienceEvents,\n\ttype LoadableObjectClass,\n\ttype LoadableObjectClassRecord,\n\ttype LoadableObjectCtor,\n\ttype LoadableObjectRecord,\n\ttype MemberChangedListener,\n\ttype Myself,\n\ttype SharedObjectClass,\n\ttype IProvideRootDataObject,\n} from \"./types.js\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1,5 +1,9 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
1
5
  import { type IRuntimeFactory } from "@fluidframework/container-definitions";
2
- import { type ContainerSchema, type LoadableObjectClassRecord } from "./types";
6
+ import { type ContainerSchema, type LoadableObjectClassRecord } from "./types.js";
3
7
  /**
4
8
  * Input props for {@link RootDataObject.initializingFirstTime}.
5
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"rootDataObject.d.ts","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAK7E,OAAO,EACN,KAAK,eAAe,EAGpB,KAAK,yBAAyB,EAG9B,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,cAAc,EAAE,yBAAyB,CAAC;CAC1C;AA+GD;;;;;GAKG;AACH,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC9D,MAAM,EAAE,eAAe,CAAC;CACxB,GAAG,eAAe,CAElB"}
1
+ {"version":3,"file":"rootDataObject.d.ts","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAK7E,OAAO,EACN,KAAK,eAAe,EAGpB,KAAK,yBAAyB,EAG9B,MAAM,YAAY,CAAC;AAQpB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,cAAc,EAAE,yBAAyB,CAAC;CAC1C;AA+GD;;;;;GAKG;AACH,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC9D,MAAM,EAAE,eAAe,CAAC;CACxB,GAAG,eAAe,CAElB"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDOProviderContainerRuntimeFactory = void 0;
4
2
  /*!
5
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
6
4
  * Licensed under the MIT License.
7
5
  */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createDOProviderContainerRuntimeFactory = void 0;
8
8
  const aqueduct_1 = require("@fluidframework/aqueduct");
9
9
  const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
10
10
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
11
- const utils_1 = require("./utils");
11
+ const utils_js_1 = require("./utils.js");
12
12
  /**
13
13
  * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.
14
14
  * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.
@@ -80,10 +80,10 @@ class RootDataObject extends aqueduct_1.DataObject {
80
80
  * {@inheritDoc IRootDataObject.create}
81
81
  */
82
82
  async create(objectClass) {
83
- if ((0, utils_1.isDataObjectClass)(objectClass)) {
83
+ if ((0, utils_js_1.isDataObjectClass)(objectClass)) {
84
84
  return this.createDataObject(objectClass);
85
85
  }
86
- else if ((0, utils_1.isSharedObjectClass)(objectClass)) {
86
+ else if ((0, utils_js_1.isSharedObjectClass)(objectClass)) {
87
87
  return this.createSharedObject(objectClass);
88
88
  }
89
89
  throw new Error("Could not create new Fluid object because an unknown object was passed");
@@ -124,7 +124,7 @@ exports.createDOProviderContainerRuntimeFactory = createDOProviderContainerRunti
124
124
  */
125
125
  class DOProviderContainerRuntimeFactory extends aqueduct_1.BaseContainerRuntimeFactory {
126
126
  constructor(schema) {
127
- const [registryEntries, sharedObjects] = (0, utils_1.parseDataObjectsFromSharedObjects)(schema);
127
+ const [registryEntries, sharedObjects] = (0, utils_js_1.parseDataObjectsFromSharedObjects)(schema);
128
128
  const rootDataObjectFactory = new aqueduct_1.DataObjectFactory("rootDO", RootDataObject, sharedObjects, {}, registryEntries);
129
129
  const provideEntryPoint = async (containerRuntime) => {
130
130
  const entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);
@@ -152,7 +152,7 @@ class DOProviderContainerRuntimeFactory extends aqueduct_1.BaseContainerRuntimeF
152
152
  // resolution progress is tracked by the Feature 465 work item in AzDO
153
153
  flushMode: runtime_definitions_1.FlushMode.Immediate,
154
154
  // The runtime compressor is required to be on to use @fluidframework/tree.
155
- enableRuntimeIdCompressor: true,
155
+ enableRuntimeIdCompressor: "on",
156
156
  },
157
157
  provideEntryPoint,
158
158
  });