@fluidframework/core-interfaces 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.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/CHANGELOG.md +26 -0
- package/Removing-IFluidRouter.md +22 -17
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -6
- package/api-report/core-interfaces.api.md +66 -73
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -0
- package/dist/core-interfaces-alpha.d.ts +101 -249
- package/dist/core-interfaces-beta.d.ts +105 -905
- package/dist/core-interfaces-public.d.ts +105 -905
- package/dist/core-interfaces-untrimmed.d.ts +112 -18
- package/dist/disposable.d.ts +1 -0
- package/dist/disposable.d.ts.map +1 -1
- package/dist/disposable.js.map +1 -1
- package/dist/error.d.ts +9 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +1 -0
- package/dist/error.js.map +1 -1
- package/dist/events.d.ts +8 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/fluidLoadable.d.ts +16 -0
- package/dist/fluidLoadable.d.ts.map +1 -1
- package/dist/fluidLoadable.js +6 -0
- package/dist/fluidLoadable.js.map +1 -1
- package/dist/fluidPackage.d.ts +9 -0
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +3 -0
- package/dist/fluidPackage.js.map +1 -1
- package/dist/fluidRouter.d.ts +9 -17
- package/dist/fluidRouter.d.ts.map +1 -1
- package/dist/fluidRouter.js +0 -5
- package/dist/fluidRouter.js.map +1 -1
- package/dist/handles.d.ts +14 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js +6 -0
- package/dist/handles.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +16 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +1 -0
- package/dist/logger.js.map +1 -1
- package/dist/provider.d.ts +3 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js.map +1 -1
- package/lib/config.d.ts +35 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +7 -0
- package/lib/config.js.map +1 -0
- package/lib/core-interfaces-alpha.d.ts +101 -249
- package/lib/core-interfaces-beta.d.ts +105 -905
- package/lib/core-interfaces-public.d.ts +105 -905
- package/lib/core-interfaces-untrimmed.d.ts +112 -18
- package/lib/disposable.d.ts +1 -0
- package/lib/disposable.d.ts.map +1 -1
- package/lib/disposable.js +2 -1
- package/lib/disposable.js.map +1 -1
- package/lib/error.d.ts +9 -0
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +5 -1
- package/lib/error.js.map +1 -1
- package/lib/events.d.ts +8 -1
- package/lib/events.d.ts.map +1 -1
- package/lib/events.js +2 -1
- package/lib/events.js.map +1 -1
- package/lib/fluidLoadable.d.ts +16 -0
- package/lib/fluidLoadable.d.ts.map +1 -1
- package/lib/fluidLoadable.js +11 -2
- package/lib/fluidLoadable.js.map +1 -1
- package/lib/fluidPackage.d.ts +9 -0
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +12 -4
- package/lib/fluidPackage.js.map +1 -1
- package/lib/fluidRouter.d.ts +9 -17
- package/lib/fluidRouter.d.ts.map +1 -1
- package/lib/fluidRouter.js +2 -4
- package/lib/fluidRouter.js.map +1 -1
- package/lib/handles.d.ts +14 -0
- package/lib/handles.d.ts.map +1 -1
- package/lib/handles.js +11 -2
- package/lib/handles.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -9
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +16 -0
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +5 -1
- package/lib/logger.js.map +1 -1
- package/lib/provider.d.ts +3 -2
- package/lib/provider.d.ts.map +1 -1
- package/lib/provider.js +2 -1
- package/lib/provider.js.map +1 -1
- package/package.json +22 -6
- package/src/config.ts +36 -0
- package/src/disposable.ts +1 -0
- package/src/error.ts +9 -0
- package/src/events.ts +8 -1
- package/src/fluidLoadable.ts +16 -0
- package/src/fluidPackage.ts +9 -0
- package/src/fluidRouter.ts +9 -20
- package/src/handles.ts +14 -0
- package/src/index.ts +2 -7
- package/src/logger.ts +16 -0
- package/src/provider.ts +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { FluidErrorTypes, IErrorBase, IGenericError, IUsageError, IThrottlingWar
|
|
|
7
7
|
export type { ExtendEventProvider, IErrorEvent, IEvent, IEventProvider, IEventThisPlaceHolder, IEventTransformer, ReplaceIEventThisPlaceHolder, TransformedEvent, } from "./events";
|
|
8
8
|
export { IFluidLoadable, IProvideFluidLoadable, IFluidRunnable, IProvideFluidRunnable, } from "./fluidLoadable";
|
|
9
9
|
export { IFluidPackageEnvironment, IFluidPackage, isFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, isFluidCodeDetails, IFluidCodeDetailsComparer, IProvideFluidCodeDetailsComparer, } from "./fluidPackage";
|
|
10
|
-
export { IRequest, IRequestHeader, IResponse
|
|
10
|
+
export { IRequest, IRequestHeader, IResponse } from "./fluidRouter";
|
|
11
11
|
export { IFluidHandleContext, IProvideFluidHandleContext, IFluidHandle, IProvideFluidHandle, } from "./handles";
|
|
12
12
|
export type { ILoggingError, ITaggedTelemetryPropertyType, // deprecated
|
|
13
13
|
ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, ITelemetryErrorEvent, // deprecated
|
|
@@ -19,4 +19,5 @@ Tagged, TelemetryEventCategory, // deprecated
|
|
|
19
19
|
TelemetryBaseEventPropertyType, TelemetryEventPropertyType, } from "./logger";
|
|
20
20
|
export { LogLevel } from "./logger";
|
|
21
21
|
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
|
22
|
+
export { ConfigTypes, IConfigProviderBase } from "./config";
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACX,aAAa,EACb,4BAA4B,EAAE,aAAa;AAC3C,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EAAE,aAAa;AACnC,sBAAsB,EAAE,aAAa;AACrC,gBAAgB,EAAE,aAAa;AAC/B,0BAA0B,EAAE,aAAa;AACzC,oBAAoB,EAAE,aAAa;AACnC,MAAM,EACN,sBAAsB,EAAE,aAAa;AACrC,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LogLevel = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
|
|
8
|
+
var error_1 = require("./error");
|
|
9
|
+
Object.defineProperty(exports, "FluidErrorTypes", { enumerable: true, get: function () { return error_1.FluidErrorTypes; } });
|
|
10
|
+
var fluidLoadable_1 = require("./fluidLoadable");
|
|
11
|
+
Object.defineProperty(exports, "IFluidLoadable", { enumerable: true, get: function () { return fluidLoadable_1.IFluidLoadable; } });
|
|
12
|
+
Object.defineProperty(exports, "IFluidRunnable", { enumerable: true, get: function () { return fluidLoadable_1.IFluidRunnable; } });
|
|
13
|
+
var fluidPackage_1 = require("./fluidPackage");
|
|
14
|
+
Object.defineProperty(exports, "isFluidPackage", { enumerable: true, get: function () { return fluidPackage_1.isFluidPackage; } });
|
|
15
|
+
Object.defineProperty(exports, "isFluidCodeDetails", { enumerable: true, get: function () { return fluidPackage_1.isFluidCodeDetails; } });
|
|
16
|
+
Object.defineProperty(exports, "IFluidCodeDetailsComparer", { enumerable: true, get: function () { return fluidPackage_1.IFluidCodeDetailsComparer; } });
|
|
17
|
+
var handles_1 = require("./handles");
|
|
18
|
+
Object.defineProperty(exports, "IFluidHandleContext", { enumerable: true, get: function () { return handles_1.IFluidHandleContext; } });
|
|
19
|
+
Object.defineProperty(exports, "IFluidHandle", { enumerable: true, get: function () { return handles_1.IFluidHandle; } });
|
|
20
|
+
var logger_1 = require("./logger");
|
|
21
|
+
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_1.LogLevel; } });
|
|
14
22
|
//# 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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iCAMiB;AALhB,wGAAA,eAAe,OAAA;AAkBhB,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AAEd,+GAAA,cAAc,OAAA;AAIf,+CASwB;AANvB,8GAAA,cAAc,OAAA;AAGd,kHAAA,kBAAkB,OAAA;AAClB,yHAAA,yBAAyB,OAAA;AAS1B,qCAKmB;AAJlB,8GAAA,mBAAmB,OAAA;AAEnB,uGAAA,YAAY,OAAA;AAoBb,mCAAoC;AAA3B,kGAAA,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\";\n\nexport {\n\tFluidErrorTypes,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events\";\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\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 { IRequest, IRequestHeader, IResponse } from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport type {\n\tILoggingError,\n\tITaggedTelemetryPropertyType, // deprecated\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tITelemetryErrorEvent, // deprecated\n\tITelemetryGenericEvent, // deprecated\n\tITelemetryLogger, // deprecated\n\tITelemetryPerformanceEvent, // deprecated\n\tITelemetryProperties, // deprecated\n\tTagged,\n\tTelemetryEventCategory, // deprecated\n\tTelemetryBaseEventPropertyType,\n\tTelemetryEventPropertyType, // deprecated\n} from \"./logger\";\nexport { LogLevel } from \"./logger\";\nexport { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider\";\nexport { ConfigTypes, IConfigProviderBase } from \"./config\";\n"]}
|
package/lib/logger.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Examples of known categories, however category can be any string for extensibility.
|
|
7
7
|
*
|
|
8
8
|
* @deprecated Moved to \@fluidframework/telemetry-utils package
|
|
9
|
+
* @alpha
|
|
9
10
|
*/
|
|
10
11
|
export type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
11
12
|
/**
|
|
@@ -14,12 +15,14 @@ export type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
|
14
15
|
* @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can
|
|
15
16
|
* easily add fields to objects that shouldn't be logged and not realize it's going to be logged.
|
|
16
17
|
* General best practice is to explicitly log the fields you care about from objects.
|
|
18
|
+
* @internal
|
|
17
19
|
*/
|
|
18
20
|
export type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
19
21
|
/**
|
|
20
22
|
* {@inheritDoc TelemetryBaseEventPropertyType}
|
|
21
23
|
*
|
|
22
24
|
* @deprecated Renamed to {@link TelemetryBaseEventPropertyType}
|
|
25
|
+
* @alpha
|
|
23
26
|
*/
|
|
24
27
|
export type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
25
28
|
/**
|
|
@@ -28,6 +31,7 @@ export type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
|
28
31
|
*
|
|
29
32
|
* This indicates that the value should be organized or handled differently by loggers in various first or third
|
|
30
33
|
* party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.
|
|
34
|
+
* @alpha
|
|
31
35
|
*/
|
|
32
36
|
export interface Tagged<V, T extends string = string> {
|
|
33
37
|
value: V;
|
|
@@ -37,6 +41,7 @@ export interface Tagged<V, T extends string = string> {
|
|
|
37
41
|
* @see {@link Tagged} for info on tagging
|
|
38
42
|
*
|
|
39
43
|
* @deprecated Use Tagged\<TelemetryBaseEventPropertyType\>
|
|
44
|
+
* @internal
|
|
40
45
|
*/
|
|
41
46
|
export interface ITaggedTelemetryPropertyType {
|
|
42
47
|
value: TelemetryEventPropertyType;
|
|
@@ -44,12 +49,14 @@ export interface ITaggedTelemetryPropertyType {
|
|
|
44
49
|
}
|
|
45
50
|
/**
|
|
46
51
|
* JSON-serializable properties, which will be logged with telemetry.
|
|
52
|
+
* @alpha
|
|
47
53
|
*/
|
|
48
54
|
export type ITelemetryBaseProperties = ITelemetryProperties;
|
|
49
55
|
/**
|
|
50
56
|
* {@inheritDoc ITelemetryBaseProperties}
|
|
51
57
|
*
|
|
52
58
|
* @deprecated Renamed to {@link ITelemetryBaseProperties}
|
|
59
|
+
* @alpha
|
|
53
60
|
*/
|
|
54
61
|
export interface ITelemetryProperties {
|
|
55
62
|
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
|
|
@@ -59,6 +66,7 @@ export interface ITelemetryProperties {
|
|
|
59
66
|
* Can contain any number of properties that get serialized as json payload.
|
|
60
67
|
* @param category - category of the event, like "error", "performance", "generic", etc.
|
|
61
68
|
* @param eventName - name of the event.
|
|
69
|
+
* @alpha
|
|
62
70
|
*/
|
|
63
71
|
export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
64
72
|
category: string;
|
|
@@ -66,6 +74,7 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
|
66
74
|
}
|
|
67
75
|
/**
|
|
68
76
|
* Specify levels of the logs.
|
|
77
|
+
* @alpha
|
|
69
78
|
*/
|
|
70
79
|
export declare const LogLevel: {
|
|
71
80
|
readonly verbose: 10;
|
|
@@ -74,11 +83,13 @@ export declare const LogLevel: {
|
|
|
74
83
|
};
|
|
75
84
|
/**
|
|
76
85
|
* Specify a level to the log to filter out logs based on the level.
|
|
86
|
+
* @alpha
|
|
77
87
|
*/
|
|
78
88
|
export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
79
89
|
/**
|
|
80
90
|
* Interface to output telemetry events.
|
|
81
91
|
* Implemented by hosting app / loader
|
|
92
|
+
* @alpha
|
|
82
93
|
*/
|
|
83
94
|
export interface ITelemetryBaseLogger {
|
|
84
95
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
@@ -90,6 +101,7 @@ export interface ITelemetryBaseLogger {
|
|
|
90
101
|
*
|
|
91
102
|
* @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \@fluidframework/telemetry-utils.
|
|
92
103
|
* No replacement intended for FluidFramework consumers.
|
|
104
|
+
* @alpha
|
|
93
105
|
*/
|
|
94
106
|
export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
95
107
|
eventName: string;
|
|
@@ -101,6 +113,7 @@ export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
|
101
113
|
*
|
|
102
114
|
* @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \@fluidframework/telemetry-utils.
|
|
103
115
|
* No replacement intended for FluidFramework consumers.
|
|
116
|
+
* @alpha
|
|
104
117
|
*/
|
|
105
118
|
export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
106
119
|
eventName: string;
|
|
@@ -111,12 +124,14 @@ export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
|
111
124
|
*
|
|
112
125
|
* @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \@fluidframework/telemetry-utils.
|
|
113
126
|
* No replacement intended for FluidFramework consumers.
|
|
127
|
+
* @alpha
|
|
114
128
|
*/
|
|
115
129
|
export interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
|
|
116
130
|
duration?: number;
|
|
117
131
|
}
|
|
118
132
|
/**
|
|
119
133
|
* An error object that supports exporting its properties to be logged to telemetry
|
|
134
|
+
* @internal
|
|
120
135
|
*/
|
|
121
136
|
export interface ILoggingError extends Error {
|
|
122
137
|
/**
|
|
@@ -131,6 +146,7 @@ export interface ILoggingError extends Error {
|
|
|
131
146
|
*
|
|
132
147
|
* @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \@fluidframework/telemetry-utils.
|
|
133
148
|
* No replacement intended for FluidFramework consumers.
|
|
149
|
+
* @alpha
|
|
134
150
|
*/
|
|
135
151
|
export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
136
152
|
/**
|
package/lib/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,0BAA0B,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG,0BAA0B,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;CACjF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IACjE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC7D;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;;;OAKG;IACH,kBAAkB,CACjB,KAAK,EAAE,sBAAsB,EAG7B,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;IAER;;;;OAIG;IAEH,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAE/D;;;;;OAKG;IACH,oBAAoB,CACnB,KAAK,EAAE,0BAA0B,EAGjC,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;CACR"}
|
package/lib/logger.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
4
5
|
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LogLevel = void 0;
|
|
5
8
|
/**
|
|
6
9
|
* Specify levels of the logs.
|
|
10
|
+
* @alpha
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
exports.LogLevel = {
|
|
9
13
|
verbose: 10,
|
|
10
14
|
default: 20,
|
|
11
15
|
error: 30, // To log errors.
|
package/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgFH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,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 * Examples of known categories, however category can be any string for extensibility.\n *\n * @deprecated Moved to \\@fluidframework/telemetry-utils package\n * @alpha\n */\nexport type TelemetryEventCategory = \"generic\" | \"error\" | \"performance\";\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 * @internal\n */\nexport type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;\n\n/**\n * {@inheritDoc TelemetryBaseEventPropertyType}\n *\n * @deprecated Renamed to {@link TelemetryBaseEventPropertyType}\n * @alpha\n */\nexport type TelemetryEventPropertyType = 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 * @alpha\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * @see {@link Tagged} for info on tagging\n *\n * @deprecated Use Tagged\\<TelemetryBaseEventPropertyType\\>\n * @internal\n */\nexport interface ITaggedTelemetryPropertyType {\n\tvalue: TelemetryEventPropertyType;\n\ttag: string;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @alpha\n */\nexport type ITelemetryBaseProperties = ITelemetryProperties;\n\n/**\n * {@inheritDoc ITelemetryBaseProperties}\n *\n * @deprecated Renamed to {@link ITelemetryBaseProperties}\n * @alpha\n */\nexport interface ITelemetryProperties {\n\t[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;\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 * @alpha\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n * @alpha\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 * @alpha\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @alpha\n */\nexport interface ITelemetryBaseLogger {\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Informational (non-error) telemetry event\n * Maps to category = \"generic\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @alpha\n */\nexport interface ITelemetryGenericEvent extends ITelemetryProperties {\n\teventName: string;\n\tcategory?: TelemetryEventCategory;\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 * @alpha\n */\nexport interface ITelemetryErrorEvent extends ITelemetryProperties {\n\teventName: string;\n}\n\n/**\n * Performance telemetry event.\n * Maps to category = \"performance\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @alpha\n */\nexport interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {\n\tduration?: number; // Duration of event (optional)\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @internal\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\n/**\n * ITelemetryLogger interface contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n * @alpha\n */\nexport interface ITelemetryLogger extends ITelemetryBaseLogger {\n\t/**\n\t * Actual implementation that sends telemetry event\n\t * Implemented by derived classes\n\t * @param event - Telemetry event to send over\n\t * @param logLevel - optional level of the log.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send information telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\tsendTelemetryEvent(\n\t\tevent: ITelemetryGenericEvent,\n\t\t// TODO: Use `unknown` instead (API-Breaking)\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n\n\t/**\n\t * Send error telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendErrorEvent(event: ITelemetryErrorEvent, error?: any): void;\n\n\t/**\n\t * Send performance telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\tsendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEvent,\n\t\t// TODO: Use `unknown` instead (API-Breaking)\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n}\n"]}
|
package/lib/provider.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* This pattern enables discovery, and delegation in a standard way which is central
|
|
28
28
|
* to FluidObject pattern.
|
|
29
|
+
* @alpha
|
|
29
30
|
*/
|
|
30
31
|
export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp ? never : number extends TProp ? never : TProp extends keyof Required<T>[TProp] ? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] ? TProp : never : never;
|
|
31
32
|
/**
|
|
@@ -59,7 +60,7 @@ export type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string
|
|
|
59
60
|
*
|
|
60
61
|
* You can inspect multiple types via a intersection. For example:
|
|
61
62
|
* `FluidObject<IFoo & IBar>`
|
|
62
|
-
*
|
|
63
|
+
* @alpha
|
|
63
64
|
*/
|
|
64
65
|
export type FluidObject<T = unknown> = {
|
|
65
66
|
[P in FluidObjectProviderKeys<T>]?: T[P];
|
|
@@ -71,7 +72,7 @@ export type FluidObject<T = unknown> = {
|
|
|
71
72
|
* See {@link FluidObject}
|
|
72
73
|
*
|
|
73
74
|
* For example `FluidObjectKeys<IFoo & IBar>` would result in `"IFoo" | "IBar"`
|
|
74
|
-
*
|
|
75
|
+
* @alpha
|
|
75
76
|
*/
|
|
76
77
|
export type FluidObjectKeys<T> = keyof FluidObject<T>;
|
|
77
78
|
//# sourceMappingURL=provider.d.ts.map
|
package/lib/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,MAAM,SAAS,KAAK,GAC3F,KAAK,GACL,MAAM,SAAS,KAAK,GACpB,KAAK,GACL,KAAK,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACtC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAC7D,KAAK,GACL,KAAK,GACN,KAAK,CAAC;AAET;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI;KACrC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC"}
|
package/lib/provider.js
CHANGED
package/lib/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Produces a valid FluidObject key given a type and a property.\n *\n * @remarks\n *\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example: `IProvideFoo.IFoo.IFoo`\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n *\n * This utility type is meant for internal use by {@link FluidObject}\n *\n * @example\n *\n * ```typescript\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern.\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp\n\t? never\n\t: number extends TProp\n\t? never // exclude indexers [key:string |number]: any\n\t: TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n\t? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n\t\t? TProp\n\t\t: never\n\t: never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * @example\n *\n * For example, if we have an interface like the following:\n *\n * ```typescript\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n
|
|
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 * Produces a valid FluidObject key given a type and a property.\n *\n * @remarks\n *\n * A valid FluidObject key is a property that exists on the incoming type\n * as well as on the type of the property itself. For example: `IProvideFoo.IFoo.IFoo`\n * This aligns with the FluidObject pattern expected to be used with all FluidObjects.\n *\n * This utility type is meant for internal use by {@link FluidObject}\n *\n * @example\n *\n * ```typescript\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * This pattern enables discovery, and delegation in a standard way which is central\n * to FluidObject pattern.\n * @alpha\n */\nexport type FluidObjectProviderKeys<T, TProp extends keyof T = keyof T> = string extends TProp\n\t? never\n\t: number extends TProp\n\t? never // exclude indexers [key:string |number]: any\n\t: TProp extends keyof Required<T>[TProp] // TProp is a property of T, and T[TProp]\n\t? Required<T>[TProp] extends Required<Required<T>[TProp]>[TProp] // T[TProp] is the same type as T[TProp][TProp]\n\t\t? TProp\n\t\t: never\n\t: never;\n\n/**\n * This utility type take interface(s) that follow the FluidObject pattern, and produces\n * a new type that can be used for inspection and discovery of those interfaces.\n *\n * It is meant to be used with types that are known to implement the FluidObject pattern.\n * A common way to specify a type implements the FluidObject pattern is to expose it as a\n * FluidObject without a generic argument.\n *\n * @example\n *\n * For example, if we have an interface like the following:\n *\n * ```typescript\n * interface IProvideFoo{\n * IFoo: IFoo\n * }\n * interface IFoo extends IProvideFoo{\n * foobar();\n * }\n * ```\n *\n * and a function that returns a FluidObject. You would do the following\n *\n * `const maybeFoo: FluidObject<IFoo> = getFluidObject()`;\n *\n * Either IFoo or IProvideFoo are valid generic arguments. In both case\n * maybeFoo will be of type `{IFoo?: IFoo}`. If IFoo is not undefined,\n * then the FluidObject provides IFoo, and it can be used.\n *\n * You can inspect multiple types via a intersection. For example:\n * `FluidObject<IFoo & IBar>`\n * @alpha\n */\nexport type FluidObject<T = unknown> = {\n\t[P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern.\n *\n * See {@link FluidObject}\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n * @alpha\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-internal.
|
|
3
|
+
"version": "2.0.0-internal.8.0.0",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"devDependencies": {
|
|
18
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
18
19
|
"@fluid-tools/build-cli": "^0.28.0",
|
|
19
20
|
"@fluidframework/build-common": "^2.0.3",
|
|
20
21
|
"@fluidframework/build-tools": "^0.28.0",
|
|
21
22
|
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-internal.7.2.0",
|
|
22
23
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
23
24
|
"@microsoft/api-extractor": "^7.38.3",
|
|
24
|
-
"@types/node": "^
|
|
25
|
+
"@types/node": "^18.19.0",
|
|
25
26
|
"copyfiles": "^2.4.1",
|
|
26
27
|
"eslint": "~8.50.0",
|
|
27
28
|
"prettier": "~3.0.3",
|
|
@@ -41,7 +42,20 @@
|
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
"typeValidation": {
|
|
44
|
-
"broken": {
|
|
45
|
+
"broken": {
|
|
46
|
+
"RemovedVariableDeclaration_IFluidRouter": {
|
|
47
|
+
"forwardCompat": false,
|
|
48
|
+
"backCompat": false
|
|
49
|
+
},
|
|
50
|
+
"RemovedInterfaceDeclaration_IFluidRouter": {
|
|
51
|
+
"forwardCompat": false,
|
|
52
|
+
"backCompat": false
|
|
53
|
+
},
|
|
54
|
+
"RemovedInterfaceDeclaration_IProvideFluidRouter": {
|
|
55
|
+
"forwardCompat": false,
|
|
56
|
+
"backCompat": false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
45
59
|
},
|
|
46
60
|
"scripts": {
|
|
47
61
|
"api": "fluid-build . --task api",
|
|
@@ -52,6 +66,8 @@
|
|
|
52
66
|
"build:compile": "fluid-build . --task compile",
|
|
53
67
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
54
68
|
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
69
|
+
"check:are-the-types-wrong": "attw --pack",
|
|
70
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
55
71
|
"ci:build": "npm run build:compile",
|
|
56
72
|
"ci:build:docs": "api-extractor run",
|
|
57
73
|
"ci:test": "echo No test for this package",
|
|
@@ -60,10 +76,10 @@
|
|
|
60
76
|
"eslint": "eslint --format stylish src",
|
|
61
77
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
62
78
|
"format": "npm run prettier:fix",
|
|
63
|
-
"lint": "npm run prettier && npm run eslint",
|
|
79
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
64
80
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
65
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
66
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
81
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
82
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
67
83
|
"tsc": "tsc",
|
|
68
84
|
"tsc:watch": "tsc --watch",
|
|
69
85
|
"typetests:gen": "fluid-type-test-generator",
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Types supported by {@link IConfigProviderBase}.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Base interface for providing configurations to enable/disable/control features.
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
16
|
+
export interface IConfigProviderBase {
|
|
17
|
+
/**
|
|
18
|
+
* For the specified config name this function gets the value.
|
|
19
|
+
*
|
|
20
|
+
* This type is meant be easy to implement by Fluid Framework consumers
|
|
21
|
+
* so the returned valued needs minimal type coercion, and allows consumers to
|
|
22
|
+
* return values in a natural way from whatever source they retrieve them.
|
|
23
|
+
*
|
|
24
|
+
* For instance a value of 1 maybe be returned as a string or a number.
|
|
25
|
+
* For array types a json string or an object are allowable.
|
|
26
|
+
*
|
|
27
|
+
* It should return undefined if there is no value available for the config name.
|
|
28
|
+
*
|
|
29
|
+
* @param name - The name of the config to get the value for.
|
|
30
|
+
*
|
|
31
|
+
* @privateRemarks Generally, this type should only be taken as input, and be wrapped by an
|
|
32
|
+
* internal monitoring context from the fluidframework/telemetry-utils package. That will provide
|
|
33
|
+
* a wrapper with provides strongly typed access to values via consistent type coercion.
|
|
34
|
+
*/
|
|
35
|
+
getRawConfig(name: string): ConfigTypes;
|
|
36
|
+
}
|
package/src/disposable.ts
CHANGED
package/src/error.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ITelemetryBaseProperties } from "./index";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Error types the Fluid Framework may report.
|
|
10
|
+
* @internal
|
|
10
11
|
*/
|
|
11
12
|
export const FluidErrorTypes = {
|
|
12
13
|
/**
|
|
@@ -34,6 +35,9 @@ export const FluidErrorTypes = {
|
|
|
34
35
|
*/
|
|
35
36
|
usageError: "usageError",
|
|
36
37
|
} as const;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
37
41
|
export type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTypes];
|
|
38
42
|
|
|
39
43
|
/**
|
|
@@ -45,6 +49,8 @@ export type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTy
|
|
|
45
49
|
* those from container-definitions. Once fully migrated, this will be a base interface for all errors and
|
|
46
50
|
* warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.
|
|
47
51
|
* Runtime and others will follow soon.
|
|
52
|
+
*
|
|
53
|
+
* @alpha
|
|
48
54
|
*/
|
|
49
55
|
export interface IErrorBase extends Partial<Error> {
|
|
50
56
|
/**
|
|
@@ -87,6 +93,7 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
87
93
|
|
|
88
94
|
/**
|
|
89
95
|
* Generic wrapper for an unrecognized/uncategorized error object
|
|
96
|
+
* @internal
|
|
90
97
|
*/
|
|
91
98
|
export interface IGenericError extends IErrorBase {
|
|
92
99
|
/**
|
|
@@ -101,6 +108,7 @@ export interface IGenericError extends IErrorBase {
|
|
|
101
108
|
|
|
102
109
|
/**
|
|
103
110
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
111
|
+
* @internal
|
|
104
112
|
*/
|
|
105
113
|
export interface IUsageError extends IErrorBase {
|
|
106
114
|
/**
|
|
@@ -111,6 +119,7 @@ export interface IUsageError extends IErrorBase {
|
|
|
111
119
|
|
|
112
120
|
/**
|
|
113
121
|
* Warning emitted when requests to storage are being throttled
|
|
122
|
+
* @internal
|
|
114
123
|
*/
|
|
115
124
|
export interface IThrottlingWarning extends IErrorBase {
|
|
116
125
|
/**
|
package/src/events.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Base interface for event emitters.
|
|
8
|
+
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export interface IEvent {
|
|
10
11
|
/**
|
|
@@ -23,6 +24,7 @@ export interface IEvent {
|
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Base interface for error event emitters.
|
|
27
|
+
* @alpha
|
|
26
28
|
*/
|
|
27
29
|
export interface IErrorEvent extends IEvent {
|
|
28
30
|
/**
|
|
@@ -36,6 +38,7 @@ export interface IErrorEvent extends IEvent {
|
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* Base interface for event providers.
|
|
41
|
+
* @alpha
|
|
39
42
|
*/
|
|
40
43
|
export interface IEventProvider<TEvent extends IEvent> {
|
|
41
44
|
/**
|
|
@@ -76,7 +79,7 @@ export interface IEventProvider<TEvent extends IEvent> {
|
|
|
76
79
|
* ```
|
|
77
80
|
*
|
|
78
81
|
* interface B will now extend interface A and its events
|
|
79
|
-
*
|
|
82
|
+
* @alpha
|
|
80
83
|
*/
|
|
81
84
|
export type ExtendEventProvider<
|
|
82
85
|
TBaseEvent extends IEvent,
|
|
@@ -98,12 +101,14 @@ export type ExtendEventProvider<
|
|
|
98
101
|
|
|
99
102
|
/**
|
|
100
103
|
* The placeholder type that should be used instead of `this` in events.
|
|
104
|
+
* @alpha
|
|
101
105
|
*/
|
|
102
106
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
103
107
|
export type IEventThisPlaceHolder = { thisPlaceHolder: "thisPlaceHolder" };
|
|
104
108
|
|
|
105
109
|
/**
|
|
106
110
|
* Does the type replacement by changing types of {@link IEventThisPlaceHolder} to `TThis`
|
|
111
|
+
* @alpha
|
|
107
112
|
*/
|
|
108
113
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
114
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[]
|
|
@@ -113,6 +118,7 @@ export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any
|
|
|
113
118
|
/**
|
|
114
119
|
* Transforms the event overload by replacing {@link IEventThisPlaceHolder} with `TThis` in the event listener
|
|
115
120
|
* arguments and having the overload return `TTHis` as well
|
|
121
|
+
* @alpha
|
|
116
122
|
*/
|
|
117
123
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
124
|
export type TransformedEvent<TThis, E, A extends any[]> = (
|
|
@@ -128,6 +134,7 @@ export type TransformedEvent<TThis, E, A extends any[]> = (
|
|
|
128
134
|
* It currently supports the max of 15 event overloads which is more than we use anywhere.
|
|
129
135
|
* At more than 15 overloads we start to hit {@link https://github.com/microsoft/TypeScript/issues/37209 | TS2589}.
|
|
130
136
|
* If we need to move beyond 15 we should evaluate using a mapped type pattern like `{"event":(listenerArgs)=>void}`
|
|
137
|
+
* @alpha
|
|
131
138
|
*/
|
|
132
139
|
export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
|
|
133
140
|
(event: infer E0, listener: (...args: infer A0) => void);
|
package/src/fluidLoadable.ts
CHANGED
|
@@ -5,24 +5,40 @@
|
|
|
5
5
|
|
|
6
6
|
import { IFluidHandle } from "./handles";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
8
11
|
export const IFluidLoadable: keyof IProvideFluidLoadable = "IFluidLoadable";
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
10
16
|
export interface IProvideFluidLoadable {
|
|
11
17
|
readonly IFluidLoadable: IFluidLoadable;
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
20
|
* A shared FluidObject has a URL from which it can be referenced
|
|
21
|
+
* @alpha
|
|
15
22
|
*/
|
|
16
23
|
export interface IFluidLoadable extends IProvideFluidLoadable {
|
|
17
24
|
// Handle to the loadable FluidObject
|
|
18
25
|
handle: IFluidHandle;
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
21
31
|
export const IFluidRunnable: keyof IProvideFluidRunnable = "IFluidRunnable";
|
|
22
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
23
36
|
export interface IProvideFluidRunnable {
|
|
24
37
|
readonly IFluidRunnable: IFluidRunnable;
|
|
25
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
26
42
|
export interface IFluidRunnable {
|
|
27
43
|
// TODO: Use `unknown` instead (API-Breaking)
|
|
28
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|