forked from SudoPlz/react-native-amplitude-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
29 lines (25 loc) · 1.19 KB
/
index.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
export default class Amplitude {
constructor(apiKey: string, trackSessionEvents?: boolean, eventPrefix?: string);
// --------------------------------------------------
// Identify
// --------------------------------------------------
setUserId(userId: string | number | null): void;
setUserProperties(properties: Record<string, any>): void;
setOptOut(optOut: boolean): void;
clearUserProperties(): void;
setDeviceId(id: string): void;
getDeviceId(): Promise<string>;
regenerateDeviceId(): void;
setLogEventPrefix(prefix: string): void;
// --------------------------------------------------
// Track
// --------------------------------------------------
logEvent(name: string, properties?: Record<string, any>): void;
logEventWithTimestamp(name: string, timestamp: number, properties?: Record<string, any>): void;
// --------------------------------------------------
// Revenue
// --------------------------------------------------
logRevenue(productIdentifier: string, quantity: number, amount: number, receipt?: string): void;
addToUserProperty(property: string, amount: number): void;
setUserPropertyOnce(property: string, value: string | number | null): void;
}