@fluidframework/core-interfaces 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.265721
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/CHANGELOG.md +13 -0
- package/api-report/core-interfaces.api.md +24 -15
- package/dist/fluidLoadable.d.ts +1 -1
- package/dist/fluidLoadable.d.ts.map +1 -1
- package/dist/fluidLoadable.js.map +1 -1
- package/dist/handles.d.ts +63 -21
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js +20 -2
- package/dist/handles.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +8 -4
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +2 -2
- package/dist/logger.js.map +1 -1
- package/dist/public.d.ts +3 -4
- package/lib/fluidLoadable.d.ts +1 -1
- package/lib/fluidLoadable.d.ts.map +1 -1
- package/lib/fluidLoadable.js.map +1 -1
- package/lib/handles.d.ts +63 -21
- package/lib/handles.d.ts.map +1 -1
- package/lib/handles.js +19 -1
- package/lib/handles.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +8 -4
- package/lib/logger.d.ts +1 -1
- package/lib/logger.js +2 -2
- package/lib/logger.js.map +1 -1
- package/lib/public.d.ts +3 -4
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +9 -8
- package/src/fluidLoadable.ts +1 -1
- package/src/handles.ts +71 -23
- package/src/index.ts +7 -2
- package/src/logger.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @fluidframework/core-interfaces
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.4.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Deprecated members of IFluidHandle are split off into new IFluidHandleInternal interface [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
|
|
8
|
+
|
|
9
|
+
Split IFluidHandle into two interfaces, `IFluidHandle` and `IFluidHandleInternal`.
|
|
10
|
+
Code depending on the previously deprecated members of IFluidHandle can access them by using `toFluidHandleInternal` from `@fluidframework/runtime-utils/legacy`.
|
|
11
|
+
|
|
12
|
+
External implementation of the `IFluidHandle` interface are not supported: this change makes the typing better convey this using the `ErasedType` pattern.
|
|
13
|
+
Any existing and previously working, and now broken, external implementations of `IFluidHandle` should still work at runtime, but will need some unsafe type casts to compile.
|
|
14
|
+
Such handle implementation may break in the future and thus should be replaced with use of handles produced by the Fluid Framework client packages.
|
|
15
|
+
|
|
3
16
|
## 2.0.0-rc.3.0.0
|
|
4
17
|
|
|
5
18
|
### Major Changes
|
|
@@ -28,6 +28,9 @@ export const FluidErrorTypes: {
|
|
|
28
28
|
// @alpha (undocumented)
|
|
29
29
|
export type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTypes];
|
|
30
30
|
|
|
31
|
+
// @public
|
|
32
|
+
export const fluidHandleSymbol: unique symbol;
|
|
33
|
+
|
|
31
34
|
// @public
|
|
32
35
|
export type FluidObject<T = unknown> = {
|
|
33
36
|
[P in FluidObjectProviderKeys<T>]?: T[P];
|
|
@@ -240,21 +243,16 @@ export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
|
|
|
240
243
|
export const IFluidHandle = "IFluidHandle";
|
|
241
244
|
|
|
242
245
|
// @public
|
|
243
|
-
export interface IFluidHandle<out T =
|
|
244
|
-
|
|
245
|
-
readonly absolutePath: string;
|
|
246
|
-
// @deprecated (undocumented)
|
|
247
|
-
attachGraph(): void;
|
|
248
|
-
// @deprecated (undocumented)
|
|
249
|
-
bind(handle: IFluidHandle): void;
|
|
246
|
+
export interface IFluidHandle<out T = unknown> {
|
|
247
|
+
readonly [fluidHandleSymbol]: IFluidHandleErased<T>;
|
|
250
248
|
get(): Promise<T>;
|
|
251
249
|
readonly isAttached: boolean;
|
|
252
250
|
}
|
|
253
251
|
|
|
254
|
-
// @
|
|
252
|
+
// @alpha (undocumented)
|
|
255
253
|
export const IFluidHandleContext: keyof IProvideFluidHandleContext;
|
|
256
254
|
|
|
257
|
-
// @
|
|
255
|
+
// @alpha
|
|
258
256
|
export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
259
257
|
readonly absolutePath: string;
|
|
260
258
|
attachGraph(): void;
|
|
@@ -264,13 +262,24 @@ export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
|
264
262
|
readonly routeContext?: IFluidHandleContext;
|
|
265
263
|
}
|
|
266
264
|
|
|
265
|
+
// @public
|
|
266
|
+
export interface IFluidHandleErased<T> extends ErasedType<readonly ["IFluidHandle", T]> {
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// @alpha
|
|
270
|
+
export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>, IProvideFluidHandle {
|
|
271
|
+
readonly absolutePath: string;
|
|
272
|
+
attachGraph(): void;
|
|
273
|
+
bind(handle: IFluidHandleInternal): void;
|
|
274
|
+
}
|
|
275
|
+
|
|
267
276
|
// @public (undocumented)
|
|
268
277
|
export const IFluidLoadable: keyof IProvideFluidLoadable;
|
|
269
278
|
|
|
270
279
|
// @public
|
|
271
280
|
export interface IFluidLoadable extends IProvideFluidLoadable {
|
|
272
281
|
// (undocumented)
|
|
273
|
-
handle: IFluidHandle;
|
|
282
|
+
readonly handle: IFluidHandle;
|
|
274
283
|
}
|
|
275
284
|
|
|
276
285
|
// @internal (undocumented)
|
|
@@ -291,18 +300,18 @@ export interface IGenericError extends IErrorBase {
|
|
|
291
300
|
readonly errorType: typeof FluidErrorTypes.genericError;
|
|
292
301
|
}
|
|
293
302
|
|
|
294
|
-
// @
|
|
303
|
+
// @alpha
|
|
295
304
|
export interface ILoggingError extends Error {
|
|
296
305
|
getTelemetryProperties(): ITelemetryBaseProperties;
|
|
297
306
|
}
|
|
298
307
|
|
|
299
|
-
// @
|
|
308
|
+
// @alpha @deprecated (undocumented)
|
|
300
309
|
export interface IProvideFluidHandle {
|
|
301
|
-
// (undocumented)
|
|
302
|
-
readonly [IFluidHandle]:
|
|
310
|
+
// @deprecated (undocumented)
|
|
311
|
+
readonly [IFluidHandle]: IFluidHandleInternal;
|
|
303
312
|
}
|
|
304
313
|
|
|
305
|
-
// @
|
|
314
|
+
// @alpha (undocumented)
|
|
306
315
|
export interface IProvideFluidHandleContext {
|
|
307
316
|
// (undocumented)
|
|
308
317
|
readonly IFluidHandleContext: IFluidHandleContext;
|
package/dist/fluidLoadable.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,MAAM,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,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;;;AAIH;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACU,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 type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\
|
|
1
|
+
{"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACU,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 type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
|
package/dist/handles.d.ts
CHANGED
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type ErasedType } from "./erasedType.js";
|
|
6
6
|
import type { IRequest, IResponse } from "./fluidRouter.js";
|
|
7
|
-
import type { FluidObject } from "./provider.js";
|
|
8
7
|
/**
|
|
9
|
-
* @
|
|
8
|
+
* @alpha
|
|
10
9
|
*/
|
|
11
10
|
export declare const IFluidHandleContext: keyof IProvideFluidHandleContext;
|
|
12
11
|
/**
|
|
13
|
-
* @
|
|
12
|
+
* @alpha
|
|
14
13
|
*/
|
|
15
14
|
export interface IProvideFluidHandleContext {
|
|
16
15
|
readonly IFluidHandleContext: IFluidHandleContext;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Describes a routing context from which other `IFluidHandleContext`s are defined.
|
|
20
|
-
* @
|
|
19
|
+
* @alpha
|
|
21
20
|
*/
|
|
22
21
|
export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
23
22
|
/**
|
|
@@ -41,45 +40,88 @@ export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* @public
|
|
43
|
+
* @privateRemarks
|
|
44
|
+
* This really should be deprecated and alpha, but since its a merged export with the public interface,
|
|
45
|
+
* it can't have its own docs or different tags.
|
|
44
46
|
*/
|
|
45
47
|
export declare const IFluidHandle = "IFluidHandle";
|
|
46
48
|
/**
|
|
47
|
-
* @
|
|
49
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
50
|
+
* @alpha
|
|
48
51
|
*/
|
|
49
52
|
export interface IProvideFluidHandle {
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
55
|
+
* @privateRemarks
|
|
56
|
+
* This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.
|
|
57
|
+
* This is required due to some use-cases mixing package versions.
|
|
58
|
+
* More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.
|
|
59
|
+
*/
|
|
60
|
+
readonly [IFluidHandle]: IFluidHandleInternal;
|
|
51
61
|
}
|
|
52
62
|
/**
|
|
53
63
|
* Handle to a shared {@link FluidObject}.
|
|
54
|
-
* @
|
|
64
|
+
* @alpha
|
|
55
65
|
*/
|
|
56
|
-
export interface
|
|
66
|
+
export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>, IProvideFluidHandle {
|
|
57
67
|
/**
|
|
58
|
-
* @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.
|
|
59
|
-
*
|
|
60
68
|
* The absolute path to the handle context from the root.
|
|
61
69
|
*/
|
|
62
70
|
readonly absolutePath: string;
|
|
63
71
|
/**
|
|
64
|
-
* Flag indicating whether or not the entity has services attached.
|
|
65
|
-
*/
|
|
66
|
-
readonly isAttached: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated To be removed. This is part of an internal API surface and should not be called.
|
|
69
|
-
*
|
|
70
72
|
* Runs through the graph and attach the bounded handles.
|
|
71
73
|
*/
|
|
72
74
|
attachGraph(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Binds the given handle to this one or attach the given handle if this handle is attached.
|
|
77
|
+
* A bound handle will also be attached once this handle is attached.
|
|
78
|
+
*/
|
|
79
|
+
bind(handle: IFluidHandleInternal): void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* To narrow arbitrary objects to handles do not simply check for this symbol:
|
|
86
|
+
* instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility
|
|
87
|
+
* with older implementations of handles that may exist due to dynamic code loading of older packages.
|
|
88
|
+
*
|
|
89
|
+
* @privateRemarks
|
|
90
|
+
* Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.
|
|
91
|
+
* In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.
|
|
92
|
+
* Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export declare const fluidHandleSymbol: unique symbol;
|
|
96
|
+
/**
|
|
97
|
+
* Handle to a shared {@link FluidObject}.
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
export interface IFluidHandle<out T = unknown> {
|
|
101
|
+
/**
|
|
102
|
+
* Flag indicating whether or not the entity has services attached.
|
|
103
|
+
*/
|
|
104
|
+
readonly isAttached: boolean;
|
|
73
105
|
/**
|
|
74
106
|
* Returns a promise to the Fluid Object referenced by the handle.
|
|
75
107
|
*/
|
|
76
108
|
get(): Promise<T>;
|
|
77
109
|
/**
|
|
78
|
-
*
|
|
110
|
+
* Symbol used to mark an object as a {@link (IFluidHandle:interface)}
|
|
111
|
+
* and to recover the underlying handle implementation.
|
|
79
112
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
113
|
+
* @privateRemarks
|
|
114
|
+
* Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.
|
|
82
115
|
*/
|
|
83
|
-
|
|
116
|
+
readonly [fluidHandleSymbol]: IFluidHandleErased<T>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A type erased Fluid Handle.
|
|
120
|
+
* These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.
|
|
121
|
+
* @privateRemarks
|
|
122
|
+
* Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export interface IFluidHandleErased<T> extends ErasedType<readonly ["IFluidHandle", T]> {
|
|
84
126
|
}
|
|
85
127
|
//# sourceMappingURL=handles.d.ts.map
|
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,KAAK,
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;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;;;;;GAKG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAEpC,GAAG,CAAC,CAAC,GAAG,OAAO,CACd,SAAQ,YAAY,CAAC,CAAC,CAAC,EACvB,mBAAmB;IACpB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAEtC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;IAC5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CAAG"}
|
package/dist/handles.js
CHANGED
|
@@ -4,13 +4,31 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.IFluidHandle = exports.IFluidHandleContext = void 0;
|
|
7
|
+
exports.fluidHandleSymbol = exports.IFluidHandle = exports.IFluidHandleContext = void 0;
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @alpha
|
|
10
10
|
*/
|
|
11
11
|
exports.IFluidHandleContext = "IFluidHandleContext";
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
|
+
* @privateRemarks
|
|
15
|
+
* This really should be deprecated and alpha, but since its a merged export with the public interface,
|
|
16
|
+
* it can't have its own docs or different tags.
|
|
14
17
|
*/
|
|
15
18
|
exports.IFluidHandle = "IFluidHandle";
|
|
19
|
+
/**
|
|
20
|
+
* Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* To narrow arbitrary objects to handles do not simply check for this symbol:
|
|
24
|
+
* instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility
|
|
25
|
+
* with older implementations of handles that may exist due to dynamic code loading of older packages.
|
|
26
|
+
*
|
|
27
|
+
* @privateRemarks
|
|
28
|
+
* Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.
|
|
29
|
+
* In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.
|
|
30
|
+
* Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
exports.fluidHandleSymbol = Symbol.for("FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da");
|
|
16
34
|
//# sourceMappingURL=handles.js.map
|
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;;;AAKH;;GAEG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;;GAKG;AACU,QAAA,YAAY,GAAG,cAAc,CAAC;AA2C3C;;;;;;;;;;;;;GAaG;AACU,QAAA,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\n\n/**\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @alpha\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\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\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 * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\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: IFluidHandleInternal): void;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @public\n */\nexport interface IFluidHandle<out T = unknown> {\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 * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventTh
|
|
|
9
9
|
export type { IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable.js";
|
|
10
10
|
export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
|
|
11
11
|
export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
|
|
12
|
-
export type { IProvideFluidHandleContext, IProvideFluidHandle } from "./handles.js";
|
|
13
|
-
export { IFluidHandleContext, IFluidHandle } from "./handles.js";
|
|
12
|
+
export type { IProvideFluidHandleContext, IProvideFluidHandle, IFluidHandleInternal, IFluidHandleErased, } from "./handles.js";
|
|
13
|
+
export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
|
|
14
14
|
export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
|
|
15
15
|
export { LogLevel } from "./logger.js";
|
|
16
16
|
export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
|
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,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.LogLevel = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
|
|
7
|
+
exports.LogLevel = exports.fluidHandleSymbol = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
|
|
8
8
|
var error_js_1 = require("./error.js");
|
|
9
9
|
Object.defineProperty(exports, "FluidErrorTypes", { enumerable: true, get: function () { return error_js_1.FluidErrorTypes; } });
|
|
10
10
|
var fluidLoadable_js_1 = require("./fluidLoadable.js");
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "IFluidRunnable", { enumerable: true, get: functi
|
|
|
13
13
|
var handles_js_1 = require("./handles.js");
|
|
14
14
|
Object.defineProperty(exports, "IFluidHandleContext", { enumerable: true, get: function () { return handles_js_1.IFluidHandleContext; } });
|
|
15
15
|
Object.defineProperty(exports, "IFluidHandle", { enumerable: true, get: function () { return handles_js_1.IFluidHandle; } });
|
|
16
|
+
Object.defineProperty(exports, "fluidHandleSymbol", { enumerable: true, get: function () { return handles_js_1.fluidHandleSymbol; } });
|
|
16
17
|
var logger_js_1 = require("./logger.js");
|
|
17
18
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_js_1.LogLevel; } });
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAcxB,uDAAoE;AAA3D,kHAAA,cAAc,OAAA;AAAE,kHAAA,cAAc,OAAA;AAavC,2CAAoF;AAA3E,iHAAA,mBAAmB,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAU7D,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\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 type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIProvideFluidHandleContext,\n\tIProvideFluidHandle,\n\tIFluidHandleInternal,\n\tIFluidHandleErased,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n"]}
|
package/dist/legacy.d.ts
CHANGED
|
@@ -25,10 +25,8 @@ export {
|
|
|
25
25
|
IEventThisPlaceHolder,
|
|
26
26
|
IEventTransformer,
|
|
27
27
|
IFluidHandle,
|
|
28
|
-
|
|
28
|
+
IFluidHandleErased,
|
|
29
29
|
IFluidLoadable,
|
|
30
|
-
IProvideFluidHandle,
|
|
31
|
-
IProvideFluidHandleContext,
|
|
32
30
|
IProvideFluidLoadable,
|
|
33
31
|
IRequest,
|
|
34
32
|
IRequestHeader,
|
|
@@ -40,9 +38,15 @@ export {
|
|
|
40
38
|
ReplaceIEventThisPlaceHolder,
|
|
41
39
|
Tagged,
|
|
42
40
|
TelemetryBaseEventPropertyType,
|
|
43
|
-
TransformedEvent,
|
|
41
|
+
TransformedEvent,
|
|
42
|
+
fluidHandleSymbol,
|
|
44
43
|
|
|
45
44
|
// @alpha APIs
|
|
46
45
|
FluidErrorTypes,
|
|
46
|
+
IFluidHandleContext,
|
|
47
|
+
IFluidHandleInternal,
|
|
48
|
+
ILoggingError,
|
|
49
|
+
IProvideFluidHandle,
|
|
50
|
+
IProvideFluidHandleContext,
|
|
47
51
|
IThrottlingWarning
|
|
48
52
|
} from "./index.js";
|
package/dist/logger.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface ITelemetryErrorEvent extends ITelemetryBaseProperties {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* An error object that supports exporting its properties to be logged to telemetry
|
|
84
|
-
* @
|
|
84
|
+
* @alpha
|
|
85
85
|
*/
|
|
86
86
|
export interface ILoggingError extends Error {
|
|
87
87
|
/**
|
package/dist/logger.js
CHANGED
|
@@ -10,8 +10,8 @@ exports.LogLevel = void 0;
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
exports.LogLevel = {
|
|
13
|
-
verbose: 10,
|
|
14
|
-
default: 20,
|
|
13
|
+
verbose: 10, // To log any verbose event for example when you are debugging something.
|
|
14
|
+
default: 20, // Default log level
|
|
15
15
|
error: 30, // To log errors.
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=logger.js.map
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiDH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiDH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @public\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @alpha\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
|
package/dist/public.d.ts
CHANGED
|
@@ -25,10 +25,8 @@ export {
|
|
|
25
25
|
IEventThisPlaceHolder,
|
|
26
26
|
IEventTransformer,
|
|
27
27
|
IFluidHandle,
|
|
28
|
-
|
|
28
|
+
IFluidHandleErased,
|
|
29
29
|
IFluidLoadable,
|
|
30
|
-
IProvideFluidHandle,
|
|
31
|
-
IProvideFluidHandleContext,
|
|
32
30
|
IProvideFluidLoadable,
|
|
33
31
|
IRequest,
|
|
34
32
|
IRequestHeader,
|
|
@@ -40,5 +38,6 @@ export {
|
|
|
40
38
|
ReplaceIEventThisPlaceHolder,
|
|
41
39
|
Tagged,
|
|
42
40
|
TelemetryBaseEventPropertyType,
|
|
43
|
-
TransformedEvent
|
|
41
|
+
TransformedEvent,
|
|
42
|
+
fluidHandleSymbol
|
|
44
43
|
} from "./index.js";
|
package/lib/fluidLoadable.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,MAAM,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fluidLoadable.d.ts","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAE5D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,qBAAwC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACxC;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG9B,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;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACH,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 type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\
|
|
1
|
+
{"version":3,"file":"fluidLoadable.js","sourceRoot":"","sources":["../src/fluidLoadable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,gBAAgB,CAAC;AAiB5E;;GAEG;AACH,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 type { IFluidHandle } from \"./handles.js\";\n\n/**\n * @public\n */\nexport const IFluidLoadable: keyof IProvideFluidLoadable = \"IFluidLoadable\";\n\n/**\n * @public\n */\nexport interface IProvideFluidLoadable {\n\treadonly IFluidLoadable: IFluidLoadable;\n}\n/**\n * A shared FluidObject has a URL from which it can be referenced\n * @public\n */\nexport interface IFluidLoadable extends IProvideFluidLoadable {\n\t// Handle to the loadable FluidObject\n\treadonly handle: IFluidHandle;\n}\n\n/**\n * @internal\n */\nexport const IFluidRunnable: keyof IProvideFluidRunnable = \"IFluidRunnable\";\n\n/**\n * @internal\n */\nexport interface IProvideFluidRunnable {\n\treadonly IFluidRunnable: IFluidRunnable;\n}\n/**\n * @internal\n */\nexport interface IFluidRunnable {\n\t// TODO: Use `unknown` instead (API-Breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\trun(...args: any[]): Promise<void>;\n\tstop(reason?: string): void;\n}\n"]}
|
package/lib/handles.d.ts
CHANGED
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type ErasedType } from "./erasedType.js";
|
|
6
6
|
import type { IRequest, IResponse } from "./fluidRouter.js";
|
|
7
|
-
import type { FluidObject } from "./provider.js";
|
|
8
7
|
/**
|
|
9
|
-
* @
|
|
8
|
+
* @alpha
|
|
10
9
|
*/
|
|
11
10
|
export declare const IFluidHandleContext: keyof IProvideFluidHandleContext;
|
|
12
11
|
/**
|
|
13
|
-
* @
|
|
12
|
+
* @alpha
|
|
14
13
|
*/
|
|
15
14
|
export interface IProvideFluidHandleContext {
|
|
16
15
|
readonly IFluidHandleContext: IFluidHandleContext;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Describes a routing context from which other `IFluidHandleContext`s are defined.
|
|
20
|
-
* @
|
|
19
|
+
* @alpha
|
|
21
20
|
*/
|
|
22
21
|
export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
23
22
|
/**
|
|
@@ -41,45 +40,88 @@ export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* @public
|
|
43
|
+
* @privateRemarks
|
|
44
|
+
* This really should be deprecated and alpha, but since its a merged export with the public interface,
|
|
45
|
+
* it can't have its own docs or different tags.
|
|
44
46
|
*/
|
|
45
47
|
export declare const IFluidHandle = "IFluidHandle";
|
|
46
48
|
/**
|
|
47
|
-
* @
|
|
49
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
50
|
+
* @alpha
|
|
48
51
|
*/
|
|
49
52
|
export interface IProvideFluidHandle {
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
55
|
+
* @privateRemarks
|
|
56
|
+
* This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.
|
|
57
|
+
* This is required due to some use-cases mixing package versions.
|
|
58
|
+
* More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.
|
|
59
|
+
*/
|
|
60
|
+
readonly [IFluidHandle]: IFluidHandleInternal;
|
|
51
61
|
}
|
|
52
62
|
/**
|
|
53
63
|
* Handle to a shared {@link FluidObject}.
|
|
54
|
-
* @
|
|
64
|
+
* @alpha
|
|
55
65
|
*/
|
|
56
|
-
export interface
|
|
66
|
+
export interface IFluidHandleInternal<out T = unknown> extends IFluidHandle<T>, IProvideFluidHandle {
|
|
57
67
|
/**
|
|
58
|
-
* @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.
|
|
59
|
-
*
|
|
60
68
|
* The absolute path to the handle context from the root.
|
|
61
69
|
*/
|
|
62
70
|
readonly absolutePath: string;
|
|
63
71
|
/**
|
|
64
|
-
* Flag indicating whether or not the entity has services attached.
|
|
65
|
-
*/
|
|
66
|
-
readonly isAttached: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated To be removed. This is part of an internal API surface and should not be called.
|
|
69
|
-
*
|
|
70
72
|
* Runs through the graph and attach the bounded handles.
|
|
71
73
|
*/
|
|
72
74
|
attachGraph(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Binds the given handle to this one or attach the given handle if this handle is attached.
|
|
77
|
+
* A bound handle will also be attached once this handle is attached.
|
|
78
|
+
*/
|
|
79
|
+
bind(handle: IFluidHandleInternal): void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* To narrow arbitrary objects to handles do not simply check for this symbol:
|
|
86
|
+
* instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility
|
|
87
|
+
* with older implementations of handles that may exist due to dynamic code loading of older packages.
|
|
88
|
+
*
|
|
89
|
+
* @privateRemarks
|
|
90
|
+
* Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.
|
|
91
|
+
* In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.
|
|
92
|
+
* Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export declare const fluidHandleSymbol: unique symbol;
|
|
96
|
+
/**
|
|
97
|
+
* Handle to a shared {@link FluidObject}.
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
export interface IFluidHandle<out T = unknown> {
|
|
101
|
+
/**
|
|
102
|
+
* Flag indicating whether or not the entity has services attached.
|
|
103
|
+
*/
|
|
104
|
+
readonly isAttached: boolean;
|
|
73
105
|
/**
|
|
74
106
|
* Returns a promise to the Fluid Object referenced by the handle.
|
|
75
107
|
*/
|
|
76
108
|
get(): Promise<T>;
|
|
77
109
|
/**
|
|
78
|
-
*
|
|
110
|
+
* Symbol used to mark an object as a {@link (IFluidHandle:interface)}
|
|
111
|
+
* and to recover the underlying handle implementation.
|
|
79
112
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
113
|
+
* @privateRemarks
|
|
114
|
+
* Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.
|
|
82
115
|
*/
|
|
83
|
-
|
|
116
|
+
readonly [fluidHandleSymbol]: IFluidHandleErased<T>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A type erased Fluid Handle.
|
|
120
|
+
* These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.
|
|
121
|
+
* @privateRemarks
|
|
122
|
+
* Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export interface IFluidHandleErased<T> extends ErasedType<readonly ["IFluidHandle", T]> {
|
|
84
126
|
}
|
|
85
127
|
//# sourceMappingURL=handles.d.ts.map
|
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,KAAK,
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;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;;;;;GAKG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAEpC,GAAG,CAAC,CAAC,GAAG,OAAO,CACd,SAAQ,YAAY,CAAC,CAAC,CAAC,EACvB,mBAAmB;IACpB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAEtC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;IAC5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CAAG"}
|
package/lib/handles.js
CHANGED
|
@@ -3,11 +3,29 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @alpha
|
|
7
7
|
*/
|
|
8
8
|
export const IFluidHandleContext = "IFluidHandleContext";
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
|
+
* @privateRemarks
|
|
12
|
+
* This really should be deprecated and alpha, but since its a merged export with the public interface,
|
|
13
|
+
* it can't have its own docs or different tags.
|
|
11
14
|
*/
|
|
12
15
|
export const IFluidHandle = "IFluidHandle";
|
|
16
|
+
/**
|
|
17
|
+
* Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* To narrow arbitrary objects to handles do not simply check for this symbol:
|
|
21
|
+
* instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility
|
|
22
|
+
* with older implementations of handles that may exist due to dynamic code loading of older packages.
|
|
23
|
+
*
|
|
24
|
+
* @privateRemarks
|
|
25
|
+
* Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.
|
|
26
|
+
* In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.
|
|
27
|
+
* Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export const fluidHandleSymbol = Symbol.for("FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da");
|
|
13
31
|
//# sourceMappingURL=handles.js.map
|
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;AAKH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AA2C3C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CACzD,kDAAkD,CAClD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ErasedType } from \"./erasedType.js\";\nimport type { IRequest, IResponse } from \"./fluidRouter.js\";\n\n/**\n * @alpha\n */\nexport const IFluidHandleContext: keyof IProvideFluidHandleContext = \"IFluidHandleContext\";\n\n/**\n * @alpha\n */\nexport interface IProvideFluidHandleContext {\n\treadonly IFluidHandleContext: IFluidHandleContext;\n}\n\n/**\n * Describes a routing context from which other `IFluidHandleContext`s are defined.\n * @alpha\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\n/**\n * @public\n * @privateRemarks\n * This really should be deprecated and alpha, but since its a merged export with the public interface,\n * it can't have its own docs or different tags.\n */\nexport const IFluidHandle = \"IFluidHandle\";\n\n/**\n * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n * @alpha\n */\nexport interface IProvideFluidHandle {\n\t/**\n\t * @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.\n\t * @privateRemarks\n\t * This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.\n\t * This is required due to some use-cases mixing package versions.\n\t * More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.\n\t */\n\treadonly [IFluidHandle]: IFluidHandleInternal;\n}\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @alpha\n */\nexport interface IFluidHandleInternal<\n\t// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?\n\tout T = unknown, // FluidObject & IFluidLoadable,\n> extends IFluidHandle<T>,\n\t\tIProvideFluidHandle {\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 * Runs through the graph and attach the bounded handles.\n\t */\n\tattachGraph(): void;\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: IFluidHandleInternal): void;\n}\n\n/**\n * Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.\n *\n * @remarks\n * To narrow arbitrary objects to handles do not simply check for this symbol:\n * instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility\n * with older implementations of handles that may exist due to dynamic code loading of older packages.\n *\n * @privateRemarks\n * Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.\n * In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.\n * Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:\n * @public\n */\nexport const fluidHandleSymbol: unique symbol = Symbol.for(\n\t\"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da\",\n);\n\n/**\n * Handle to a shared {@link FluidObject}.\n * @public\n */\nexport interface IFluidHandle<out T = unknown> {\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 * Returns a promise to the Fluid Object referenced by the handle.\n\t */\n\tget(): Promise<T>;\n\n\t/**\n\t * Symbol used to mark an object as a {@link (IFluidHandle:interface)}\n\t * and to recover the underlying handle implementation.\n\t *\n\t * @privateRemarks\n\t * Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.\n\t */\n\treadonly [fluidHandleSymbol]: IFluidHandleErased<T>;\n}\n\n/**\n * A type erased Fluid Handle.\n * These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.\n * @privateRemarks\n * Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IFluidHandleErased<T> extends ErasedType<readonly [\"IFluidHandle\", T]> {}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventTh
|
|
|
9
9
|
export type { IProvideFluidLoadable, IProvideFluidRunnable } from "./fluidLoadable.js";
|
|
10
10
|
export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
|
|
11
11
|
export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
|
|
12
|
-
export type { IProvideFluidHandleContext, IProvideFluidHandle } from "./handles.js";
|
|
13
|
-
export { IFluidHandleContext, IFluidHandle } from "./handles.js";
|
|
12
|
+
export type { IProvideFluidHandleContext, IProvideFluidHandle, IFluidHandleInternal, IFluidHandleErased, } from "./handles.js";
|
|
13
|
+
export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
|
|
14
14
|
export type { ILoggingError, ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, Tagged, TelemetryBaseEventPropertyType, } from "./logger.js";
|
|
15
15
|
export { LogLevel } from "./logger.js";
|
|
16
16
|
export type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider.js";
|
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,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,YAAY,EACX,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpF,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,EACN,8BAA8B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { FluidErrorTypes } from "./error.js";
|
|
6
6
|
export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
|
|
7
|
-
export { IFluidHandleContext, IFluidHandle } from "./handles.js";
|
|
7
|
+
export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
|
|
8
8
|
export { LogLevel } from "./logger.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAapE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable.js\";\n\nexport type { IErrorBase, IGenericError, IUsageError, IThrottlingWarning } from \"./error.js\";\nexport { FluidErrorTypes } from \"./error.js\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events.js\";\n\nexport type { IProvideFluidLoadable, IProvideFluidRunnable } from \"./fluidLoadable.js\";\nexport { IFluidLoadable, IFluidRunnable } from \"./fluidLoadable.js\";\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 type { IRequest, IRequestHeader, IResponse } from \"./fluidRouter.js\";\n\nexport type {\n\tIProvideFluidHandleContext,\n\tIProvideFluidHandle,\n\tIFluidHandleInternal,\n\tIFluidHandleErased,\n} from \"./handles.js\";\nexport { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from \"./handles.js\";\n\nexport type {\n\tILoggingError,\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tTagged,\n\tTelemetryBaseEventPropertyType,\n} from \"./logger.js\";\nexport { LogLevel } from \"./logger.js\";\nexport type { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider.js\";\nexport type { ConfigTypes, IConfigProviderBase } from \"./config.js\";\nexport type { ISignalEnvelope } from \"./messages.js\";\nexport type { ErasedType } from \"./erasedType.js\";\n"]}
|
package/lib/legacy.d.ts
CHANGED
|
@@ -25,10 +25,8 @@ export {
|
|
|
25
25
|
IEventThisPlaceHolder,
|
|
26
26
|
IEventTransformer,
|
|
27
27
|
IFluidHandle,
|
|
28
|
-
|
|
28
|
+
IFluidHandleErased,
|
|
29
29
|
IFluidLoadable,
|
|
30
|
-
IProvideFluidHandle,
|
|
31
|
-
IProvideFluidHandleContext,
|
|
32
30
|
IProvideFluidLoadable,
|
|
33
31
|
IRequest,
|
|
34
32
|
IRequestHeader,
|
|
@@ -40,9 +38,15 @@ export {
|
|
|
40
38
|
ReplaceIEventThisPlaceHolder,
|
|
41
39
|
Tagged,
|
|
42
40
|
TelemetryBaseEventPropertyType,
|
|
43
|
-
TransformedEvent,
|
|
41
|
+
TransformedEvent,
|
|
42
|
+
fluidHandleSymbol,
|
|
44
43
|
|
|
45
44
|
// @alpha APIs
|
|
46
45
|
FluidErrorTypes,
|
|
46
|
+
IFluidHandleContext,
|
|
47
|
+
IFluidHandleInternal,
|
|
48
|
+
ILoggingError,
|
|
49
|
+
IProvideFluidHandle,
|
|
50
|
+
IProvideFluidHandleContext,
|
|
47
51
|
IThrottlingWarning
|
|
48
52
|
} from "./index.js";
|
package/lib/logger.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface ITelemetryErrorEvent extends ITelemetryBaseProperties {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* An error object that supports exporting its properties to be logged to telemetry
|
|
84
|
-
* @
|
|
84
|
+
* @alpha
|
|
85
85
|
*/
|
|
86
86
|
export interface ILoggingError extends Error {
|
|
87
87
|
/**
|
package/lib/logger.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export const LogLevel = {
|
|
10
|
-
verbose: 10,
|
|
11
|
-
default: 20,
|
|
10
|
+
verbose: 10, // To log any verbose event for example when you are debugging something.
|
|
11
|
+
default: 20, // Default log level
|
|
12
12
|
error: 30, // To log errors.
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=logger.js.map
|
package/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n * @public\n */\nexport type TelemetryBaseEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @public\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @alpha\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n"]}
|
package/lib/public.d.ts
CHANGED
|
@@ -25,10 +25,8 @@ export {
|
|
|
25
25
|
IEventThisPlaceHolder,
|
|
26
26
|
IEventTransformer,
|
|
27
27
|
IFluidHandle,
|
|
28
|
-
|
|
28
|
+
IFluidHandleErased,
|
|
29
29
|
IFluidLoadable,
|
|
30
|
-
IProvideFluidHandle,
|
|
31
|
-
IProvideFluidHandleContext,
|
|
32
30
|
IProvideFluidLoadable,
|
|
33
31
|
IRequest,
|
|
34
32
|
IRequestHeader,
|
|
@@ -40,5 +38,6 @@ export {
|
|
|
40
38
|
ReplaceIEventThisPlaceHolder,
|
|
41
39
|
Tagged,
|
|
42
40
|
TelemetryBaseEventPropertyType,
|
|
43
|
-
TransformedEvent
|
|
41
|
+
TransformedEvent,
|
|
42
|
+
fluidHandleSymbol
|
|
44
43
|
} from "./index.js";
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-dev-rc.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.265721",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
51
51
|
"@biomejs/biome": "^1.6.2",
|
|
52
|
-
"@fluid-tools/build-cli": "0.
|
|
52
|
+
"@fluid-tools/build-cli": "^0.39.0-264124",
|
|
53
53
|
"@fluidframework/build-common": "^2.0.3",
|
|
54
|
-
"@fluidframework/build-tools": "0.
|
|
55
|
-
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-rc.
|
|
54
|
+
"@fluidframework/build-tools": "^0.39.0-264124",
|
|
55
|
+
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-rc.4.0.0",
|
|
56
56
|
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
57
|
-
"@microsoft/api-extractor": "^7.
|
|
57
|
+
"@microsoft/api-extractor": "^7.43.1",
|
|
58
58
|
"@types/node": "^18.19.0",
|
|
59
59
|
"copyfiles": "^2.4.1",
|
|
60
60
|
"eslint": "~8.55.0",
|
|
61
61
|
"prettier": "~3.0.3",
|
|
62
62
|
"rimraf": "^4.4.0",
|
|
63
|
-
"typescript": "~5.
|
|
63
|
+
"typescript": "~5.3.3"
|
|
64
64
|
},
|
|
65
65
|
"typeValidation": {
|
|
66
66
|
"broken": {}
|
|
@@ -91,8 +91,9 @@
|
|
|
91
91
|
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
92
92
|
"lint": "fluid-build . --task lint",
|
|
93
93
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
94
|
-
"
|
|
95
|
-
"tsc
|
|
94
|
+
"place:cjs:package-stub": "copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
95
|
+
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && npm run place:cjs:package-stub",
|
|
96
|
+
"tsc:watch": "npm run place:cjs:package-stub && fluid-tsc commonjs --project ./tsconfig.cjs.json --watch",
|
|
96
97
|
"typetests:gen": "flub generate typetests --dir . -v --publicFallback",
|
|
97
98
|
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
98
99
|
}
|
package/src/fluidLoadable.ts
CHANGED
package/src/handles.ts
CHANGED
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type
|
|
6
|
+
import { type ErasedType } from "./erasedType.js";
|
|
7
7
|
import type { IRequest, IResponse } from "./fluidRouter.js";
|
|
8
|
-
import type { FluidObject } from "./provider.js";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
|
-
* @
|
|
10
|
+
* @alpha
|
|
12
11
|
*/
|
|
13
12
|
export const IFluidHandleContext: keyof IProvideFluidHandleContext = "IFluidHandleContext";
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
|
-
* @
|
|
15
|
+
* @alpha
|
|
17
16
|
*/
|
|
18
17
|
export interface IProvideFluidHandleContext {
|
|
19
18
|
readonly IFluidHandleContext: IFluidHandleContext;
|
|
@@ -21,7 +20,7 @@ export interface IProvideFluidHandleContext {
|
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* Describes a routing context from which other `IFluidHandleContext`s are defined.
|
|
24
|
-
* @
|
|
23
|
+
* @alpha
|
|
25
24
|
*/
|
|
26
25
|
export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
27
26
|
/**
|
|
@@ -50,42 +49,80 @@ export interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
51
|
* @public
|
|
52
|
+
* @privateRemarks
|
|
53
|
+
* This really should be deprecated and alpha, but since its a merged export with the public interface,
|
|
54
|
+
* it can't have its own docs or different tags.
|
|
53
55
|
*/
|
|
54
56
|
export const IFluidHandle = "IFluidHandle";
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
|
-
* @
|
|
59
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
60
|
+
* @alpha
|
|
58
61
|
*/
|
|
59
62
|
export interface IProvideFluidHandle {
|
|
60
|
-
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated {@link IFluidHandleInternal} and {@link IFluidHandleInternal} should be identified should be identified using the {@link fluidHandleSymbol} symbol.
|
|
65
|
+
* @privateRemarks
|
|
66
|
+
* This field must be kept so that code from before 2.0.0-rc.4.0.0 (When fluidHandleSymbol was added) still detects handles.
|
|
67
|
+
* This is required due to some use-cases mixing package versions.
|
|
68
|
+
* More details in packages/runtime/runtime-utils/src/handles.ts and on {@link fluidHandleSymbol}.
|
|
69
|
+
*/
|
|
70
|
+
readonly [IFluidHandle]: IFluidHandleInternal;
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
/**
|
|
64
74
|
* Handle to a shared {@link FluidObject}.
|
|
65
|
-
* @
|
|
75
|
+
* @alpha
|
|
66
76
|
*/
|
|
67
|
-
export interface
|
|
77
|
+
export interface IFluidHandleInternal<
|
|
68
78
|
// REVIEW: Constrain `T` to something? How do we support dds and datastores safely?
|
|
69
|
-
out T = FluidObject & IFluidLoadable,
|
|
70
|
-
> extends
|
|
79
|
+
out T = unknown, // FluidObject & IFluidLoadable,
|
|
80
|
+
> extends IFluidHandle<T>,
|
|
81
|
+
IProvideFluidHandle {
|
|
71
82
|
/**
|
|
72
|
-
* @deprecated Do not use handle's path for routing. Use `get` to get the underlying object.
|
|
73
|
-
*
|
|
74
83
|
* The absolute path to the handle context from the root.
|
|
75
84
|
*/
|
|
76
85
|
readonly absolutePath: string;
|
|
77
86
|
|
|
78
87
|
/**
|
|
79
|
-
*
|
|
88
|
+
* Runs through the graph and attach the bounded handles.
|
|
80
89
|
*/
|
|
81
|
-
|
|
90
|
+
attachGraph(): void;
|
|
82
91
|
|
|
83
92
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* Runs through the graph and attach the bounded handles.
|
|
93
|
+
* Binds the given handle to this one or attach the given handle if this handle is attached.
|
|
94
|
+
* A bound handle will also be attached once this handle is attached.
|
|
87
95
|
*/
|
|
88
|
-
|
|
96
|
+
bind(handle: IFluidHandleInternal): void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Symbol which must only be used on an {@link (IFluidHandle:interface)}, and is used to identify such objects.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* To narrow arbitrary objects to handles do not simply check for this symbol:
|
|
104
|
+
* instead use {@link @fluidframework/runtime-utils#isFluidHandle} which has improved compatibility
|
|
105
|
+
* with older implementations of handles that may exist due to dynamic code loading of older packages.
|
|
106
|
+
*
|
|
107
|
+
* @privateRemarks
|
|
108
|
+
* Normally `Symbol` would be used here instead of `Symbol.for` since just using Symbol (and avoiding the global symbol registry) removes the risk of collision, which is the main point of using a symbol for this in the first place.
|
|
109
|
+
* In this case however, some users of this library do dynamic code loading, and can end up with multiple versions of packages, and mix data from one version with another.
|
|
110
|
+
* Using the global symbol registry allows duplicate copies of this library to share a single symbol, though reintroduces the risk of collision, which is mitigated via the use of a UUIDv4 randomly generated when this code was authored:
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
export const fluidHandleSymbol: unique symbol = Symbol.for(
|
|
114
|
+
"FluidHandle-3978c7cf-4675-49ba-a20c-bf35efbf43da",
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Handle to a shared {@link FluidObject}.
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
export interface IFluidHandle<out T = unknown> {
|
|
122
|
+
/**
|
|
123
|
+
* Flag indicating whether or not the entity has services attached.
|
|
124
|
+
*/
|
|
125
|
+
readonly isAttached: boolean;
|
|
89
126
|
|
|
90
127
|
/**
|
|
91
128
|
* Returns a promise to the Fluid Object referenced by the handle.
|
|
@@ -93,10 +130,21 @@ export interface IFluidHandle<
|
|
|
93
130
|
get(): Promise<T>;
|
|
94
131
|
|
|
95
132
|
/**
|
|
96
|
-
*
|
|
133
|
+
* Symbol used to mark an object as a {@link (IFluidHandle:interface)}
|
|
134
|
+
* and to recover the underlying handle implementation.
|
|
97
135
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
136
|
+
* @privateRemarks
|
|
137
|
+
* Used to recover {@link IFluidHandleInternal}, see {@link toFluidHandleInternal}.
|
|
100
138
|
*/
|
|
101
|
-
|
|
139
|
+
readonly [fluidHandleSymbol]: IFluidHandleErased<T>;
|
|
102
140
|
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A type erased Fluid Handle.
|
|
144
|
+
* These can only be produced by the Fluid Framework and provide the implementation details needed to power {@link (IFluidHandle:interface)}.
|
|
145
|
+
* @privateRemarks
|
|
146
|
+
* Created from {@link IFluidHandleInternal} using {@link toFluidHandleErased}.
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
150
|
+
export interface IFluidHandleErased<T> extends ErasedType<readonly ["IFluidHandle", T]> {}
|
package/src/index.ts
CHANGED
|
@@ -27,8 +27,13 @@ export { IFluidLoadable, IFluidRunnable } from "./fluidLoadable.js";
|
|
|
27
27
|
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
|
|
28
28
|
export type { IRequest, IRequestHeader, IResponse } from "./fluidRouter.js";
|
|
29
29
|
|
|
30
|
-
export type {
|
|
31
|
-
|
|
30
|
+
export type {
|
|
31
|
+
IProvideFluidHandleContext,
|
|
32
|
+
IProvideFluidHandle,
|
|
33
|
+
IFluidHandleInternal,
|
|
34
|
+
IFluidHandleErased,
|
|
35
|
+
} from "./handles.js";
|
|
36
|
+
export { IFluidHandleContext, IFluidHandle, fluidHandleSymbol } from "./handles.js";
|
|
32
37
|
|
|
33
38
|
export type {
|
|
34
39
|
ILoggingError,
|
package/src/logger.ts
CHANGED