forked from pagopa/io-react-native-zendesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
108 lines (82 loc) · 3.14 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
declare module 'io-react-native-zendesk' {
// function to display chat box
export function startChat(chatOptions: ChatOptions): void;
// normal init function when you want to use all of the sdks
export function init(initializationOptins: InitOptions): void;
// init function when you just want to use chat sdk
export function initChat(accountKey: string): void;
// function to set primary color code for the chat theme, pass hex code of the color here
export function setPrimaryColor(color: string): void;
// function to display help center UI
export function showHelpCenter(chatOptions: ChatOptions): void;
// function to add a ticket custom field
export function addTicketCustomField(key: string, value: string): void;
// function to append a new line to the ticket log
export function appendLog(log: string)
// add a new tag to the ticket
export function addTicketTag(tag: string)
// remove custom fields
export function resetCustomFields(): void;
// remove tags
export function resetTags(): void;
// remove log data
export function resetLog(): void;
// iOS only - close the current zendesk view (ticket creation, tickets list) if any
export function dismiss(): void;
// function to open a ticket
export function openTicket(): void;
// function to shows all the tickets of the user
export function showTickets(): void;
// function that return the number of tickets created by the user
export function hasOpenedTickets(): Promise<number>;
// function that return the number of unread messages by the user
export function getTotalNewResponses(): Promise<number>;
// function to set visitor info in chat
export function setVisitorInfo(visitorInfo: UserInfo): void;
// function to register notifications token with zendesk
export function setNotificationToken(token: string): void;
export function setUserIdentity(identity: JwtIdentity | AnonymousIdentity): void;
export function resetUserIdentity(): void;
interface ChatOptions extends UserInfo {
botName?: string
// boolean value if you want just chat sdk or want to use all the sdk like support, answer bot and chat
// true value means just chat sdk
chatOnly?: boolean
// hex code color to set on chat
color?: string
/* help center specific props only */
// sent in help center function only to show help center with/without chat
withChat?: boolean
// to enable/disable ticket creation in help center
disableTicketCreation?: boolean
}
interface InitOptions {
// chat key of zendesk account to init chat
key: string,
// appId of your zendesk account
appId: string,
// clientId of your zendesk account
clientId: string,
// support url of zendesk account
url: string,
// id of the log custom field
logId: string
}
interface UserInfo extends AnonymousIdentity{
// user's phone
phone?: number
// department to redirect the chat
department?: string
// tags for chat
tags?: Array<string>
}
interface JwtIdentity {
token: string
}
interface AnonymousIdentity {
// user's name
name?: string
// user's email
email?: string
}
}