@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.
Files changed (110) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/Removing-IFluidRouter.md +22 -17
  3. package/api-extractor-lint.json +13 -0
  4. package/api-extractor.json +3 -6
  5. package/api-report/core-interfaces.api.md +66 -73
  6. package/dist/config.d.ts +35 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +7 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/core-interfaces-alpha.d.ts +101 -249
  11. package/dist/core-interfaces-beta.d.ts +105 -905
  12. package/dist/core-interfaces-public.d.ts +105 -905
  13. package/dist/core-interfaces-untrimmed.d.ts +112 -18
  14. package/dist/disposable.d.ts +1 -0
  15. package/dist/disposable.d.ts.map +1 -1
  16. package/dist/disposable.js.map +1 -1
  17. package/dist/error.d.ts +9 -0
  18. package/dist/error.d.ts.map +1 -1
  19. package/dist/error.js +1 -0
  20. package/dist/error.js.map +1 -1
  21. package/dist/events.d.ts +8 -1
  22. package/dist/events.d.ts.map +1 -1
  23. package/dist/events.js.map +1 -1
  24. package/dist/fluidLoadable.d.ts +16 -0
  25. package/dist/fluidLoadable.d.ts.map +1 -1
  26. package/dist/fluidLoadable.js +6 -0
  27. package/dist/fluidLoadable.js.map +1 -1
  28. package/dist/fluidPackage.d.ts +9 -0
  29. package/dist/fluidPackage.d.ts.map +1 -1
  30. package/dist/fluidPackage.js +3 -0
  31. package/dist/fluidPackage.js.map +1 -1
  32. package/dist/fluidRouter.d.ts +9 -17
  33. package/dist/fluidRouter.d.ts.map +1 -1
  34. package/dist/fluidRouter.js +0 -5
  35. package/dist/fluidRouter.js.map +1 -1
  36. package/dist/handles.d.ts +14 -0
  37. package/dist/handles.d.ts.map +1 -1
  38. package/dist/handles.js +6 -0
  39. package/dist/handles.js.map +1 -1
  40. package/dist/index.d.ts +2 -1
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +1 -6
  43. package/dist/index.js.map +1 -1
  44. package/dist/logger.d.ts +16 -0
  45. package/dist/logger.d.ts.map +1 -1
  46. package/dist/logger.js +1 -0
  47. package/dist/logger.js.map +1 -1
  48. package/dist/provider.d.ts +3 -2
  49. package/dist/provider.d.ts.map +1 -1
  50. package/dist/provider.js.map +1 -1
  51. package/lib/config.d.ts +35 -0
  52. package/lib/config.d.ts.map +1 -0
  53. package/lib/config.js +7 -0
  54. package/lib/config.js.map +1 -0
  55. package/lib/core-interfaces-alpha.d.ts +101 -249
  56. package/lib/core-interfaces-beta.d.ts +105 -905
  57. package/lib/core-interfaces-public.d.ts +105 -905
  58. package/lib/core-interfaces-untrimmed.d.ts +112 -18
  59. package/lib/disposable.d.ts +1 -0
  60. package/lib/disposable.d.ts.map +1 -1
  61. package/lib/disposable.js +2 -1
  62. package/lib/disposable.js.map +1 -1
  63. package/lib/error.d.ts +9 -0
  64. package/lib/error.d.ts.map +1 -1
  65. package/lib/error.js +5 -1
  66. package/lib/error.js.map +1 -1
  67. package/lib/events.d.ts +8 -1
  68. package/lib/events.d.ts.map +1 -1
  69. package/lib/events.js +2 -1
  70. package/lib/events.js.map +1 -1
  71. package/lib/fluidLoadable.d.ts +16 -0
  72. package/lib/fluidLoadable.d.ts.map +1 -1
  73. package/lib/fluidLoadable.js +11 -2
  74. package/lib/fluidLoadable.js.map +1 -1
  75. package/lib/fluidPackage.d.ts +9 -0
  76. package/lib/fluidPackage.d.ts.map +1 -1
  77. package/lib/fluidPackage.js +12 -4
  78. package/lib/fluidPackage.js.map +1 -1
  79. package/lib/fluidRouter.d.ts +9 -17
  80. package/lib/fluidRouter.d.ts.map +1 -1
  81. package/lib/fluidRouter.js +2 -4
  82. package/lib/fluidRouter.js.map +1 -1
  83. package/lib/handles.d.ts +14 -0
  84. package/lib/handles.d.ts.map +1 -1
  85. package/lib/handles.js +11 -2
  86. package/lib/handles.js.map +1 -1
  87. package/lib/index.d.ts +2 -1
  88. package/lib/index.d.ts.map +1 -1
  89. package/lib/index.js +17 -9
  90. package/lib/index.js.map +1 -1
  91. package/lib/logger.d.ts +16 -0
  92. package/lib/logger.d.ts.map +1 -1
  93. package/lib/logger.js +5 -1
  94. package/lib/logger.js.map +1 -1
  95. package/lib/provider.d.ts +3 -2
  96. package/lib/provider.d.ts.map +1 -1
  97. package/lib/provider.js +2 -1
  98. package/lib/provider.js.map +1 -1
  99. package/package.json +22 -6
  100. package/src/config.ts +36 -0
  101. package/src/disposable.ts +1 -0
  102. package/src/error.ts +9 -0
  103. package/src/events.ts +8 -1
  104. package/src/fluidLoadable.ts +16 -0
  105. package/src/fluidPackage.ts +9 -0
  106. package/src/fluidRouter.ts +9 -20
  107. package/src/handles.ts +14 -0
  108. package/src/index.ts +2 -7
  109. package/src/logger.ts +16 -0
  110. package/src/provider.ts +3 -2
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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;AAI1B,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADtB,2GAAA,YAAY,OAAA;AAGb,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 {\n\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport 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\";\n"]}
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/dist/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
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,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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/dist/logger.js CHANGED
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.LogLevel = void 0;
8
8
  /**
9
9
  * Specify levels of the logs.
10
+ * @alpha
10
11
  */
11
12
  exports.LogLevel = {
12
13
  verbose: 10,
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwEH;;GAEG;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 */\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 */\nexport type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;\n\n/**\n * {@inheritDoc TelemetryBaseEventPropertyType}\n *\n * @deprecated Renamed to {@link TelemetryBaseEventPropertyType}\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 */\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 */\nexport interface ITaggedTelemetryPropertyType {\n\tvalue: TelemetryEventPropertyType;\n\ttag: string;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n */\nexport type ITelemetryBaseProperties = ITelemetryProperties;\n\n/**\n * {@inheritDoc ITelemetryBaseProperties}\n *\n * @deprecated Renamed to {@link ITelemetryBaseProperties}\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 */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\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 */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\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 */\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 */\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 */\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 */\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 */\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"]}
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"]}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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"}
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"}
@@ -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 *\n */\nexport type FluidObject<T = unknown> = {\n\t[P in FluidObjectProviderKeys<T>]?: T[P];\n};\n\n/**\n * This utility type creates a type that is the union of all keys on the generic type\n * which implement the FluidObject pattern.\n *\n * See {@link FluidObject}\n *\n * For example `FluidObjectKeys<IFoo & IBar>` would result in `\"IFoo\" | \"IBar\"`\n *\n */\nexport type FluidObjectKeys<T> = keyof FluidObject<T>;\n"]}
1
+ {"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"]}
@@ -0,0 +1,35 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Types supported by {@link IConfigProviderBase}.
7
+ * @alpha
8
+ */
9
+ export type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
10
+ /**
11
+ * Base interface for providing configurations to enable/disable/control features.
12
+ * @alpha
13
+ */
14
+ export interface IConfigProviderBase {
15
+ /**
16
+ * For the specified config name this function gets the value.
17
+ *
18
+ * This type is meant be easy to implement by Fluid Framework consumers
19
+ * so the returned valued needs minimal type coercion, and allows consumers to
20
+ * return values in a natural way from whatever source they retrieve them.
21
+ *
22
+ * For instance a value of 1 maybe be returned as a string or a number.
23
+ * For array types a json string or an object are allowable.
24
+ *
25
+ * It should return undefined if there is no value available for the config name.
26
+ *
27
+ * @param name - The name of the config to get the value for.
28
+ *
29
+ * @privateRemarks Generally, this type should only be taken as input, and be wrapped by an
30
+ * internal monitoring context from the fluidframework/telemetry-utils package. That will provide
31
+ * a wrapper with provides strongly typed access to values via consistent type coercion.
32
+ */
33
+ getRawConfig(name: string): ConfigTypes;
34
+ }
35
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AAElG;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;CACxC"}
package/lib/config.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.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 * Types supported by {@link IConfigProviderBase}.\n * @alpha\n */\nexport type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;\n\n/**\n * Base interface for providing configurations to enable/disable/control features.\n * @alpha\n */\nexport interface IConfigProviderBase {\n\t/**\n\t * For the specified config name this function gets the value.\n\t *\n\t * This type is meant be easy to implement by Fluid Framework consumers\n\t * so the returned valued needs minimal type coercion, and allows consumers to\n\t * return values in a natural way from whatever source they retrieve them.\n\t *\n\t * For instance a value of 1 maybe be returned as a string or a number.\n\t * For array types a json string or an object are allowable.\n\t *\n\t * It should return undefined if there is no value available for the config name.\n\t *\n\t * @param name - The name of the config to get the value for.\n\t *\n\t * @privateRemarks Generally, this type should only be taken as input, and be wrapped by an\n\t * internal monitoring context from the fluidframework/telemetry-utils package. That will provide\n\t * a wrapper with provides strongly typed access to values via consistent type coercion.\n\t */\n\tgetRawConfig(name: string): ConfigTypes;\n}\n"]}