forked from betaacid/expo-analytics
-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.d.ts
36 lines (30 loc) · 1001 Bytes
/
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
export class Analytics {
constructor(trackingId: string, clientId: string, parameters?: MeasurementParamter, options?: Options);
hit(hitObject: PageHit | ScreenHit): Promise<void>;
event(event: Event): Promise<void>;
addCustomDimension(dimensionIndex: number, tag: string): void;
addCustomMetric(metricIndex: number, tag: number): void;
removeCustomDimension(dimensionIndex: number): void;
removeCustomMetric(metricIndex: number): void;
}
export interface MeasurementParamter {
uid?: string;
dr?: string;
cn?: string;
// Support any other parameters available here:
// https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
[key: string]: any;
}
export interface Options {
debug?: boolean;
userAgent?: string;
}
export class PageHit {
constructor(pageName: string);
}
export class ScreenHit {
constructor(screenName: string);
}
export class Event {
constructor(category: string, action: string, label?: string, value?: number);
}