-
Notifications
You must be signed in to change notification settings - Fork 29.9k
/
index.d.ts
executable file
·104 lines (95 loc) · 3.54 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
declare namespace Intercom_ {
interface IntercomSettings {
// Messenger attributes
app_id?: string | undefined;
api_base?: string | undefined;
alignment?: string | undefined;
custom_launcher_selector?: string | undefined;
hide_default_launcher?: boolean | undefined;
horizontal_padding?: number | undefined;
session_duration?: number | undefined;
vertical_padding?: number | undefined;
action_color?: string | undefined;
background_color?: string | undefined;
// Data attributes
email?: string | undefined;
phone?: string | undefined;
created_at?: number | undefined;
name?: string | undefined;
user_id?: string | undefined;
user_hash?: string | undefined;
unsubscribed_from_emails?: boolean | undefined;
language_override?: string | undefined;
utm_campaign?: string | undefined;
utm_content?: string | undefined;
utm_medium?: string | undefined;
utm_source?: string | undefined;
utm_term?: string | undefined;
company?: IntercomCompany | undefined;
companies?: IntercomCompany[] | undefined;
avatar?: IntercomAvatar | undefined;
// Custom attributes
[custom_attribute: string]:
| IntercomCompany
| IntercomCompany[]
| IntercomAvatar
| IntercomCustomAttribute;
}
interface IntercomCommandSignature {
boot: (settings: IntercomSettings) => void;
shutdown: () => void;
update: (settings?: IntercomSettings) => void;
hide: () => void;
show: () => void;
showMessages: () => void;
showNewMessage: (prepopulateMessage?: string) => void;
onHide: (callback: () => void) => void;
onShow: (callback: () => void) => void;
onUnreadCountChange: (callback: (unreadCount: number) => void) => void;
onActivatorClick: (callback: () => void) => void;
trackEvent: (tag?: string, metadata?: any) => void;
getVisitorId: () => string;
startTour: (tourId: number) => void;
showArticle: (articleId: number) => void;
startSurvey: (surveyId: number) => void;
reattach_activator: () => void;
showSpace: (space: string) => void;
}
type IntercomCommand = keyof IntercomCommandSignature;
interface IntercomStatic {
<Command extends IntercomCommand>(
command: Command,
...params: Parameters<IntercomCommandSignature[Command]>
): ReturnType<IntercomCommandSignature[Command]>;
booted: boolean;
}
interface IntercomCompany {
name: string;
id?: string | number | undefined;
company_id?: string | number | undefined;
created_at?: number | undefined;
remote_created_at?: number | undefined;
plan?: string | undefined;
monthly_spend?: number | undefined;
user_count?: number | undefined;
size?: number | undefined;
website?: string | undefined;
industry?: string | undefined;
[custom_attribute: string]: IntercomCustomAttribute;
}
interface IntercomAvatar {
type: "avatar";
image_url: string;
}
type IntercomCustomAttribute =
| string
| number
| boolean
| null
| undefined;
}
declare var Intercom: Intercom_.IntercomStatic;
declare var intercomSettings: Intercom_.IntercomSettings | undefined;
interface Window {
intercomSettings?: Intercom_.IntercomSettings | undefined;
}