forked from dcvz/react-native-zendesk
/
index.ts
47 lines (34 loc) · 887 Bytes
/
index.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
import { NativeModules } from 'react-native'
const { RNZendesk } = NativeModules
interface Config {
appId: string
clientId: string
zendeskUrl: string
}
// MARK: - Initialization
export function initialize(config: Config) {
RNZendesk.initialize(config)
}
// MARK: - Indentification
export function identifyJWT(token: string) {
RNZendesk.identifyJWT(token)
}
export function identifyAnonymous(name?: string, email?: string) {
RNZendesk.identifyAnonymous(name, email)
}
// MARK: - UI Methods
interface HelpCenterOptions {
hideContactSupport?: boolean
}
export function showHelpCenter(options: HelpCenterOptions) {
RNZendesk.showHelpCenter(options)
}
interface NewTicketOptions {
tags?: string[]
}
export function showNewTicket(options: NewTicketOptions) {
RNZendesk.showNewTicket(options)
}
export function showTicketList() {
RNZendesk.showTicketList()
}