forked from davide-scalzo/react-native-mixpanel
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
88 lines (80 loc) · 3.87 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
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
declare module 'react-native-mixpanel' {
export class MixpanelInstance {
constructor(apiToken?: string, optOutTrackingDefault?: boolean, trackCrashes?: boolean, automaticPushTracking?: boolean, launchOptions?: Object)
initialize(): Promise<void>
getDistinctId(): Promise<string>
getSuperProperty(propertyName: string): Promise<any>
track(event: string, properties?: Object): Promise<void>
flush(): Promise<void>
disableIpAddressGeolocalization(): Promise<void>
alias(alias: string, oldDistinctID?: string): Promise<void>
identify(userId: string): Promise<void>
timeEvent(event: string): Promise<void>
registerSuperProperties(properties: Object): Promise<void>
registerSuperPropertiesOnce(properties: Object): Promise<void>
initPushHandling(token: string): Promise<void>
set(properties: Object): Promise<void>
setOnce(properties: Object): Promise<void>
trackCharge(charge: number): Promise<void>
trackChargeWithProperties(charge: number, properties: Object): Promise<void>
increment(property: string, by: number): Promise<void>
union(name: string, properties: any[]): Promise<void>
append(name: string, properties: any[]): Promise<void>
clearSuperProperties(): Promise<void>
reset(flushOnReset?: boolean, autoGenerateNewUniqueId?: boolean): Promise<void>
showInAppMessageIfAvailable(): Promise<void>
optInTracking(): Promise<void>
optOutTracking(): Promise<void>
addGroup(groupKey: string, groupId: string): Promise<void>
setGroup(groupKey: string, groupId: string): Promise<void>
// android only
setPushRegistrationId(token: string): Promise<void>
clearPushRegistrationId(token?: string): Promise<void>
getPushRegistrationId(): Promise<string>
// iOS only
setAppSessionPropertiesIOS(properties: Object): Promise<void>
removePushDeviceToken(pushDeviceToken: string): Promise<void>
removeAllPushDeviceTokens(): Promise<void>
addPushDeviceToken(token: string): Promise<void>
}
interface MixpanelAPI {
sharedInstanceWithToken(apiToken: string, optOutTrackingDefault?: boolean, trackCrashes?: boolean, automaticPushTracking?: boolean, launchOptions?: Object): Promise<void>;
getDistinctId(callback: (id?: string) => void): void;
getSuperProperty(propertyName: string, callback: (value: any) => void): void;
track(event: string): void;
trackWithProperties(event: string, properties: Object): void;
flush(): void;
disableIpAddressGeolocalization(): void;
createAlias(alias: string, oldDistinctID?: string): void;
identify(userId: string): void;
timeEvent(event: string): void;
registerSuperProperties(properties: Object): void;
registerSuperPropertiesOnce(properties: Object): void;
initPushHandling(token: string): void;
set(properties: Object): void;
setOnce(properties: Object): void;
trackCharge(charge: number): void;
trackChargeWithProperties(charge: number, properties: Object): void;
increment(property: string, by: number): void;
union(name: string, properties: any[]): void;
append(name: string, properties: any[]): void;
clearSuperProperties(): void;
reset(flushOnReset?: boolean, autoGenerateNewUniqueId?: boolean): void;
showInAppMessageIfAvailable(): void;
optInTracking(): void;
optOutTracking(): void;
addGroup(groupKey: string, groupId: string): void;
setGroup(groupKey: string, groupId: string): void;
// android only
setPushRegistrationId(token: string): void;
clearPushRegistrationId(token?: string): void;
getPushRegistrationId(callback: (token?: string) => void): void;
// iOS only
setAppSessionPropertiesIOS(properties: Object): Promise<void>;
addPushDeviceToken(token: string): void;
removePushDeviceToken(pushDeviceToken: string): void;
removeAllPushDeviceTokens(): void;
}
const mixpanelApi: MixpanelAPI;
export default mixpanelApi;
}