forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixpanel.d.ts
72 lines (43 loc) · 1.89 KB
/
mixpanel.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
// Type definitions for Mixpanel
// Project: https://mixpanel.com/
// https://github.com/mixpanel/mixpanel-js
// Definitions by: Knut Eirik Leira Hjelle <https://github.com/hjellek/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Mixpanel
{
people:Mixpanel.People;
init(token:string, config?:{[index:string]:any}, libraryName?:string):Mixpanel;
push(item:any[]):void;
disable(events?:string[]):void;
track(eventName:string, params?:{[index:string]:any}, callback?:() => void):void;
track_links(querySelector:string, eventName:string, params?:{[index:string]:any}):void;
track_forms(querySelector:string, eventName:string, params?:{[index:string]:any}):void;
register(params:{[index:string]:any}, days?:number):void;
register_once(params:{[index:string]:any}, defaultValue?:string, days?:number):void;
unregister(propertyName:string):void;
identify(id?:string):void;
get_distinct_id():string;
alias(alias:string, currentId?:string):void;
set_config(config:{[index:string]:any}):void;
get_config():{[index:string]:any};
get_property(propertyName:string):any;
}
declare namespace Mixpanel
{
interface People
{
set(keys:{[index:string]:any}, callback?:() => void):void;
set(key:string, value:any, callback?:() => void):void;
set_once(keys:{[index:string]:any}, callback?:() => void):void;
set_once(key:string, value:any, callback?:() => void):void;
increment(key:string):void;
increment(keys:{[index:string]:number}):void;
increment(key:string, value:number):void;
append(keys:{[index:string]:any}):void;
append(key:string, value:any):void;
track_charge(amount:number, params?:{[index:string]:any}, callback?:() => void):void;
clear_charges():void;
delete_user():void;
}
}
declare var mixpanel:Mixpanel;