@fluidframework/core-interfaces 0.40.0-39960 → 0.41.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/api-report/core-interfaces.api.md +31 -4
- package/dist/fluidObject.d.ts +36 -5
- package/dist/fluidObject.d.ts.map +1 -1
- package/dist/fluidObject.js +0 -1
- package/dist/fluidObject.js.map +1 -1
- package/dist/handles.d.ts +2 -1
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +64 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +7 -0
- package/dist/provider.js.map +1 -0
- package/dist/serializer.d.ts +1 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js.map +1 -1
- package/lib/fluidObject.d.ts +36 -5
- package/lib/fluidObject.d.ts.map +1 -1
- package/lib/fluidObject.js +0 -1
- package/lib/fluidObject.js.map +1 -1
- package/lib/handles.d.ts +2 -1
- package/lib/handles.d.ts.map +1 -1
- package/lib/handles.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/provider.d.ts +64 -0
- package/lib/provider.d.ts.map +1 -0
- package/lib/provider.js +6 -0
- package/lib/provider.js.map +1 -0
- package/lib/serializer.d.ts +1 -1
- package/lib/serializer.d.ts.map +1 -1
- package/lib/serializer.js.map +1 -1
- package/lib/test/{validate0.39.8.d.ts → types/validate0.39.8.d.ts} +0 -0
- package/lib/test/types/validate0.39.8.d.ts.map +1 -0
- package/lib/test/{validate0.39.8.js → types/validate0.39.8.js} +7 -0
- package/lib/test/types/validate0.39.8.js.map +1 -0
- package/lib/test/types/validate0.40.0.d.ts +2 -0
- package/lib/test/types/validate0.40.0.d.ts.map +1 -0
- package/lib/test/types/validate0.40.0.js +72 -0
- package/lib/test/types/validate0.40.0.js.map +1 -0
- package/package.json +17 -29
- package/src/fluidObject.ts +39 -17
- package/src/handles.ts +3 -2
- package/src/index.ts +1 -0
- package/src/provider.ts +70 -0
- package/src/serializer.ts +1 -1
- package/test-d/index.test-d.ts +103 -0
- package/tsconfig.json +3 -2
- package/lib/test/validate0.39.8.d.ts.map +0 -1
- package/lib/test/validate0.39.8.js.map +0 -1
|
@@ -4,6 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
// Warning: (ae-incompatible-release-tags) The symbol "FluidObject" is marked as @public, but its signature references "FluidObjectProviderKeys" which is marked as @internal
|
|
8
|
+
//
|
|
9
|
+
// @public
|
|
10
|
+
export type FluidObject<T = unknown> = Partial<Pick<T, FluidObjectProviderKeys<T>>>;
|
|
11
|
+
|
|
12
|
+
// @public
|
|
13
|
+
export type FluidObjectKeys<T> = keyof FluidObject<T>;
|
|
14
|
+
|
|
15
|
+
// Warning: (ae-internal-missing-underscore) The name "FluidObjectProviderKeys" should be prefixed with an underscore because the declaration is marked as @internal
|
|
16
|
+
//
|
|
17
|
+
// @internal
|
|
18
|
+
export 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;
|
|
19
|
+
|
|
7
20
|
// @public
|
|
8
21
|
export interface IFluidCodeDetails {
|
|
9
22
|
readonly config?: IFluidCodeDetailsConfig;
|
|
@@ -38,7 +51,7 @@ export interface IFluidConfiguration extends IProvideFluidConfiguration {
|
|
|
38
51
|
export const IFluidHandle: keyof IProvideFluidHandle;
|
|
39
52
|
|
|
40
53
|
// @public
|
|
41
|
-
export interface IFluidHandle<T = IFluidObject & IFluidLoadable> extends IProvideFluidHandle {
|
|
54
|
+
export interface IFluidHandle<T = IFluidObject & FluidObject & IFluidLoadable> extends IProvideFluidHandle {
|
|
42
55
|
// @deprecated (undocumented)
|
|
43
56
|
readonly absolutePath: string;
|
|
44
57
|
attachGraph(): void;
|
|
@@ -69,8 +82,22 @@ export interface IFluidLoadable extends IProvideFluidLoadable {
|
|
|
69
82
|
handle: IFluidHandle;
|
|
70
83
|
}
|
|
71
84
|
|
|
72
|
-
// @public (undocumented)
|
|
73
|
-
export interface IFluidObject
|
|
85
|
+
// @public @deprecated (undocumented)
|
|
86
|
+
export interface IFluidObject {
|
|
87
|
+
// @deprecated (undocumented)
|
|
88
|
+
readonly IFluidConfiguration?: IFluidConfiguration;
|
|
89
|
+
// @deprecated (undocumented)
|
|
90
|
+
readonly IFluidHandle?: IFluidHandle;
|
|
91
|
+
// @deprecated (undocumented)
|
|
92
|
+
readonly IFluidHandleContext?: IFluidHandleContext;
|
|
93
|
+
// @deprecated (undocumented)
|
|
94
|
+
readonly IFluidLoadable?: IFluidLoadable;
|
|
95
|
+
// @deprecated (undocumented)
|
|
96
|
+
readonly IFluidRouter?: IFluidRouter;
|
|
97
|
+
// @deprecated (undocumented)
|
|
98
|
+
readonly IFluidRunnable?: IFluidRunnable;
|
|
99
|
+
// @deprecated (undocumented)
|
|
100
|
+
readonly IFluidSerializer?: IFluidSerializer;
|
|
74
101
|
}
|
|
75
102
|
|
|
76
103
|
// @public
|
|
@@ -115,7 +142,7 @@ export const IFluidSerializer: keyof IProvideFluidSerializer;
|
|
|
115
142
|
|
|
116
143
|
// @public (undocumented)
|
|
117
144
|
export interface IFluidSerializer extends IProvideFluidSerializer {
|
|
118
|
-
decode(input: any): any;
|
|
145
|
+
decode?(input: any): any;
|
|
119
146
|
parse(value: string): any;
|
|
120
147
|
replaceHandles(value: any, bind: IFluidHandle): any;
|
|
121
148
|
stringify(value: any, bind: IFluidHandle): string;
|
package/dist/fluidObject.d.ts
CHANGED
|
@@ -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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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,
|
|
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"}
|
package/dist/fluidObject.js
CHANGED
package/dist/fluidObject.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidObject.js","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
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"]}
|
package/dist/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
|
*
|
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,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
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;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,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,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"}
|
package/dist/handles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOU,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 { 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/dist/index.d.ts
CHANGED
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;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/dist/index.js
CHANGED
|
@@ -24,4 +24,5 @@ Object.defineProperty(exports, "IFluidRouter", { enumerable: true, get: function
|
|
|
24
24
|
__exportStar(require("./handles"), exports);
|
|
25
25
|
__exportStar(require("./serializer"), exports);
|
|
26
26
|
__exportStar(require("./fluidPackage"), exports);
|
|
27
|
+
__exportStar(require("./provider"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;AAMH,kDAAgC;AAChC,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADnB,2GAAA,YAAY,OAAA;AAEhB,4CAA0B;AAC1B,+CAA6B;AAC7B,iDAA+B","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,kDAAgC;AAChC,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADnB,2GAAA,YAAY,OAAA;AAEhB,4CAA0B;AAC1B,+CAA6B;AAC7B,iDAA+B;AAC/B,6CAA2B","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"}
|
package/dist/provider.js
ADDED
|
@@ -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"]}
|
package/dist/serializer.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface IFluidSerializer extends IProvideFluidSerializer {
|
|
|
32
32
|
*
|
|
33
33
|
* The decoded handles are implicitly bound to the handle context of this serializer.
|
|
34
34
|
*/
|
|
35
|
-
decode(input: any): any;
|
|
35
|
+
decode?(input: any): any;
|
|
36
36
|
/**
|
|
37
37
|
* Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
|
|
38
38
|
*/
|
package/dist/serializer.d.ts.map
CHANGED
|
@@ -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,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;
|
|
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"}
|
package/dist/serializer.js.map
CHANGED
|
@@ -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":";;;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"]}
|
package/lib/fluidObject.d.ts
CHANGED
|
@@ -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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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
|
package/lib/fluidObject.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidObject.d.ts","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,
|
|
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"}
|
package/lib/fluidObject.js
CHANGED
package/lib/fluidObject.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidObject.js","sourceRoot":"","sources":["../src/fluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
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"]}
|
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
|
*
|
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,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
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;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,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,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"}
|
package/lib/handles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
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
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;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
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"}
|
package/lib/provider.js
ADDED
|
@@ -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"]}
|
package/lib/serializer.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface IFluidSerializer extends IProvideFluidSerializer {
|
|
|
32
32
|
*
|
|
33
33
|
* The decoded handles are implicitly bound to the handle context of this serializer.
|
|
34
34
|
*/
|
|
35
|
-
decode(input: any): any;
|
|
35
|
+
decode?(input: any): any;
|
|
36
36
|
/**
|
|
37
37
|
* Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
|
|
38
38
|
*/
|
package/lib/serializer.d.ts.map
CHANGED
|
@@ -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,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;
|
|
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"}
|
package/lib/serializer.js.map
CHANGED
|
@@ -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":"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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate0.39.8.d.ts","sourceRoot":"","sources":["../../../src/test/types/validate0.39.8.ts"],"names":[],"mappings":""}
|