forked from tinycreative/react-native-intercom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
170 lines (147 loc) · 4.08 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
interface IVisibility {
GONE: 'GONE';
VISIBLE: 'VISIBLE';
}
declare const Visibility: IVisibility;
type VisibilityType = IVisibility[keyof IVisibility];
interface INotifications {
UNREAD_COUNT: 'UNREAD_CHANGE_NOTIFICATION';
WINDOW_DID_HIDE: 'WINDOW_DID_HIDE';
}
declare const Notifications: INotifications;
/**
* sendTokenToIntercom
* @param token
*/
export function sendTokenToIntercom(token: any): Promise<void>;
/**
* registerUnidentifiedUser
* @returns {Promise<void>}
*/
export function registerUnidentifiedUser(): Promise<void>;
/**
* updateUser
* @param { email?: string,user_id?: string, name?: string, phone?: string, language_override?: string, signed_up_at?: number, unsubscribed_from_emails?: boolean, companies?: Array<{company_id?: string, name?: string, created_at?: number, monthly_spend?: number, plan?: string, custom_attributes?: { [key: string]: string } }>, custom_attributes?: { [key: string]: string } } attributes
* @returns {Promise<void>}
*/
export function updateUser(attributes: {
email?: string;
user_id?: string;
name?: string;
phone?: string;
language_override?: string;
signed_up_at?: number;
unsubscribed_from_emails?: boolean;
companies?: Array<{
company_id?: string;
name?: string;
created_at?: number;
monthly_spend?: number;
plan?: string;
custom_attributes?: { [key: string]: string };
}>;
custom_attributes?: { [key: string]: string };
}): Promise<void>;
/**
* registerIdentifiedUser
* @param {userId: string} options
* @returns {Promise<void>}
*/
export function registerIdentifiedUser(options: { userId: string }): Promise<void>;
/**
* logout
* @returns {Promise<void>}
*/
export function logout(): Promise<void>;
/**
* Log an event
* @param {string} eventName
* @param {[key: string]: string} metadata
*/
export function logEvent(eventName: string, metadata: { [key: string]: string }): Promise<void>;
/**
* handlePushMessage
* @returns {Promise<void>}
*/
export function handlePushMessage(): Promise<void>;
/**
* displayMessenger
* @returns {Promise<void>}
*/
export function displayMessenger(): Promise<void>;
/**
* hideMessenger
* @returns {Promise<void>}
*/
export function hideMessenger(): Promise<void>;
/**
* Show Message Composer
*/
export function displayMessageComposer(): Promise<void>;
/**
* displayMessageComposerWithInitialMessage
* @param {string} message
* @returns {Promise<void>}
*/
export function displayMessageComposerWithInitialMessage(message: string): Promise<void>;
/**
* displayConversationsList
* @returns {Promise<void>}
*/
export function displayConversationsList(): Promise<void>;
/**
* getUnreadConversationCount
* @returns {Promise<void>}
*/
export function getUnreadConversationCount(): Promise<number>;
/**
* displayHelpCenter
* @returns {Promise<void>}
*/
export function displayHelpCenter(): Promise<void>;
/**
* setLauncherVisibility
* @param {string} visibility
* @returns {Promise<void>}
*/
export function setLauncherVisibility(visibility: VisibilityType): Promise<void>;
/**
* setLauncherVisibility
* @param {string} visibility
* @returns {Promise<void>}
*/
export function setInAppMessageVisibility(visibility: VisibilityType): Promise<void>;
/**
* setupAPN
* @param {string} deviceToken
* @returns {Promise<void>}
*/
export function setupAPN(deviceToken: string): Promise<void>;
/**
* setUserHash
* @param {string} userHash
* @returns {Promise<void>}
*/
export function setUserHash(userHash: string): Promise<void>;
/**
* setBottomPadding
* @param {number} padding
* @returns {Promise<void>}
*/
export function setBottomPadding(padding: number): Promise<void>;
/**
* addEventListener
* @param {string} type
* @param {() => void} handler
*/
export function addEventListener(type: string, handler: (event?: any) => void): void;
/**
* removeEventListener
* @param {string} type
* @param {() => void} handler
*/
export function removeEventListener(type: string, handler: (event?: any) => void): void;
/**
* To enable iOS push notifications, simply call the following anywhere in your code:
*/
export function registerForPush(): Promise<void>;