@fluidframework/core-interfaces 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -8
- package/api-extractor.json +2 -2
- package/dist/fluidLoadable.d.ts.map +1 -1
- package/dist/fluidLoadable.js.map +1 -1
- package/dist/fluidPackage.d.ts +3 -3
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +7 -8
- package/dist/fluidPackage.js.map +1 -1
- package/dist/fluidRouter.d.ts.map +1 -1
- package/dist/fluidRouter.js.map +1 -1
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js.map +1 -1
- package/lib/fluidLoadable.d.ts.map +1 -1
- package/lib/fluidLoadable.js.map +1 -1
- package/lib/fluidPackage.d.ts +3 -3
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +7 -8
- package/lib/fluidPackage.js.map +1 -1
- package/lib/fluidRouter.d.ts.map +1 -1
- package/lib/fluidRouter.js.map +1 -1
- package/lib/handles.d.ts.map +1 -1
- package/lib/handles.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/provider.d.ts.map +1 -1
- package/lib/provider.js.map +1 -1
- package/package.json +27 -26
- package/prettier.config.cjs +1 -1
- package/src/fluidLoadable.ts +6 -6
- package/src/fluidPackage.ts +92 -89
- package/src/fluidRouter.ts +10 -10
- package/src/handles.ts +54 -55
- package/src/index.ts +22 -26
- package/src/provider.ts +10 -8
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +8 -12
package/.eslintrc.js
CHANGED
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"project": ["./tsconfig.json", "./src/test/tsconfig.json"]
|
|
13
|
-
},
|
|
14
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common-strict.json"
|
|
4
4
|
}
|
|
@@ -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;
|
|
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;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,MAAM,EAAE,YAAY,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD,MAAM,WAAW,cAAc;IAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAa/D,QAAA,cAAc,GAAgC,gBAAgB,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
|
|
1
|
+
{"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAa/D,QAAA,cAAc,GAAgC,gBAAgB,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\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\thandle: IFluidHandle;\n}\n\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\nexport interface IFluidRunnable {\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
|
package/dist/fluidPackage.d.ts
CHANGED
|
@@ -97,17 +97,17 @@ export interface IFluidCodeDetails {
|
|
|
97
97
|
/**
|
|
98
98
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
99
99
|
* to have code loading modules in same package.
|
|
100
|
-
*/
|
|
100
|
+
*/
|
|
101
101
|
export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
|
|
102
102
|
/**
|
|
103
103
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
104
104
|
* to have code loading modules in same package.
|
|
105
|
-
*/
|
|
105
|
+
*/
|
|
106
106
|
export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
|
|
107
107
|
/**
|
|
108
108
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}
|
|
109
109
|
* to have code loading modules in same package.
|
|
110
|
-
*/
|
|
110
|
+
*/
|
|
111
111
|
export interface IProvideFluidCodeDetailsComparer {
|
|
112
112
|
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
113
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,MAAM,EAAE,MAAM,GACZ,SAAS,GACT;QACA;;;;WAIG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB;;;;WAIG;QACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACL;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE;QACN;;;WAGG;QACH,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,CAAC;KAC5D,CAAC;IACF;;;;OAIG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,QAAS,GAAG,mCACoD,CAAC;AAE5F;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAa,OAAO,2CAQlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,gCAClB,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;CAC9D;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IAClF;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzF;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjF"}
|
package/dist/fluidPackage.js
CHANGED
|
@@ -13,24 +13,23 @@ exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluid
|
|
|
13
13
|
*
|
|
14
14
|
* @param pkg - The package json data to check if it is a Fluid package.
|
|
15
15
|
*/
|
|
16
|
-
const isFluidPackage = (pkg) => typeof pkg === "object"
|
|
17
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
|
|
18
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
16
|
+
const isFluidPackage = (pkg) => typeof pkg === "object" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
19
17
|
exports.isFluidPackage = isFluidPackage;
|
|
20
18
|
/**
|
|
21
19
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
22
20
|
* to have code loading modules in same package.
|
|
23
|
-
*/
|
|
21
|
+
*/
|
|
24
22
|
const isFluidCodeDetails = (details) => {
|
|
25
23
|
const maybeCodeDetails = details;
|
|
26
|
-
return typeof maybeCodeDetails === "object"
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
return (typeof maybeCodeDetails === "object" &&
|
|
25
|
+
(typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" ||
|
|
26
|
+
(0, exports.isFluidPackage)(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package)) &&
|
|
27
|
+
((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object"));
|
|
29
28
|
};
|
|
30
29
|
exports.isFluidCodeDetails = isFluidCodeDetails;
|
|
31
30
|
/**
|
|
32
31
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
33
32
|
* to have code loading modules in same package.
|
|
34
|
-
*/
|
|
33
|
+
*/
|
|
35
34
|
exports.IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
|
|
36
35
|
//# sourceMappingURL=fluidPackage.js.map
|
package/dist/fluidPackage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgEH;;;;;;;GAOG;AACI,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CAC1E,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAD/E,QAAA,cAAc,kBACiE;AA+B5F;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC9F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,CACN,OAAO,gBAAgB,KAAK,QAAQ;QACpC,CAAC,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ;YAC7C,IAAA,sBAAc,EAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CACxF,CAAC;AACH,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEF;;;GAGG;AACU,QAAA,yBAAyB,GACrC,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 an {@link IFluidPackage}.\n *\n * @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackageEnvironment}\n * to have code loading modules in same package.\n */\nexport interface IFluidPackageEnvironment {\n\t/**\n\t * The name of the target. For a browser environment, this could be umd for scripts\n\t * or css for styles.\n\t */\n\t[target: string]:\n\t\t| undefined\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * List of files for the target. These can be relative or absolute.\n\t\t\t\t * The code loader should resolve relative paths, and validate all\n\t\t\t\t * full urls.\n\t\t\t\t */\n\t\t\t\tfiles: string[];\n\n\t\t\t\t/**\n\t\t\t\t * General access for extended fields as specific usages will\n\t\t\t\t * likely have additional infornamation like a definition\n\t\t\t\t * of Library, the entrypoint for umd packages\n\t\t\t\t */\n\t\t\t\t[key: string]: unknown;\n\t\t };\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 *\n * @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackage}\n * to have code loading modules in same package.\n */\nexport interface IFluidPackage {\n\t/**\n\t * The name of the package that this code represnets\n\t */\n\tname: string;\n\t/**\n\t * This object represents the Fluid specific properties of the package\n\t */\n\tfluid: {\n\t\t/**\n\t\t * The name of the of the environment. This should be something like browser, or node\n\t\t * and contain the necessary targets for loading this code in that environment.\n\t\t */\n\t\t[environment: string]: undefined | IFluidPackageEnvironment;\n\t};\n\t/**\n\t * General access for extended fields as specific usages will\n\t * likely have additional infornamation like a definition of\n\t * compatible versions, or deployment information like rings or rollouts.\n\t */\n\t[key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#isFluidPackage}\n * to have code loading modules in same package.\n *\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\ttypeof pkg === \"object\" && typeof pkg?.name === \"string\" && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsConfig}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetailsConfig {\n\treadonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetails}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetails {\n\t/**\n\t * The code package to be used on the Fluid document. This is either the package name which will be loaded\n\t * from a package manager. Or the expanded Fluid package.\n\t */\n\treadonly package: string | Readonly<IFluidPackage>;\n\n\t/**\n\t * Configuration details. This includes links to the package manager and base CDNs.\n\t */\n\treadonly config?: IFluidCodeDetailsConfig;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}\n * to have code loading modules in same package.\n */\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n\tconst maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n\treturn (\n\t\ttypeof maybeCodeDetails === \"object\" &&\n\t\t(typeof maybeCodeDetails?.package === \"string\" ||\n\t\t\tisFluidPackage(maybeCodeDetails?.package)) &&\n\t\t(maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\")\n\t);\n};\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =\n\t\"IFluidCodeDetailsComparer\";\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport interface IProvideFluidCodeDetailsComparer {\n\treadonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\t/**\n\t * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n\t *\n\t * Similar semantics to:\n\t * {@link https://github.com/npm/node-semver#usage}\n\t */\n\tsatisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Returns a number representing the ascending sort order of the `a` and `b` code details:\n\t *\n\t * - `< 0` if `a < b`.\n\t *\n\t * - `= 0` if `a === b`.\n\t *\n\t * - `> 0` if `a > b`.\n\t *\n\t * - `undefined` if `a` is not comparable to `b`.\n\t *\n\t * Similar semantics to:\n\t * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n\t */\n\tcompare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRouter.d.ts","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"fluidRouter.d.ts","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC9B,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AACD,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACxD,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC/C"}
|
package/dist/fluidRouter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRouter.js","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IRequestHeader {\n
|
|
1
|
+
{"version":3,"file":"fluidRouter.js","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IRequestHeader {\n\t[index: string]: any;\n}\n\nexport interface IRequest {\n\turl: string;\n\theaders?: IRequestHeader;\n}\n\nexport interface IResponse {\n\tmimeType: string;\n\tstatus: number;\n\tvalue: any;\n\theaders?: { [key: string]: any };\n\tstack?: string;\n}\n\nexport const IFluidRouter: keyof IProvideFluidRouter = \"IFluidRouter\";\n\n/**\n * Request routing\n */\nexport interface IProvideFluidRouter {\n\treadonly IFluidRouter: IFluidRouter;\n}\nexport interface IFluidRouter extends IProvideFluidRouter {\n\trequest(request: IRequest): Promise<IResponse>;\n}\n"]}
|
package/dist/handles.d.ts.map
CHANGED
|
@@ -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,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F,MAAM,WAAW,0BAA0B;
|
|
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,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACtE;;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;CACrD;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAE5B,CAAC,GAAG,WAAW,GAAG,cAAc,CAC/B,SAAQ,mBAAmB;IAC5B;;;;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;CACjC"}
|
package/dist/handles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAkC9E,QAAA,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 { IFluidLoadable } from \"./fluidLoadable\";\nimport { FluidObject } from \"./provider\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n
|
|
1
|
+
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAkC9E,QAAA,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 { IFluidLoadable } from \"./fluidLoadable\";\nimport { FluidObject } from \"./provider\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\nexport interface IProvideFluidHandle {\n\treadonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n */\nexport interface IFluidHandle<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tT = FluidObject & IFluidLoadable,\n> extends IProvideFluidHandle {\n\t/**\n\t * @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.\n\t *\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandle): void;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { IFluidLoadable, IProvideFluidLoadable, IFluidRunnable, IProvideFluidRun
|
|
|
6
6
|
export { IRequest, IRequestHeader, IResponse, IProvideFluidRouter, IFluidRouter, } from "./fluidRouter";
|
|
7
7
|
export { IFluidHandleContext, IProvideFluidHandleContext, IFluidHandle, IProvideFluidHandle, } from "./handles";
|
|
8
8
|
export { IFluidPackageEnvironment, IFluidPackage, isFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, isFluidCodeDetails, IFluidCodeDetailsComparer, IProvideFluidCodeDetailsComparer, } from "./fluidPackage";
|
|
9
|
-
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys
|
|
9
|
+
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAKyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AAEd,+GAAA,cAAc,OAAA;AAIf,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADtB,2GAAA,YAAY,OAAA;AAGb,qCAKmB;AAJlB,8GAAA,mBAAmB,OAAA;AAEnB,uGAAA,YAAY,OAAA;AAIb,+CASwB;AANvB,8GAAA,cAAc,OAAA;AAGd,kHAAA,kBAAkB,OAAA;AAClB,yHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\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\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\nexport { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider\";\n"]}
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,MAAM,SAAS,KAAK,GAC3F,KAAK,GACL,MAAM,SAAS,KAAK,GACpB,KAAK,GACL,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACtC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC7D,KAAK,GACL,KAAK,GACN,KAAK,CAAC;AAET;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;KACrC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;GAQG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/provider.js.map
CHANGED
|
@@ -1 +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 * This utility type is meant for internal use by {@link 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 *\n * @example\n * ```typescript\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 * @internal\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T>
|
|
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 * This utility type is meant for internal use by {@link 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 *\n * @example\n * ```typescript\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 * @internal\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp\n\t? never\n\t: number extends TProp\n\t? never // exclude indexers [key:string |number]: any\n\t: TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n\t? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n\t\t? TProp\n\t\t: never\n\t: 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 * @example\n * For example, if we have an interface like below\n * ```typescript\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 */\nexport type FluidObject<T = unknown> = {\n\t[P in FluidObjectProviderKeys<T>]?: T[P];\n};\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.\n *\n * See {@link FluidObject}\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
|
|
@@ -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;
|
|
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;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,MAAM,EAAE,YAAY,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD,MAAM,WAAW,cAAc;IAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
package/lib/fluidLoadable.js.map
CHANGED
|
@@ -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","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
|
|
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","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\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\thandle: IFluidHandle;\n}\n\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\nexport interface IFluidRunnable {\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
|
package/lib/fluidPackage.d.ts
CHANGED
|
@@ -97,17 +97,17 @@ export interface IFluidCodeDetails {
|
|
|
97
97
|
/**
|
|
98
98
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
99
99
|
* to have code loading modules in same package.
|
|
100
|
-
*/
|
|
100
|
+
*/
|
|
101
101
|
export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
|
|
102
102
|
/**
|
|
103
103
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
104
104
|
* to have code loading modules in same package.
|
|
105
|
-
*/
|
|
105
|
+
*/
|
|
106
106
|
export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
|
|
107
107
|
/**
|
|
108
108
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}
|
|
109
109
|
* to have code loading modules in same package.
|
|
110
|
-
*/
|
|
110
|
+
*/
|
|
111
111
|
export interface IProvideFluidCodeDetailsComparer {
|
|
112
112
|
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
113
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,MAAM,EAAE,MAAM,GACZ,SAAS,GACT;QACA;;;;WAIG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB;;;;WAIG;QACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACL;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE;QACN;;;WAGG;QACH,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,CAAC;KAC5D,CAAC;IACF;;;;OAIG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,QAAS,GAAG,mCACoD,CAAC;AAE5F;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAa,OAAO,2CAQlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,gCAClB,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;CAC9D;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IAClF;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzF;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjF"}
|
package/lib/fluidPackage.js
CHANGED
|
@@ -10,22 +10,21 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @param pkg - The package json data to check if it is a Fluid package.
|
|
12
12
|
*/
|
|
13
|
-
export const isFluidPackage = (pkg) => typeof pkg === "object"
|
|
14
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
|
|
15
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
13
|
+
export const isFluidPackage = (pkg) => typeof pkg === "object" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
16
14
|
/**
|
|
17
15
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
18
16
|
* to have code loading modules in same package.
|
|
19
|
-
*/
|
|
17
|
+
*/
|
|
20
18
|
export const isFluidCodeDetails = (details) => {
|
|
21
19
|
const maybeCodeDetails = details;
|
|
22
|
-
return typeof maybeCodeDetails === "object"
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return (typeof maybeCodeDetails === "object" &&
|
|
21
|
+
(typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" ||
|
|
22
|
+
isFluidPackage(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package)) &&
|
|
23
|
+
((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object"));
|
|
25
24
|
};
|
|
26
25
|
/**
|
|
27
26
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
28
27
|
* to have code loading modules in same package.
|
|
29
|
-
*/
|
|
28
|
+
*/
|
|
30
29
|
export const IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
|
|
31
30
|
//# sourceMappingURL=fluidPackage.js.map
|
package/lib/fluidPackage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CAC1E,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AA+B5F;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC9F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,CACN,OAAO,gBAAgB,KAAK,QAAQ;QACpC,CAAC,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ;YAC7C,cAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CACxF,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACrC,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 an {@link IFluidPackage}.\n *\n * @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackageEnvironment}\n * to have code loading modules in same package.\n */\nexport interface IFluidPackageEnvironment {\n\t/**\n\t * The name of the target. For a browser environment, this could be umd for scripts\n\t * or css for styles.\n\t */\n\t[target: string]:\n\t\t| undefined\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * List of files for the target. These can be relative or absolute.\n\t\t\t\t * The code loader should resolve relative paths, and validate all\n\t\t\t\t * full urls.\n\t\t\t\t */\n\t\t\t\tfiles: string[];\n\n\t\t\t\t/**\n\t\t\t\t * General access for extended fields as specific usages will\n\t\t\t\t * likely have additional infornamation like a definition\n\t\t\t\t * of Library, the entrypoint for umd packages\n\t\t\t\t */\n\t\t\t\t[key: string]: unknown;\n\t\t };\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 *\n * @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackage}\n * to have code loading modules in same package.\n */\nexport interface IFluidPackage {\n\t/**\n\t * The name of the package that this code represnets\n\t */\n\tname: string;\n\t/**\n\t * This object represents the Fluid specific properties of the package\n\t */\n\tfluid: {\n\t\t/**\n\t\t * The name of the of the environment. This should be something like browser, or node\n\t\t * and contain the necessary targets for loading this code in that environment.\n\t\t */\n\t\t[environment: string]: undefined | IFluidPackageEnvironment;\n\t};\n\t/**\n\t * General access for extended fields as specific usages will\n\t * likely have additional infornamation like a definition of\n\t * compatible versions, or deployment information like rings or rollouts.\n\t */\n\t[key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#isFluidPackage}\n * to have code loading modules in same package.\n *\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\ttypeof pkg === \"object\" && typeof pkg?.name === \"string\" && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsConfig}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetailsConfig {\n\treadonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetails}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetails {\n\t/**\n\t * The code package to be used on the Fluid document. This is either the package name which will be loaded\n\t * from a package manager. Or the expanded Fluid package.\n\t */\n\treadonly package: string | Readonly<IFluidPackage>;\n\n\t/**\n\t * Configuration details. This includes links to the package manager and base CDNs.\n\t */\n\treadonly config?: IFluidCodeDetailsConfig;\n}\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}\n * to have code loading modules in same package.\n */\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n\tconst maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n\treturn (\n\t\ttypeof maybeCodeDetails === \"object\" &&\n\t\t(typeof maybeCodeDetails?.package === \"string\" ||\n\t\t\tisFluidPackage(maybeCodeDetails?.package)) &&\n\t\t(maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\")\n\t);\n};\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =\n\t\"IFluidCodeDetailsComparer\";\n\n/**\n * @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport interface IProvideFluidCodeDetailsComparer {\n\treadonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n *\n * @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}\n * to have code loading modules in same package.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\t/**\n\t * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n\t *\n\t * Similar semantics to:\n\t * {@link https://github.com/npm/node-semver#usage}\n\t */\n\tsatisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Returns a number representing the ascending sort order of the `a` and `b` code details:\n\t *\n\t * - `< 0` if `a < b`.\n\t *\n\t * - `= 0` if `a === b`.\n\t *\n\t * - `> 0` if `a > b`.\n\t *\n\t * - `undefined` if `a` is not comparable to `b`.\n\t *\n\t * Similar semantics to:\n\t * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n\t */\n\tcompare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n}\n"]}
|
package/lib/fluidRouter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRouter.d.ts","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"fluidRouter.d.ts","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC9B,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AACD,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACxD,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC/C"}
|
package/lib/fluidRouter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRouter.js","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,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\nexport interface IRequestHeader {\n
|
|
1
|
+
{"version":3,"file":"fluidRouter.js","sourceRoot":"","sources":["../src/fluidRouter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,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\nexport interface IRequestHeader {\n\t[index: string]: any;\n}\n\nexport interface IRequest {\n\turl: string;\n\theaders?: IRequestHeader;\n}\n\nexport interface IResponse {\n\tmimeType: string;\n\tstatus: number;\n\tvalue: any;\n\theaders?: { [key: string]: any };\n\tstack?: string;\n}\n\nexport const IFluidRouter: keyof IProvideFluidRouter = \"IFluidRouter\";\n\n/**\n * Request routing\n */\nexport interface IProvideFluidRouter {\n\treadonly IFluidRouter: IFluidRouter;\n}\nexport interface IFluidRouter extends IProvideFluidRouter {\n\trequest(request: IRequest): Promise<IResponse>;\n}\n"]}
|
package/lib/handles.d.ts.map
CHANGED
|
@@ -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,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F,MAAM,WAAW,0BAA0B;
|
|
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,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACtE;;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;CACrD;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,mBAAoC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAE5B,CAAC,GAAG,WAAW,GAAG,cAAc,CAC/B,SAAQ,mBAAmB;IAC5B;;;;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;CACjC"}
|
package/lib/handles.js.map
CHANGED
|
@@ -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 { IFluidLoadable } from \"./fluidLoadable\";\nimport { FluidObject } from \"./provider\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n
|
|
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 { IFluidLoadable } from \"./fluidLoadable\";\nimport { FluidObject } from \"./provider\";\n\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n */\nexport interface IFluidHandleContext extends IProvideFluidHandleContext {\n\t/**\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined\n\t * at the root.\n\t */\n\treadonly routeContext?: IFluidHandleContext;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\nexport const IFluidHandle: keyof IProvideFluidHandle = \"IFluidHandle\";\n\nexport interface IProvideFluidHandle {\n\treadonly IFluidHandle: IFluidHandle;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n */\nexport interface IFluidHandle<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tT = FluidObject & IFluidLoadable,\n> extends IProvideFluidHandle {\n\t/**\n\t * @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.\n\t *\n\t * The absolute path to the handle context from the root.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Flag indicating whether or not the entity has services attached.\n\t */\n\treadonly isAttached: boolean;\n\n\t/**\n\t * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Binds the given handle to this one or attach the given handle if this handle is attached.\n\t * A bound handle will also be attached once this handle is attached.\n\t */\n\tbind(handle: IFluidHandle): void;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { IFluidLoadable, IProvideFluidLoadable, IFluidRunnable, IProvideFluidRun
|
|
|
6
6
|
export { IRequest, IRequestHeader, IResponse, IProvideFluidRouter, IFluidRouter, } from "./fluidRouter";
|
|
7
7
|
export { IFluidHandleContext, IProvideFluidHandleContext, IFluidHandle, IProvideFluidHandle, } from "./handles";
|
|
8
8
|
export { IFluidPackageEnvironment, IFluidPackage, isFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, isFluidCodeDetails, IFluidCodeDetailsComparer, IProvideFluidCodeDetailsComparer, } from "./fluidPackage";
|
|
9
|
-
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys
|
|
9
|
+
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EAEd,cAAc,GAEd,MAAM,iBAAiB,CAAC;AAEzB,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,OAAO,EAKN,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EAEnB,YAAY,GAEZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAGN,cAAc,EAGd,kBAAkB,EAClB,yBAAyB,GAEzB,MAAM,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\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\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\nexport { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider\";\n"]}
|
package/lib/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,MAAM,SAAS,KAAK,GAC3F,KAAK,GACL,MAAM,SAAS,KAAK,GACpB,KAAK,GACL,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACtC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC7D,KAAK,GACL,KAAK,GACN,KAAK,CAAC;AAET;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,oBAAY,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;KACrC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;GAQG;AACH,oBAAY,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
|
package/lib/provider.js.map
CHANGED
|
@@ -1 +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 * This utility type is meant for internal use by {@link 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 *\n * @example\n * ```typescript\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 * @internal\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T>
|
|
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 * This utility type is meant for internal use by {@link 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 *\n * @example\n * ```typescript\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 * @internal\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp\n\t? never\n\t: number extends TProp\n\t? never // exclude indexers [key:string |number]: any\n\t: TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n\t? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n\t\t? TProp\n\t\t: never\n\t: 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 * @example\n * For example, if we have an interface like below\n * ```typescript\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 */\nexport type FluidObject<T = unknown> = {\n\t[P in FluidObjectProviderKeys<T>]?: T[P];\n};\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.\n *\n * See {@link FluidObject}\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-internal.3.0
|
|
3
|
+
"version": "2.0.0-internal.3.2.0",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -14,6 +14,29 @@
|
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@fluid-tools/build-cli": "^0.10.0",
|
|
19
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
20
|
+
"@fluidframework/build-tools": "^0.10.0",
|
|
21
|
+
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-internal.3.1.0",
|
|
22
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
23
|
+
"@microsoft/api-extractor": "^7.22.2",
|
|
24
|
+
"@rushstack/eslint-config": "^2.5.1",
|
|
25
|
+
"@types/node": "^14.18.36",
|
|
26
|
+
"concurrently": "^6.2.0",
|
|
27
|
+
"copyfiles": "^2.4.1",
|
|
28
|
+
"eslint": "~8.6.0",
|
|
29
|
+
"prettier": "~2.6.2",
|
|
30
|
+
"rimraf": "^2.6.2",
|
|
31
|
+
"typescript": "~4.5.5"
|
|
32
|
+
},
|
|
33
|
+
"typeValidation": {
|
|
34
|
+
"version": "2.0.0-internal.3.2.0",
|
|
35
|
+
"previousVersionStyle": "~previousMinor",
|
|
36
|
+
"baselineRange": ">=2.0.0-internal.3.1.0 <2.0.0-internal.3.2.0",
|
|
37
|
+
"baselineVersion": "2.0.0-internal.3.1.0",
|
|
38
|
+
"broken": {}
|
|
39
|
+
},
|
|
17
40
|
"scripts": {
|
|
18
41
|
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
19
42
|
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
@@ -31,35 +54,13 @@
|
|
|
31
54
|
"eslint": "eslint --format stylish src",
|
|
32
55
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
33
56
|
"format": "npm run prettier:fix",
|
|
34
|
-
"lint": "npm run eslint",
|
|
35
|
-
"lint:fix": "npm run eslint:fix",
|
|
57
|
+
"lint": "npm run prettier && npm run eslint",
|
|
58
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
36
59
|
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
37
60
|
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
38
61
|
"tsc": "tsc",
|
|
39
62
|
"tsc:watch": "tsc --watch",
|
|
40
63
|
"typetests:gen": "flub generate typetests --generate --dir .",
|
|
41
64
|
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@fluid-tools/build-cli": "^0.8.0",
|
|
45
|
-
"@fluidframework/build-common": "^1.1.0",
|
|
46
|
-
"@fluidframework/build-tools": "^0.8.0",
|
|
47
|
-
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-internal.3.0.0",
|
|
48
|
-
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
49
|
-
"@microsoft/api-extractor": "^7.22.2",
|
|
50
|
-
"@rushstack/eslint-config": "^2.5.1",
|
|
51
|
-
"@types/node": "^14.18.36",
|
|
52
|
-
"concurrently": "^6.2.0",
|
|
53
|
-
"copyfiles": "^2.4.1",
|
|
54
|
-
"eslint": "~8.6.0",
|
|
55
|
-
"prettier": "~2.6.2",
|
|
56
|
-
"rimraf": "^2.6.2",
|
|
57
|
-
"typescript": "~4.5.5"
|
|
58
|
-
},
|
|
59
|
-
"typeValidation": {
|
|
60
|
-
"version": "2.0.0-internal.3.0.1",
|
|
61
|
-
"previousVersionStyle": "previousPatch",
|
|
62
|
-
"baselineRange": "2.0.0-internal.3.0.0",
|
|
63
|
-
"broken": {}
|
|
64
65
|
}
|
|
65
|
-
}
|
|
66
|
+
}
|
package/prettier.config.cjs
CHANGED
package/src/fluidLoadable.ts
CHANGED
|
@@ -8,22 +8,22 @@ import { IFluidHandle } from "./handles";
|
|
|
8
8
|
export const IFluidLoadable: keyof IProvideFluidLoadable = "IFluidLoadable";
|
|
9
9
|
|
|
10
10
|
export interface IProvideFluidLoadable {
|
|
11
|
-
|
|
11
|
+
readonly IFluidLoadable: IFluidLoadable;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* A shared FluidObject has a URL from which it can be referenced
|
|
15
15
|
*/
|
|
16
16
|
export interface IFluidLoadable extends IProvideFluidLoadable {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// Handle to the loadable FluidObject
|
|
18
|
+
handle: IFluidHandle;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const IFluidRunnable: keyof IProvideFluidRunnable = "IFluidRunnable";
|
|
22
22
|
|
|
23
23
|
export interface IProvideFluidRunnable {
|
|
24
|
-
|
|
24
|
+
readonly IFluidRunnable: IFluidRunnable;
|
|
25
25
|
}
|
|
26
26
|
export interface IFluidRunnable {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
run(...args: any[]): Promise<void>;
|
|
28
|
+
stop(reason?: string): void;
|
|
29
29
|
}
|
package/src/fluidPackage.ts
CHANGED
|
@@ -3,32 +3,34 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Specifies an environment on Fluid property of an {@link IFluidPackage}.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackageEnvironment}
|
|
10
|
+
* to have code loading modules in same package.
|
|
11
|
+
*/
|
|
12
12
|
export interface IFluidPackageEnvironment {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The name of the target. For a browser environment, this could be umd for scripts
|
|
15
|
+
* or css for styles.
|
|
16
|
+
*/
|
|
17
|
+
[target: string]:
|
|
18
|
+
| undefined
|
|
19
|
+
| {
|
|
20
|
+
/**
|
|
21
|
+
* List of files for the target. These can be relative or absolute.
|
|
22
|
+
* The code loader should resolve relative paths, and validate all
|
|
23
|
+
* full urls.
|
|
24
|
+
*/
|
|
25
|
+
files: string[];
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/**
|
|
28
|
+
* General access for extended fields as specific usages will
|
|
29
|
+
* likely have additional infornamation like a definition
|
|
30
|
+
* of Library, the entrypoint for umd packages
|
|
31
|
+
*/
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -41,26 +43,26 @@ export interface IFluidPackageEnvironment {
|
|
|
41
43
|
* to have code loading modules in same package.
|
|
42
44
|
*/
|
|
43
45
|
export interface IFluidPackage {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The name of the package that this code represnets
|
|
48
|
+
*/
|
|
49
|
+
name: string;
|
|
50
|
+
/**
|
|
51
|
+
* This object represents the Fluid specific properties of the package
|
|
52
|
+
*/
|
|
53
|
+
fluid: {
|
|
54
|
+
/**
|
|
55
|
+
* The name of the of the environment. This should be something like browser, or node
|
|
56
|
+
* and contain the necessary targets for loading this code in that environment.
|
|
57
|
+
*/
|
|
58
|
+
[environment: string]: undefined | IFluidPackageEnvironment;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* General access for extended fields as specific usages will
|
|
62
|
+
* likely have additional infornamation like a definition of
|
|
63
|
+
* compatible versions, or deployment information like rings or rollouts.
|
|
64
|
+
*/
|
|
65
|
+
[key: string]: unknown;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
/**
|
|
@@ -72,9 +74,7 @@ export interface IFluidPackage {
|
|
|
72
74
|
* @param pkg - The package json data to check if it is a Fluid package.
|
|
73
75
|
*/
|
|
74
76
|
export const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>
|
|
75
|
-
|
|
76
|
-
&& typeof pkg?.name === "string"
|
|
77
|
-
&& typeof pkg?.fluid === "object";
|
|
77
|
+
typeof pkg === "object" && typeof pkg?.name === "string" && typeof pkg?.fluid === "object";
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Package manager configuration. Provides a key value mapping of config values.
|
|
@@ -83,7 +83,7 @@ export const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>
|
|
|
83
83
|
* to have code loading modules in same package.
|
|
84
84
|
*/
|
|
85
85
|
export interface IFluidCodeDetailsConfig {
|
|
86
|
-
|
|
86
|
+
readonly [key: string]: string;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -93,41 +93,45 @@ export interface IFluidCodeDetailsConfig {
|
|
|
93
93
|
* to have code loading modules in same package.
|
|
94
94
|
*/
|
|
95
95
|
export interface IFluidCodeDetails {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The code package to be used on the Fluid document. This is either the package name which will be loaded
|
|
98
|
+
* from a package manager. Or the expanded Fluid package.
|
|
99
|
+
*/
|
|
100
|
+
readonly package: string | Readonly<IFluidPackage>;
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Configuration details. This includes links to the package manager and base CDNs.
|
|
104
|
+
*/
|
|
105
|
+
readonly config?: IFluidCodeDetailsConfig;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
110
110
|
* to have code loading modules in same package.
|
|
111
|
-
*/
|
|
111
|
+
*/
|
|
112
112
|
export const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;
|
|
114
|
+
return (
|
|
115
|
+
typeof maybeCodeDetails === "object" &&
|
|
116
|
+
(typeof maybeCodeDetails?.package === "string" ||
|
|
117
|
+
isFluidPackage(maybeCodeDetails?.package)) &&
|
|
118
|
+
(maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === "object")
|
|
119
|
+
);
|
|
117
120
|
};
|
|
118
121
|
|
|
119
122
|
/**
|
|
120
123
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
121
124
|
* to have code loading modules in same package.
|
|
122
|
-
*/
|
|
123
|
-
export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =
|
|
125
|
+
*/
|
|
126
|
+
export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =
|
|
127
|
+
"IFluidCodeDetailsComparer";
|
|
124
128
|
|
|
125
129
|
/**
|
|
126
130
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}
|
|
127
131
|
* to have code loading modules in same package.
|
|
128
|
-
*/
|
|
132
|
+
*/
|
|
129
133
|
export interface IProvideFluidCodeDetailsComparer {
|
|
130
|
-
|
|
134
|
+
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
/**
|
|
@@ -137,28 +141,27 @@ export interface IProvideFluidCodeDetailsComparer {
|
|
|
137
141
|
* to have code loading modules in same package.
|
|
138
142
|
*/
|
|
139
143
|
export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
|
|
144
|
+
/**
|
|
145
|
+
* Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.
|
|
146
|
+
*
|
|
147
|
+
* Similar semantics to:
|
|
148
|
+
* {@link https://github.com/npm/node-semver#usage}
|
|
149
|
+
*/
|
|
150
|
+
satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
* - `> 0` if `a > b`.
|
|
157
|
-
*
|
|
158
|
-
* - `undefined` if `a` is not comparable to `b`.
|
|
159
|
-
*
|
|
160
|
-
* Similar semantics to:
|
|
161
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}
|
|
162
|
-
*/
|
|
163
|
-
compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* Returns a number representing the ascending sort order of the `a` and `b` code details:
|
|
154
|
+
*
|
|
155
|
+
* - `< 0` if `a < b`.
|
|
156
|
+
*
|
|
157
|
+
* - `= 0` if `a === b`.
|
|
158
|
+
*
|
|
159
|
+
* - `> 0` if `a > b`.
|
|
160
|
+
*
|
|
161
|
+
* - `undefined` if `a` is not comparable to `b`.
|
|
162
|
+
*
|
|
163
|
+
* Similar semantics to:
|
|
164
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}
|
|
165
|
+
*/
|
|
166
|
+
compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
|
|
164
167
|
}
|
package/src/fluidRouter.ts
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface IRequestHeader {
|
|
7
|
-
|
|
7
|
+
[index: string]: any;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface IRequest {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
url: string;
|
|
12
|
+
headers?: IRequestHeader;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface IResponse {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
mimeType: string;
|
|
17
|
+
status: number;
|
|
18
|
+
value: any;
|
|
19
|
+
headers?: { [key: string]: any };
|
|
20
|
+
stack?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const IFluidRouter: keyof IProvideFluidRouter = "IFluidRouter";
|
|
@@ -26,8 +26,8 @@ export const IFluidRouter: keyof IProvideFluidRouter = "IFluidRouter";
|
|
|
26
26
|
* Request routing
|
|
27
27
|
*/
|
|
28
28
|
export interface IProvideFluidRouter {
|
|
29
|
-
|
|
29
|
+
readonly IFluidRouter: IFluidRouter;
|
|
30
30
|
}
|
|
31
31
|
export interface IFluidRouter extends IProvideFluidRouter {
|
|
32
|
-
|
|
32
|
+
request(request: IRequest): Promise<IResponse>;
|
|
33
33
|
}
|
package/src/handles.ts
CHANGED
|
@@ -10,76 +10,75 @@ import { FluidObject } from "./provider";
|
|
|
10
10
|
export const IFluidHandleContext: keyof IProvideFluidHandleContext = "IFluidHandleContext";
|
|
11
11
|
|
|
12
12
|
export interface IProvideFluidHandleContext {
|
|
13
|
-
|
|
13
|
+
readonly IFluidHandleContext: IFluidHandleContext;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Describes a routing context from which other `IFluidHandleContext`s are defined.
|
|
18
18
|
*/
|
|
19
19
|
export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The absolute path to the handle context from the root.
|
|
22
|
+
*/
|
|
23
|
+
readonly absolutePath: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The parent IFluidHandleContext that has provided a route path to this IFluidHandleContext or undefined
|
|
27
|
+
* at the root.
|
|
28
|
+
*/
|
|
29
|
+
readonly routeContext?: IFluidHandleContext;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Flag indicating whether or not the entity has services attached.
|
|
33
|
+
*/
|
|
34
|
+
readonly isAttached: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Runs through the graph and attach the bounded handles.
|
|
38
|
+
*/
|
|
39
|
+
attachGraph(): void;
|
|
40
|
+
|
|
41
|
+
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export const IFluidHandle: keyof IProvideFluidHandle = "IFluidHandle";
|
|
45
45
|
|
|
46
46
|
export interface IProvideFluidHandle {
|
|
47
|
-
|
|
47
|
+
readonly IFluidHandle: IFluidHandle;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Handle to a shared {@link FluidObject}.
|
|
52
52
|
*/
|
|
53
53
|
export interface IFluidHandle<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
bind(handle: IFluidHandle): void;
|
|
54
|
+
// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?
|
|
55
|
+
T = FluidObject & IFluidLoadable,
|
|
56
|
+
> extends IProvideFluidHandle {
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.
|
|
59
|
+
*
|
|
60
|
+
* The absolute path to the handle context from the root.
|
|
61
|
+
*/
|
|
62
|
+
readonly absolutePath: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Flag indicating whether or not the entity has services attached.
|
|
66
|
+
*/
|
|
67
|
+
readonly isAttached: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Runs through the graph and attach the bounded handles.
|
|
71
|
+
*/
|
|
72
|
+
attachGraph(): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns a promise to the Fluid Object referenced by the handle.
|
|
76
|
+
*/
|
|
77
|
+
get(): Promise<T>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Binds the given handle to this one or attach the given handle if this handle is attached.
|
|
81
|
+
* A bound handle will also be attached once this handle is attached.
|
|
82
|
+
*/
|
|
83
|
+
bind(handle: IFluidHandle): void;
|
|
85
84
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,43 +4,39 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
IFluidLoadable,
|
|
8
|
+
IProvideFluidLoadable,
|
|
9
|
+
IFluidRunnable,
|
|
10
|
+
IProvideFluidRunnable,
|
|
11
11
|
} from "./fluidLoadable";
|
|
12
12
|
|
|
13
13
|
// Typescript forgets the index signature when customers augment IRequestHeader if we export *.
|
|
14
14
|
// So we export the explicit members as a workaround:
|
|
15
15
|
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
IRequest,
|
|
18
|
+
IRequestHeader,
|
|
19
|
+
IResponse,
|
|
20
|
+
IProvideFluidRouter,
|
|
21
|
+
IFluidRouter,
|
|
22
22
|
} from "./fluidRouter";
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
IFluidHandleContext,
|
|
26
|
+
IProvideFluidHandleContext,
|
|
27
|
+
IFluidHandle,
|
|
28
|
+
IProvideFluidHandle,
|
|
29
29
|
} from "./handles";
|
|
30
30
|
|
|
31
31
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
IFluidPackageEnvironment,
|
|
33
|
+
IFluidPackage,
|
|
34
|
+
isFluidPackage,
|
|
35
|
+
IFluidCodeDetailsConfig,
|
|
36
|
+
IFluidCodeDetails,
|
|
37
|
+
isFluidCodeDetails,
|
|
38
|
+
IFluidCodeDetailsComparer,
|
|
39
|
+
IProvideFluidCodeDetailsComparer,
|
|
40
40
|
} from "./fluidPackage";
|
|
41
41
|
|
|
42
|
-
export {
|
|
43
|
-
FluidObjectProviderKeys,
|
|
44
|
-
FluidObject,
|
|
45
|
-
FluidObjectKeys,
|
|
46
|
-
} from "./provider";
|
|
42
|
+
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
package/src/provider.ts
CHANGED
|
@@ -24,13 +24,15 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
|
-
export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp
|
|
28
|
+
? never
|
|
29
|
+
: number extends TProp
|
|
30
|
+
? never // exclude indexers [key:string |number]: any
|
|
31
|
+
: TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]
|
|
32
|
+
? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]
|
|
33
|
+
? TProp
|
|
34
|
+
: never
|
|
35
|
+
: never;
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* This utility type take interface(s) that follow the FluidObject pattern, and produces
|
|
@@ -64,7 +66,7 @@ export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> =
|
|
|
64
66
|
*
|
|
65
67
|
*/
|
|
66
68
|
export type FluidObject<T = unknown> = {
|
|
67
|
-
|
|
69
|
+
[P in FluidObjectProviderKeys<T>]?: T[P];
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
/**
|
package/tsconfig.esnext.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./lib",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
},
|
|
7
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
"src/**/*"
|
|
13
|
-
]
|
|
2
|
+
"extends": "@fluidframework/build-common/ts-common-config.json",
|
|
3
|
+
"exclude": ["src/test/**/*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"composite": true,
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*"],
|
|
14
10
|
}
|