@fluidframework/core-interfaces 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.1
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 +10 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -6
- package/api-report/core-interfaces.api.md +69 -61
- 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 +105 -230
- package/dist/core-interfaces-beta.d.ts +109 -905
- package/dist/core-interfaces-public.d.ts +109 -905
- package/dist/core-interfaces-untrimmed.d.ts +120 -3
- 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 +12 -0
- package/dist/fluidRouter.d.ts.map +1 -1
- package/dist/fluidRouter.js +1 -0
- 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 +1 -0
- package/dist/index.d.ts.map +1 -1
- 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 +105 -230
- package/lib/core-interfaces-beta.d.ts +109 -905
- package/lib/core-interfaces-public.d.ts +109 -905
- package/lib/core-interfaces-untrimmed.d.ts +120 -3
- 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 +12 -0
- package/lib/fluidRouter.d.ts.map +1 -1
- package/lib/fluidRouter.js +5 -1
- 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 +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -6
- 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 +8 -5
- 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 +12 -0
- package/src/handles.ts +14 -0
- package/src/index.ts +1 -0
- package/src/logger.ts +16 -0
- package/src/provider.ts +3 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types supported by {@link IConfigProviderBase}.
|
|
3
|
+
* @alpha
|
|
4
|
+
*/
|
|
5
|
+
export declare type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* Allows an interface to extend interfaces that already extend an {@link IEventProvider}.
|
|
3
9
|
*
|
|
@@ -20,12 +26,13 @@
|
|
|
20
26
|
* ```
|
|
21
27
|
*
|
|
22
28
|
* interface B will now extend interface A and its events
|
|
23
|
-
*
|
|
29
|
+
* @alpha
|
|
24
30
|
*/
|
|
25
31
|
export declare type ExtendEventProvider<TBaseEvent extends IEvent, TBase extends IEventProvider<TBaseEvent>, TEvent extends TBaseEvent> = Omit<Omit<Omit<TBase, "on">, "once">, "off"> & IEventProvider<TBaseEvent> & IEventProvider<TEvent>;
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* Error types the Fluid Framework may report.
|
|
35
|
+
* @internal
|
|
29
36
|
*/
|
|
30
37
|
export declare const FluidErrorTypes: {
|
|
31
38
|
/**
|
|
@@ -50,6 +57,9 @@ export declare const FluidErrorTypes: {
|
|
|
50
57
|
readonly usageError: "usageError";
|
|
51
58
|
};
|
|
52
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
53
63
|
export declare type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTypes];
|
|
54
64
|
|
|
55
65
|
/**
|
|
@@ -83,7 +93,7 @@ export declare type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof Flui
|
|
|
83
93
|
*
|
|
84
94
|
* You can inspect multiple types via a intersection. For example:
|
|
85
95
|
* `FluidObject<IFoo & IBar>`
|
|
86
|
-
*
|
|
96
|
+
* @alpha
|
|
87
97
|
*/
|
|
88
98
|
export declare type FluidObject<T = unknown> = {
|
|
89
99
|
[P in FluidObjectProviderKeys<T>]?: T[P];
|
|
@@ -96,7 +106,7 @@ export declare type FluidObject<T = unknown> = {
|
|
|
96
106
|
* See {@link FluidObject}
|
|
97
107
|
*
|
|
98
108
|
* For example `FluidObjectKeys<IFoo & IBar>` would result in `"IFoo" | "IBar"`
|
|
99
|
-
*
|
|
109
|
+
* @alpha
|
|
100
110
|
*/
|
|
101
111
|
export declare type FluidObjectKeys<T> = keyof FluidObject<T>;
|
|
102
112
|
|
|
@@ -124,11 +134,39 @@ export declare type FluidObjectKeys<T> = keyof FluidObject<T>;
|
|
|
124
134
|
*
|
|
125
135
|
* This pattern enables discovery, and delegation in a standard way which is central
|
|
126
136
|
* to FluidObject pattern.
|
|
137
|
+
* @alpha
|
|
127
138
|
*/
|
|
128
139
|
export declare 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;
|
|
129
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Base interface for providing configurations to enable/disable/control features.
|
|
143
|
+
* @alpha
|
|
144
|
+
*/
|
|
145
|
+
export declare interface IConfigProviderBase {
|
|
146
|
+
/**
|
|
147
|
+
* For the specified config name this function gets the value.
|
|
148
|
+
*
|
|
149
|
+
* This type is meant be easy to implement by Fluid Framework consumers
|
|
150
|
+
* so the returned valued needs minimal type coercion, and allows consumers to
|
|
151
|
+
* return values in a natural way from whatever source they retrieve them.
|
|
152
|
+
*
|
|
153
|
+
* For instance a value of 1 maybe be returned as a string or a number.
|
|
154
|
+
* For array types a json string or an object are allowable.
|
|
155
|
+
*
|
|
156
|
+
* It should return undefined if there is no value available for the config name.
|
|
157
|
+
*
|
|
158
|
+
* @param name - The name of the config to get the value for.
|
|
159
|
+
*
|
|
160
|
+
* @privateRemarks Generally, this type should only be taken as input, and be wrapped by an
|
|
161
|
+
* internal monitoring context from the fluidframework/telemetry-utils package. That will provide
|
|
162
|
+
* a wrapper with provides strongly typed access to values via consistent type coercion.
|
|
163
|
+
*/
|
|
164
|
+
getRawConfig(name: string): ConfigTypes;
|
|
165
|
+
}
|
|
166
|
+
|
|
130
167
|
/**
|
|
131
168
|
* Base interface for objects that require lifetime management via explicit disposal.
|
|
169
|
+
* @alpha
|
|
132
170
|
*/
|
|
133
171
|
export declare interface IDisposable {
|
|
134
172
|
/**
|
|
@@ -153,6 +191,8 @@ export declare interface IDisposable {
|
|
|
153
191
|
* those from container-definitions. Once fully migrated, this will be a base interface for all errors and
|
|
154
192
|
* warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.
|
|
155
193
|
* Runtime and others will follow soon.
|
|
194
|
+
*
|
|
195
|
+
* @alpha
|
|
156
196
|
*/
|
|
157
197
|
export declare interface IErrorBase extends Partial<Error> {
|
|
158
198
|
/**
|
|
@@ -191,6 +231,7 @@ export declare interface IErrorBase extends Partial<Error> {
|
|
|
191
231
|
|
|
192
232
|
/**
|
|
193
233
|
* Base interface for error event emitters.
|
|
234
|
+
* @alpha
|
|
194
235
|
*/
|
|
195
236
|
export declare interface IErrorEvent extends IEvent {
|
|
196
237
|
/**
|
|
@@ -203,6 +244,7 @@ export declare interface IErrorEvent extends IEvent {
|
|
|
203
244
|
|
|
204
245
|
/**
|
|
205
246
|
* Base interface for event emitters.
|
|
247
|
+
* @alpha
|
|
206
248
|
*/
|
|
207
249
|
export declare interface IEvent {
|
|
208
250
|
/**
|
|
@@ -220,6 +262,7 @@ export declare interface IEvent {
|
|
|
220
262
|
|
|
221
263
|
/**
|
|
222
264
|
* Base interface for event providers.
|
|
265
|
+
* @alpha
|
|
223
266
|
*/
|
|
224
267
|
export declare interface IEventProvider<TEvent extends IEvent> {
|
|
225
268
|
/**
|
|
@@ -238,6 +281,7 @@ export declare interface IEventProvider<TEvent extends IEvent> {
|
|
|
238
281
|
|
|
239
282
|
/**
|
|
240
283
|
* The placeholder type that should be used instead of `this` in events.
|
|
284
|
+
* @alpha
|
|
241
285
|
*/
|
|
242
286
|
export declare type IEventThisPlaceHolder = {
|
|
243
287
|
thisPlaceHolder: "thisPlaceHolder";
|
|
@@ -251,6 +295,7 @@ export declare type IEventThisPlaceHolder = {
|
|
|
251
295
|
* It currently supports the max of 15 event overloads which is more than we use anywhere.
|
|
252
296
|
* At more than 15 overloads we start to hit {@link https://github.com/microsoft/TypeScript/issues/37209 | TS2589}.
|
|
253
297
|
* If we need to move beyond 15 we should evaluate using a mapped type pattern like `{"event":(listenerArgs)=>void}`
|
|
298
|
+
* @alpha
|
|
254
299
|
*/
|
|
255
300
|
export declare type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
|
|
256
301
|
(event: infer E0, listener: (...args: infer A0) => void): any;
|
|
@@ -409,6 +454,7 @@ export declare type IEventTransformer<TThis, TEvent extends IEvent> = TEvent ext
|
|
|
409
454
|
*
|
|
410
455
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetails}
|
|
411
456
|
* to have code loading modules in same package.
|
|
457
|
+
* @internal
|
|
412
458
|
*/
|
|
413
459
|
export declare interface IFluidCodeDetails {
|
|
414
460
|
/**
|
|
@@ -425,6 +471,7 @@ export declare interface IFluidCodeDetails {
|
|
|
425
471
|
/**
|
|
426
472
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
427
473
|
* to have code loading modules in same package.
|
|
474
|
+
* @internal
|
|
428
475
|
*/
|
|
429
476
|
export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
|
|
430
477
|
|
|
@@ -433,6 +480,7 @@ export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsCo
|
|
|
433
480
|
*
|
|
434
481
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsComparer}
|
|
435
482
|
* to have code loading modules in same package.
|
|
483
|
+
* @internal
|
|
436
484
|
*/
|
|
437
485
|
export declare interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
|
|
438
486
|
/**
|
|
@@ -464,15 +512,20 @@ export declare interface IFluidCodeDetailsComparer extends IProvideFluidCodeDeta
|
|
|
464
512
|
*
|
|
465
513
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IFluidCodeDetailsConfig}
|
|
466
514
|
* to have code loading modules in same package.
|
|
515
|
+
* @internal
|
|
467
516
|
*/
|
|
468
517
|
export declare interface IFluidCodeDetailsConfig {
|
|
469
518
|
readonly [key: string]: string;
|
|
470
519
|
}
|
|
471
520
|
|
|
521
|
+
/**
|
|
522
|
+
* @alpha
|
|
523
|
+
*/
|
|
472
524
|
export declare const IFluidHandle: keyof IProvideFluidHandle;
|
|
473
525
|
|
|
474
526
|
/**
|
|
475
527
|
* Handle to a shared {@link FluidObject}.
|
|
528
|
+
* @alpha
|
|
476
529
|
*/
|
|
477
530
|
export declare interface IFluidHandle<T = FluidObject & IFluidLoadable> extends IProvideFluidHandle {
|
|
478
531
|
/**
|
|
@@ -504,10 +557,14 @@ export declare interface IFluidHandle<T = FluidObject & IFluidLoadable> extends
|
|
|
504
557
|
bind(handle: IFluidHandle): void;
|
|
505
558
|
}
|
|
506
559
|
|
|
560
|
+
/**
|
|
561
|
+
* @alpha
|
|
562
|
+
*/
|
|
507
563
|
export declare const IFluidHandleContext: keyof IProvideFluidHandleContext;
|
|
508
564
|
|
|
509
565
|
/**
|
|
510
566
|
* Describes a routing context from which other `IFluidHandleContext`s are defined.
|
|
567
|
+
* @alpha
|
|
511
568
|
*/
|
|
512
569
|
export declare interface IFluidHandleContext extends IProvideFluidHandleContext {
|
|
513
570
|
/**
|
|
@@ -530,10 +587,14 @@ export declare interface IFluidHandleContext extends IProvideFluidHandleContext
|
|
|
530
587
|
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
531
588
|
}
|
|
532
589
|
|
|
590
|
+
/**
|
|
591
|
+
* @alpha
|
|
592
|
+
*/
|
|
533
593
|
export declare const IFluidLoadable: keyof IProvideFluidLoadable;
|
|
534
594
|
|
|
535
595
|
/**
|
|
536
596
|
* A shared FluidObject has a URL from which it can be referenced
|
|
597
|
+
* @alpha
|
|
537
598
|
*/
|
|
538
599
|
export declare interface IFluidLoadable extends IProvideFluidLoadable {
|
|
539
600
|
handle: IFluidHandle;
|
|
@@ -547,6 +608,7 @@ export declare interface IFluidLoadable extends IProvideFluidLoadable {
|
|
|
547
608
|
*
|
|
548
609
|
* @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackage}
|
|
549
610
|
* to have code loading modules in same package.
|
|
611
|
+
* @internal
|
|
550
612
|
*/
|
|
551
613
|
export declare interface IFluidPackage {
|
|
552
614
|
/**
|
|
@@ -576,6 +638,7 @@ export declare interface IFluidPackage {
|
|
|
576
638
|
*
|
|
577
639
|
* @deprecated In favor of {@link @fluidframework/container-definitions#IFluidPackageEnvironment}
|
|
578
640
|
* to have code loading modules in same package.
|
|
641
|
+
* @internal
|
|
579
642
|
*/
|
|
580
643
|
export declare interface IFluidPackageEnvironment {
|
|
581
644
|
/**
|
|
@@ -600,18 +663,26 @@ export declare interface IFluidPackageEnvironment {
|
|
|
600
663
|
|
|
601
664
|
/**
|
|
602
665
|
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
666
|
+
* @alpha
|
|
603
667
|
*/
|
|
604
668
|
export declare const IFluidRouter: keyof IProvideFluidRouter;
|
|
605
669
|
|
|
606
670
|
/**
|
|
607
671
|
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
672
|
+
* @alpha
|
|
608
673
|
*/
|
|
609
674
|
export declare interface IFluidRouter extends IProvideFluidRouter {
|
|
610
675
|
request(request: IRequest): Promise<IResponse>;
|
|
611
676
|
}
|
|
612
677
|
|
|
678
|
+
/**
|
|
679
|
+
* @internal
|
|
680
|
+
*/
|
|
613
681
|
export declare const IFluidRunnable: keyof IProvideFluidRunnable;
|
|
614
682
|
|
|
683
|
+
/**
|
|
684
|
+
* @internal
|
|
685
|
+
*/
|
|
615
686
|
export declare interface IFluidRunnable {
|
|
616
687
|
run(...args: any[]): Promise<void>;
|
|
617
688
|
stop(reason?: string): void;
|
|
@@ -619,6 +690,7 @@ export declare interface IFluidRunnable {
|
|
|
619
690
|
|
|
620
691
|
/**
|
|
621
692
|
* Generic wrapper for an unrecognized/uncategorized error object
|
|
693
|
+
* @internal
|
|
622
694
|
*/
|
|
623
695
|
export declare interface IGenericError extends IErrorBase {
|
|
624
696
|
/**
|
|
@@ -630,6 +702,7 @@ export declare interface IGenericError extends IErrorBase {
|
|
|
630
702
|
|
|
631
703
|
/**
|
|
632
704
|
* An error object that supports exporting its properties to be logged to telemetry
|
|
705
|
+
* @internal
|
|
633
706
|
*/
|
|
634
707
|
export declare interface ILoggingError extends Error {
|
|
635
708
|
/**
|
|
@@ -641,19 +714,29 @@ export declare interface ILoggingError extends Error {
|
|
|
641
714
|
/**
|
|
642
715
|
* @deprecated in favor of {@link @fluidframework/container-definitions#IProvideFluidCodeDetailsComparer}
|
|
643
716
|
* to have code loading modules in same package.
|
|
717
|
+
* @internal
|
|
644
718
|
*/
|
|
645
719
|
export declare interface IProvideFluidCodeDetailsComparer {
|
|
646
720
|
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
647
721
|
}
|
|
648
722
|
|
|
723
|
+
/**
|
|
724
|
+
* @alpha
|
|
725
|
+
*/
|
|
649
726
|
export declare interface IProvideFluidHandle {
|
|
650
727
|
readonly IFluidHandle: IFluidHandle;
|
|
651
728
|
}
|
|
652
729
|
|
|
730
|
+
/**
|
|
731
|
+
* @alpha
|
|
732
|
+
*/
|
|
653
733
|
export declare interface IProvideFluidHandleContext {
|
|
654
734
|
readonly IFluidHandleContext: IFluidHandleContext;
|
|
655
735
|
}
|
|
656
736
|
|
|
737
|
+
/**
|
|
738
|
+
* @alpha
|
|
739
|
+
*/
|
|
657
740
|
export declare interface IProvideFluidLoadable {
|
|
658
741
|
readonly IFluidLoadable: IFluidLoadable;
|
|
659
742
|
}
|
|
@@ -661,24 +744,37 @@ export declare interface IProvideFluidLoadable {
|
|
|
661
744
|
/**
|
|
662
745
|
* Request routing
|
|
663
746
|
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
747
|
+
* @alpha
|
|
664
748
|
*/
|
|
665
749
|
export declare interface IProvideFluidRouter {
|
|
666
750
|
readonly IFluidRouter: IFluidRouter;
|
|
667
751
|
}
|
|
668
752
|
|
|
753
|
+
/**
|
|
754
|
+
* @internal
|
|
755
|
+
*/
|
|
669
756
|
export declare interface IProvideFluidRunnable {
|
|
670
757
|
readonly IFluidRunnable: IFluidRunnable;
|
|
671
758
|
}
|
|
672
759
|
|
|
760
|
+
/**
|
|
761
|
+
* @alpha
|
|
762
|
+
*/
|
|
673
763
|
export declare interface IRequest {
|
|
674
764
|
url: string;
|
|
675
765
|
headers?: IRequestHeader;
|
|
676
766
|
}
|
|
677
767
|
|
|
768
|
+
/**
|
|
769
|
+
* @alpha
|
|
770
|
+
*/
|
|
678
771
|
export declare interface IRequestHeader {
|
|
679
772
|
[index: string]: any;
|
|
680
773
|
}
|
|
681
774
|
|
|
775
|
+
/**
|
|
776
|
+
* @alpha
|
|
777
|
+
*/
|
|
682
778
|
export declare interface IResponse {
|
|
683
779
|
mimeType: string;
|
|
684
780
|
status: number;
|
|
@@ -692,6 +788,7 @@ export declare interface IResponse {
|
|
|
692
788
|
/**
|
|
693
789
|
* @deprecated in favor of {@link @fluidframework/container-definitions#isFluidCodeDetails}
|
|
694
790
|
* to have code loading modules in same package.
|
|
791
|
+
* @internal
|
|
695
792
|
*/
|
|
696
793
|
export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
|
|
697
794
|
|
|
@@ -702,6 +799,7 @@ export declare const isFluidCodeDetails: (details: unknown) => details is Readon
|
|
|
702
799
|
* to have code loading modules in same package.
|
|
703
800
|
*
|
|
704
801
|
* @param pkg - The package json data to check if it is a Fluid package.
|
|
802
|
+
* @internal
|
|
705
803
|
*/
|
|
706
804
|
export declare const isFluidPackage: (pkg: unknown) => pkg is Readonly<IFluidPackage>;
|
|
707
805
|
|
|
@@ -709,6 +807,7 @@ export declare const isFluidPackage: (pkg: unknown) => pkg is Readonly<IFluidPac
|
|
|
709
807
|
* @see {@link Tagged} for info on tagging
|
|
710
808
|
*
|
|
711
809
|
* @deprecated Use Tagged\<TelemetryBaseEventPropertyType\>
|
|
810
|
+
* @internal
|
|
712
811
|
*/
|
|
713
812
|
export declare interface ITaggedTelemetryPropertyType {
|
|
714
813
|
value: TelemetryEventPropertyType;
|
|
@@ -720,6 +819,7 @@ export declare interface ITaggedTelemetryPropertyType {
|
|
|
720
819
|
* Can contain any number of properties that get serialized as json payload.
|
|
721
820
|
* @param category - category of the event, like "error", "performance", "generic", etc.
|
|
722
821
|
* @param eventName - name of the event.
|
|
822
|
+
* @alpha
|
|
723
823
|
*/
|
|
724
824
|
export declare interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
725
825
|
category: string;
|
|
@@ -729,6 +829,7 @@ export declare interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
|
729
829
|
/**
|
|
730
830
|
* Interface to output telemetry events.
|
|
731
831
|
* Implemented by hosting app / loader
|
|
832
|
+
* @alpha
|
|
732
833
|
*/
|
|
733
834
|
export declare interface ITelemetryBaseLogger {
|
|
734
835
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
@@ -737,6 +838,7 @@ export declare interface ITelemetryBaseLogger {
|
|
|
737
838
|
|
|
738
839
|
/**
|
|
739
840
|
* JSON-serializable properties, which will be logged with telemetry.
|
|
841
|
+
* @alpha
|
|
740
842
|
*/
|
|
741
843
|
export declare type ITelemetryBaseProperties = ITelemetryProperties;
|
|
742
844
|
|
|
@@ -746,6 +848,7 @@ export declare type ITelemetryBaseProperties = ITelemetryProperties;
|
|
|
746
848
|
*
|
|
747
849
|
* @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \@fluidframework/telemetry-utils.
|
|
748
850
|
* No replacement intended for FluidFramework consumers.
|
|
851
|
+
* @alpha
|
|
749
852
|
*/
|
|
750
853
|
export declare interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
751
854
|
eventName: string;
|
|
@@ -757,6 +860,7 @@ export declare interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
|
757
860
|
*
|
|
758
861
|
* @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \@fluidframework/telemetry-utils.
|
|
759
862
|
* No replacement intended for FluidFramework consumers.
|
|
863
|
+
* @alpha
|
|
760
864
|
*/
|
|
761
865
|
export declare interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
762
866
|
eventName: string;
|
|
@@ -770,6 +874,7 @@ export declare interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
|
770
874
|
*
|
|
771
875
|
* @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \@fluidframework/telemetry-utils.
|
|
772
876
|
* No replacement intended for FluidFramework consumers.
|
|
877
|
+
* @alpha
|
|
773
878
|
*/
|
|
774
879
|
export declare interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
775
880
|
/**
|
|
@@ -807,6 +912,7 @@ export declare interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
807
912
|
*
|
|
808
913
|
* @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \@fluidframework/telemetry-utils.
|
|
809
914
|
* No replacement intended for FluidFramework consumers.
|
|
915
|
+
* @alpha
|
|
810
916
|
*/
|
|
811
917
|
export declare interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
|
|
812
918
|
duration?: number;
|
|
@@ -816,6 +922,7 @@ export declare interface ITelemetryPerformanceEvent extends ITelemetryGenericEve
|
|
|
816
922
|
* {@inheritDoc ITelemetryBaseProperties}
|
|
817
923
|
*
|
|
818
924
|
* @deprecated Renamed to {@link ITelemetryBaseProperties}
|
|
925
|
+
* @alpha
|
|
819
926
|
*/
|
|
820
927
|
export declare interface ITelemetryProperties {
|
|
821
928
|
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
|
|
@@ -823,6 +930,7 @@ export declare interface ITelemetryProperties {
|
|
|
823
930
|
|
|
824
931
|
/**
|
|
825
932
|
* Warning emitted when requests to storage are being throttled
|
|
933
|
+
* @internal
|
|
826
934
|
*/
|
|
827
935
|
export declare interface IThrottlingWarning extends IErrorBase {
|
|
828
936
|
/**
|
|
@@ -834,6 +942,7 @@ export declare interface IThrottlingWarning extends IErrorBase {
|
|
|
834
942
|
|
|
835
943
|
/**
|
|
836
944
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
945
|
+
* @internal
|
|
837
946
|
*/
|
|
838
947
|
export declare interface IUsageError extends IErrorBase {
|
|
839
948
|
/**
|
|
@@ -844,6 +953,7 @@ export declare interface IUsageError extends IErrorBase {
|
|
|
844
953
|
|
|
845
954
|
/**
|
|
846
955
|
* Specify levels of the logs.
|
|
956
|
+
* @alpha
|
|
847
957
|
*/
|
|
848
958
|
export declare const LogLevel: {
|
|
849
959
|
readonly verbose: 10;
|
|
@@ -853,11 +963,13 @@ export declare const LogLevel: {
|
|
|
853
963
|
|
|
854
964
|
/**
|
|
855
965
|
* Specify a level to the log to filter out logs based on the level.
|
|
966
|
+
* @alpha
|
|
856
967
|
*/
|
|
857
968
|
export declare type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
858
969
|
|
|
859
970
|
/**
|
|
860
971
|
* Does the type replacement by changing types of {@link IEventThisPlaceHolder} to `TThis`
|
|
972
|
+
* @alpha
|
|
861
973
|
*/
|
|
862
974
|
export declare type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
863
975
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -869,6 +981,7 @@ export declare type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L ext
|
|
|
869
981
|
*
|
|
870
982
|
* This indicates that the value should be organized or handled differently by loggers in various first or third
|
|
871
983
|
* party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.
|
|
984
|
+
* @alpha
|
|
872
985
|
*/
|
|
873
986
|
export declare interface Tagged<V, T extends string = string> {
|
|
874
987
|
value: V;
|
|
@@ -881,6 +994,7 @@ export declare interface Tagged<V, T extends string = string> {
|
|
|
881
994
|
* @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can
|
|
882
995
|
* easily add fields to objects that shouldn't be logged and not realize it's going to be logged.
|
|
883
996
|
* General best practice is to explicitly log the fields you care about from objects.
|
|
997
|
+
* @internal
|
|
884
998
|
*/
|
|
885
999
|
export declare type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
886
1000
|
|
|
@@ -888,6 +1002,7 @@ export declare type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
|
888
1002
|
* Examples of known categories, however category can be any string for extensibility.
|
|
889
1003
|
*
|
|
890
1004
|
* @deprecated Moved to \@fluidframework/telemetry-utils package
|
|
1005
|
+
* @alpha
|
|
891
1006
|
*/
|
|
892
1007
|
export declare type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
893
1008
|
|
|
@@ -895,12 +1010,14 @@ export declare type TelemetryEventCategory = "generic" | "error" | "performance"
|
|
|
895
1010
|
* {@inheritDoc TelemetryBaseEventPropertyType}
|
|
896
1011
|
*
|
|
897
1012
|
* @deprecated Renamed to {@link TelemetryBaseEventPropertyType}
|
|
1013
|
+
* @alpha
|
|
898
1014
|
*/
|
|
899
1015
|
export declare type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
900
1016
|
|
|
901
1017
|
/**
|
|
902
1018
|
* Transforms the event overload by replacing {@link IEventThisPlaceHolder} with `TThis` in the event listener
|
|
903
1019
|
* arguments and having the overload return `TTHis` as well
|
|
1020
|
+
* @alpha
|
|
904
1021
|
*/
|
|
905
1022
|
export declare type TransformedEvent<TThis, E, A extends any[]> = (event: E, listener: (...args: ReplaceIEventThisPlaceHolder<A, TThis>) => void) => TThis;
|
|
906
1023
|
|
package/lib/disposable.d.ts
CHANGED
package/lib/disposable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC7B"}
|
package/lib/disposable.js
CHANGED
package/lib/disposable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposable.js","sourceRoot":"","sources":["../src/disposable.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 * Base interface for objects that require lifetime management via explicit disposal.\n */\nexport interface IDisposable {\n\t/**\n\t * Whether or not the object has been disposed.\n\t * If true, the object should be considered invalid, and its other state should be disregarded.\n\t */\n\treadonly disposed: boolean;\n\n\t/**\n\t * Dispose of the object and its resources.\n\t * @param error - Optional error indicating the reason for the disposal, if the object was\n\t * disposed as the result of an error.\n\t */\n\tdispose(error?: Error): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"disposable.js","sourceRoot":"","sources":["../src/disposable.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 * Base interface for objects that require lifetime management via explicit disposal.\n * @alpha\n */\nexport interface IDisposable {\n\t/**\n\t * Whether or not the object has been disposed.\n\t * If true, the object should be considered invalid, and its other state should be disregarded.\n\t */\n\treadonly disposed: boolean;\n\n\t/**\n\t * Dispose of the object and its resources.\n\t * @param error - Optional error indicating the reason for the disposal, if the object was\n\t * disposed as the result of an error.\n\t */\n\tdispose(error?: Error): void;\n}\n"]}
|
package/lib/error.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { ITelemetryBaseProperties } from "./index";
|
|
6
6
|
/**
|
|
7
7
|
* Error types the Fluid Framework may report.
|
|
8
|
+
* @internal
|
|
8
9
|
*/
|
|
9
10
|
export declare const FluidErrorTypes: {
|
|
10
11
|
/**
|
|
@@ -28,6 +29,9 @@ export declare const FluidErrorTypes: {
|
|
|
28
29
|
*/
|
|
29
30
|
readonly usageError: "usageError";
|
|
30
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
31
35
|
export type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTypes];
|
|
32
36
|
/**
|
|
33
37
|
* Base interface for all errors and warnings emitted the container.
|
|
@@ -38,6 +42,8 @@ export type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTy
|
|
|
38
42
|
* those from container-definitions. Once fully migrated, this will be a base interface for all errors and
|
|
39
43
|
* warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.
|
|
40
44
|
* Runtime and others will follow soon.
|
|
45
|
+
*
|
|
46
|
+
* @alpha
|
|
41
47
|
*/
|
|
42
48
|
export interface IErrorBase extends Partial<Error> {
|
|
43
49
|
/**
|
|
@@ -75,6 +81,7 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
75
81
|
}
|
|
76
82
|
/**
|
|
77
83
|
* Generic wrapper for an unrecognized/uncategorized error object
|
|
84
|
+
* @internal
|
|
78
85
|
*/
|
|
79
86
|
export interface IGenericError extends IErrorBase {
|
|
80
87
|
/**
|
|
@@ -85,6 +92,7 @@ export interface IGenericError extends IErrorBase {
|
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
94
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
95
|
+
* @internal
|
|
88
96
|
*/
|
|
89
97
|
export interface IUsageError extends IErrorBase {
|
|
90
98
|
/**
|
|
@@ -94,6 +102,7 @@ export interface IUsageError extends IErrorBase {
|
|
|
94
102
|
}
|
|
95
103
|
/**
|
|
96
104
|
* Warning emitted when requests to storage are being throttled
|
|
105
|
+
* @internal
|
|
97
106
|
*/
|
|
98
107
|
export interface IThrottlingWarning extends IErrorBase {
|
|
99
108
|
/**
|
package/lib/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC;IACjD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,wBAAwB,CAAC;CACpD;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAChD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,YAAY,CAAC;IAIxD,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC9C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,UAAU,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACrD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,eAAe,CAAC;IAC3D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC"}
|
package/lib/error.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.FluidErrorTypes = void 0;
|
|
5
8
|
/**
|
|
6
9
|
* Error types the Fluid Framework may report.
|
|
10
|
+
* @internal
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
exports.FluidErrorTypes = {
|
|
9
13
|
/**
|
|
10
14
|
* Some error, most likely an exception caught by runtime and propagated to container as critical error
|
|
11
15
|
*/
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"./index\";\n\n/**\n * Error types the Fluid Framework may report.\n * @internal\n */\nexport const FluidErrorTypes = {\n\t/**\n\t * Some error, most likely an exception caught by runtime and propagated to container as critical error\n\t */\n\tgenericError: \"genericError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError: \"throttlingError\",\n\n\t/**\n\t * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n\t */\n\tdataCorruptionError: \"dataCorruptionError\",\n\n\t/**\n\t * Error encountered when processing an operation. May correlate with data corruption.\n\t */\n\tdataProcessingError: \"dataProcessingError\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t */\n\tusageError: \"usageError\",\n} as const;\n/**\n * @internal\n */\nexport type FluidErrorTypes = (typeof FluidErrorTypes)[keyof typeof FluidErrorTypes];\n\n/**\n * Base interface for all errors and warnings emitted the container.\n *\n * @remarks\n *\n * We are in the process of unifying error types across layers of the Framework. For now we have only migrated\n * those from container-definitions. Once fully migrated, this will be a base interface for all errors and\n * warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.\n * Runtime and others will follow soon.\n *\n * @alpha\n */\nexport interface IErrorBase extends Partial<Error> {\n\t/**\n\t * A type tag differentiating kinds of errors emitted by the container.\n\t *\n\t * @see See {@link FluidErrorTypes#genericError} for some common examples.\n\t * - container\n\t * - runtime\n\t * - drivers\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error.message}\n\t *\n\t * @remarks\n\t *\n\t * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n\t * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n\t * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name | Error.name}\n\t */\n\treadonly name?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * Returns all properties of this error object that are fit for logging.\n\t * Some may be tagged to indicate they contain some kind of sensitive data.\n\t */\n\tgetTelemetryProperties?(): ITelemetryBaseProperties;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n * @internal\n */\nexport interface IGenericError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.genericError;\n\n\t// TODO: Use `unknown` instead (API-Breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\terror?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * @internal\n */\nexport interface IUsageError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n * @internal\n */\nexport interface IThrottlingWarning extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n"]}
|
package/lib/events.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Base interface for event emitters.
|
|
7
|
+
* @alpha
|
|
7
8
|
*/
|
|
8
9
|
export interface IEvent {
|
|
9
10
|
/**
|
|
@@ -20,6 +21,7 @@ export interface IEvent {
|
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Base interface for error event emitters.
|
|
24
|
+
* @alpha
|
|
23
25
|
*/
|
|
24
26
|
export interface IErrorEvent extends IEvent {
|
|
25
27
|
/**
|
|
@@ -31,6 +33,7 @@ export interface IErrorEvent extends IEvent {
|
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Base interface for event providers.
|
|
36
|
+
* @alpha
|
|
34
37
|
*/
|
|
35
38
|
export interface IEventProvider<TEvent extends IEvent> {
|
|
36
39
|
/**
|
|
@@ -68,17 +71,19 @@ export interface IEventProvider<TEvent extends IEvent> {
|
|
|
68
71
|
* ```
|
|
69
72
|
*
|
|
70
73
|
* interface B will now extend interface A and its events
|
|
71
|
-
*
|
|
74
|
+
* @alpha
|
|
72
75
|
*/
|
|
73
76
|
export type ExtendEventProvider<TBaseEvent extends IEvent, TBase extends IEventProvider<TBaseEvent>, TEvent extends TBaseEvent> = Omit<Omit<Omit<TBase, "on">, "once">, "off"> & IEventProvider<TBaseEvent> & IEventProvider<TEvent>;
|
|
74
77
|
/**
|
|
75
78
|
* The placeholder type that should be used instead of `this` in events.
|
|
79
|
+
* @alpha
|
|
76
80
|
*/
|
|
77
81
|
export type IEventThisPlaceHolder = {
|
|
78
82
|
thisPlaceHolder: "thisPlaceHolder";
|
|
79
83
|
};
|
|
80
84
|
/**
|
|
81
85
|
* Does the type replacement by changing types of {@link IEventThisPlaceHolder} to `TThis`
|
|
86
|
+
* @alpha
|
|
82
87
|
*/
|
|
83
88
|
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
|
|
84
89
|
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
|
|
@@ -86,6 +91,7 @@ export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any
|
|
|
86
91
|
/**
|
|
87
92
|
* Transforms the event overload by replacing {@link IEventThisPlaceHolder} with `TThis` in the event listener
|
|
88
93
|
* arguments and having the overload return `TTHis` as well
|
|
94
|
+
* @alpha
|
|
89
95
|
*/
|
|
90
96
|
export type TransformedEvent<TThis, E, A extends any[]> = (event: E, listener: (...args: ReplaceIEventThisPlaceHolder<A, TThis>) => void) => TThis;
|
|
91
97
|
/**
|
|
@@ -96,6 +102,7 @@ export type TransformedEvent<TThis, E, A extends any[]> = (event: E, listener: (
|
|
|
96
102
|
* It currently supports the max of 15 event overloads which is more than we use anywhere.
|
|
97
103
|
* At more than 15 overloads we start to hit {@link https://github.com/microsoft/TypeScript/issues/37209 | TS2589}.
|
|
98
104
|
* If we need to move beyond 15 we should evaluate using a mapped type pattern like `{"event":(listenerArgs)=>void}`
|
|
105
|
+
* @alpha
|
|
99
106
|
*/
|
|
100
107
|
export type IEventTransformer<TThis, TEvent extends IEvent> = TEvent extends {
|
|
101
108
|
(event: infer E0, listener: (...args: infer A0) => void): any;
|