-
-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathanalytics.d.ts
More file actions
52 lines (46 loc) · 1.43 KB
/
analytics.d.ts
File metadata and controls
52 lines (46 loc) · 1.43 KB
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
/**
* Describes the information that will be passed to analytics for tracking.
*/
interface ITrackingInformation {
/**
* The type of the data sent to analytics service - initalization data, feature to be tracked, error to be tracked, etc.
*/
type: TrackingTypes
}
/**
* Describes information for exception that should be tracked.
*/
interface IExceptionsTrackingInformation extends ITrackingInformation {
/**
* The exception that should be tracked.
*/
exception: Error;
/**
* The message of the error that should be tracked.
*/
message: string;
}
/**
* Describes the broker used to pass information to all analytics providers.
*/
interface IAnalyticsBroker {
/**
* Sends the specified tracking information to all providers.
* @param {ITrackingInformation} trackInfo The information that should be passed to all providers.
* @returns {Promise<void>}
*/
sendDataForTracking(trackInfo: ITrackingInformation): Promise<void>;
}
interface IGoogleAnalyticsTrackingInformation extends IGoogleAnalyticsData, ITrackingInformation { }
interface IPreviewAppTrackingInformation extends IPreviewAppGoogleAnalyticsData, ITrackingInformation { }
/**
* Describes methods required to track in Google Analytics.
*/
interface IGoogleAnalyticsProvider {
/**
* Tracks hit types.
* @param {IGoogleAnalyticsData} data Data that has to be tracked.
* @returns {Promise<void>}
*/
trackHit(data: IGoogleAnalyticsData): Promise<void>;
}