forked from klimenkoDanil/react-native-contacts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
82 lines (75 loc) · 2.56 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
export function getAll(): Promise<Contact[]>;
export function getAllWithoutPhotos(): Promise<Contact[]>;
export function getContactById(contactId: string): Promise<Contact | null>;
export function getCount(): Promise<number>;
export function getPhotoForId(contactId: string): Promise<string>;
export function addContact(contact: Partial<Contact>): Promise<Contact>;
export function openContactForm(contact: Partial<Contact>): Promise<Contact>;
export function openExistingContact(contact: Contact): Promise<Contact>;
export function viewExistingContact(contact: { recordID: string }): Promise<Contact | void>
export function editExistingContact(contact: Contact): Promise<Contact>;
export function updateContact(contact: Partial<Contact> & {recordID: string}): Promise<void>;
export function deleteContact(contact: Contact): Promise<void>;
export function getContactsMatchingString(str: string): Promise<Contact[]>;
export function getContactsByPhoneNumber(phoneNumber: string): Promise<Contact[]>;
export function getContactsByEmailAddress(emailAddress: string): Promise<Contact[]>;
export function checkPermission(): Promise<'authorized' | 'denied' | 'undefined'>;
export function requestPermission(): Promise<'authorized' | 'denied' | 'undefined'>;
export function writePhotoToPath(contactId: string, file: string): Promise<boolean>;
export function iosEnableNotesUsage(enabled: boolean): void;
export interface EmailAddress {
label: string;
email: string;
}
export interface PhoneNumber {
label: string;
number: string;
}
export interface PostalAddress {
label: string;
formattedAddress: string;
street: string;
pobox: string;
neighborhood: string;
city: string;
region: string;
state: string;
postCode: string;
country: string;
}
export interface InstantMessageAddress {
username: string;
service: string;
}
export interface Birthday {
day: number;
month: number;
year: number;
}
export interface UrlAddress {
url: string;
label: string;
}
export interface Contact {
recordID: string;
backTitle: string;
company: string|null;
emailAddresses: EmailAddress[];
displayName: string;
familyName: string;
givenName: string;
middleName: string;
jobTitle: string;
phoneNumbers: PhoneNumber[];
hasThumbnail: boolean;
thumbnailPath: string;
isStarred: boolean;
postalAddresses: PostalAddress[];
prefix: string;
suffix: string;
department: string;
birthday: Birthday;
imAddresses: InstantMessageAddress[];
urlAddresses: UrlAddress[];
note: string;
}