-
Notifications
You must be signed in to change notification settings - Fork 32
/
nativescript-contacts.d.ts
135 lines (115 loc) · 3.39 KB
/
nativescript-contacts.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
declare module "nativescript-contacts" {
import imageSource = require("@nativescript/core/image-source");
export interface ContactField {
id?: string;
label: string;
value: string;
}
export interface AddressLocation {
street?: string;
city?: string;
state?: string;
postalCode?: string;
country?: string;
countryCode?: string;
formatted?: string;
}
export interface ContactAddressField {
id?: string;
label: string;
location: AddressLocation;
}
export interface ContactPhoneticName {
given?: string;
middle?: string;
family?: string;
}
export interface ContactName {
given?: string;
middle?: string;
family?: string;
prefix?: string;
suffix?: string;
displayname?: string;
phonetic?: ContactPhoneticName
}
export interface Organization {
name?: string;
jobTitle?: string;
department?: string;
// Android Specific
symbol?: string;
phonetic?: string;
location?: string;
type?: string;
}
export class Contact {
id: string;
name: ContactName;
nickname: string;
organization: Organization;
notes: string;
photo: imageSource.ImageSource
phoneNumbers: ContactField[];
emailAddresses: ContactField[];
postalAddresses: ContactAddressField[];
urls: ContactField[];
public save();
public delete();
// iOS Specific
public isUnified(): boolean;
}
export var KnownLabel: {
HOME: string;
MOBILE: string;
WORK: string;
FAX_WORK: string;
FAX_HOME: string;
PAGER: string;
HOMEPAGE: string;
MAIN: string;
OTHER: string;
// Android Specific
CALLBACK: string;
CAR: string;
COMPANY_MAIN: string;
ISDN: string;
OTHER_FAX: string;
RADIO: string;
TELEX: string;
TTY_TDD: string;
WORK_MOBILE: string;
WORK_PAGER: string;
ASSISTANT: string;
MMS: string;
FTP: string;
PROFILE: string;
BLOG: string;
}
export interface GetContactResult {
data: Contact;
response: string; // "selected" or "cancelled"
}
export interface GetFetchResult {
data: Contact[];
response: string; // "fetch"
}
export function getContact(): Promise<GetContactResult>;
export function getContactById(id: string, contactFields?: string[]): Promise<GetFetchResult>; // iOS Only
export function getContactsByName(searchPredicate: string, contactFields: string[]): Promise<GetFetchResult>;
export function getAllContacts(contactFields?: string[]): Promise<GetFetchResult>;
export function getContactsInGroup(group: Group): Promise<GetFetchResult>;
export class Group {
id: string;
name: string;
public save(useDefaultContainer: boolean);
public delete();
public addMember(contact: Contact);
public removeMember(contact: Contact);
}
export interface GetGroupResult {
data: Group[];
response: string; // "fetch"
}
export function getGroups(name?: string): Promise<GetGroupResult>;
}