-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathindex.d.ts
43 lines (38 loc) · 1.61 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
export interface RevenueProperties {
productId?: string;
quantity?: number;
price: number;
revenueType?: string;
receipt?: string;
receiptSignature?: string;
eventProperties?: {[key: string]: any},
}
export default class Amplitude {
constructor(apiKey: string, trackSessionEvents?: boolean, eventPrefix?: string);
// --------------------------------------------------
// Identify
// --------------------------------------------------
setEventUploadThreshold(threshold: number): void;
setUserId(userId: string | number | null): void;
getUserId(): Promise<string | number | null>;
setUserProperties(properties: Record<string, any>): void;
setOptOut(optOut: boolean): void;
clearUserProperties(): void;
getSessionId(): Promise<number>;
getDeviceId(): Promise<string>;
setDeviceId(deviceId: string | number | null): void;
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;
logRevenueV2(revenueProperties: RevenueProperties): void;
addToUserProperty(property: string, amount: number): void;
setUserPropertyOnce(property: string, value: string | number | null): void;
}