@fluidframework/core-interfaces 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.eslintrc.js +1 -1
  2. package/api-report/core-interfaces.api.md +47 -20
  3. package/dist/fluidLoadable.d.ts +15 -0
  4. package/dist/fluidLoadable.d.ts.map +1 -1
  5. package/dist/fluidLoadable.js +3 -0
  6. package/dist/fluidLoadable.js.map +1 -1
  7. package/dist/fluidObject.d.ts +36 -5
  8. package/dist/fluidObject.d.ts.map +1 -1
  9. package/dist/fluidObject.js +0 -1
  10. package/dist/fluidObject.js.map +1 -1
  11. package/dist/fluidPackage.d.ts +25 -0
  12. package/dist/fluidPackage.d.ts.map +1 -1
  13. package/dist/fluidPackage.js +10 -0
  14. package/dist/fluidPackage.js.map +1 -1
  15. package/dist/handles.d.ts +2 -1
  16. package/dist/handles.d.ts.map +1 -1
  17. package/dist/handles.js.map +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/provider.d.ts +64 -0
  23. package/dist/provider.d.ts.map +1 -0
  24. package/dist/provider.js +7 -0
  25. package/dist/provider.js.map +1 -0
  26. package/dist/serializer.d.ts +10 -0
  27. package/dist/serializer.d.ts.map +1 -1
  28. package/dist/serializer.js +3 -0
  29. package/dist/serializer.js.map +1 -1
  30. package/lib/fluidLoadable.d.ts +15 -0
  31. package/lib/fluidLoadable.d.ts.map +1 -1
  32. package/lib/fluidLoadable.js +3 -0
  33. package/lib/fluidLoadable.js.map +1 -1
  34. package/lib/fluidObject.d.ts +36 -5
  35. package/lib/fluidObject.d.ts.map +1 -1
  36. package/lib/fluidObject.js +0 -1
  37. package/lib/fluidObject.js.map +1 -1
  38. package/lib/fluidPackage.d.ts +25 -0
  39. package/lib/fluidPackage.d.ts.map +1 -1
  40. package/lib/fluidPackage.js +10 -0
  41. package/lib/fluidPackage.js.map +1 -1
  42. package/lib/handles.d.ts +2 -1
  43. package/lib/handles.d.ts.map +1 -1
  44. package/lib/handles.js.map +1 -1
  45. package/lib/index.d.ts +1 -0
  46. package/lib/index.d.ts.map +1 -1
  47. package/lib/index.js +1 -0
  48. package/lib/index.js.map +1 -1
  49. package/lib/provider.d.ts +64 -0
  50. package/lib/provider.d.ts.map +1 -0
  51. package/lib/provider.js +6 -0
  52. package/lib/provider.js.map +1 -0
  53. package/lib/serializer.d.ts +10 -0
  54. package/lib/serializer.d.ts.map +1 -1
  55. package/lib/serializer.js +3 -0
  56. package/lib/serializer.js.map +1 -1
  57. package/lib/test/types/fluidObjectTypes.d.ts +2 -0
  58. package/lib/test/types/fluidObjectTypes.d.ts.map +1 -0
  59. package/lib/test/types/fluidObjectTypes.js +80 -0
  60. package/lib/test/types/fluidObjectTypes.js.map +1 -0
  61. package/lib/test/types/validate0.40.0.d.ts +2 -0
  62. package/lib/test/types/validate0.40.0.d.ts.map +1 -0
  63. package/lib/test/types/validate0.40.0.js +72 -0
  64. package/lib/test/types/validate0.40.0.js.map +1 -0
  65. package/lib/test/types/validate0.41.0.d.ts +2 -0
  66. package/lib/test/types/validate0.41.0.d.ts.map +1 -0
  67. package/lib/test/types/validate0.41.0.js +78 -0
  68. package/lib/test/types/validate0.41.0.js.map +1 -0
  69. package/package.json +19 -17
  70. package/src/fluidLoadable.ts +15 -0
  71. package/src/fluidObject.ts +39 -17
  72. package/src/fluidPackage.ts +25 -0
  73. package/src/handles.ts +3 -2
  74. package/src/index.ts +1 -0
  75. package/src/provider.ts +70 -0
  76. package/src/serializer.ts +10 -0
  77. package/tsconfig.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAE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H,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAElD;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CAC7B"}
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IFluidSerializer = void 0;
4
+ /**
5
+ * @deprecated - Moved to fluidframework/shared-object-base package
6
+ */
4
7
  exports.IFluidSerializer = "IFluidSerializer";
5
8
  //# sourceMappingURL=serializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":";;;AAiBa,QAAA,gBAAgB,GAAkC,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidHandle } from \"./handles\";\n\n/**\n * JSON serialized form of an IFluidHandle\n */\nexport interface ISerializedHandle {\n // Marker to indicate to JSON.parse that the object is a Fluid handle\n type: \"__fluid_handle__\";\n\n // URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n url: string;\n}\n\nexport const IFluidSerializer: keyof IProvideFluidSerializer = \"IFluidSerializer\";\n\nexport interface IProvideFluidSerializer {\n readonly IFluidSerializer: IFluidSerializer;\n}\n\nexport interface IFluidSerializer extends IProvideFluidSerializer {\n /**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n */\n replaceHandles(value: any, bind: IFluidHandle): any;\n\n /**\n * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n * equivalent object tree where any encoded IFluidHandles have been replaced with thier decoded form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * The decoded handles are implicitly bound to the handle context of this serializer.\n */\n decode?(input: any): any;\n\n /**\n * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n */\n stringify(value: any, bind: IFluidHandle): string;\n\n /**\n * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n * handles will be realized as part of the parse\n */\n parse(value: string): any;\n}\n"]}
1
+ {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":";;;AAkBA;;GAEG;AACU,QAAA,gBAAgB,GAAkC,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidHandle } from \"./handles\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface ISerializedHandle {\n // Marker to indicate to JSON.parse that the object is a Fluid handle\n type: \"__fluid_handle__\";\n\n // URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n url: string;\n}\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport const IFluidSerializer: keyof IProvideFluidSerializer = \"IFluidSerializer\";\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface IProvideFluidSerializer {\n readonly IFluidSerializer: IFluidSerializer;\n}\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface IFluidSerializer extends IProvideFluidSerializer {\n /**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n */\n replaceHandles(value: any, bind: IFluidHandle): any;\n\n /**\n * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n * equivalent object tree where any encoded IFluidHandles have been replaced with thier decoded form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * The decoded handles are implicitly bound to the handle context of this serializer.\n */\n decode?(input: any): any;\n\n /**\n * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n */\n stringify(value: any, bind: IFluidHandle): string;\n\n /**\n * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n * handles will be realized as part of the parse\n */\n parse(value: string): any;\n}\n"]}
@@ -21,11 +21,26 @@ export interface IFluidRunnable {
21
21
  run(...args: any[]): Promise<void>;
22
22
  stop(reason?: string): void;
23
23
  }
24
+ /**
25
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
26
+ */
24
27
  export declare const IFluidConfiguration: keyof IProvideFluidConfiguration;
28
+ /**
29
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
30
+ */
25
31
  export interface IProvideFluidConfiguration {
32
+ /**
33
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
34
+ */
26
35
  readonly IFluidConfiguration: IFluidConfiguration;
27
36
  }
37
+ /**
38
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
39
+ */
28
40
  export interface IFluidConfiguration extends IProvideFluidConfiguration {
41
+ /**
42
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
43
+ */
29
44
  scopes: string[];
30
45
  }
31
46
  //# sourceMappingURL=fluidLoadable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CAC3C;AACD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAEzD,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MA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AC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACnE;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -4,5 +4,8 @@
4
4
  */
5
5
  export const IFluidLoadable = "IFluidLoadable";
6
6
  export const IFluidRunnable = "IFluidRunnable";
7
+ /**
8
+ * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.
9
+ */
7
10
  export const IFluidConfiguration = "IFluidConfiguration";
8
11
  //# sourceMappingURL=fluidLoadable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAa5E,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAU5E,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"./handles\";\n\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\nexport interface IProvideFluidLoadable {\n readonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n // Handle to the loadable FluidObject\n handle: IFluidHandle;\n}\n\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\nexport interface IProvideFluidRunnable {\n readonly IFluidRunnable: IFluidRunnable;\n}\nexport interface IFluidRunnable {\n run(...args: any[]): Promise<void>;\n stop(reason?: string): void;\n}\n\nexport const IFluidConfiguration: keyof IProvideFluidConfiguration = \"IFluidConfiguration\";\n\nexport interface IProvideFluidConfiguration {\n readonly IFluidConfiguration: IFluidConfiguration;\n}\n\nexport interface IFluidConfiguration extends IProvideFluidConfiguration {\n scopes: string[];\n}\n"]}
1
+ {"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAa5E,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAU5E;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"./handles\";\n\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\nexport interface IProvideFluidLoadable {\n readonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n // Handle to the loadable FluidObject\n handle: IFluidHandle;\n}\n\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\nexport interface IProvideFluidRunnable {\n readonly IFluidRunnable: IFluidRunnable;\n}\nexport interface IFluidRunnable {\n run(...args: any[]): Promise<void>;\n stop(reason?: string): void;\n}\n\n/**\n * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.\n */\nexport const IFluidConfiguration: keyof IProvideFluidConfiguration = \"IFluidConfiguration\";\n\n/**\n * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.\n */\nexport interface IProvideFluidConfiguration {\n /**\n * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.\n */\n readonly IFluidConfiguration: IFluidConfiguration;\n}\n\n/**\n * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.\n */\nexport interface IFluidConfiguration extends IProvideFluidConfiguration {\n /**\n * @deprecated 0.42 - Not recommended for use and will be removed in an upcoming release.\n */\n scopes: string[];\n}\n"]}
@@ -2,10 +2,41 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IProvideFluidConfiguration, IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable";
6
- import { IProvideFluidRouter } from "./fluidRouter";
7
- import { IProvideFluidHandle, IProvideFluidHandleContext } from "./handles";
8
- import { IProvideFluidSerializer } from "./serializer";
9
- export interface IFluidObject extends Readonly<Partial<IProvideFluidLoadable & IProvideFluidRunnable & IProvideFluidRouter & IProvideFluidHandleContext & IProvideFluidConfiguration & IProvideFluidHandle & IProvideFluidSerializer>> {
5
+ import { IFluidConfiguration, IFluidLoadable, IFluidRunnable } from "./fluidLoadable";
6
+ import { IFluidRouter } from "./fluidRouter";
7
+ import { IFluidHandle, IFluidHandleContext } from "./handles";
8
+ import { IFluidSerializer } from "./serializer";
9
+ /**
10
+ * @deprecated Use `FluidObject` or the interface directly instead
11
+ */
12
+ export interface IFluidObject {
13
+ /**
14
+ * @deprecated - use `FluidObject<IFluidLoadable>` instead
15
+ */
16
+ readonly IFluidLoadable?: IFluidLoadable;
17
+ /**
18
+ * @deprecated - use `FluidObject<IFluidRunnable>` instead
19
+ */
20
+ readonly IFluidRunnable?: IFluidRunnable;
21
+ /**
22
+ * @deprecated - use `FluidObject<IFluidRouter>` instead
23
+ */
24
+ readonly IFluidRouter?: IFluidRouter;
25
+ /**
26
+ * @deprecated - use `FluidObject<IFluidHandleContext>` instead
27
+ */
28
+ readonly IFluidHandleContext?: IFluidHandleContext;
29
+ /**
30
+ * @deprecated - use `FluidObject<IFluidConfiguration>` instead
31
+ */
32
+ readonly IFluidConfiguration?: IFluidConfiguration;
33
+ /**
34
+ * @deprecated - use `FluidObject<IFluidHandle>` instead
35
+ */
36
+ readonly IFluidHandle?: IFluidHandle;
37
+ /**
38
+ * @deprecated - use `FluidObject<IFluidSerializer>` instead
39
+ */
40
+ readonly IFluidSerializer?: IFluidSerializer;
10
41
  }
11
42
  //# sourceMappingURL=fluidObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidObject.d.ts","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,WAAW,YAAa,SAC1B,QAAQ,CAAC,OAAO,CACZ,qBAAqB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,0BAA0B,GAC1B,0BAA0B,GAC1B,mBAAmB,GACnB,uBAAuB,CAAC,CAAC;CAClC"}
1
+ {"version":3,"file":"fluidObject.d.ts","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,cAAc,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,YAAY;IAEzB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD;;OAEG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAChD"}
@@ -3,5 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- /* eslint-enable @typescript-eslint/no-empty-interface */
7
6
  //# sourceMappingURL=fluidObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidObject.js","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAsBH,yDAAyD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IProvideFluidConfiguration,\n IProvideFluidLoadable,\n IProvideFluidRunnable,\n} from \"./fluidLoadable\";\nimport { IProvideFluidRouter } from \"./fluidRouter\";\nimport { IProvideFluidHandle, IProvideFluidHandleContext } from \"./handles\";\nimport { IProvideFluidSerializer } from \"./serializer\";\n\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface IFluidObject extends\n Readonly<Partial<\n IProvideFluidLoadable\n & IProvideFluidRunnable\n & IProvideFluidRouter\n & IProvideFluidHandleContext\n & IProvideFluidConfiguration\n & IProvideFluidHandle\n & IProvideFluidSerializer>> {\n}\n/* eslint-enable @typescript-eslint/no-empty-interface */\n"]}
1
+ {"version":3,"file":"fluidObject.js","sourceRoot":"","sources":["../src/fluidObject.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 {\n IFluidConfiguration,\n IFluidLoadable,\n IFluidRunnable,\n} from \"./fluidLoadable\";\nimport { IFluidRouter } from \"./fluidRouter\";\nimport { IFluidHandle, IFluidHandleContext } from \"./handles\";\nimport { IFluidSerializer } from \"./serializer\";\n\n/**\n * @deprecated Use `FluidObject` or the interface directly instead\n */\nexport interface IFluidObject {\n\n /**\n * @deprecated - use `FluidObject<IFluidLoadable>` instead\n */\n readonly IFluidLoadable?: IFluidLoadable;\n /**\n * @deprecated - use `FluidObject<IFluidRunnable>` instead\n */\n readonly IFluidRunnable?: IFluidRunnable\n /**\n * @deprecated - use `FluidObject<IFluidRouter>` instead\n */\n readonly IFluidRouter?: IFluidRouter;\n /**\n * @deprecated - use `FluidObject<IFluidHandleContext>` instead\n */\n readonly IFluidHandleContext?: IFluidHandleContext;\n /**\n * @deprecated - use `FluidObject<IFluidConfiguration>` instead\n */\n readonly IFluidConfiguration?: IFluidConfiguration;\n /**\n * @deprecated - use `FluidObject<IFluidHandle>` instead\n */\n readonly IFluidHandle?: IFluidHandle;\n /**\n * @deprecated - use `FluidObject<IFluidSerializer>` instead\n */\n readonly IFluidSerializer?: IFluidSerializer;\n}\n"]}
@@ -3,6 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidPackageEnvironment}
7
+ * to have code loading modules in same package.
6
8
  * Specifies an environment on Fluid property of a IFluidPackage
7
9
  */
8
10
  export interface IFluidPackageEnvironment {
@@ -26,6 +28,8 @@ export interface IFluidPackageEnvironment {
26
28
  };
27
29
  }
28
30
  /**
31
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidPackage}
32
+ * to have code loading modules in same package.
29
33
  * Fluid-specific properties expected on a package to be loaded by the code loader.
30
34
  * While compatible with the npm package format it is not necessary that that package is an
31
35
  * npm package:
@@ -54,17 +58,23 @@ export interface IFluidPackage {
54
58
  [key: string]: unknown;
55
59
  }
56
60
  /**
61
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidPackage}
62
+ * to have code loading modules in same package.
57
63
  * Check if the package.json defines a Fluid package
58
64
  * @param pkg - the package json data to check if it is a Fluid package.
59
65
  */
60
66
  export declare const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;
61
67
  /**
68
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsConfig}
69
+ * to have code loading modules in same package.
62
70
  * Package manager configuration. Provides a key value mapping of config values
63
71
  */
64
72
  export interface IFluidCodeDetailsConfig {
65
73
  readonly [key: string]: string;
66
74
  }
67
75
  /**
76
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetails}
77
+ * to have code loading modules in same package.
68
78
  * Data structure used to describe the code to load on the Fluid document
69
79
  */
70
80
  export interface IFluidCodeDetails {
@@ -78,12 +88,27 @@ export interface IFluidCodeDetails {
78
88
  */
79
89
  readonly config?: IFluidCodeDetailsConfig;
80
90
  }
91
+ /**
92
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidCodeDetails}
93
+ * to have code loading modules in same package
94
+ */
81
95
  export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
96
+ /**
97
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsComparer}
98
+ * to have code loading modules in same package.
99
+ */
82
100
  export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
101
+ /**
102
+ * @deprecated in favor of
103
+ * {@link @fluidframework/container-definitions/fluidPackage.ts#IProvideFluidCodeDetailsComparer}
104
+ * to have code loading modules in same package.
105
+ */
83
106
  export interface IProvideFluidCodeDetailsComparer {
84
107
  readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
85
108
  }
86
109
  /**
110
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsComparer}
111
+ * to have code loading modules in same package.
87
112
  * Provides capability to compare Fluid code details.
88
113
  */
89
114
  export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
@@ -1 +1 @@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a,OAAO,2CAKlD,CAAC;AAEF;;;EAGE;AACF,eAAO,MAAM,yBAAyB,EAAE,MAAM,gCAA8D,CAAC;AAE7G;;;;EAIE;AACF,MAAM,WAAW,gCAAgC;IAC7C,QAAQ,CAAC,yBAAyB,EAAE,yBAAyB,CAAE;CAClE;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IAE/E;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAGzF;;;;;;;;;OASG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAEpF"}
@@ -3,17 +3,27 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidPackage}
7
+ * to have code loading modules in same package.
6
8
  * Check if the package.json defines a Fluid package
7
9
  * @param pkg - the package json data to check if it is a Fluid package.
8
10
  */
9
11
  export const isFluidPackage = (pkg) => typeof pkg === "object"
10
12
  && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
11
13
  && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
14
+ /**
15
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidCodeDetails}
16
+ * to have code loading modules in same package
17
+ */
12
18
  export const isFluidCodeDetails = (details) => {
13
19
  const maybeCodeDetails = details;
14
20
  return typeof maybeCodeDetails === "object"
15
21
  && (typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" || isFluidPackage(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package))
16
22
  && ((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object");
17
23
  };
24
+ /**
25
+ * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsComparer}
26
+ * to have code loading modules in same package.
27
+ */
18
28
  export const IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
19
29
  //# sourceMappingURL=fluidPackage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyDH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAyBtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,cAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n /**\n * Specifies an environment on Fluid property of a IFluidPackage\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages\n */\n [key: string]: unknown;\n }\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> =>{\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n/* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details;\n * `< 0` if `a < b`.\n * `= 0` if `a === b`.\n * `> 0` if `a > b`.\n * `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n/* eslint-enable max-len */\n}\n"]}
1
+ {"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6DH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AA6BtC;;;EAGE;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,cAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AAEF;;;EAGE;AACF,MAAM,CAAC,MAAM,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n /**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidPackageEnvironment}\n * to have code loading modules in same package.\n * Specifies an environment on Fluid property of a IFluidPackage\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages\n */\n [key: string]: unknown;\n }\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidPackage}\n * to have code loading modules in same package.\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidPackage}\n * to have code loading modules in same package.\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsConfig}\n * to have code loading modules in same package.\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetails}\n * to have code loading modules in same package.\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#isFluidCodeDetails}\n * to have code loading modules in same package\n*/\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> =>{\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n*/\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\n/**\n * @deprecated in favor of\n * {@link @fluidframework/container-definitions/fluidPackage.ts#IProvideFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n*/\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions/fluidPackage.ts#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n/* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details;\n * `< 0` if `a < b`.\n * `= 0` if `a === b`.\n * `> 0` if `a > b`.\n * `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n/* eslint-enable max-len */\n}\n"]}
package/lib/handles.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  import { IRequest, IResponse } from "./fluidRouter";
6
6
  import { IFluidObject } from "./fluidObject";
7
7
  import { IFluidLoadable } from "./fluidLoadable";
8
+ import { FluidObject } from "./provider";
8
9
  export declare const IFluidHandleContext: keyof IProvideFluidHandleContext;
9
10
  export interface IProvideFluidHandleContext {
10
11
  readonly IFluidHandleContext: IFluidHandleContext;
@@ -39,7 +40,7 @@ export interface IProvideFluidHandle {
39
40
  /**
40
41
  * Handle to a shared FluidObject
41
42
  */
42
- export interface IFluidHandle<T = IFluidObject & IFluidLoadable> extends IProvideFluidHandle {
43
+ export interface IFluidHandle<T = IFluidObject & FluidObject & IFluidLoadable> extends IProvideFluidHandle {
43
44
  /**
44
45
  * @deprecated - Do not use handle's path for routing. Use `get` to get the underlying object.
45
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACnE;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE,MAAM,WAA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;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAEzB,CAAC,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,CAC7C,SAAQ,mBAAmB;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAkC3F,MAAM,CAAC,MAAM,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"./fluidRouter\";\nimport { IFluidObject } from \"./fluidObject\";\nimport { IFluidLoadable } from \"./fluidLoadable\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n readonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * An IFluidHandleContext describes a routing context from which other IFluidHandleContexts are defined\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n /**\n * The absolute path to the handle context from the root.\n */\n readonly absolutePath: string;\n\n /**\n * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n * at the root.\n */\n readonly routeContext?: IFluidHandleContext;\n\n /**\n * Flag indicating whether or not the entity has services attached.\n */\n readonly isAttached: boolean;\n\n /**\n * Runs through the graph and attach the bounded handles.\n */\n attachGraph(): void;\n\n resolveHandle(request: IRequest): Promise<IResponse>;\n}\n\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\nexport interface IProvideFluidHandle {\n readonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared FluidObject\n */\nexport interface IFluidHandle<\n // REVIEW: Constrain `T` to `IFluidObject & IFluidLoadable`?\n T = IFluidObject & IFluidLoadable\n > extends IProvideFluidHandle {\n\n /**\n * @deprecated - Do not use handle's path for routing. Use `get` to get the underlying object.\n *\n * The absolute path to the handle context from the root.\n */\n readonly absolutePath: string;\n\n /**\n * Flag indicating whether or not the entity has services attached.\n */\n readonly isAttached: boolean;\n\n /**\n * Runs through the graph and attach the bounded handles.\n */\n attachGraph(): void;\n\n /**\n * Returns a promise to the Fluid Object referenced by the handle.\n */\n get(): Promise<T>;\n\n /**\n * Binds the given handle to this one or attach the given handle if this handle is attached.\n * A bound handle will also be attached once this handle is attached.\n */\n bind(handle: IFluidHandle): void;\n}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAkC3F,MAAM,CAAC,MAAM,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"./fluidRouter\";\nimport { IFluidObject } from \"./fluidObject\";\nimport { IFluidLoadable } from \"./fluidLoadable\";\nimport { FluidObject } from \"./provider\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n readonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * An IFluidHandleContext describes a routing context from which other IFluidHandleContexts are defined\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n /**\n * The absolute path to the handle context from the root.\n */\n readonly absolutePath: string;\n\n /**\n * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n * at the root.\n */\n readonly routeContext?: IFluidHandleContext;\n\n /**\n * Flag indicating whether or not the entity has services attached.\n */\n readonly isAttached: boolean;\n\n /**\n * Runs through the graph and attach the bounded handles.\n */\n attachGraph(): void;\n\n resolveHandle(request: IRequest): Promise<IResponse>;\n}\n\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\nexport interface IProvideFluidHandle {\n readonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared FluidObject\n */\nexport interface IFluidHandle<\n // REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n T = IFluidObject & FluidObject & IFluidLoadable\n > extends IProvideFluidHandle {\n\n /**\n * @deprecated - Do not use handle's path for routing. Use `get` to get the underlying object.\n *\n * The absolute path to the handle context from the root.\n */\n readonly absolutePath: string;\n\n /**\n * Flag indicating whether or not the entity has services attached.\n */\n readonly isAttached: boolean;\n\n /**\n * Runs through the graph and attach the bounded handles.\n */\n attachGraph(): void;\n\n /**\n * Returns a promise to the Fluid Object referenced by the handle.\n */\n get(): Promise<T>;\n\n /**\n * Binds the given handle to this one or attach the given handle if this handle is attached.\n * A bound handle will also be attached once this handle is attached.\n */\n bind(handle: IFluidHandle): void;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export { IRequest, IRequestHeader, IResponse, IProvideFluidRouter, IFluidRouter,
8
8
  export * from "./handles";
9
9
  export * from "./serializer";
10
10
  export * from "./fluidPackage";
11
+ export * from "./provider";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAIhC,OAAO,EACH,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAIhC,OAAO,EACH,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
package/lib/index.js CHANGED
@@ -10,4 +10,5 @@ export { IFluidRouter, } from "./fluidRouter";
10
10
  export * from "./handles";
11
11
  export * from "./serializer";
12
12
  export * from "./fluidPackage";
13
+ export * from "./provider";
13
14
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,cAAc,iBAAiB,CAAC;AAChC,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,OAAO,EAKH,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// when merging declarations the module path must match exactly. Because of this we need to explicitly export\n// IFluidObject as opposed to an export *\nexport { IFluidObject } from \"./fluidObject\";\n\nexport * from \"./fluidLoadable\";\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n IRequest,\n IRequestHeader,\n IResponse,\n IProvideFluidRouter,\n IFluidRouter,\n} from \"./fluidRouter\";\nexport * from \"./handles\";\nexport * from \"./serializer\";\nexport * from \"./fluidPackage\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,cAAc,iBAAiB,CAAC;AAChC,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,OAAO,EAKH,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// when merging declarations the module path must match exactly. Because of this we need to explicitly export\n// IFluidObject as opposed to an export *\nexport { IFluidObject } from \"./fluidObject\";\n\nexport * from \"./fluidLoadable\";\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n IRequest,\n IRequestHeader,\n IResponse,\n IProvideFluidRouter,\n IFluidRouter,\n} from \"./fluidRouter\";\nexport * from \"./handles\";\nexport * from \"./serializer\";\nexport * from \"./fluidPackage\";\nexport * from \"./provider\";\n"]}
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * @internal
7
+ * This utility type is meant for internal use by @see FluidObject
8
+ * Produces a valid FluidObject key given a type and a property.
9
+ * A valid FluidObject key is a property that exists on the incoming type
10
+ * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo
11
+ * This aligns with the FluidObject pattern expected to be used with all FluidObjects.
12
+ * For example:
13
+ * ```
14
+ * interface IProvideFoo{
15
+ * IFoo: IFoo
16
+ * }
17
+ * interface IFoo extends IProvideFoo{
18
+ * foobar();
19
+ * }
20
+ * ```
21
+ * This pattern enables discovery, and delegation in a standard way which is central
22
+ * to FluidObject pattern
23
+ */
24
+ export declare type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp ? never : number extends TProp ? never : TProp extends keyof Exclude<T[TProp], undefined> ? TProp : never;
25
+ /**
26
+ * This utility type take interface(s) that follow the FluidObject pattern, and produces
27
+ * a new type that can be used for inspection and discovery of those interfaces.
28
+ *
29
+ * It is meant to be used with types that are known to implement the FluidObject pattern.
30
+ * A common way to specify a type implements the FluidObject pattern is to expose it as a
31
+ * FluidObject without a generic argument.
32
+ *
33
+ * For example, if we have an interface like below
34
+ * ```
35
+ * interface IProvideFoo{
36
+ * IFoo: IFoo
37
+ * }
38
+ * interface IFoo extends IProvideFoo{
39
+ * foobar();
40
+ * }
41
+ * ```
42
+ *
43
+ * and a function that returns a FluidObject. You would do the following
44
+ *
45
+ * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;
46
+ *
47
+ * Either IFoo or IProvideFoo are valid generic arguments. In both case
48
+ * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,
49
+ * then the FluidObject provides IFoo, and it can be used.
50
+ *
51
+ * You can inspect multiple types via a intersection. For example:
52
+ * `FluidObject<IFoo & IBar>`
53
+ *
54
+ */
55
+ export declare type FluidObject<T = unknown> = Partial<Pick<T, FluidObjectProviderKeys<T>>>;
56
+ /**
57
+ * This utility type creates a type that is the union of all keys on the generic type
58
+ * which implement the FluidObject pattern. @see FluidObject
59
+ *
60
+ * For example `FluidObjectKeys<IFoo & IBar>` would result in `"IFoo" | "IBar"`
61
+ *
62
+ */
63
+ export declare type FluidObjectKeys<T> = keyof FluidObject<T>;
64
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACF,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IACnE,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,SAAS,KAAK,GAAE,KAAK,GAC1D,KAAK,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,GAC1C,KAAK,GACN,KAAK,CAAC;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACF,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n * This utility type is meant for internal use by @see FluidObject\n * Produces a valid FluidObject key given a type and a property.\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example, IProvideFoo.IFoo.IFoo\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n * For example:\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern\n */\n export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =\n string extends TProp ? never : number extends TProp? never : // exclude indexers [key:string |number]: any\n TProp extends keyof Exclude<T[TProp], undefined> // TProp is a property of T, and T[TProp]\n ? TProp\n :never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * For example, if we have an interface like below\n * ```\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n *\n */\n export type FluidObject<T = unknown> = Partial<Pick<T, FluidObjectProviderKeys<T>>>;\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern. @see FluidObject\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
@@ -5,15 +5,25 @@
5
5
  import { IFluidHandle } from "./handles";
6
6
  /**
7
7
  * JSON serialized form of an IFluidHandle
8
+ * @deprecated - Moved to fluidframework/shared-object-base package
8
9
  */
9
10
  export interface ISerializedHandle {
10
11
  type: "__fluid_handle__";
11
12
  url: string;
12
13
  }
14
+ /**
15
+ * @deprecated - Moved to fluidframework/shared-object-base package
16
+ */
13
17
  export declare const IFluidSerializer: keyof IProvideFluidSerializer;
18
+ /**
19
+ * @deprecated - Moved to fluidframework/shared-object-base package
20
+ */
14
21
  export interface IProvideFluidSerializer {
15
22
  readonly IFluidSerializer: IFluidSerializer;
16
23
  }
24
+ /**
25
+ * @deprecated - Moved to fluidframework/shared-object-base package
26
+ */
17
27
  export interface IFluidSerializer extends IProvideFluidSerializer {
18
28
  /**
19
29
  * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAE9B,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,uBAA4C,CAAC;AAElF,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC7D;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC;IAEpD;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAElD;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CAC7B"}
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAE9B,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,uBAA4C,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC7D;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC;IAEpD;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAElD;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CAC7B"}
package/lib/serializer.js CHANGED
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @deprecated - Moved to fluidframework/shared-object-base package
3
+ */
1
4
  export const IFluidSerializer = "IFluidSerializer";
2
5
  //# sourceMappingURL=serializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,MAAM,gBAAgB,GAAkC,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidHandle } from \"./handles\";\n\n/**\n * JSON serialized form of an IFluidHandle\n */\nexport interface ISerializedHandle {\n // Marker to indicate to JSON.parse that the object is a Fluid handle\n type: \"__fluid_handle__\";\n\n // URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n url: string;\n}\n\nexport const IFluidSerializer: keyof IProvideFluidSerializer = \"IFluidSerializer\";\n\nexport interface IProvideFluidSerializer {\n readonly IFluidSerializer: IFluidSerializer;\n}\n\nexport interface IFluidSerializer extends IProvideFluidSerializer {\n /**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n */\n replaceHandles(value: any, bind: IFluidHandle): any;\n\n /**\n * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n * equivalent object tree where any encoded IFluidHandles have been replaced with thier decoded form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * The decoded handles are implicitly bound to the handle context of this serializer.\n */\n decode?(input: any): any;\n\n /**\n * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n */\n stringify(value: any, bind: IFluidHandle): string;\n\n /**\n * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n * handles will be realized as part of the parse\n */\n parse(value: string): any;\n}\n"]}
1
+ {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAkC,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IFluidHandle } from \"./handles\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface ISerializedHandle {\n // Marker to indicate to JSON.parse that the object is a Fluid handle\n type: \"__fluid_handle__\";\n\n // URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n url: string;\n}\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport const IFluidSerializer: keyof IProvideFluidSerializer = \"IFluidSerializer\";\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface IProvideFluidSerializer {\n readonly IFluidSerializer: IFluidSerializer;\n}\n\n/**\n * @deprecated - Moved to fluidframework/shared-object-base package\n */\nexport interface IFluidSerializer extends IProvideFluidSerializer {\n /**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n */\n replaceHandles(value: any, bind: IFluidHandle): any;\n\n /**\n * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n * equivalent object tree where any encoded IFluidHandles have been replaced with thier decoded form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * The decoded handles are implicitly bound to the handle context of this serializer.\n */\n decode?(input: any): any;\n\n /**\n * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n */\n stringify(value: any, bind: IFluidHandle): string;\n\n /**\n * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n * handles will be realized as part of the parse\n */\n parse(value: string): any;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fluidObjectTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidObjectTypes.d.ts","sourceRoot":"","sources":["../../../src/test/types/fluidObjectTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,80 @@
1
+ var _a, _b, _c;
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ import { IFluidLoadable } from "../../";
7
+ // test implicit conversions between FluidObject and a FluidObject with a provides interface
8
+ {
9
+ const provider = getFluidObject();
10
+ useFluidObject(provider);
11
+ useFluidObject(provider.IFluidLoadable);
12
+ useProvider(provider);
13
+ useProvider(provider.IFluidLoadable);
14
+ useLoadable(provider);
15
+ useLoadable(provider.IFluidLoadable);
16
+ // @ts-expect-error provider shouldn't have any non-provider properties
17
+ use(provider.handle);
18
+ use((_a = provider.IFluidLoadable) === null || _a === void 0 ? void 0 : _a.handle);
19
+ const unknown = provider.IFluidLoadable;
20
+ useFluidObject(unknown);
21
+ useProvider(unknown);
22
+ useProvider(unknown);
23
+ useLoadable(unknown);
24
+ }
25
+ // test implicit conversions between FluidObject and a FluidObject with a implementation interface
26
+ {
27
+ const foo = getFluidObject();
28
+ useFluidObject(foo);
29
+ useFluidObject(foo.IFluidLoadable);
30
+ useProvider(foo);
31
+ useProvider(foo.IFluidLoadable);
32
+ useLoadable(foo);
33
+ useLoadable(foo.IFluidLoadable);
34
+ // @ts-expect-error provider shouldn't have any non-provider properties
35
+ use(foo.handle);
36
+ use((_b = foo.IFluidLoadable) === null || _b === void 0 ? void 0 : _b.handle);
37
+ const unknown = foo.IFluidLoadable;
38
+ useFluidObject(unknown);
39
+ useProvider(unknown);
40
+ useProvider(unknown);
41
+ useLoadable(unknown);
42
+ }
43
+ // test getting keys
44
+ {
45
+ useProviderKey(IFluidLoadable);
46
+ useProviderKey(IFluidLoadable);
47
+ const loadableKey = "handle";
48
+ // @ts-expect-error provider shouldn't have any non-provider properties
49
+ useProviderKey(loadableKey);
50
+ }
51
+ // test implicit conversions between FluidObject and a FluidObject with a partial provider interface
52
+ {
53
+ const foo = getFluidObject();
54
+ useFluidObject(foo);
55
+ useFluidObject(foo.IFoo);
56
+ useProvider(foo);
57
+ useProvider(foo.IFoo);
58
+ (_c = foo.IFoo) === null || _c === void 0 ? void 0 : _c.doFoo();
59
+ const fooKey = "doFoo";
60
+ // @ts-expect-error provider shouldn't have any non-provider properties
61
+ useProviderKey(fooKey);
62
+ const unknown = foo.IFoo;
63
+ useFluidObject(unknown);
64
+ useProvider(unknown);
65
+ useProvider(unknown);
66
+ useLoadable(unknown);
67
+ }
68
+ {
69
+ const fluidObject = getIFluidObject();
70
+ const legacy = getFluidObject();
71
+ useLoadable(fluidObject);
72
+ useLoadable(legacy);
73
+ useFluidObject(fluidObject);
74
+ useFluidObject(legacy);
75
+ useProvider(legacy);
76
+ useProvider(fluidObject);
77
+ useProvider(legacy);
78
+ useProvider(fluidObject);
79
+ }
80
+ //# sourceMappingURL=fluidObjectTypes.js.map