/
FirebaseAnalyticsJS.types.d.ts
106 lines (106 loc) · 3.56 KB
/
FirebaseAnalyticsJS.types.d.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
export declare type FirebaseAnalyticsJSCodedEvent = {
[key: string]: any;
};
export interface FirebaseAnalyticsJSConfig {
/**
* **(Required)** Measurement-Id as found in the web Firebase-config.
* The format is G-XXXXXXXXXX.
*/
measurementId: string;
}
export interface FirebaseAnalyticsJSOptions {
/**
* **(Required)** Anonymously identifies a particular user, device, or browser instance.
* For the web, this is generally stored as a first-party cookie with a two-year expiration.
* For mobile apps, this is randomly generated for each particular instance of an application install.
* The value of this field should be a random UUID (version 4) as described in http://www.ietf.org/rfc/rfc4122.txt.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid
*/
clientId: string;
/**
* Max cache time in msec (default = 5000).
* Caches events fired within a certain time-frame and then
* sends them to the Google Measurement API in a single batch.
*/
maxCacheTime?: number;
/**
* Enables strict data format checks for logEvent and setUserProperties.
* When enabled, causes `logEvent` and `setUserProperties` to strictly check
* whether any event- names & values and user-properties conform to the
* native SDK requirements.
*/
strictNativeEmulation?: boolean;
/**
* Document title (e.g. "My Awesome Page").
* This is a browser specific field.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dt
*/
docTitle?: string;
/**
* Document location URL (e.g. "https://myawesomeapp.com").
* This is a browser specific field.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dl
*/
docLocation?: string;
/**
* Screen-resolution in the format "WxH" (e.g "2000x1440").
* This is a browser specific field.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#sr
*/
screenRes?: string;
/**
* Application name (e.g. "My Awesome App").
* This is a mobile app specific field.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#an
*/
appName?: string;
/**
* Application version (e.g. "1.2").
* This is a mobile app specific field.
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#av
*/
appVersion?: string;
/**
* User language (e.g. "en-us").
* https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ul
*/
userLanguage?: string;
/**
* Origin (default = "firebase").
*/
origin?: string;
/**
* Custom query arguments that are appended to the POST request that is send to the
* Google Measurement API v2.
*
* @example
* ```
* const analytics = new FirebaseAnalyticsJS(config, {
* appName: 'My Awesome App',
* customArg: {
* vp: '123x456', // Add viewport-size
* sd: '24-bits' // Add screen-colors
* }
* });
* ```
*/
customArgs?: {
[key: string]: any;
};
/**
* HTTP headers that are appended to the POST request.
*
* @example
* ```
* const analytics = new FirebaseAnalyticsJS(config, {
* appName: 'My Awesome App',
* headers: {
* 'user-agent': 'MyAwesomeHTTPClient/1.2.3'
* }
* });
* ```
*/
headers?: {
[key: string]: any;
};
}