-
Notifications
You must be signed in to change notification settings - Fork 242
/
INotificationManager.ts
52 lines (45 loc) · 2.12 KB
/
INotificationManager.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
import { IPerfEvent } from "./IPerfEvent";
/**
* Class to manage sending notifications to all the listeners.
*/
export interface INotificationManager {
listeners: INotificationListener[];
/**
* Adds a notification listener.
* @param {INotificationListener} listener - The notification listener to be added.
*/
addNotificationListener(listener: INotificationListener): void;
/**
* Removes all instances of the listener.
* @param {INotificationListener} listener - AWTNotificationListener to remove.
*/
removeNotificationListener(listener: INotificationListener): void;
/**
* Notification for events sent.
* @param {ITelemetryItem[]} events - The array of events that have been sent.
*/
eventsSent(events: ITelemetryItem[]): void;
/**
* Notification for events being discarded.
* @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.
* @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
* constant should be used to check the different values.
*/
eventsDiscarded(events: ITelemetryItem[], reason: number): void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?(sendReason: number, isAsync: boolean): void;
/**
* [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
* the event can be displayed via the debug plugin extension.
* @param perfEvent
*/
perfEvent?(perfEvent: IPerfEvent): void;
}