-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContactsModule.d.ts
56 lines (47 loc) · 1.49 KB
/
ContactsModule.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
/** Native contacts module - implemented by ContactsModule.uno */
declare module "FuseJS/Contacts" {
/** Returns whether permissions are granted */
function hasPermission(): boolean
/** Requests permissions from the user */
function requestPermission(): Promise<boolean>
/** Adds a contact on your device */
function addContact(contact: Contact)
interface EmailAddress {
label: EmailLabel
email: string
}
interface PhoneNumber {
label: PhoneLabel
number: string
}
interface PostalAddress {
label: PostalAddressLabel
street?: string
city?: string
state?: string
postCode?: string
country?: string
}
interface InstantMessageAddress {
username?: string
service?: string
}
interface Contact {
company?: string
emailAddresses?: EmailAddress[]
familyName?: string
givenName?: string
middleName?: string
jobTitle?: string
phoneNumbers?: PhoneNumber[]
prefix?: string
suffix?: string
department?: string
imAddresses?: InstantMessageAddress[]
note?: string
postalAddresses?: PostalAddress[]
}
type EmailLabel = "home" | "work" | "mobile" | "other" | "personal"
type PhoneLabel = "home" | "work" | "mobile" | "main" | "work fax" | "home fax" | "pager" | "work_pager" | "work_mobile" | "other" | "cell"
type PostalAddressLabel = "home" | "work"
}