1/* 2 * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit ContactsKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import type Context from './application/BaseContext'; 23 24/** 25 * Contains variety of system contact, provides functions for adding, updating and deleting these system contact 26 * and provides methods for querying the information of contact. 27 * 28 * @namespace contact 29 * @syscap SystemCapability.Applications.ContactsData 30 * @since 7 31 */ 32/** 33 * Contains variety of system contact, provides functions for adding, updating and deleting these system contact 34 * and provides methods for querying the information of contact. 35 * 36 * @namespace contact 37 * @syscap SystemCapability.Applications.ContactsData 38 * @atomicservice 39 * @since 11 40 */ 41declare namespace contact { 42 /** 43 * Creates a contact. 44 * 45 * @permission ohos.permission.WRITE_CONTACTS 46 * @param { Contact } contact - Indicates the contact information. 47 * @param { AsyncCallback<number> } callback - Returns the contact ID (which can be obtained 48 * by {@link Contact#getId()}) if the creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the 49 * creation fails. 50 * @syscap SystemCapability.Applications.ContactsData 51 * @since 7 52 * @deprecated since 10 53 * @useinstead contact.addContact#addContact 54 */ 55 function addContact(contact: Contact, callback: AsyncCallback<number>): void; 56 57 /** 58 * Creates a contact. 59 * 60 * @permission ohos.permission.WRITE_CONTACTS 61 * @param { Context } context - Indicates the context of application or capability. 62 * @param { Contact } contact - Indicates the contact information. 63 * @param { AsyncCallback<number> } callback - Returns the contact ID (which can be obtained 64 * by {@link Contact#getId()}) if the creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the 65 * creation fails. 66 * @throws { BusinessError } 201 - Permission denied. 67 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 68 * @syscap SystemCapability.Applications.ContactsData 69 * @since 10 70 */ 71 /** 72 * Creates a contact. 73 * 74 * @permission ohos.permission.WRITE_CONTACTS 75 * @param { Context } context - Indicates the context of application or capability. 76 * @param { Contact } contact - Indicates the contact information. 77 * @param { AsyncCallback<number> } callback - Returns the contact ID (which can be obtained 78 * by {@link Contact#getId()}) if the creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the 79 * creation fails. 80 * @throws { BusinessError } 201 - Permission denied. 81 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 82 * @syscap SystemCapability.Applications.ContactsData 83 * @atomicservice 84 * @since 12 85 */ 86 function addContact(context: Context, contact: Contact, callback: AsyncCallback<number>): void; 87 88 /** 89 * Creates a contact. 90 * 91 * @permission ohos.permission.WRITE_CONTACTS 92 * @param { Contact } contact - Indicates the contact information. 93 * @returns { Promise<number> } Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the 94 * creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. 95 * @syscap SystemCapability.Applications.ContactsData 96 * @since 7 97 * @deprecated since 10 98 * @useinstead contact.addContact#addContact 99 */ 100 function addContact(contact: Contact): Promise<number>; 101 102 /** 103 * Creates a contact. 104 * 105 * @permission ohos.permission.WRITE_CONTACTS 106 * @param { Context } context - Indicates the context of application or capability. 107 * @param { Contact } contact - Indicates the contact information. 108 * @returns { Promise<number> } Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the 109 * creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. 110 * @throws { BusinessError } 201 - Permission denied. 111 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 112 * @syscap SystemCapability.Applications.ContactsData 113 * @since 10 114 */ 115 /** 116 * Creates a contact. 117 * 118 * @permission ohos.permission.WRITE_CONTACTS 119 * @param { Context } context - Indicates the context of application or capability. 120 * @param { Contact } contact - Indicates the contact information. 121 * @returns { Promise<number> } Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the 122 * creation is successful. returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. 123 * @throws { BusinessError } 201 - Permission denied. 124 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 125 * @syscap SystemCapability.Applications.ContactsData 126 * @atomicservice 127 * @since 12 128 */ 129 function addContact(context: Context, contact: Contact): Promise<number>; 130 131 /** 132 * Select contact. 133 * 134 * @permission ohos.permission.READ_CONTACTS 135 * @param { AsyncCallback<Array<Contact>> } callback - Indicates the callback for getting the result of the call. 136 * Returns the contact list which user select; returns empty contact list if user not select. 137 * @syscap SystemCapability.Applications.Contacts 138 * @since 7 139 * @deprecated since 10 140 * @useinstead contact.selectContact#selectContacts 141 */ 142 function selectContact(callback: AsyncCallback<Array<Contact>>): void; 143 144 /** 145 * Select contact. 146 * 147 * @param { AsyncCallback<Array<Contact>> } callback - Indicates the callback for getting the result of the call. 148 * Returns the contact list which user select; returns empty contact list if user not select. 149 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 150 * @syscap SystemCapability.Applications.Contacts 151 * @since 10 152 */ 153 /** 154 * Select contact. 155 * 156 * @param { AsyncCallback<Array<Contact>> } callback - Indicates the callback for getting the result of the call. 157 * Returns the contact list which user select; returns empty contact list if user not select. 158 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 159 * @syscap SystemCapability.Applications.Contacts 160 * @atomicservice 161 * @since 11 162 */ 163 function selectContacts(callback: AsyncCallback<Array<Contact>>): void; 164 165 /** 166 * Select contact. 167 * 168 * @permission ohos.permission.READ_CONTACTS 169 * @returns { Promise<Array<Contact>> } Returns the contact list which user select; 170 * returns empty contact list if user not select. 171 * @syscap SystemCapability.Applications.Contacts 172 * @since 7 173 * @deprecated since 10 174 * @useinstead contact.selectContact#selectContacts 175 */ 176 function selectContact(): Promise<Array<Contact>>; 177 178 /** 179 * Select contact. 180 * 181 * @returns { Promise<Array<Contact>> } Returns the contact list which user select; 182 * returns empty contact list if user not select. 183 * @syscap SystemCapability.Applications.Contacts 184 * @since 10 185 */ 186 /** 187 * Select contact. 188 * 189 * @returns { Promise<Array<Contact>> } Returns the contact list which user select; 190 * returns empty contact list if user not select. 191 * @syscap SystemCapability.Applications.Contacts 192 * @atomicservice 193 * @since 11 194 */ 195 function selectContacts(): Promise<Array<Contact>>; 196 197 /** 198 * Select contact with option. 199 * 200 * @param { ContactSelectionOptions } options - Indicates the Single-select or multiple-select. 201 * @param { AsyncCallback<Array<Contact>> } callback - Indicates the callback for getting the result of the call. 202 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 203 * @syscap SystemCapability.Applications.Contacts 204 * @since 10 205 */ 206 /** 207 * Select contact with option. 208 * 209 * @param { ContactSelectionOptions } options - Indicates the Single-select or multiple-select. 210 * @param { AsyncCallback<Array<Contact>> } callback - Indicates the callback for getting the result of the call. 211 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 212 * @syscap SystemCapability.Applications.Contacts 213 * @atomicservice 214 * @since 11 215 */ 216 function selectContacts(options: ContactSelectionOptions, callback: AsyncCallback<Array<Contact>>): void; 217 218 /** 219 * Select contact with option. 220 * 221 * @param { ContactSelectionOptions } options - Indicates the Single-select or multiple-select. 222 * @returns { Promise<Array<Contact>> } Returns the contact list which user select; 223 * returns empty contact list if user not select. 224 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 225 * @syscap SystemCapability.Applications.Contacts 226 * @since 10 227 */ 228 /** 229 * Select contact with option. 230 * 231 * @param { ContactSelectionOptions } options - Indicates the Single-select or multiple-select. 232 * @returns { Promise<Array<Contact>> } Returns the contact list which user select; 233 * returns empty contact list if user not select. 234 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 235 * @syscap SystemCapability.Applications.Contacts 236 * @atomicservice 237 * @since 11 238 */ 239 function selectContacts(options: ContactSelectionOptions): Promise<Array<Contact>>; 240 241 /** 242 * Deletes a specified contact. 243 * 244 * @permission ohos.permission.WRITE_CONTACTS 245 * @param { string } key - Indicates the unique query key of a contact to delete. 246 * @param { AsyncCallback<void> } callback - Return the callback function. 247 * @syscap SystemCapability.Applications.ContactsData 248 * @since 7 249 * @deprecated since 10 250 * @useinstead contact.deleteContact#deleteContact 251 */ 252 function deleteContact(key: string, callback: AsyncCallback<void>): void; 253 254 /** 255 * Deletes a specified contact. 256 * 257 * @permission ohos.permission.WRITE_CONTACTS 258 * @param { Context } context - Indicates the context of application or capability. 259 * @param { string } key - Indicates the unique query key of a contact to delete. 260 * @param { AsyncCallback<void> } callback - Return the callback function. 261 * @throws { BusinessError } 201 - Permission denied. 262 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 263 * @syscap SystemCapability.Applications.ContactsData 264 * @since 10 265 */ 266 function deleteContact(context: Context, key: string, callback: AsyncCallback<void>): void; 267 268 /** 269 * Deletes a specified contact. 270 * 271 * @permission ohos.permission.WRITE_CONTACTS 272 * @param { string } key - Indicates the unique query key of a contact to delete. 273 * @returns { Promise<void> } The promise returned by the function. 274 * @syscap SystemCapability.Applications.ContactsData 275 * @since 7 276 * @deprecated since 10 277 * @useinstead contact.deleteContact#deleteContact 278 */ 279 function deleteContact(key: string): Promise<void>; 280 281 /** 282 * Deletes a specified contact. 283 * 284 * @permission ohos.permission.WRITE_CONTACTS 285 * @param { Context } context - Indicates the context of application or capability. 286 * @param { string } key - Indicates the unique query key of a contact to delete. 287 * @returns { Promise<void> } The promise returned by the function. 288 * @throws { BusinessError } 201 - Permission denied. 289 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 290 * @syscap SystemCapability.Applications.ContactsData 291 * @since 10 292 */ 293 function deleteContact(context: Context, key: string): Promise<void>; 294 295 /** 296 * Queries a specified contact of specified attributes. 297 * 298 * @permission ohos.permission.READ_CONTACTS 299 * @param { string } key - Indicates the unique query key of a contact. 300 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 301 * @syscap SystemCapability.Applications.ContactsData 302 * @since 7 303 * @deprecated since 10 304 * @useinstead contact.queryContact#queryContact 305 */ 306 function queryContact(key: string, callback: AsyncCallback<Contact>): void; 307 308 /** 309 * Queries a specified contact of specified attributes. 310 * 311 * @permission ohos.permission.READ_CONTACTS 312 * @param { Context } context - Indicates the context of application or capability. 313 * @param { string } key - Indicates the unique query key of a contact. 314 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 315 * @throws { BusinessError } 201 - Permission denied. 316 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 317 * @syscap SystemCapability.Applications.ContactsData 318 * @since 10 319 */ 320 function queryContact(context: Context, key: string, callback: AsyncCallback<Contact>): void; 321 322 /** 323 * Queries a specified contact of specified attributes. 324 * 325 * @permission ohos.permission.READ_CONTACTS 326 * @param { string } key - Indicates the unique query key of a contact. 327 * @param { Holder } holder - Indicates the contact holder. 328 * If this parameter is null, the default holder is used for matching. 329 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 330 * @syscap SystemCapability.Applications.ContactsData 331 * @since 7 332 * @deprecated since 10 333 * @useinstead contact.queryContact#queryContact 334 */ 335 function queryContact(key: string, holder: Holder, callback: AsyncCallback<Contact>): void; 336 337 /** 338 * Queries a specified contact of specified attributes. 339 * 340 * @permission ohos.permission.READ_CONTACTS 341 * @param { Context } context - Indicates the context of application or capability. 342 * @param { string } key - Indicates the unique query key of a contact. 343 * @param { Holder } holder - Indicates the contact holder. 344 * If this parameter is null, the default holder is used for matching. 345 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 346 * @throws { BusinessError } 201 - Permission denied. 347 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 348 * @syscap SystemCapability.Applications.ContactsData 349 * @since 10 350 */ 351 function queryContact(context: Context, key: string, holder: Holder, callback: AsyncCallback<Contact>): void; 352 353 /** 354 * Queries a specified contact of specified attributes. 355 * 356 * @permission ohos.permission.READ_CONTACTS 357 * @param { string } key - Indicates the unique query key of a contact. 358 * @param { ContactAttributes } attrs - Indicates the contact attributes. 359 * If this parameter is null, all attributes are used for matching. 360 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 361 * @syscap SystemCapability.Applications.ContactsData 362 * @since 7 363 * @deprecated since 10 364 * @useinstead contact.queryContact#queryContact 365 */ 366 function queryContact(key: string, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 367 368 /** 369 * Queries a specified contact of specified attributes. 370 * 371 * @permission ohos.permission.READ_CONTACTS 372 * @param { Context } context - Indicates the context of application or capability. 373 * @param { string } key - Indicates the unique query key of a contact. 374 * @param { ContactAttributes } attrs - Indicates the contact attributes. 375 * If this parameter is null, all attributes are used for matching. 376 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 377 * @throws { BusinessError } 201 - Permission denied. 378 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 379 * @syscap SystemCapability.Applications.ContactsData 380 * @since 10 381 */ 382 function queryContact(context: Context, key: string, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 383 384 /** 385 * Queries a specified contact of specified attributes. 386 * 387 * @permission ohos.permission.READ_CONTACTS 388 * @param { string } key - Indicates the unique query key of a contact. 389 * @param { Holder } holder - Indicates the contact holder. 390 * @param { ContactAttributes } attrs - Indicates the contact attributes. 391 * If this parameter is null, all attributes are used for matching. 392 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 393 * @syscap SystemCapability.Applications.ContactsData 394 * @since 7 395 * @deprecated since 10 396 * @useinstead contact.queryContact#queryContact 397 */ 398 function queryContact(key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 399 400 /** 401 * Queries a specified contact of specified attributes. 402 * 403 * @permission ohos.permission.READ_CONTACTS 404 * @param { Context } context - Indicates the context of application or capability. 405 * @param { string } key - Indicates the unique query key of a contact. 406 * @param { Holder } holder - Indicates the contact holder. 407 * @param { ContactAttributes } attrs - Indicates the contact attributes. 408 * If this parameter is null, all attributes are used for matching. 409 * @param { AsyncCallback<Contact> } callback - Returns the specified contact. 410 * @throws { BusinessError } 201 - Permission denied. 411 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 412 * @syscap SystemCapability.Applications.ContactsData 413 * @since 10 414 */ 415 function queryContact(context: Context, key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 416 417 /** 418 * Queries a specified contact of specified attributes. 419 * 420 * @permission ohos.permission.READ_CONTACTS 421 * @param { string } key - Indicates the unique query key of a contact. 422 * @param { Holder } holder - Indicates the contact holder. 423 * @param { ContactAttributes } attrs - Indicates the contact attributes. 424 * If this parameter is null, all attributes are used for matching. 425 * @returns { Promise<Contact> } Returns the specified contact. 426 * @syscap SystemCapability.Applications.ContactsData 427 * @since 7 428 * @deprecated since 10 429 * @useinstead contact.queryContact#queryContact 430 */ 431 function queryContact(key: string, holder?: Holder, attrs?: ContactAttributes): Promise<Contact>; 432 433 /** 434 * Queries a specified contact of specified attributes. 435 * 436 * @permission ohos.permission.READ_CONTACTS 437 * @param { Context } context - Indicates the context of application or capability. 438 * @param { string } key - Indicates the unique query key of a contact. 439 * @param { Holder } holder - Indicates the contact holder. 440 * @param { ContactAttributes } attrs - Indicates the contact attributes. 441 * If this parameter is null, all attributes are used for matching. 442 * @returns { Promise<Contact> } Returns the specified contact. 443 * @throws { BusinessError } 201 - Permission denied. 444 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 445 * @syscap SystemCapability.Applications.ContactsData 446 * @since 10 447 */ 448 function queryContact(context: Context, key: string, holder?: Holder, attrs?: ContactAttributes): Promise<Contact>; 449 450 /** 451 * Queries contacts with query conditions. 452 * 453 * @permission ohos.permission.READ_CONTACTS 454 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 455 * @syscap SystemCapability.Applications.ContactsData 456 * @since 7 457 * @deprecated since 10 458 * @useinstead contact.queryContacts#queryContacts 459 */ 460 function queryContacts(callback: AsyncCallback<Array<Contact>>): void; 461 462 /** 463 * Queries contacts with query conditions. 464 * 465 * @permission ohos.permission.READ_CONTACTS 466 * @param { Context } context - Indicates the context of application or capability. 467 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 468 * @throws { BusinessError } 201 - Permission denied. 469 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 470 * @syscap SystemCapability.Applications.ContactsData 471 * @since 10 472 */ 473 function queryContacts(context: Context, callback: AsyncCallback<Array<Contact>>): void; 474 475 /** 476 * Queries contacts with query conditions. 477 * 478 * @permission ohos.permission.READ_CONTACTS 479 * @param { Holder } holder - Indicates the contact holder. 480 * If this parameter is null, the default holder is used for matching. 481 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 482 * @syscap SystemCapability.Applications.ContactsData 483 * @since 7 484 * @deprecated since 10 485 * @useinstead contact.queryContacts#queryContacts 486 */ 487 function queryContacts(holder: Holder, callback: AsyncCallback<Array<Contact>>): void; 488 489 /** 490 * Queries contacts with query conditions. 491 * 492 * @permission ohos.permission.READ_CONTACTS 493 * @param { Context } context - Indicates the context of application or capability. 494 * @param { Holder } holder - Indicates the contact holder. 495 * If this parameter is null, the default holder is used for matching. 496 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 497 * @throws { BusinessError } 201 - Permission denied. 498 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 499 * @syscap SystemCapability.Applications.ContactsData 500 * @since 10 501 */ 502 function queryContacts(context: Context, holder: Holder, callback: AsyncCallback<Array<Contact>>): void; 503 504 /** 505 * Queries contacts with query conditions. 506 * 507 * @permission ohos.permission.READ_CONTACTS 508 * @param { ContactAttributes } attrs - Indicates the contact attributes. 509 * If this parameter is null, all attributes are used for matching. 510 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 511 * @syscap SystemCapability.Applications.ContactsData 512 * @since 7 513 * @deprecated since 10 514 * @useinstead contact.queryContacts#queryContacts 515 */ 516 function queryContacts(attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 517 518 /** 519 * Queries contacts with query conditions. 520 * 521 * @permission ohos.permission.READ_CONTACTS 522 * @param { Context } context - Indicates the context of application or capability. 523 * @param { ContactAttributes } attrs - Indicates the contact attributes. 524 * If this parameter is null, all attributes are used for matching. 525 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 526 * @throws { BusinessError } 201 - Permission denied. 527 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 528 * @syscap SystemCapability.Applications.ContactsData 529 * @since 10 530 */ 531 function queryContacts(context: Context, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 532 533 /** 534 * Queries contacts with query conditions. 535 * 536 * @permission ohos.permission.READ_CONTACTS 537 * @param { Holder } holder - Indicates the contact holder. 538 * If this parameter is null, the default holder is used for matching. 539 * @param { ContactAttributes } attrs - Indicates the contact attributes. 540 * If this parameter is null, all attributes are used for matching. 541 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 542 * @syscap SystemCapability.Applications.ContactsData 543 * @since 7 544 * @deprecated since 10 545 * @useinstead contact.queryContacts#queryContacts 546 */ 547 function queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 548 549 /** 550 * Queries contacts with query conditions. 551 * 552 * @permission ohos.permission.READ_CONTACTS 553 * @param { Context } context - Indicates the context of application or capability. 554 * @param { Holder } holder - Indicates the contact holder. 555 * If this parameter is null, the default holder is used for matching. 556 * @param { ContactAttributes } attrs - Indicates the contact attributes. 557 * If this parameter is null, all attributes are used for matching. 558 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 559 * @throws { BusinessError } 201 - Permission denied. 560 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 561 * @syscap SystemCapability.Applications.ContactsData 562 * @since 10 563 */ 564 function queryContacts(context: Context, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 565 566 /** 567 * Queries contacts with query conditions. 568 * 569 * @permission ohos.permission.READ_CONTACTS 570 * @param { Holder } holder - Indicates the contact holder. 571 * If this parameter is null, the default holder is used for matching. 572 * @param { ContactAttributes } attrs - Indicates the contact attributes. 573 * If this parameter is null, all attributes are used for matching. 574 * @returns { Promise<Array<Contact>> } Returns the {@code Contact} list object. 575 * @syscap SystemCapability.Applications.ContactsData 576 * @since 7 577 * @deprecated since 10 578 * @useinstead contact.queryContacts#queryContacts 579 */ 580 function queryContacts(holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 581 582 /** 583 * Queries contacts with query conditions. 584 * 585 * @permission ohos.permission.READ_CONTACTS 586 * @param { Context } context - Indicates the context of application or capability. 587 * @param { Holder } holder - Indicates the contact holder. 588 * If this parameter is null, the default holder is used for matching. 589 * @param { ContactAttributes } attrs - Indicates the contact attributes. 590 * If this parameter is null, all attributes are used for matching. 591 * @returns { Promise<Array<Contact>> } Returns the {@code Contact} list object. 592 * @throws { BusinessError } 201 - Permission denied. 593 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 594 * @syscap SystemCapability.Applications.ContactsData 595 * @since 10 596 */ 597 function queryContacts(context: Context, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 598 599 /** 600 * Queries contacts by a specified email address. 601 * 602 * @permission ohos.permission.READ_CONTACTS 603 * @param { string } email - Indicates the email address. 604 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 605 * @syscap SystemCapability.Applications.ContactsData 606 * @since 7 607 * @deprecated since 10 608 * @useinstead contact.queryContactsByEmail#queryContactsByEmail 609 */ 610 function queryContactsByEmail(email: string, callback: AsyncCallback<Array<Contact>>): void; 611 612 /** 613 * Queries contacts by a specified email address. 614 * 615 * @permission ohos.permission.READ_CONTACTS 616 * @param { Context } context - Indicates the context of application or capability. 617 * @param { string } email - Indicates the email address. 618 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 619 * @throws { BusinessError } 201 - Permission denied. 620 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 621 * @syscap SystemCapability.Applications.ContactsData 622 * @since 10 623 */ 624 function queryContactsByEmail(context: Context, email: string, callback: AsyncCallback<Array<Contact>>): void; 625 626 /** 627 * Queries contacts by a specified email address and contact holder. 628 * 629 * @permission ohos.permission.READ_CONTACTS 630 * @param { string } email - Indicates the email address. 631 * @param { Holder } holder - Indicates the contact holder. 632 * If this parameter is null, the default holder is used for matching. 633 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 634 * @syscap SystemCapability.Applications.ContactsData 635 * @since 7 636 * @deprecated since 10 637 * @useinstead contact.queryContactsByEmail#queryContactsByEmail 638 */ 639 function queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback<Array<Contact>>): void; 640 641 /** 642 * Queries contacts by a specified email address and contact holder. 643 * 644 * @permission ohos.permission.READ_CONTACTS 645 * @param { Context } context - Indicates the context of application or capability. 646 * @param { string } email - Indicates the email address. 647 * @param { Holder } holder - Indicates the contact holder. 648 * If this parameter is null, the default holder is used for matching. 649 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 650 * @throws { BusinessError } 201 - Permission denied. 651 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 652 * @syscap SystemCapability.Applications.ContactsData 653 * @since 10 654 */ 655 function queryContactsByEmail(context: Context, email: string, holder: Holder, 656 callback: AsyncCallback<Array<Contact>>): void; 657 658 /** 659 * Queries contacts by a specified email address and contact attributes. 660 * 661 * @permission ohos.permission.READ_CONTACTS 662 * @param { string } email - Indicates the email address. 663 * @param { ContactAttributes } attrs - Indicates the contact attributes. 664 * If this parameter is null, all attributes are used for matching. 665 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 666 * @syscap SystemCapability.Applications.ContactsData 667 * @since 7 668 * @deprecated since 10 669 * @useinstead contact.queryContactsByEmail#queryContactsByEmail 670 */ 671 function queryContactsByEmail(email: string, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 672 673 /** 674 * Queries contacts by a specified email address and contact attributes. 675 * 676 * @permission ohos.permission.READ_CONTACTS 677 * @param { Context } context - Indicates the context of application or capability. 678 * @param { string } email - Indicates the email address. 679 * @param { ContactAttributes } attrs - Indicates the contact attributes. 680 * If this parameter is null, all attributes are used for matching. 681 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 682 * @throws { BusinessError } 201 - Permission denied. 683 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 684 * @syscap SystemCapability.Applications.ContactsData 685 * @since 10 686 */ 687 function queryContactsByEmail(context: Context, email: string, attrs: ContactAttributes, 688 callback: AsyncCallback<Array<Contact>>): void; 689 690 /** 691 * Queries contacts by a specified email address, contact holder, and contact attributes. 692 * 693 * @permission ohos.permission.READ_CONTACTS 694 * @param { string } email - Indicates the email address. 695 * @param { Holder } holder - Indicates the contact holder. 696 * If this parameter is null, the default holder is used for matching. 697 * @param { ContactAttributes } attrs - Indicates the contact attributes. 698 * If this parameter is null, all attributes are used for matching. 699 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 700 * @syscap SystemCapability.Applications.ContactsData 701 * @since 7 702 * @deprecated since 10 703 * @useinstead contact.queryContactsByEmail#queryContactsByEmail 704 */ 705 function queryContactsByEmail(email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 706 707 /** 708 * Queries contacts by a specified email address, contact holder, and contact attributes. 709 * 710 * @permission ohos.permission.READ_CONTACTS 711 * @param { Context } context - Indicates the context of application or capability. 712 * @param { string } email - Indicates the email address. 713 * @param { Holder } holder - Indicates the contact holder. 714 * If this parameter is null, the default holder is used for matching. 715 * @param { ContactAttributes } attrs - Indicates the contact attributes. 716 * If this parameter is null, all attributes are used for matching. 717 * @param { AsyncCallback<Array<Contact>> } callback - Returns a {@code Contact} list object. 718 * @throws { BusinessError } 201 - Permission denied. 719 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 720 * @syscap SystemCapability.Applications.ContactsData 721 * @since 10 722 */ 723 function queryContactsByEmail(context: Context, email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 724 725 /** 726 * Queries contacts by a specified email address, contact holder, and contact attributes. 727 * 728 * @permission ohos.permission.READ_CONTACTS 729 * @param { string } email - Indicates the email address. 730 * @param { Holder } holder - Indicates the contact holder. 731 * If this parameter is null, the default holder is used for matching. 732 * @param { ContactAttributes } attrs - Indicates the contact attributes. 733 * If this parameter is null, all attributes are used for matching. 734 * @returns { Promise<Array<Contact>> } Returns a {@code Contact} list object. 735 * @syscap SystemCapability.Applications.ContactsData 736 * @since 7 737 * @deprecated since 10 738 * @useinstead contact.queryContactsByEmail#queryContactsByEmail 739 */ 740 function queryContactsByEmail(email: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 741 742 /** 743 * Queries contacts by a specified email address, contact holder, and contact attributes. 744 * 745 * @permission ohos.permission.READ_CONTACTS 746 * @param { Context } context - Indicates the context of application or capability. 747 * @param { string } email - Indicates the email address. 748 * @param { Holder } holder - Indicates the contact holder. 749 * If this parameter is null, the default holder is used for matching. 750 * @param { ContactAttributes } attrs - Indicates the contact attributes. 751 * If this parameter is null, all attributes are used for matching. 752 * @returns { Promise<Array<Contact>> } Returns a {@code Contact} list object. 753 * @throws { BusinessError } 201 - Permission denied. 754 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 755 * @syscap SystemCapability.Applications.ContactsData 756 * @since 10 757 */ 758 function queryContactsByEmail(context: Context, email: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 759 760 /** 761 * Queries contacts by a phone number. 762 * 763 * @permission ohos.permission.READ_CONTACTS 764 * @param { string } phoneNumber - Indicates the phone number. 765 * Only full match is supported, and wildcards are not supported. 766 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 767 * @syscap SystemCapability.Applications.ContactsData 768 * @since 7 769 * @deprecated since 10 770 * @useinstead contact.queryContactsByPhoneNumber#queryContactsByPhoneNumber 771 */ 772 function queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback<Array<Contact>>): void; 773 774 /** 775 * Queries contacts by a phone number. 776 * 777 * @permission ohos.permission.READ_CONTACTS 778 * @param { Context } context - Indicates the context of application or capability. 779 * @param { string } phoneNumber - Indicates the phone number. 780 * Only full match is supported, and wildcards are not supported. 781 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 782 * @throws { BusinessError } 201 - Permission denied. 783 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 784 * @syscap SystemCapability.Applications.ContactsData 785 * @since 10 786 */ 787 function queryContactsByPhoneNumber(context: Context, phoneNumber: string, callback: AsyncCallback<Array<Contact>>): void; 788 789 /** 790 * Queries contacts by a phone number and contact holder. 791 * 792 * @permission ohos.permission.READ_CONTACTS 793 * @param { string } phoneNumber - Indicates the phone number. 794 * Only full match is supported, and wildcards are not supported. 795 * @param { Holder } holder - Indicates the contact holder. 796 * If this parameter is null, the default holder is used for matching. 797 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 798 * @syscap SystemCapability.Applications.ContactsData 799 * @since 7 800 * @deprecated since 10 801 * @useinstead contact.queryContactsByPhoneNumber#queryContactsByPhoneNumber 802 */ 803 function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback<Array<Contact>>): void; 804 805 /** 806 * Queries contacts by a phone number and contact holder. 807 * 808 * @permission ohos.permission.READ_CONTACTS 809 * @param { Context } context - Indicates the context of application or capability. 810 * @param { string } phoneNumber - Indicates the phone number. 811 * Only full match is supported, and wildcards are not supported. 812 * @param { Holder } holder - Indicates the contact holder. 813 * If this parameter is null, the default holder is used for matching. 814 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 815 * @throws { BusinessError } 201 - Permission denied. 816 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 817 * @syscap SystemCapability.Applications.ContactsData 818 * @since 10 819 */ 820 function queryContactsByPhoneNumber(context: Context, phoneNumber: string, holder: Holder, callback: AsyncCallback<Array<Contact>>): void; 821 822 /** 823 * Queries contacts by a phone number and contact attribute. 824 * 825 * @permission ohos.permission.READ_CONTACTS 826 * @param { string } phoneNumber - Indicates the phone number. 827 * Only full match is supported, and wildcards are not supported. 828 * @param { ContactAttributes } attrs - Indicates the contact attribute. 829 * If this parameter is null, all attributes will be used for matching. 830 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 831 * @syscap SystemCapability.Applications.ContactsData 832 * @since 7 833 * @deprecated since 10 834 * @useinstead contact.queryContactsByPhoneNumber#queryContactsByPhoneNumber 835 */ 836 function queryContactsByPhoneNumber(phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 837 838 /** 839 * Queries contacts by a phone number and contact attribute. 840 * 841 * @permission ohos.permission.READ_CONTACTS 842 * @param { Context } context - Indicates the context of application or capability. 843 * @param { string } phoneNumber - Indicates the phone number. 844 * Only full match is supported, and wildcards are not supported. 845 * @param { ContactAttributes } attrs - Indicates the contact attribute. 846 * If this parameter is null, all attributes will be used for matching. 847 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 848 * @throws { BusinessError } 201 - Permission denied. 849 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 850 * @syscap SystemCapability.Applications.ContactsData 851 * @since 10 852 */ 853 function queryContactsByPhoneNumber(context: Context, phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 854 855 /** 856 * Queries contacts by a phone number, contact holder and contact attribute. 857 * 858 * @permission ohos.permission.READ_CONTACTS 859 * @param { string } phoneNumber - Indicates the phone number. 860 * Only full match is supported, and wildcards are not supported. 861 * @param { Holder } holder - Indicates the contact holder. 862 * If this parameter is null, the default holder is used for matching. 863 * @param { ContactAttributes } attrs - Indicates the contact attribute. 864 * If this parameter is null, all attributes will be used for matching. 865 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 866 * @syscap SystemCapability.Applications.ContactsData 867 * @since 7 868 * @deprecated since 10 869 * @useinstead contact.queryContactsByPhoneNumber#queryContactsByPhoneNumber 870 */ 871 function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void; 872 873 /** 874 * Queries contacts by a phone number, contact holder and contact attribute. 875 * 876 * @permission ohos.permission.READ_CONTACTS 877 * @param { Context } context - Indicates the context of application or capability. 878 * @param { string } phoneNumber - Indicates the phone number. 879 * Only full match is supported, and wildcards are not supported. 880 * @param { Holder } holder - Indicates the contact holder. 881 * If this parameter is null, the default holder is used for matching. 882 * @param { ContactAttributes } attrs - Indicates the contact attribute. 883 * If this parameter is null, all attributes will be used for matching. 884 * @param { AsyncCallback<Array<Contact>> } callback - Returns the {@code Contact} list object. 885 * @throws { BusinessError } 201 - Permission denied. 886 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 887 * @syscap SystemCapability.Applications.ContactsData 888 * @since 10 889 */ 890 function queryContactsByPhoneNumber(context: Context, phoneNumber: string, holder: Holder, attrs: ContactAttributes, 891 callback: AsyncCallback<Array<Contact>>): void; 892 893 /** 894 * Queries contacts by a phone number, contact holder and contact attribute. 895 * 896 * @permission ohos.permission.READ_CONTACTS 897 * @param { string } phoneNumber - Indicates the phone number. 898 * Only full match is supported, and wildcards are not supported. 899 * @param { Holder } holder - Indicates the contact holder. 900 * If this parameter is null, the default holder is used for matching. 901 * @param { ContactAttributes } attrs - Indicates the contact attribute. 902 * If this parameter is null, all attributes will be used for matching. 903 * @returns { Promise<Array<Contact>> } Returns the {@code Contact} list object. 904 * @syscap SystemCapability.Applications.ContactsData 905 * @since 7 906 * @deprecated since 10 907 * @useinstead contact.queryContactsByPhoneNumber#queryContactsByPhoneNumber 908 */ 909 function queryContactsByPhoneNumber(phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 910 911 /** 912 * Queries contacts by a phone number, contact holder and contact attribute. 913 * 914 * @permission ohos.permission.READ_CONTACTS 915 * @param { Context } context - Indicates the context of application or capability. 916 * @param { string } phoneNumber - Indicates the phone number. 917 * Only full match is supported, and wildcards are not supported. 918 * @param { Holder } holder - Indicates the contact holder. 919 * If this parameter is null, the default holder is used for matching. 920 * @param { ContactAttributes } attrs - Indicates the contact attribute. 921 * If this parameter is null, all attributes will be used for matching. 922 * @returns { Promise<Array<Contact>> } Returns the {@code Contact} list object. 923 * @throws { BusinessError } 201 - Permission denied. 924 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 925 * @syscap SystemCapability.Applications.ContactsData 926 * @since 10 927 */ 928 function queryContactsByPhoneNumber(context: Context, phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>; 929 930 /** 931 * Queries contact groups. 932 * 933 * @permission ohos.permission.READ_CONTACTS 934 * @param { AsyncCallback<Array<Group>> } callback - Returns the contact group list object. 935 * @syscap SystemCapability.Applications.ContactsData 936 * @since 7 937 * @deprecated since 10 938 * @useinstead contact.queryGroups#queryGroups 939 */ 940 function queryGroups(callback: AsyncCallback<Array<Group>>): void; 941 942 /** 943 * Queries contact groups. 944 * 945 * @permission ohos.permission.READ_CONTACTS 946 * @param { Context } context - Indicates the context of application or capability. 947 * @param { AsyncCallback<Array<Group>> } callback - Returns the contact group list object. 948 * @throws { BusinessError } 201 - Permission denied. 949 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 950 * @syscap SystemCapability.Applications.ContactsData 951 * @since 10 952 */ 953 function queryGroups(context: Context, callback: AsyncCallback<Array<Group>>): void; 954 955 /** 956 * Queries contact groups by contact holder. 957 * 958 * @permission ohos.permission.READ_CONTACTS 959 * @param { Holder } holder - Indicates the contact holder. 960 * If this parameter is null, the default holder is used for matching. 961 * @param { AsyncCallback<Array<Group>> } callback - Returns the contact group list object. 962 * @syscap SystemCapability.Applications.ContactsData 963 * @since 7 964 * @deprecated since 10 965 * @useinstead contact.queryGroups#queryGroups 966 */ 967 function queryGroups(holder: Holder, callback: AsyncCallback<Array<Group>>): void; 968 969 /** 970 * Queries contact groups by contact holder. 971 * 972 * @permission ohos.permission.READ_CONTACTS 973 * @param { Context } context - Indicates the context of application or capability. 974 * @param { Holder } holder - Indicates the contact holder. 975 * If this parameter is null, the default holder is used for matching. 976 * @param { AsyncCallback<Array<Group>> } callback - Returns the contact group list object. 977 * @throws { BusinessError } 201 - Permission denied. 978 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 979 * @syscap SystemCapability.Applications.ContactsData 980 * @since 10 981 */ 982 function queryGroups(context: Context, holder: Holder, callback: AsyncCallback<Array<Group>>): void; 983 984 /** 985 * Queries contact groups by contact holder. 986 * 987 * @permission ohos.permission.READ_CONTACTS 988 * @param { Holder } holder - Indicates the contact holder. 989 * If this parameter is null, the default holder is used for matching. 990 * @returns { Promise<Array<Group>> } Returns the contact group list object. 991 * @syscap SystemCapability.Applications.ContactsData 992 * @since 7 993 * @deprecated since 10 994 * @useinstead contact.queryGroups#queryGroups 995 */ 996 function queryGroups(holder?: Holder): Promise<Array<Group>>; 997 998 /** 999 * Queries contact groups by contact holder. 1000 * 1001 * @permission ohos.permission.READ_CONTACTS 1002 * @param { Context } context - Indicates the context of application or capability. 1003 * @param { Holder } holder - Indicates the contact holder. 1004 * If this parameter is null, the default holder is used for matching. 1005 * @returns { Promise<Array<Group>> } Returns the contact group list object. 1006 * @throws { BusinessError } 201 - Permission denied. 1007 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1008 * @syscap SystemCapability.Applications.ContactsData 1009 * @since 10 1010 */ 1011 function queryGroups(context: Context, holder?: Holder): Promise<Array<Group>>; 1012 1013 /** 1014 * Queries contact holders. 1015 * 1016 * @permission ohos.permission.READ_CONTACTS 1017 * @param { AsyncCallback<Array<Holder>> } callback - Returns the {@code Holder} list object. 1018 * @syscap SystemCapability.Applications.ContactsData 1019 * @since 7 1020 * @deprecated since 10 1021 * @useinstead contact.queryHolders#queryHolders 1022 */ 1023 function queryHolders(callback: AsyncCallback<Array<Holder>>): void; 1024 1025 /** 1026 * Queries contact holders. 1027 * 1028 * @permission ohos.permission.READ_CONTACTS 1029 * @param { Context } context - Indicates the context of application or capability. 1030 * @param { AsyncCallback<Array<Holder>> } callback - Returns the {@code Holder} list object. 1031 * @throws { BusinessError } 201 - Permission denied. 1032 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1033 * @syscap SystemCapability.Applications.ContactsData 1034 * @since 10 1035 */ 1036 function queryHolders(context: Context, callback: AsyncCallback<Array<Holder>>): void; 1037 1038 /** 1039 * Queries contact holders. 1040 * 1041 * @permission ohos.permission.READ_CONTACTS 1042 * @returns { Promise<Array<Holder>> } Returns the {@code Holder} list object. 1043 * @syscap SystemCapability.Applications.ContactsData 1044 * @since 7 1045 * @deprecated since 10 1046 * @useinstead contact.queryHolders#queryHolders 1047 */ 1048 function queryHolders(): Promise<Array<Holder>>; 1049 1050 /** 1051 * Queries contact holders. 1052 * 1053 * @permission ohos.permission.READ_CONTACTS 1054 * @param { Context } context - Indicates the context of application or capability. 1055 * @returns { Promise<Array<Holder>> } Returns the {@code Holder} list object. 1056 * @throws { BusinessError } 201 - Permission denied. 1057 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1058 * @syscap SystemCapability.Applications.ContactsData 1059 * @since 10 1060 */ 1061 function queryHolders(context: Context): Promise<Array<Holder>>; 1062 1063 /** 1064 * Obtains the query key of a contact based on a specified ID. 1065 * 1066 * @permission ohos.permission.READ_CONTACTS 1067 * @param { number } id - Indicates the contact ID. 1068 * @param { AsyncCallback<string> } callback - Returns the query key of the contact. 1069 * @syscap SystemCapability.Applications.ContactsData 1070 * @since 7 1071 * @deprecated since 10 1072 * @useinstead contact.queryKey#queryKey 1073 */ 1074 function queryKey(id: number, callback: AsyncCallback<string>): void; 1075 1076 /** 1077 * Obtains the query key of a contact based on a specified ID. 1078 * 1079 * @permission ohos.permission.READ_CONTACTS 1080 * @param { Context } context - Indicates the context of application or capability. 1081 * @param { number } id - Indicates the contact ID. 1082 * @param { AsyncCallback<string> } callback - Returns the query key of the contact. 1083 * @throws { BusinessError } 201 - Permission denied. 1084 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1085 * @syscap SystemCapability.Applications.ContactsData 1086 * @since 10 1087 */ 1088 function queryKey(context: Context, id: number, callback: AsyncCallback<string>): void; 1089 1090 /** 1091 * Obtains the query key of a contact based on a specified ID and holder. 1092 * 1093 * @permission ohos.permission.READ_CONTACTS 1094 * @param { number } id - Indicates the contact ID. 1095 * @param { Holder } holder - Indicates the contact holder. 1096 * If this parameter is null, the default holder is used for matching. 1097 * @param { AsyncCallback<string> } callback - Returns the query key of the contact. 1098 * @syscap SystemCapability.Applications.ContactsData 1099 * @since 7 1100 * @deprecated since 10 1101 * @useinstead contact.queryKey#queryKey 1102 */ 1103 function queryKey(id: number, holder: Holder, callback: AsyncCallback<string>): void; 1104 1105 /** 1106 * Obtains the query key of a contact based on a specified ID and holder. 1107 * 1108 * @permission ohos.permission.READ_CONTACTS 1109 * @param { Context } context - Indicates the context of application or capability. 1110 * @param { number } id - Indicates the contact ID. 1111 * @param { Holder } holder - Indicates the contact holder. 1112 * If this parameter is null, the default holder is used for matching. 1113 * @param { AsyncCallback<string> } callback - Returns the query key of the contact. 1114 * @throws { BusinessError } 201 - Permission denied. 1115 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1116 * @syscap SystemCapability.Applications.ContactsData 1117 * @since 10 1118 */ 1119 function queryKey(context: Context, id: number, holder: Holder, callback: AsyncCallback<string>): void; 1120 1121 /** 1122 * Obtains the query key of a contact based on a specified ID and holder. 1123 * 1124 * @permission ohos.permission.READ_CONTACTS 1125 * @param { number } id - Indicates the contact ID. 1126 * @param { Holder } holder - Indicates the contact holder. 1127 * If this parameter is null, the default holder is used for matching. 1128 * @returns { Promise<string> } Returns the query key of the contact. 1129 * @syscap SystemCapability.Applications.ContactsData 1130 * @since 7 1131 * @deprecated since 10 1132 * @useinstead contact.queryKey#queryKey 1133 */ 1134 function queryKey(id: number, holder?: Holder): Promise<string>; 1135 1136 /** 1137 * Obtains the query key of a contact based on a specified ID and holder. 1138 * 1139 * @permission ohos.permission.READ_CONTACTS 1140 * @param { Context } context - Indicates the context of application or capability. 1141 * @param { number } id - Indicates the contact ID. 1142 * @param { Holder } holder - Indicates the contact holder. 1143 * If this parameter is null, the default holder is used for matching. 1144 * @returns { Promise<string> } Returns the query key of the contact. 1145 * @throws { BusinessError } 201 - Permission denied. 1146 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1147 * @syscap SystemCapability.Applications.ContactsData 1148 * @since 10 1149 */ 1150 function queryKey(context: Context, id: number, holder?: Holder): Promise<string>; 1151 1152 /** 1153 * Queries information about "my card". 1154 * 1155 * @permission ohos.permission.READ_CONTACTS 1156 * @param { AsyncCallback<Contact> } callback - Returns information about "my card". 1157 * @syscap SystemCapability.Applications.ContactsData 1158 * @since 7 1159 * @deprecated since 10 1160 * @useinstead contact.queryMyCard#queryMyCard 1161 */ 1162 function queryMyCard(callback: AsyncCallback<Contact>): void; 1163 1164 /** 1165 * Queries information about "my card". 1166 * 1167 * @permission ohos.permission.READ_CONTACTS 1168 * @param { Context } context - Indicates the context of application or capability. 1169 * @param { AsyncCallback<Contact> } callback - Returns information about "my card". 1170 * @throws { BusinessError } 201 - Permission denied. 1171 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1172 * @syscap SystemCapability.Applications.ContactsData 1173 * @since 10 1174 */ 1175 function queryMyCard(context: Context, callback: AsyncCallback<Contact>): void; 1176 1177 /** 1178 * Queries information about "my card". 1179 * 1180 * @permission ohos.permission.READ_CONTACTS 1181 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1182 * If this parameter is null, all attributes are used for matching. 1183 * @param { AsyncCallback<Contact> } callback - Returns information about "my card". 1184 * @syscap SystemCapability.Applications.ContactsData 1185 * @since 7 1186 * @deprecated since 10 1187 * @useinstead contact.queryMyCard#queryMyCard 1188 */ 1189 function queryMyCard(attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 1190 1191 /** 1192 * Queries information about "my card". 1193 * 1194 * @permission ohos.permission.READ_CONTACTS 1195 * @param { Context } context - Indicates the context of application or capability. 1196 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1197 * If this parameter is null, all attributes are used for matching. 1198 * @param { AsyncCallback<Contact> } callback - Returns information about "my card". 1199 * @throws { BusinessError } 201 - Permission denied. 1200 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1201 * @syscap SystemCapability.Applications.ContactsData 1202 * @since 10 1203 */ 1204 function queryMyCard(context: Context, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void; 1205 1206 /** 1207 * Queries information about "my card". 1208 * 1209 * @permission ohos.permission.READ_CONTACTS 1210 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1211 * If this parameter is null, all attributes are used for matching. 1212 * @returns { Promise<Contact> } Returns information about "my card". 1213 * @syscap SystemCapability.Applications.ContactsData 1214 * @since 7 1215 * @deprecated since 10 1216 * @useinstead contact.queryMyCard#queryMyCard 1217 */ 1218 function queryMyCard(attrs?: ContactAttributes): Promise<Contact>; 1219 1220 /** 1221 * Queries information about "my card". 1222 * 1223 * @permission ohos.permission.READ_CONTACTS 1224 * @param { Context } context - Indicates the context of application or capability. 1225 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1226 * If this parameter is null, all attributes are used for matching. 1227 * @returns { Promise<Contact> } Returns information about "my card". 1228 * @throws { BusinessError } 201 - Permission denied. 1229 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1230 * @syscap SystemCapability.Applications.ContactsData 1231 * @since 10 1232 */ 1233 function queryMyCard(context: Context, attrs?: ContactAttributes): Promise<Contact>; 1234 1235 /** 1236 * Updates specified attributes of a contact. 1237 * 1238 * @permission ohos.permission.WRITE_CONTACTS 1239 * @param { Contact } contact - Indicates the contact whose information is to update. 1240 * @param { AsyncCallback<void> } callback - The callback of updateContact. 1241 * @syscap SystemCapability.Applications.ContactsData 1242 * @since 7 1243 * @deprecated since 10 1244 * @useinstead contact.updateContact#updateContact 1245 */ 1246 function updateContact(contact: Contact, callback: AsyncCallback<void>): void; 1247 1248 /** 1249 * Updates specified attributes of a contact. 1250 * 1251 * @permission ohos.permission.WRITE_CONTACTS 1252 * @param { Context } context - Indicates the context of application or capability. 1253 * @param { Contact } contact - Indicates the contact whose information is to update. 1254 * @param { AsyncCallback<void> } callback - The callback of updateContact. 1255 * @throws { BusinessError } 201 - Permission denied. 1256 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1257 * @syscap SystemCapability.Applications.ContactsData 1258 * @since 10 1259 */ 1260 function updateContact(context: Context, contact: Contact, callback: AsyncCallback<void>): void; 1261 1262 /** 1263 * Updates specified attributes of a contact. 1264 * 1265 * @permission ohos.permission.WRITE_CONTACTS 1266 * @param { Contact } contact - Indicates the contact whose information is to update. 1267 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1268 * If this parameter is null, all attributes are used for matching. 1269 * @param { AsyncCallback<void> } callback - The callback of updateContact. 1270 * @syscap SystemCapability.Applications.ContactsData 1271 * @since 7 1272 * @deprecated since 10 1273 * @useinstead contact.updateContact#updateContact 1274 */ 1275 function updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback<void>): void; 1276 1277 /** 1278 * Updates specified attributes of a contact. 1279 * 1280 * @permission ohos.permission.WRITE_CONTACTS 1281 * @param { Context } context - Indicates the context of application or capability. 1282 * @param { Contact } contact - Indicates the contact whose information is to update. 1283 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1284 * If this parameter is null, all attributes are used for matching. 1285 * @param { AsyncCallback<void> } callback - The callback of updateContact. 1286 * @throws { BusinessError } 201 - Permission denied. 1287 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1288 * @syscap SystemCapability.Applications.ContactsData 1289 * @since 10 1290 */ 1291 function updateContact(context: Context, contact: Contact, attrs: ContactAttributes, callback: AsyncCallback<void>): void; 1292 1293 /** 1294 * Updates specified attributes of a contact. 1295 * 1296 * @permission ohos.permission.WRITE_CONTACTS 1297 * @param { Contact } contact - Indicates the contact whose information is to update. 1298 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1299 * If this parameter is null, all attributes are used for matching. 1300 * @returns { Promise<void> } The promise returned by the function. 1301 * @syscap SystemCapability.Applications.ContactsData 1302 * @since 7 1303 * @deprecated since 10 1304 * @useinstead contact.updateContact#updateContact 1305 */ 1306 function updateContact(contact: Contact, attrs?: ContactAttributes): Promise<void>; 1307 1308 /** 1309 * Updates specified attributes of a contact. 1310 * 1311 * @permission ohos.permission.WRITE_CONTACTS 1312 * @param { Context } context - Indicates the context of application or capability. 1313 * @param { Contact } contact - Indicates the contact whose information is to update. 1314 * @param { ContactAttributes } attrs - Indicates the contact attribute. 1315 * If this parameter is null, all attributes are used for matching. 1316 * @returns { Promise<void> } The promise returned by the function. 1317 * @throws { BusinessError } 201 - Permission denied. 1318 * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. 1319 * @syscap SystemCapability.Applications.ContactsData 1320 * @since 10 1321 */ 1322 function updateContact(context: Context, contact: Contact, attrs?: ContactAttributes): Promise<void>; 1323 1324 /** 1325 * Checks whether the contact ID is in the local phone book. 1326 * 1327 * @permission ohos.permission.READ_CONTACTS 1328 * @param { number } id - Indicates the contact ID. 1329 * @param { AsyncCallback<boolean> } callback - The callback of isLocalContact. 1330 * Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. 1331 * @syscap SystemCapability.Applications.ContactsData 1332 * @since 7 1333 * @deprecated since 10 1334 * @useinstead contact.isLocalContact#isLocalContact 1335 */ 1336 function isLocalContact(id: number, callback: AsyncCallback<boolean>): void; 1337 1338 /** 1339 * Checks whether the contact ID is in the local phone book. 1340 * 1341 * @permission ohos.permission.READ_CONTACTS 1342 * @param { Context } context - Indicates the context of application or capability. 1343 * @param { number } id - Indicates the contact ID. 1344 * @param { AsyncCallback<boolean> } callback - The callback of isLocalContact. 1345 * Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. 1346 * @throws { BusinessError } 201 - Permission denied. 1347 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1348 * @syscap SystemCapability.Applications.ContactsData 1349 * @since 10 1350 */ 1351 function isLocalContact(context: Context, id: number, callback: AsyncCallback<boolean>): void; 1352 1353 /** 1354 * Checks whether the contact ID is in the local phone book. 1355 * 1356 * @permission ohos.permission.READ_CONTACTS 1357 * @param { number } id - Indicates the contact ID. 1358 * @returns { Promise<boolean> } Returns {@code true} if the contact ID is in the local phone book, 1359 * returns {@code false} otherwise. 1360 * @syscap SystemCapability.Applications.ContactsData 1361 * @since 7 1362 * @deprecated since 10 1363 * @useinstead contact.isLocalContact#isLocalContact 1364 */ 1365 function isLocalContact(id: number): Promise<boolean>; 1366 1367 /** 1368 * Checks whether the contact ID is in the local phone book. 1369 * 1370 * @permission ohos.permission.READ_CONTACTS 1371 * @param { Context } context - Indicates the context of application or capability. 1372 * @param { number } id - Indicates the contact ID. 1373 * @returns { Promise<boolean> } Returns {@code true} if the contact ID is in the local phone book, 1374 * returns {@code false} otherwise. 1375 * @throws { BusinessError } 201 - Permission denied. 1376 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1377 * @syscap SystemCapability.Applications.ContactsData 1378 * @since 10 1379 */ 1380 function isLocalContact(context: Context, id: number): Promise<boolean>; 1381 1382 /** 1383 * Checks whether the contact ID is of "my card". 1384 * 1385 * @permission ohos.permission.READ_CONTACTS 1386 * @param { number } id - Indicates the contact ID. 1387 * @param { AsyncCallback<boolean> } callback - The callback of isMyCard. 1388 * Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. 1389 * @syscap SystemCapability.Applications.ContactsData 1390 * @since 7 1391 * @deprecated since 10 1392 * @useinstead contact.deleteContact#deleteContact 1393 */ 1394 function isMyCard(id: number, callback: AsyncCallback<boolean>): void; 1395 1396 /** 1397 * Checks whether the contact ID is of "my card". 1398 * 1399 * @permission ohos.permission.READ_CONTACTS 1400 * @param { Context } context - Indicates the context of application or capability. 1401 * @param { number } id - Indicates the contact ID. 1402 * @param { AsyncCallback<boolean> } callback - The callback of isMyCard. 1403 * Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. 1404 * @throws { BusinessError } 201 - Permission denied. 1405 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1406 * @syscap SystemCapability.Applications.ContactsData 1407 * @since 10 1408 */ 1409 function isMyCard(context: Context, id: number, callback: AsyncCallback<boolean>): void; 1410 1411 /** 1412 * Checks whether the contact ID is of "my card". 1413 * 1414 * @permission ohos.permission.READ_CONTACTS 1415 * @param { number } id - Indicates the contact ID. 1416 * @returns { Promise<boolean> } Returns true if the contact ID is of "my card", returns false otherwise. 1417 * @syscap SystemCapability.Applications.ContactsData 1418 * @since 7 1419 * @deprecated since 10 1420 * @useinstead contact.isMyCard#isMyCard 1421 */ 1422 function isMyCard(id: number): Promise<boolean>; 1423 1424 /** 1425 * Checks whether the contact ID is of "my card". 1426 * 1427 * @permission ohos.permission.READ_CONTACTS 1428 * @param { Context } context - Indicates the context of application or capability. 1429 * @param { number } id - Indicates the contact ID. 1430 * @returns { Promise<boolean> } Returns true if the contact ID is of "my card", returns false otherwise. 1431 * @throws { BusinessError } 201 - Permission denied. 1432 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Parameter verification failed. 1433 * @syscap SystemCapability.Applications.ContactsData 1434 * @since 10 1435 */ 1436 function isMyCard(context: Context, id: number): Promise<boolean>; 1437 1438 /** 1439 * ContactSelectionOptions Object 1440 * 1441 * @interface ContactSelectionOptions 1442 * @syscap SystemCapability.Applications.Contacts 1443 * @since 10 1444 */ 1445 /** 1446 * ContactSelectionOptions Object 1447 * 1448 * @interface ContactSelectionOptions 1449 * @syscap SystemCapability.Applications.Contacts 1450 * @atomicservice 1451 * @since 11 1452 */ 1453 interface ContactSelectionOptions { 1454 /** 1455 * Indicates the Single-select or multiple-select. 1456 * 1457 * @type { ?boolean } 1458 * @syscap SystemCapability.Applications.Contacts 1459 * @since 10 1460 */ 1461 /** 1462 * Indicates the Single-select or multiple-select. 1463 * 1464 * @type { ?boolean } 1465 * @syscap SystemCapability.Applications.Contacts 1466 * @atomicservice 1467 * @since 11 1468 */ 1469 isMultiSelect?: boolean; 1470 } 1471 1472 /** 1473 * Provides methods for contact information 1474 * 1475 * @syscap SystemCapability.Applications.ContactsData 1476 * @since 7 1477 */ 1478 /** 1479 * Provides methods for contact information 1480 * 1481 * @syscap SystemCapability.Applications.ContactsData 1482 * @atomicservice 1483 * @since 11 1484 */ 1485 class Contact { 1486 /** 1487 * Indicates the contact invalid ID. 1488 * 1489 * @type { number } 1490 * @readonly 1491 * @static 1492 * @syscap SystemCapability.Applications.ContactsData 1493 * @since 7 1494 */ 1495 /** 1496 * Indicates the contact invalid ID. 1497 * 1498 * @type { number } 1499 * @readonly 1500 * @static 1501 * @syscap SystemCapability.Applications.ContactsData 1502 * @atomicservice 1503 * @since 11 1504 */ 1505 static readonly INVALID_CONTACT_ID: -1 1506 1507 /** 1508 * Indicates the contact ID. 1509 * 1510 * @type { ?number } 1511 * @readonly 1512 * @syscap SystemCapability.Applications.ContactsData 1513 * @since 7 1514 */ 1515 /** 1516 * Indicates the contact ID. 1517 * 1518 * @type { ?number } 1519 * @readonly 1520 * @syscap SystemCapability.Applications.ContactsData 1521 * @atomicservice 1522 * @since 11 1523 */ 1524 readonly id?: number 1525 1526 /** 1527 * Indicates the query key that identifies the contact. 1528 * 1529 * @type { ?string } 1530 * @readonly 1531 * @syscap SystemCapability.Applications.ContactsData 1532 * @since 7 1533 */ 1534 /** 1535 * Indicates the query key that identifies the contact. 1536 * 1537 * @type { ?string } 1538 * @readonly 1539 * @syscap SystemCapability.Applications.ContactsData 1540 * @atomicservice 1541 * @since 11 1542 */ 1543 readonly key?: string 1544 1545 /** 1546 * Indicates the contact attributes. 1547 * 1548 * @type { ?ContactAttributes } 1549 * @syscap SystemCapability.Applications.ContactsData 1550 * @since 7 1551 */ 1552 /** 1553 * Indicates the contact attributes. 1554 * 1555 * @type { ?ContactAttributes } 1556 * @syscap SystemCapability.Applications.ContactsData 1557 * @atomicservice 1558 * @since 11 1559 */ 1560 contactAttributes?: ContactAttributes 1561 1562 /** 1563 * Indicates list of contact email addresses. 1564 * 1565 * @type { ?Email[] } 1566 * @syscap SystemCapability.Applications.ContactsData 1567 * @since 7 1568 */ 1569 /** 1570 * Indicates list of contact email addresses. 1571 * 1572 * @type { ?Email[] } 1573 * @syscap SystemCapability.Applications.ContactsData 1574 * @atomicservice 1575 * @since 11 1576 */ 1577 emails?: Email[] 1578 1579 /** 1580 * Indicates an event (special date) of the contact. 1581 * 1582 * @type { ?Event[] } 1583 * @syscap SystemCapability.Applications.ContactsData 1584 * @since 7 1585 */ 1586 /** 1587 * Indicates an event (special date) of the contact. 1588 * 1589 * @type { ?Event[] } 1590 * @syscap SystemCapability.Applications.ContactsData 1591 * @atomicservice 1592 * @since 11 1593 */ 1594 events?: Event[] 1595 1596 /** 1597 * Indicates a group of the contact. 1598 * 1599 * @type { ?Group[] } 1600 * @syscap SystemCapability.Applications.ContactsData 1601 * @since 7 1602 */ 1603 /** 1604 * Indicates a group of the contact. 1605 * 1606 * @type { ?Group[] } 1607 * @syscap SystemCapability.Applications.ContactsData 1608 * @atomicservice 1609 * @since 11 1610 */ 1611 groups?: Group[] 1612 1613 /** 1614 * Indicates an IM address of the contact. 1615 * 1616 * @type { ?ImAddress[] } 1617 * @syscap SystemCapability.Applications.ContactsData 1618 * @since 7 1619 */ 1620 /** 1621 * Indicates an IM address of the contact. 1622 * 1623 * @type { ?ImAddress[] } 1624 * @syscap SystemCapability.Applications.ContactsData 1625 * @atomicservice 1626 * @since 11 1627 */ 1628 imAddresses?: ImAddress[] 1629 1630 /** 1631 * Indicates a phone number of the contact. 1632 * 1633 * @type { ?PhoneNumber[] } 1634 * @syscap SystemCapability.Applications.ContactsData 1635 * @since 7 1636 */ 1637 /** 1638 * Indicates a phone number of the contact. 1639 * 1640 * @type { ?PhoneNumber[] } 1641 * @syscap SystemCapability.Applications.ContactsData 1642 * @atomicservice 1643 * @since 11 1644 */ 1645 phoneNumbers?: PhoneNumber[] 1646 1647 /** 1648 * Indicates the contact portrait. 1649 * 1650 * @type { ?Portrait } 1651 * @syscap SystemCapability.Applications.ContactsData 1652 * @since 7 1653 */ 1654 /** 1655 * Indicates the contact portrait. 1656 * 1657 * @type { ?Portrait } 1658 * @syscap SystemCapability.Applications.ContactsData 1659 * @atomicservice 1660 * @since 11 1661 */ 1662 portrait?: Portrait 1663 1664 /** 1665 * Indicates a postal address of the contact. 1666 * 1667 * @type { ?PostalAddress[] } 1668 * @syscap SystemCapability.Applications.ContactsData 1669 * @since 7 1670 */ 1671 /** 1672 * Indicates a postal address of the contact. 1673 * 1674 * @type { ?PostalAddress[] } 1675 * @syscap SystemCapability.Applications.ContactsData 1676 * @atomicservice 1677 * @since 11 1678 */ 1679 postalAddresses?: PostalAddress[] 1680 1681 /** 1682 * Indicates a relation of the contact. 1683 * 1684 * @type { ?Relation[] } 1685 * @syscap SystemCapability.Applications.ContactsData 1686 * @since 7 1687 */ 1688 /** 1689 * Indicates a relation of the contact. 1690 * 1691 * @type { ?Relation[] } 1692 * @syscap SystemCapability.Applications.ContactsData 1693 * @atomicservice 1694 * @since 11 1695 */ 1696 relations?: Relation[] 1697 1698 /** 1699 * Indicates a Session Initiation Protocol (SIP) address of the contact. 1700 * 1701 * @type { ?SipAddress[] } 1702 * @syscap SystemCapability.Applications.ContactsData 1703 * @since 7 1704 */ 1705 /** 1706 * Indicates a Session Initiation Protocol (SIP) address of the contact. 1707 * 1708 * @type { ?SipAddress[] } 1709 * @syscap SystemCapability.Applications.ContactsData 1710 * @atomicservice 1711 * @since 11 1712 */ 1713 sipAddresses?: SipAddress[] 1714 1715 /** 1716 * Indicates a website of the contact. 1717 * 1718 * @type { ?Website[] } 1719 * @syscap SystemCapability.Applications.ContactsData 1720 * @since 7 1721 */ 1722 /** 1723 * Indicates a website of the contact. 1724 * 1725 * @type { ?Website[] } 1726 * @syscap SystemCapability.Applications.ContactsData 1727 * @atomicservice 1728 * @since 11 1729 */ 1730 websites?: Website[] 1731 1732 /** 1733 * Indicates the contact name. 1734 * 1735 * @type { ?Name } 1736 * @syscap SystemCapability.Applications.ContactsData 1737 * @since 7 1738 */ 1739 /** 1740 * Indicates the contact name. 1741 * 1742 * @type { ?Name } 1743 * @syscap SystemCapability.Applications.ContactsData 1744 * @atomicservice 1745 * @since 11 1746 */ 1747 name?: Name 1748 1749 /** 1750 * Indicates the contact nickname. 1751 * 1752 * @type { ?NickName } 1753 * @syscap SystemCapability.Applications.ContactsData 1754 * @since 7 1755 */ 1756 /** 1757 * Indicates the contact nickname. 1758 * 1759 * @type { ?NickName } 1760 * @syscap SystemCapability.Applications.ContactsData 1761 * @atomicservice 1762 * @since 11 1763 */ 1764 nickName?: NickName 1765 1766 /** 1767 * Indicates the contact note. 1768 * 1769 * @type { ?Note } 1770 * @syscap SystemCapability.Applications.ContactsData 1771 * @since 7 1772 */ 1773 /** 1774 * Indicates the contact note. 1775 * 1776 * @type { ?Note } 1777 * @syscap SystemCapability.Applications.ContactsData 1778 * @atomicservice 1779 * @since 11 1780 */ 1781 note?: Note 1782 1783 /** 1784 * Indicates organization information about the contact. 1785 * 1786 * @type { ?Organization } 1787 * @syscap SystemCapability.Applications.ContactsData 1788 * @since 7 1789 */ 1790 /** 1791 * Indicates organization information about the contact. 1792 * 1793 * @type { ?Organization } 1794 * @syscap SystemCapability.Applications.ContactsData 1795 * @atomicservice 1796 * @since 11 1797 */ 1798 organization?: Organization 1799 } 1800 1801 /** 1802 * Provides methods for contact attributes information 1803 * 1804 * @syscap SystemCapability.Applications.ContactsData 1805 * @since 7 1806 */ 1807 /** 1808 * Provides methods for contact attributes information 1809 * 1810 * @syscap SystemCapability.Applications.ContactsData 1811 * @atomicservice 1812 * @since 11 1813 */ 1814 class ContactAttributes { 1815 /** 1816 * Indicates the contact attributes. 1817 * 1818 * @type { Attribute[] } 1819 * @syscap SystemCapability.Applications.ContactsData 1820 * @since 7 1821 */ 1822 /** 1823 * Indicates the contact attributes. 1824 * 1825 * @type { Attribute[] } 1826 * @syscap SystemCapability.Applications.ContactsData 1827 * @atomicservice 1828 * @since 11 1829 */ 1830 attributes: Attribute[] 1831 } 1832 1833 /** 1834 * Provides methods for attribute information 1835 * 1836 * @enum { number } 1837 * @syscap SystemCapability.Applications.ContactsData 1838 * @since 7 1839 */ 1840 /** 1841 * Provides methods for attribute information 1842 * 1843 * @enum { number } 1844 * @syscap SystemCapability.Applications.ContactsData 1845 * @atomicservice 1846 * @since 11 1847 */ 1848 enum Attribute { 1849 /** 1850 * Indicates the contact event. 1851 * 1852 * @syscap SystemCapability.Applications.ContactsData 1853 * @since 7 1854 */ 1855 /** 1856 * Indicates the contact event. 1857 * 1858 * @syscap SystemCapability.Applications.ContactsData 1859 * @atomicservice 1860 * @since 11 1861 */ 1862 ATTR_CONTACT_EVENT, 1863 1864 /** 1865 * Indicates the email address. 1866 * 1867 * @syscap SystemCapability.Applications.ContactsData 1868 * @since 7 1869 */ 1870 /** 1871 * Indicates the email address. 1872 * 1873 * @syscap SystemCapability.Applications.ContactsData 1874 * @atomicservice 1875 * @since 11 1876 */ 1877 ATTR_EMAIL, 1878 1879 /** 1880 * Indicates the contact group. 1881 * 1882 * @syscap SystemCapability.Applications.ContactsData 1883 * @since 7 1884 */ 1885 /** 1886 * Indicates the contact group. 1887 * 1888 * @syscap SystemCapability.Applications.ContactsData 1889 * @atomicservice 1890 * @since 11 1891 */ 1892 ATTR_GROUP_MEMBERSHIP, 1893 1894 /** 1895 * Indicates the instant messaging (IM) address. 1896 * 1897 * @syscap SystemCapability.Applications.ContactsData 1898 * @since 7 1899 */ 1900 /** 1901 * Indicates the instant messaging (IM) address. 1902 * 1903 * @syscap SystemCapability.Applications.ContactsData 1904 * @atomicservice 1905 * @since 11 1906 */ 1907 ATTR_IM, 1908 1909 /** 1910 * Indicates the name. 1911 * 1912 * @syscap SystemCapability.Applications.ContactsData 1913 * @since 7 1914 */ 1915 /** 1916 * Indicates the name. 1917 * 1918 * @syscap SystemCapability.Applications.ContactsData 1919 * @atomicservice 1920 * @since 11 1921 */ 1922 ATTR_NAME, 1923 1924 /** 1925 * Indicates the nickname. 1926 * 1927 * @syscap SystemCapability.Applications.ContactsData 1928 * @since 7 1929 */ 1930 /** 1931 * Indicates the nickname. 1932 * 1933 * @syscap SystemCapability.Applications.ContactsData 1934 * @atomicservice 1935 * @since 11 1936 */ 1937 ATTR_NICKNAME, 1938 1939 /** 1940 * Indicates the note. 1941 * 1942 * @syscap SystemCapability.Applications.ContactsData 1943 * @since 7 1944 */ 1945 /** 1946 * Indicates the note. 1947 * 1948 * @syscap SystemCapability.Applications.ContactsData 1949 * @atomicservice 1950 * @since 11 1951 */ 1952 ATTR_NOTE, 1953 1954 /** 1955 * Indicates the organization. 1956 * 1957 * @syscap SystemCapability.Applications.ContactsData 1958 * @since 7 1959 */ 1960 /** 1961 * Indicates the organization. 1962 * 1963 * @syscap SystemCapability.Applications.ContactsData 1964 * @atomicservice 1965 * @since 11 1966 */ 1967 ATTR_ORGANIZATION, 1968 1969 /** 1970 * Indicates the phone number. 1971 * 1972 * @syscap SystemCapability.Applications.ContactsData 1973 * @since 7 1974 */ 1975 /** 1976 * Indicates the phone number. 1977 * 1978 * @syscap SystemCapability.Applications.ContactsData 1979 * @atomicservice 1980 * @since 11 1981 */ 1982 ATTR_PHONE, 1983 1984 /** 1985 * Indicates the portrait. 1986 * 1987 * @syscap SystemCapability.Applications.ContactsData 1988 * @since 7 1989 */ 1990 /** 1991 * Indicates the portrait. 1992 * 1993 * @syscap SystemCapability.Applications.ContactsData 1994 * @atomicservice 1995 * @since 11 1996 */ 1997 ATTR_PORTRAIT, 1998 1999 /** 2000 * Indicates the postal address. 2001 * 2002 * @syscap SystemCapability.Applications.ContactsData 2003 * @since 7 2004 */ 2005 /** 2006 * Indicates the postal address. 2007 * 2008 * @syscap SystemCapability.Applications.ContactsData 2009 * @atomicservice 2010 * @since 11 2011 */ 2012 ATTR_POSTAL_ADDRESS, 2013 2014 /** 2015 * Indicates the relation. 2016 * 2017 * @syscap SystemCapability.Applications.ContactsData 2018 * @since 7 2019 */ 2020 /** 2021 * Indicates the relation. 2022 * 2023 * @syscap SystemCapability.Applications.ContactsData 2024 * @atomicservice 2025 * @since 11 2026 */ 2027 ATTR_RELATION, 2028 2029 /** 2030 * Indicates the Session Initiation Protocol (SIP) address. 2031 * 2032 * @syscap SystemCapability.Applications.ContactsData 2033 * @since 7 2034 */ 2035 /** 2036 * Indicates the Session Initiation Protocol (SIP) address. 2037 * 2038 * @syscap SystemCapability.Applications.ContactsData 2039 * @atomicservice 2040 * @since 11 2041 */ 2042 ATTR_SIP_ADDRESS, 2043 2044 /** 2045 * Indicates the website. 2046 * 2047 * @syscap SystemCapability.Applications.ContactsData 2048 * @since 7 2049 */ 2050 /** 2051 * Indicates the website. 2052 * 2053 * @syscap SystemCapability.Applications.ContactsData 2054 * @atomicservice 2055 * @since 11 2056 */ 2057 ATTR_WEBSITE 2058 } 2059 2060 /** 2061 * Provides methods for email information 2062 * 2063 * @syscap SystemCapability.Applications.ContactsData 2064 * @since 7 2065 */ 2066 /** 2067 * Provides methods for email information 2068 * 2069 * @syscap SystemCapability.Applications.ContactsData 2070 * @atomicservice 2071 * @since 11 2072 */ 2073 class Email { 2074 /** 2075 * Indicates a custom label. 2076 * 2077 * @type { number } 2078 * @readonly 2079 * @static 2080 * @syscap SystemCapability.Applications.ContactsData 2081 * @since 7 2082 */ 2083 /** 2084 * Indicates a custom label. 2085 * 2086 * @type { number } 2087 * @readonly 2088 * @static 2089 * @syscap SystemCapability.Applications.ContactsData 2090 * @atomicservice 2091 * @since 11 2092 */ 2093 static readonly CUSTOM_LABEL: 0 2094 2095 /** 2096 * Indicates a home email. 2097 * 2098 * @type { number } 2099 * @readonly 2100 * @static 2101 * @syscap SystemCapability.Applications.ContactsData 2102 * @since 7 2103 */ 2104 /** 2105 * Indicates a home email. 2106 * 2107 * @type { number } 2108 * @readonly 2109 * @static 2110 * @syscap SystemCapability.Applications.ContactsData 2111 * @atomicservice 2112 * @since 11 2113 */ 2114 static readonly EMAIL_HOME: 1 2115 2116 /** 2117 * Indicates a work email. 2118 * 2119 * @type { number } 2120 * @readonly 2121 * @static 2122 * @syscap SystemCapability.Applications.ContactsData 2123 * @since 7 2124 */ 2125 /** 2126 * Indicates a work email. 2127 * 2128 * @type { number } 2129 * @readonly 2130 * @static 2131 * @syscap SystemCapability.Applications.ContactsData 2132 * @atomicservice 2133 * @since 11 2134 */ 2135 static readonly EMAIL_WORK: 2 2136 2137 /** 2138 * Indicates an email of the OTHER type. 2139 * 2140 * @type { number } 2141 * @readonly 2142 * @static 2143 * @syscap SystemCapability.Applications.ContactsData 2144 * @since 7 2145 */ 2146 /** 2147 * Indicates an email of the OTHER type. 2148 * 2149 * @type { number } 2150 * @readonly 2151 * @static 2152 * @syscap SystemCapability.Applications.ContactsData 2153 * @atomicservice 2154 * @since 11 2155 */ 2156 static readonly EMAIL_OTHER: 3 2157 2158 /** 2159 * Indicates an invalid label ID. 2160 * 2161 * @type { number } 2162 * @readonly 2163 * @static 2164 * @syscap SystemCapability.Applications.ContactsData 2165 * @since 7 2166 */ 2167 /** 2168 * Indicates an invalid label ID. 2169 * 2170 * @type { number } 2171 * @readonly 2172 * @static 2173 * @syscap SystemCapability.Applications.ContactsData 2174 * @atomicservice 2175 * @since 11 2176 */ 2177 static readonly INVALID_LABEL_ID: -1 2178 2179 /** 2180 * Indicates the email address. 2181 * 2182 * @type { string } 2183 * @syscap SystemCapability.Applications.ContactsData 2184 * @since 7 2185 */ 2186 /** 2187 * Indicates the email address. 2188 * 2189 * @type { string } 2190 * @syscap SystemCapability.Applications.ContactsData 2191 * @atomicservice 2192 * @since 11 2193 */ 2194 email: string 2195 2196 /** 2197 * Indicates the label name of an attribute. 2198 * 2199 * @type { ?string } 2200 * @syscap SystemCapability.Applications.ContactsData 2201 * @since 7 2202 */ 2203 /** 2204 * Indicates the label name of an attribute. 2205 * 2206 * @type { ?string } 2207 * @syscap SystemCapability.Applications.ContactsData 2208 * @atomicservice 2209 * @since 11 2210 */ 2211 labelName?: string 2212 2213 /** 2214 * Indicates the displayed email name. 2215 * 2216 * @type { ?string } 2217 * @syscap SystemCapability.Applications.ContactsData 2218 * @since 7 2219 */ 2220 /** 2221 * Indicates the displayed email name. 2222 * 2223 * @type { ?string } 2224 * @syscap SystemCapability.Applications.ContactsData 2225 * @atomicservice 2226 * @since 11 2227 */ 2228 displayName?: string 2229 2230 /** 2231 * Indicates the label id. 2232 * 2233 * @type { ?number } 2234 * @syscap SystemCapability.Applications.ContactsData 2235 * @since 7 2236 */ 2237 /** 2238 * Indicates the label id. 2239 * 2240 * @type { ?number } 2241 * @syscap SystemCapability.Applications.ContactsData 2242 * @atomicservice 2243 * @since 11 2244 */ 2245 labelId?: number 2246 } 2247 2248 /** 2249 * Provides methods for event information 2250 * 2251 * @syscap SystemCapability.Applications.ContactsData 2252 * @since 7 2253 */ 2254 /** 2255 * Provides methods for event information 2256 * 2257 * @syscap SystemCapability.Applications.ContactsData 2258 * @atomicservice 2259 * @since 11 2260 */ 2261 class Event { 2262 /** 2263 * Indicates a custom label. 2264 * 2265 * @type { number } 2266 * @readonly 2267 * @static 2268 * @syscap SystemCapability.Applications.ContactsData 2269 * @since 7 2270 */ 2271 /** 2272 * Indicates a custom label. 2273 * 2274 * @type { number } 2275 * @readonly 2276 * @static 2277 * @syscap SystemCapability.Applications.ContactsData 2278 * @atomicservice 2279 * @since 11 2280 */ 2281 static readonly CUSTOM_LABEL: 0 2282 2283 /** 2284 * Indicates an anniversary event. 2285 * 2286 * @type { number } 2287 * @readonly 2288 * @static 2289 * @syscap SystemCapability.Applications.ContactsData 2290 * @since 7 2291 */ 2292 /** 2293 * Indicates an anniversary event. 2294 * 2295 * @type { number } 2296 * @readonly 2297 * @static 2298 * @syscap SystemCapability.Applications.ContactsData 2299 * @atomicservice 2300 * @since 11 2301 */ 2302 static readonly EVENT_ANNIVERSARY: 1 2303 2304 /** 2305 * Indicates an event of the OTHER type. 2306 * 2307 * @type { number } 2308 * @readonly 2309 * @static 2310 * @syscap SystemCapability.Applications.ContactsData 2311 * @since 7 2312 */ 2313 /** 2314 * Indicates an event of the OTHER type. 2315 * 2316 * @type { number } 2317 * @readonly 2318 * @static 2319 * @syscap SystemCapability.Applications.ContactsData 2320 * @atomicservice 2321 * @since 11 2322 */ 2323 static readonly EVENT_OTHER: 2 2324 2325 /** 2326 * Indicates an birthday event. 2327 * 2328 * @type { number } 2329 * @readonly 2330 * @static 2331 * @syscap SystemCapability.Applications.ContactsData 2332 * @since 7 2333 */ 2334 /** 2335 * Indicates an birthday event. 2336 * 2337 * @type { number } 2338 * @readonly 2339 * @static 2340 * @syscap SystemCapability.Applications.ContactsData 2341 * @atomicservice 2342 * @since 11 2343 */ 2344 static readonly EVENT_BIRTHDAY: 3 2345 2346 /** 2347 * Indicates an invalid label ID. 2348 * 2349 * @type { number } 2350 * @readonly 2351 * @static 2352 * @syscap SystemCapability.Applications.ContactsData 2353 * @since 7 2354 */ 2355 /** 2356 * Indicates an invalid label ID. 2357 * 2358 * @type { number } 2359 * @readonly 2360 * @static 2361 * @syscap SystemCapability.Applications.ContactsData 2362 * @atomicservice 2363 * @since 11 2364 */ 2365 static readonly INVALID_LABEL_ID: -1 2366 2367 /** 2368 * Indicates the event date. 2369 * 2370 * @type { string } 2371 * @syscap SystemCapability.Applications.ContactsData 2372 * @since 7 2373 */ 2374 /** 2375 * Indicates the event date. 2376 * 2377 * @type { string } 2378 * @syscap SystemCapability.Applications.ContactsData 2379 * @atomicservice 2380 * @since 11 2381 */ 2382 eventDate: string 2383 2384 /** 2385 * Indicates the label name of an attribute. 2386 * 2387 * @type { ?string } 2388 * @syscap SystemCapability.Applications.ContactsData 2389 * @since 7 2390 */ 2391 /** 2392 * Indicates the label name of an attribute. 2393 * 2394 * @type { ?string } 2395 * @syscap SystemCapability.Applications.ContactsData 2396 * @atomicservice 2397 * @since 11 2398 */ 2399 labelName?: string 2400 2401 /** 2402 * Indicates the label id. 2403 * 2404 * @type { ?number } 2405 * @syscap SystemCapability.Applications.ContactsData 2406 * @since 7 2407 */ 2408 /** 2409 * Indicates the label id. 2410 * 2411 * @type { ?number } 2412 * @syscap SystemCapability.Applications.ContactsData 2413 * @atomicservice 2414 * @since 11 2415 */ 2416 labelId?: number 2417 } 2418 2419 /** 2420 * Provides methods for group information 2421 * 2422 * @syscap SystemCapability.Applications.ContactsData 2423 * @since 7 2424 */ 2425 /** 2426 * Provides methods for group information 2427 * 2428 * @syscap SystemCapability.Applications.ContactsData 2429 * @atomicservice 2430 * @since 11 2431 */ 2432 class Group { 2433 /** 2434 * Indicates the contact group ID. 2435 * 2436 * @type { ?number } 2437 * @syscap SystemCapability.Applications.ContactsData 2438 * @since 7 2439 */ 2440 /** 2441 * Indicates the contact group ID. 2442 * 2443 * @type { ?number } 2444 * @syscap SystemCapability.Applications.ContactsData 2445 * @atomicservice 2446 * @since 11 2447 */ 2448 groupId?: number 2449 2450 /** 2451 * Indicates the contact group title. 2452 * 2453 * @type { string } 2454 * @syscap SystemCapability.Applications.ContactsData 2455 * @since 7 2456 */ 2457 /** 2458 * Indicates the contact group title. 2459 * 2460 * @type { string } 2461 * @syscap SystemCapability.Applications.ContactsData 2462 * @atomicservice 2463 * @since 11 2464 */ 2465 title: string 2466 } 2467 2468 /** 2469 * Provides methods for holder information 2470 * 2471 * @syscap SystemCapability.Applications.ContactsData 2472 * @since 7 2473 */ 2474 class Holder { 2475 /** 2476 * Indicates the bundle name of a contact holder. 2477 * 2478 * @type { string } 2479 * @readonly 2480 * @syscap SystemCapability.Applications.ContactsData 2481 * @since 7 2482 */ 2483 readonly bundleName: string 2484 2485 /** 2486 * Indicates the displayed name of a contact holder. 2487 * 2488 * @type { ?string } 2489 * @readonly 2490 * @syscap SystemCapability.Applications.ContactsData 2491 * @since 7 2492 */ 2493 readonly displayName?: string 2494 2495 /** 2496 * Indicates the holder ID. 2497 * 2498 * @type { ?number } 2499 * @syscap SystemCapability.Applications.ContactsData 2500 * @since 7 2501 */ 2502 holderId?: number 2503 } 2504 2505 /** 2506 * Provides methods for ImAddress information 2507 * 2508 * @syscap SystemCapability.Applications.ContactsData 2509 * @since 7 2510 */ 2511 /** 2512 * Provides methods for ImAddress information 2513 * 2514 * @syscap SystemCapability.Applications.ContactsData 2515 * @atomicservice 2516 * @since 11 2517 */ 2518 class ImAddress { 2519 /** 2520 * Indicates a custom label. 2521 * 2522 * @type { number } 2523 * @readonly 2524 * @static 2525 * @syscap SystemCapability.Applications.ContactsData 2526 * @since 7 2527 */ 2528 /** 2529 * Indicates a custom label. 2530 * 2531 * @type { number } 2532 * @readonly 2533 * @static 2534 * @syscap SystemCapability.Applications.ContactsData 2535 * @atomicservice 2536 * @since 11 2537 */ 2538 static readonly CUSTOM_LABEL: -1 2539 2540 /** 2541 * Indicates an AIM instant message. 2542 * 2543 * @type { number } 2544 * @readonly 2545 * @static 2546 * @syscap SystemCapability.Applications.ContactsData 2547 * @since 7 2548 */ 2549 /** 2550 * Indicates an AIM instant message. 2551 * 2552 * @type { number } 2553 * @readonly 2554 * @static 2555 * @syscap SystemCapability.Applications.ContactsData 2556 * @atomicservice 2557 * @since 11 2558 */ 2559 static readonly IM_AIM: 0 2560 2561 /** 2562 * Indicates a Windows Live instant message. 2563 * 2564 * @type { number } 2565 * @readonly 2566 * @static 2567 * @syscap SystemCapability.Applications.ContactsData 2568 * @since 7 2569 */ 2570 /** 2571 * Indicates a Windows Live instant message. 2572 * 2573 * @type { number } 2574 * @readonly 2575 * @static 2576 * @syscap SystemCapability.Applications.ContactsData 2577 * @atomicservice 2578 * @since 11 2579 */ 2580 static readonly IM_MSN: 1 2581 2582 /** 2583 * Indicates a Yahoo instant message. 2584 * 2585 * @type { number } 2586 * @readonly 2587 * @static 2588 * @syscap SystemCapability.Applications.ContactsData 2589 * @since 7 2590 */ 2591 /** 2592 * Indicates a Yahoo instant message. 2593 * 2594 * @type { number } 2595 * @readonly 2596 * @static 2597 * @syscap SystemCapability.Applications.ContactsData 2598 * @atomicservice 2599 * @since 11 2600 */ 2601 static readonly IM_YAHOO: 2 2602 2603 /** 2604 * Indicates a Skype instant message. 2605 * 2606 * @type { number } 2607 * @readonly 2608 * @static 2609 * @syscap SystemCapability.Applications.ContactsData 2610 * @since 7 2611 */ 2612 /** 2613 * Indicates a Skype instant message. 2614 * 2615 * @type { number } 2616 * @readonly 2617 * @static 2618 * @syscap SystemCapability.Applications.ContactsData 2619 * @atomicservice 2620 * @since 11 2621 */ 2622 static readonly IM_SKYPE: 3 2623 2624 /** 2625 * Indicates a QQ instant message. 2626 * 2627 * @type { number } 2628 * @readonly 2629 * @static 2630 * @syscap SystemCapability.Applications.ContactsData 2631 * @since 7 2632 */ 2633 /** 2634 * Indicates a QQ instant message. 2635 * 2636 * @type { number } 2637 * @readonly 2638 * @static 2639 * @syscap SystemCapability.Applications.ContactsData 2640 * @atomicservice 2641 * @since 11 2642 */ 2643 static readonly IM_QQ: 4 2644 2645 /** 2646 * Indicates an ICQ instant message. 2647 * 2648 * @type { number } 2649 * @readonly 2650 * @static 2651 * @syscap SystemCapability.Applications.ContactsData 2652 * @since 7 2653 */ 2654 /** 2655 * Indicates an ICQ instant message. 2656 * 2657 * @type { number } 2658 * @readonly 2659 * @static 2660 * @syscap SystemCapability.Applications.ContactsData 2661 * @atomicservice 2662 * @since 11 2663 */ 2664 static readonly IM_ICQ: 6 2665 2666 /** 2667 * Indicates a Jabber instant message. 2668 * 2669 * @type { number } 2670 * @readonly 2671 * @static 2672 * @syscap SystemCapability.Applications.ContactsData 2673 * @since 7 2674 */ 2675 /** 2676 * Indicates a Jabber instant message. 2677 * 2678 * @type { number } 2679 * @readonly 2680 * @static 2681 * @syscap SystemCapability.Applications.ContactsData 2682 * @atomicservice 2683 * @since 11 2684 */ 2685 static readonly IM_JABBER: 7 2686 2687 /** 2688 * Indicates an invalid label ID. 2689 * 2690 * @type { number } 2691 * @readonly 2692 * @static 2693 * @syscap SystemCapability.Applications.ContactsData 2694 * @since 7 2695 */ 2696 /** 2697 * Indicates an invalid label ID. 2698 * 2699 * @type { number } 2700 * @readonly 2701 * @static 2702 * @syscap SystemCapability.Applications.ContactsData 2703 * @atomicservice 2704 * @since 11 2705 */ 2706 static readonly INVALID_LABEL_ID: -2 2707 2708 /** 2709 * Indicates the IM address. 2710 * 2711 * @type { string } 2712 * @syscap SystemCapability.Applications.ContactsData 2713 * @since 7 2714 */ 2715 /** 2716 * Indicates the IM address. 2717 * 2718 * @type { string } 2719 * @syscap SystemCapability.Applications.ContactsData 2720 * @atomicservice 2721 * @since 11 2722 */ 2723 imAddress: string 2724 2725 /** 2726 * Indicates the label name of an attribute. 2727 * 2728 * @type { ?string } 2729 * @syscap SystemCapability.Applications.ContactsData 2730 * @since 7 2731 */ 2732 /** 2733 * Indicates the label name of an attribute. 2734 * 2735 * @type { ?string } 2736 * @syscap SystemCapability.Applications.ContactsData 2737 * @atomicservice 2738 * @since 11 2739 */ 2740 labelName?: string 2741 2742 /** 2743 * Indicates the label id. 2744 * 2745 * @type { ?number } 2746 * @syscap SystemCapability.Applications.ContactsData 2747 * @since 7 2748 */ 2749 /** 2750 * Indicates the label id. 2751 * 2752 * @type { ?number } 2753 * @syscap SystemCapability.Applications.ContactsData 2754 * @atomicservice 2755 * @since 11 2756 */ 2757 labelId?: number 2758 } 2759 2760 /** 2761 * Provides methods for name information 2762 * 2763 * @syscap SystemCapability.Applications.ContactsData 2764 * @since 7 2765 */ 2766 /** 2767 * Provides methods for name information 2768 * 2769 * @syscap SystemCapability.Applications.ContactsData 2770 * @atomicservice 2771 * @since 11 2772 */ 2773 class Name { 2774 /** 2775 * Indicates the family name of the contact. 2776 * 2777 * @type { ?string } 2778 * @syscap SystemCapability.Applications.ContactsData 2779 * @since 7 2780 */ 2781 /** 2782 * Indicates the family name of the contact. 2783 * 2784 * @type { ?string } 2785 * @syscap SystemCapability.Applications.ContactsData 2786 * @atomicservice 2787 * @since 11 2788 */ 2789 familyName?: string 2790 2791 /** 2792 * Indicates the phonetic family name of the contact. 2793 * 2794 * @type { ?string } 2795 * @syscap SystemCapability.Applications.ContactsData 2796 * @since 7 2797 */ 2798 /** 2799 * Indicates the phonetic family name of the contact. 2800 * 2801 * @type { ?string } 2802 * @syscap SystemCapability.Applications.ContactsData 2803 * @atomicservice 2804 * @since 11 2805 */ 2806 familyNamePhonetic?: string 2807 2808 /** 2809 * Indicates the full name of the contact. 2810 * 2811 * @type { string } 2812 * @syscap SystemCapability.Applications.ContactsData 2813 * @since 7 2814 */ 2815 /** 2816 * Indicates the full name of the contact. 2817 * 2818 * @type { string } 2819 * @syscap SystemCapability.Applications.ContactsData 2820 * @atomicservice 2821 * @since 11 2822 */ 2823 fullName: string 2824 2825 /** 2826 * Indicates the given name of the contact. 2827 * 2828 * @type { ?string } 2829 * @syscap SystemCapability.Applications.ContactsData 2830 * @since 7 2831 */ 2832 /** 2833 * Indicates the given name of the contact. 2834 * 2835 * @type { ?string } 2836 * @syscap SystemCapability.Applications.ContactsData 2837 * @atomicservice 2838 * @since 11 2839 */ 2840 givenName?: string 2841 2842 /** 2843 * Indicates the phonetic given name of the contact. 2844 * 2845 * @type { ?string } 2846 * @syscap SystemCapability.Applications.ContactsData 2847 * @since 7 2848 */ 2849 /** 2850 * Indicates the phonetic given name of the contact. 2851 * 2852 * @type { ?string } 2853 * @syscap SystemCapability.Applications.ContactsData 2854 * @atomicservice 2855 * @since 11 2856 */ 2857 givenNamePhonetic?: string 2858 2859 /** 2860 * Indicates the middle name of the contact. 2861 * 2862 * @type { ?string } 2863 * @syscap SystemCapability.Applications.ContactsData 2864 * @since 7 2865 */ 2866 /** 2867 * Indicates the middle name of the contact. 2868 * 2869 * @type { ?string } 2870 * @syscap SystemCapability.Applications.ContactsData 2871 * @atomicservice 2872 * @since 11 2873 */ 2874 middleName?: string 2875 2876 /** 2877 * Indicates the phonetic middle name of the contact. 2878 * 2879 * @type { ?string } 2880 * @syscap SystemCapability.Applications.ContactsData 2881 * @since 7 2882 */ 2883 /** 2884 * Indicates the phonetic middle name of the contact. 2885 * 2886 * @type { ?string } 2887 * @syscap SystemCapability.Applications.ContactsData 2888 * @atomicservice 2889 * @since 11 2890 */ 2891 middleNamePhonetic?: string 2892 2893 /** 2894 * Indicates the prefix of the contact name. 2895 * 2896 * @type { ?string } 2897 * @syscap SystemCapability.Applications.ContactsData 2898 * @since 7 2899 */ 2900 /** 2901 * Indicates the prefix of the contact name. 2902 * 2903 * @type { ?string } 2904 * @syscap SystemCapability.Applications.ContactsData 2905 * @atomicservice 2906 * @since 11 2907 */ 2908 namePrefix?: string 2909 2910 /** 2911 * Indicates the suffix of this contact name. 2912 * 2913 * @type { ?string } 2914 * @syscap SystemCapability.Applications.ContactsData 2915 * @since 7 2916 */ 2917 /** 2918 * Indicates the suffix of this contact name. 2919 * 2920 * @type { ?string } 2921 * @syscap SystemCapability.Applications.ContactsData 2922 * @atomicservice 2923 * @since 11 2924 */ 2925 nameSuffix?: string 2926 } 2927 2928 /** 2929 * Provides methods for nick name information 2930 * 2931 * @syscap SystemCapability.Applications.ContactsData 2932 * @since 7 2933 */ 2934 /** 2935 * Provides methods for nick name information 2936 * 2937 * @syscap SystemCapability.Applications.ContactsData 2938 * @atomicservice 2939 * @since 11 2940 */ 2941 class NickName { 2942 /** 2943 * Indicates the nickname of the contact. 2944 * 2945 * @type { string } 2946 * @syscap SystemCapability.Applications.ContactsData 2947 * @since 7 2948 */ 2949 /** 2950 * Indicates the nickname of the contact. 2951 * 2952 * @type { string } 2953 * @syscap SystemCapability.Applications.ContactsData 2954 * @atomicservice 2955 * @since 11 2956 */ 2957 nickName: string 2958 } 2959 2960 /** 2961 * Provides methods for note information 2962 * 2963 * @syscap SystemCapability.Applications.ContactsData 2964 * @since 7 2965 */ 2966 /** 2967 * Provides methods for note information 2968 * 2969 * @syscap SystemCapability.Applications.ContactsData 2970 * @atomicservice 2971 * @since 11 2972 */ 2973 class Note { 2974 /** 2975 * Indicates the note content. 2976 * 2977 * @type { string } 2978 * @syscap SystemCapability.Applications.ContactsData 2979 * @since 7 2980 */ 2981 /** 2982 * Indicates the note content. 2983 * 2984 * @type { string } 2985 * @syscap SystemCapability.Applications.ContactsData 2986 * @atomicservice 2987 * @since 11 2988 */ 2989 noteContent: string 2990 } 2991 2992 /** 2993 * Provides methods for organization information 2994 * 2995 * @syscap SystemCapability.Applications.ContactsData 2996 * @since 7 2997 */ 2998 /** 2999 * Provides methods for organization information 3000 * 3001 * @syscap SystemCapability.Applications.ContactsData 3002 * @atomicservice 3003 * @since 11 3004 */ 3005 class Organization { 3006 /** 3007 * Indicates the name of the organization to which the contact belongs. 3008 * 3009 * @type { string } 3010 * @syscap SystemCapability.Applications.ContactsData 3011 * @since 7 3012 */ 3013 /** 3014 * Indicates the name of the organization to which the contact belongs. 3015 * 3016 * @type { string } 3017 * @syscap SystemCapability.Applications.ContactsData 3018 * @atomicservice 3019 * @since 11 3020 */ 3021 name: string 3022 3023 /** 3024 * Indicates the title of the organization. 3025 * 3026 * @type { ?string } 3027 * @syscap SystemCapability.Applications.ContactsData 3028 * @since 7 3029 */ 3030 /** 3031 * Indicates the title of the organization. 3032 * 3033 * @type { ?string } 3034 * @syscap SystemCapability.Applications.ContactsData 3035 * @atomicservice 3036 * @since 11 3037 */ 3038 title?: string 3039 } 3040 3041 /** 3042 * Provides methods for phone number information 3043 * 3044 * @syscap SystemCapability.Applications.ContactsData 3045 * @since 7 3046 */ 3047 /** 3048 * Provides methods for phone number information 3049 * 3050 * @syscap SystemCapability.Applications.ContactsData 3051 * @atomicservice 3052 * @since 11 3053 */ 3054 class PhoneNumber { 3055 /** 3056 * Indicates a custom label. 3057 * 3058 * @type { number } 3059 * @readonly 3060 * @static 3061 * @syscap SystemCapability.Applications.ContactsData 3062 * @since 7 3063 */ 3064 /** 3065 * Indicates a custom label. 3066 * 3067 * @type { number } 3068 * @readonly 3069 * @static 3070 * @syscap SystemCapability.Applications.ContactsData 3071 * @atomicservice 3072 * @since 11 3073 */ 3074 static readonly CUSTOM_LABEL: 0 3075 3076 /** 3077 * Indicates a home number. 3078 * 3079 * @type { number } 3080 * @readonly 3081 * @static 3082 * @syscap SystemCapability.Applications.ContactsData 3083 * @since 7 3084 */ 3085 /** 3086 * Indicates a home number. 3087 * 3088 * @type { number } 3089 * @readonly 3090 * @static 3091 * @syscap SystemCapability.Applications.ContactsData 3092 * @atomicservice 3093 * @since 11 3094 */ 3095 static readonly NUM_HOME: 1 3096 3097 /** 3098 * Indicates a mobile phone number. 3099 * 3100 * @type { number } 3101 * @readonly 3102 * @static 3103 * @syscap SystemCapability.Applications.ContactsData 3104 * @since 7 3105 */ 3106 /** 3107 * Indicates a mobile phone number. 3108 * 3109 * @type { number } 3110 * @readonly 3111 * @static 3112 * @syscap SystemCapability.Applications.ContactsData 3113 * @atomicservice 3114 * @since 11 3115 */ 3116 static readonly NUM_MOBILE: 2 3117 3118 /** 3119 * Indicates a work number. 3120 * 3121 * @type { number } 3122 * @readonly 3123 * @static 3124 * @syscap SystemCapability.Applications.ContactsData 3125 * @since 7 3126 */ 3127 /** 3128 * Indicates a work number. 3129 * 3130 * @type { number } 3131 * @readonly 3132 * @static 3133 * @syscap SystemCapability.Applications.ContactsData 3134 * @atomicservice 3135 * @since 11 3136 */ 3137 static readonly NUM_WORK: 3 3138 3139 /** 3140 * Indicates a work fax number. 3141 * 3142 * @type { number } 3143 * @readonly 3144 * @static 3145 * @syscap SystemCapability.Applications.ContactsData 3146 * @since 7 3147 */ 3148 /** 3149 * Indicates a work fax number. 3150 * 3151 * @type { number } 3152 * @readonly 3153 * @static 3154 * @syscap SystemCapability.Applications.ContactsData 3155 * @atomicservice 3156 * @since 11 3157 */ 3158 static readonly NUM_FAX_WORK: 4 3159 3160 /** 3161 * Indicates a home fax number. 3162 * 3163 * @type { number } 3164 * @readonly 3165 * @static 3166 * @syscap SystemCapability.Applications.ContactsData 3167 * @since 7 3168 */ 3169 /** 3170 * Indicates a home fax number. 3171 * 3172 * @type { number } 3173 * @readonly 3174 * @static 3175 * @syscap SystemCapability.Applications.ContactsData 3176 * @atomicservice 3177 * @since 11 3178 */ 3179 static readonly NUM_FAX_HOME: 5 3180 3181 /** 3182 * Indicates a pager number. 3183 * 3184 * @type { number } 3185 * @readonly 3186 * @static 3187 * @syscap SystemCapability.Applications.ContactsData 3188 * @since 7 3189 */ 3190 /** 3191 * Indicates a pager number. 3192 * 3193 * @type { number } 3194 * @readonly 3195 * @static 3196 * @syscap SystemCapability.Applications.ContactsData 3197 * @atomicservice 3198 * @since 11 3199 */ 3200 static readonly NUM_PAGER: 6 3201 3202 /** 3203 * Indicates a number of the OTHER type. 3204 * 3205 * @type { number } 3206 * @readonly 3207 * @static 3208 * @syscap SystemCapability.Applications.ContactsData 3209 * @since 7 3210 */ 3211 /** 3212 * Indicates a number of the OTHER type. 3213 * 3214 * @type { number } 3215 * @readonly 3216 * @static 3217 * @syscap SystemCapability.Applications.ContactsData 3218 * @atomicservice 3219 * @since 11 3220 */ 3221 static readonly NUM_OTHER: 7 3222 3223 /** 3224 * Indicates a callback number. 3225 * 3226 * @type { number } 3227 * @readonly 3228 * @static 3229 * @syscap SystemCapability.Applications.ContactsData 3230 * @since 7 3231 */ 3232 /** 3233 * Indicates a callback number. 3234 * 3235 * @type { number } 3236 * @readonly 3237 * @static 3238 * @syscap SystemCapability.Applications.ContactsData 3239 * @atomicservice 3240 * @since 11 3241 */ 3242 static readonly NUM_CALLBACK: 8 3243 3244 /** 3245 * Indicates a car number. 3246 * 3247 * @type { number } 3248 * @readonly 3249 * @static 3250 * @syscap SystemCapability.Applications.ContactsData 3251 * @since 7 3252 */ 3253 /** 3254 * Indicates a car number. 3255 * 3256 * @type { number } 3257 * @readonly 3258 * @static 3259 * @syscap SystemCapability.Applications.ContactsData 3260 * @atomicservice 3261 * @since 11 3262 */ 3263 static readonly NUM_CAR: 9 3264 3265 /** 3266 * Indicates a company director number. 3267 * 3268 * @type { number } 3269 * @readonly 3270 * @static 3271 * @syscap SystemCapability.Applications.ContactsData 3272 * @since 7 3273 */ 3274 /** 3275 * Indicates a company director number. 3276 * 3277 * @type { number } 3278 * @readonly 3279 * @static 3280 * @syscap SystemCapability.Applications.ContactsData 3281 * @atomicservice 3282 * @since 11 3283 */ 3284 static readonly NUM_COMPANY_MAIN: 10 3285 3286 /** 3287 * Indicates an Integrated Services Digital Network (ISDN) number. 3288 * 3289 * @type { number } 3290 * @readonly 3291 * @static 3292 * @syscap SystemCapability.Applications.ContactsData 3293 * @since 7 3294 */ 3295 /** 3296 * Indicates an Integrated Services Digital Network (ISDN) number. 3297 * 3298 * @type { number } 3299 * @readonly 3300 * @static 3301 * @syscap SystemCapability.Applications.ContactsData 3302 * @atomicservice 3303 * @since 11 3304 */ 3305 static readonly NUM_ISDN: 11 3306 3307 /** 3308 * Indicates a main number. 3309 * 3310 * @type { number } 3311 * @readonly 3312 * @static 3313 * @syscap SystemCapability.Applications.ContactsData 3314 * @since 7 3315 */ 3316 /** 3317 * Indicates a main number. 3318 * 3319 * @type { number } 3320 * @readonly 3321 * @static 3322 * @syscap SystemCapability.Applications.ContactsData 3323 * @atomicservice 3324 * @since 11 3325 */ 3326 static readonly NUM_MAIN: 12 3327 3328 /** 3329 * Indicates a number of the OTHER_FAX type. 3330 * 3331 * @type { number } 3332 * @readonly 3333 * @static 3334 * @syscap SystemCapability.Applications.ContactsData 3335 * @since 7 3336 */ 3337 /** 3338 * Indicates a number of the OTHER_FAX type. 3339 * 3340 * @type { number } 3341 * @readonly 3342 * @static 3343 * @syscap SystemCapability.Applications.ContactsData 3344 * @atomicservice 3345 * @since 11 3346 */ 3347 static readonly NUM_OTHER_FAX: 13 3348 3349 /** 3350 * Indicates a radio number. 3351 * 3352 * @type { number } 3353 * @readonly 3354 * @static 3355 * @syscap SystemCapability.Applications.ContactsData 3356 * @since 7 3357 */ 3358 /** 3359 * Indicates a radio number. 3360 * 3361 * @type { number } 3362 * @readonly 3363 * @static 3364 * @syscap SystemCapability.Applications.ContactsData 3365 * @atomicservice 3366 * @since 11 3367 */ 3368 static readonly NUM_RADIO: 14 3369 3370 /** 3371 * Indicates a telex number. 3372 * 3373 * @type { number } 3374 * @readonly 3375 * @static 3376 * @syscap SystemCapability.Applications.ContactsData 3377 * @since 7 3378 */ 3379 /** 3380 * Indicates a telex number. 3381 * 3382 * @type { number } 3383 * @readonly 3384 * @static 3385 * @syscap SystemCapability.Applications.ContactsData 3386 * @atomicservice 3387 * @since 11 3388 */ 3389 static readonly NUM_TELEX: 15 3390 3391 /** 3392 * Indicates a teletypewriter (TTY) or test-driven development (TDD) number. 3393 * 3394 * @type { number } 3395 * @readonly 3396 * @static 3397 * @syscap SystemCapability.Applications.ContactsData 3398 * @since 7 3399 */ 3400 /** 3401 * Indicates a teletypewriter (TTY) or test-driven development (TDD) number. 3402 * 3403 * @type { number } 3404 * @readonly 3405 * @static 3406 * @syscap SystemCapability.Applications.ContactsData 3407 * @atomicservice 3408 * @since 11 3409 */ 3410 static readonly NUM_TTY_TDD: 16 3411 3412 /** 3413 * Indicates a work mobile phone number. 3414 * 3415 * @type { number } 3416 * @readonly 3417 * @static 3418 * @syscap SystemCapability.Applications.ContactsData 3419 * @since 7 3420 */ 3421 /** 3422 * Indicates a work mobile phone number. 3423 * 3424 * @type { number } 3425 * @readonly 3426 * @static 3427 * @syscap SystemCapability.Applications.ContactsData 3428 * @atomicservice 3429 * @since 11 3430 */ 3431 static readonly NUM_WORK_MOBILE: 17 3432 3433 /** 3434 * Indicates a work pager number. 3435 * 3436 * @type { number } 3437 * @readonly 3438 * @static 3439 * @syscap SystemCapability.Applications.ContactsData 3440 * @since 7 3441 */ 3442 /** 3443 * Indicates a work pager number. 3444 * 3445 * @type { number } 3446 * @readonly 3447 * @static 3448 * @syscap SystemCapability.Applications.ContactsData 3449 * @atomicservice 3450 * @since 11 3451 */ 3452 static readonly NUM_WORK_PAGER: 18 3453 3454 /** 3455 * Indicates an assistant number. 3456 * 3457 * @type { number } 3458 * @readonly 3459 * @static 3460 * @syscap SystemCapability.Applications.ContactsData 3461 * @since 7 3462 */ 3463 /** 3464 * Indicates an assistant number. 3465 * 3466 * @type { number } 3467 * @readonly 3468 * @static 3469 * @syscap SystemCapability.Applications.ContactsData 3470 * @atomicservice 3471 * @since 11 3472 */ 3473 static readonly NUM_ASSISTANT: 19 3474 3475 /** 3476 * Indicates an MMS number. 3477 * 3478 * @type { number } 3479 * @readonly 3480 * @static 3481 * @syscap SystemCapability.Applications.ContactsData 3482 * @since 7 3483 */ 3484 /** 3485 * Indicates an MMS number. 3486 * 3487 * @type { number } 3488 * @readonly 3489 * @static 3490 * @syscap SystemCapability.Applications.ContactsData 3491 * @atomicservice 3492 * @since 11 3493 */ 3494 static readonly NUM_MMS: 20 3495 3496 /** 3497 * Indicates an invalid label ID. 3498 * 3499 * @type { number } 3500 * @readonly 3501 * @static 3502 * @syscap SystemCapability.Applications.ContactsData 3503 * @since 7 3504 */ 3505 /** 3506 * Indicates an invalid label ID. 3507 * 3508 * @type { number } 3509 * @readonly 3510 * @static 3511 * @syscap SystemCapability.Applications.ContactsData 3512 * @atomicservice 3513 * @since 11 3514 */ 3515 static readonly INVALID_LABEL_ID: -1 3516 3517 /** 3518 * Indicates the label name of an attribute. 3519 * 3520 * @type { ?string } 3521 * @syscap SystemCapability.Applications.ContactsData 3522 * @since 7 3523 */ 3524 /** 3525 * Indicates the label name of an attribute. 3526 * 3527 * @type { ?string } 3528 * @syscap SystemCapability.Applications.ContactsData 3529 * @atomicservice 3530 * @since 11 3531 */ 3532 labelName?: string 3533 3534 /** 3535 * Indicates the phone number of the contact. 3536 * 3537 * @type { string } 3538 * @syscap SystemCapability.Applications.ContactsData 3539 * @since 7 3540 */ 3541 /** 3542 * Indicates the phone number of the contact. 3543 * 3544 * @type { string } 3545 * @syscap SystemCapability.Applications.ContactsData 3546 * @atomicservice 3547 * @since 11 3548 */ 3549 phoneNumber: string 3550 3551 /** 3552 * Indicates the label id. 3553 * 3554 * @type { ?number } 3555 * @syscap SystemCapability.Applications.ContactsData 3556 * @since 7 3557 */ 3558 /** 3559 * Indicates the label id. 3560 * 3561 * @type { ?number } 3562 * @syscap SystemCapability.Applications.ContactsData 3563 * @atomicservice 3564 * @since 11 3565 */ 3566 labelId?: number 3567 } 3568 3569 /** 3570 * Provides methods for portrait information 3571 * 3572 * @syscap SystemCapability.Applications.ContactsData 3573 * @since 7 3574 */ 3575 /** 3576 * Provides methods for portrait information 3577 * 3578 * @syscap SystemCapability.Applications.ContactsData 3579 * @atomicservice 3580 * @since 11 3581 */ 3582 class Portrait { 3583 /** 3584 * Indicates the uri of the contact portrait. 3585 * 3586 * @type { string } 3587 * @syscap SystemCapability.Applications.ContactsData 3588 * @since 7 3589 */ 3590 /** 3591 * Indicates the uri of the contact portrait. 3592 * 3593 * @type { string } 3594 * @syscap SystemCapability.Applications.ContactsData 3595 * @atomicservice 3596 * @since 11 3597 */ 3598 uri: string 3599 } 3600 3601 /** 3602 * Provides methods for postal address information 3603 * 3604 * @syscap SystemCapability.Applications.ContactsData 3605 * @since 7 3606 */ 3607 /** 3608 * Provides methods for postal address information 3609 * 3610 * @syscap SystemCapability.Applications.ContactsData 3611 * @atomicservice 3612 * @since 11 3613 */ 3614 class PostalAddress { 3615 /** 3616 * Indicates a custom label. 3617 * 3618 * @type { number } 3619 * @readonly 3620 * @static 3621 * @syscap SystemCapability.Applications.ContactsData 3622 * @since 7 3623 */ 3624 /** 3625 * Indicates a custom label. 3626 * 3627 * @type { number } 3628 * @readonly 3629 * @static 3630 * @syscap SystemCapability.Applications.ContactsData 3631 * @atomicservice 3632 * @since 11 3633 */ 3634 static readonly CUSTOM_LABEL: 0 3635 3636 /** 3637 * Indicates a home address. 3638 * 3639 * @type { number } 3640 * @readonly 3641 * @static 3642 * @syscap SystemCapability.Applications.ContactsData 3643 * @since 7 3644 */ 3645 /** 3646 * Indicates a home address. 3647 * 3648 * @type { number } 3649 * @readonly 3650 * @static 3651 * @syscap SystemCapability.Applications.ContactsData 3652 * @atomicservice 3653 * @since 11 3654 */ 3655 static readonly ADDR_HOME: 1 3656 3657 /** 3658 * Indicates a work address. 3659 * 3660 * @type { number } 3661 * @readonly 3662 * @static 3663 * @syscap SystemCapability.Applications.ContactsData 3664 * @since 7 3665 */ 3666 /** 3667 * Indicates a work address. 3668 * 3669 * @type { number } 3670 * @readonly 3671 * @static 3672 * @syscap SystemCapability.Applications.ContactsData 3673 * @atomicservice 3674 * @since 11 3675 */ 3676 static readonly ADDR_WORK: 2 3677 3678 /** 3679 * Indicates an address of the OTHER type. 3680 * 3681 * @type { number } 3682 * @readonly 3683 * @static 3684 * @syscap SystemCapability.Applications.ContactsData 3685 * @since 7 3686 */ 3687 /** 3688 * Indicates an address of the OTHER type. 3689 * 3690 * @type { number } 3691 * @readonly 3692 * @static 3693 * @syscap SystemCapability.Applications.ContactsData 3694 * @atomicservice 3695 * @since 11 3696 */ 3697 static readonly ADDR_OTHER: 3 3698 3699 /** 3700 * Indicates an invalid label ID. 3701 * 3702 * @type { number } 3703 * @readonly 3704 * @static 3705 * @syscap SystemCapability.Applications.ContactsData 3706 * @since 7 3707 */ 3708 /** 3709 * Indicates an invalid label ID. 3710 * 3711 * @type { number } 3712 * @readonly 3713 * @static 3714 * @syscap SystemCapability.Applications.ContactsData 3715 * @atomicservice 3716 * @since 11 3717 */ 3718 static readonly INVALID_LABEL_ID: -1 3719 3720 /** 3721 * Indicates the city where this contact is located. 3722 * 3723 * @type { ?string } 3724 * @syscap SystemCapability.Applications.ContactsData 3725 * @since 7 3726 */ 3727 /** 3728 * Indicates the city where this contact is located. 3729 * 3730 * @type { ?string } 3731 * @syscap SystemCapability.Applications.ContactsData 3732 * @atomicservice 3733 * @since 11 3734 */ 3735 city?: string 3736 3737 /** 3738 * Indicates the country/region where this contact is located. 3739 * 3740 * @type { ?string } 3741 * @syscap SystemCapability.Applications.ContactsData 3742 * @since 7 3743 */ 3744 /** 3745 * Indicates the country/region where this contact is located. 3746 * 3747 * @type { ?string } 3748 * @syscap SystemCapability.Applications.ContactsData 3749 * @atomicservice 3750 * @since 11 3751 */ 3752 country?: string 3753 3754 /** 3755 * Indicates the label name of an attribute. 3756 * 3757 * @type { ?string } 3758 * @syscap SystemCapability.Applications.ContactsData 3759 * @since 7 3760 */ 3761 /** 3762 * Indicates the label name of an attribute. 3763 * 3764 * @type { ?string } 3765 * @syscap SystemCapability.Applications.ContactsData 3766 * @atomicservice 3767 * @since 11 3768 */ 3769 labelName?: string 3770 3771 /** 3772 * Indicates the neighborhood where this contact is located. 3773 * 3774 * @type { ?string } 3775 * @syscap SystemCapability.Applications.ContactsData 3776 * @since 7 3777 */ 3778 /** 3779 * Indicates the neighborhood where this contact is located. 3780 * 3781 * @type { ?string } 3782 * @syscap SystemCapability.Applications.ContactsData 3783 * @atomicservice 3784 * @since 11 3785 */ 3786 neighborhood?: string 3787 3788 /** 3789 * Indicates the post box of this contact. 3790 * 3791 * @type { ?string } 3792 * @syscap SystemCapability.Applications.ContactsData 3793 * @since 7 3794 */ 3795 /** 3796 * Indicates the post box of this contact. 3797 * 3798 * @type { ?string } 3799 * @syscap SystemCapability.Applications.ContactsData 3800 * @atomicservice 3801 * @since 11 3802 */ 3803 pobox?: string 3804 3805 /** 3806 * Indicates the postal address of this contact. 3807 * 3808 * @type { string } 3809 * @syscap SystemCapability.Applications.ContactsData 3810 * @since 7 3811 */ 3812 /** 3813 * Indicates the postal address of this contact. 3814 * 3815 * @type { string } 3816 * @syscap SystemCapability.Applications.ContactsData 3817 * @atomicservice 3818 * @since 11 3819 */ 3820 postalAddress: string 3821 3822 /** 3823 * Indicates the postal code of this contact. 3824 * 3825 * @type { ?string } 3826 * @syscap SystemCapability.Applications.ContactsData 3827 * @since 7 3828 */ 3829 /** 3830 * Indicates the postal code of this contact. 3831 * 3832 * @type { ?string } 3833 * @syscap SystemCapability.Applications.ContactsData 3834 * @atomicservice 3835 * @since 11 3836 */ 3837 postcode?: string 3838 3839 /** 3840 * Indicates the area where this contact is located. 3841 * 3842 * @type { ?string } 3843 * @syscap SystemCapability.Applications.ContactsData 3844 * @since 7 3845 */ 3846 /** 3847 * Indicates the area where this contact is located. 3848 * 3849 * @type { ?string } 3850 * @syscap SystemCapability.Applications.ContactsData 3851 * @atomicservice 3852 * @since 11 3853 */ 3854 region?: string 3855 3856 /** 3857 * Indicates the street where this contact is located. 3858 * 3859 * @type { ?string } 3860 * @syscap SystemCapability.Applications.ContactsData 3861 * @since 7 3862 */ 3863 /** 3864 * Indicates the street where this contact is located. 3865 * 3866 * @type { ?string } 3867 * @syscap SystemCapability.Applications.ContactsData 3868 * @atomicservice 3869 * @since 11 3870 */ 3871 street?: string 3872 3873 /** 3874 * Indicates the label id. 3875 * 3876 * @type { ?number } 3877 * @syscap SystemCapability.Applications.ContactsData 3878 * @since 7 3879 */ 3880 /** 3881 * Indicates the label id. 3882 * 3883 * @type { ?number } 3884 * @syscap SystemCapability.Applications.ContactsData 3885 * @atomicservice 3886 * @since 11 3887 */ 3888 labelId?: number 3889 } 3890 3891 /** 3892 * Provides methods for relation information 3893 * 3894 * @syscap SystemCapability.Applications.ContactsData 3895 * @since 7 3896 */ 3897 /** 3898 * Provides methods for relation information 3899 * 3900 * @syscap SystemCapability.Applications.ContactsData 3901 * @atomicservice 3902 * @since 11 3903 */ 3904 class Relation { 3905 /** 3906 * Indicates custom relationship type. 3907 * 3908 * @type { number } 3909 * @readonly 3910 * @static 3911 * @syscap SystemCapability.Applications.ContactsData 3912 * @since 7 3913 */ 3914 /** 3915 * Indicates custom relationship type. 3916 * 3917 * @type { number } 3918 * @readonly 3919 * @static 3920 * @syscap SystemCapability.Applications.ContactsData 3921 * @atomicservice 3922 * @since 11 3923 */ 3924 static readonly CUSTOM_LABEL: 0 3925 3926 /** 3927 * Indicates assistant relationship type. 3928 * 3929 * @type { number } 3930 * @readonly 3931 * @static 3932 * @syscap SystemCapability.Applications.ContactsData 3933 * @since 7 3934 */ 3935 /** 3936 * Indicates assistant relationship type. 3937 * 3938 * @type { number } 3939 * @readonly 3940 * @static 3941 * @syscap SystemCapability.Applications.ContactsData 3942 * @atomicservice 3943 * @since 11 3944 */ 3945 static readonly RELATION_ASSISTANT: 1 3946 3947 /** 3948 * Indicates brother relationship type. 3949 * 3950 * @type { number } 3951 * @readonly 3952 * @static 3953 * @syscap SystemCapability.Applications.ContactsData 3954 * @since 7 3955 */ 3956 /** 3957 * Indicates brother relationship type. 3958 * 3959 * @type { number } 3960 * @readonly 3961 * @static 3962 * @syscap SystemCapability.Applications.ContactsData 3963 * @atomicservice 3964 * @since 11 3965 */ 3966 static readonly RELATION_BROTHER: 2 3967 3968 /** 3969 * Indicates child relationship type. 3970 * 3971 * @type { number } 3972 * @readonly 3973 * @static 3974 * @syscap SystemCapability.Applications.ContactsData 3975 * @since 7 3976 */ 3977 /** 3978 * Indicates child relationship type. 3979 * 3980 * @type { number } 3981 * @readonly 3982 * @static 3983 * @syscap SystemCapability.Applications.ContactsData 3984 * @atomicservice 3985 * @since 11 3986 */ 3987 static readonly RELATION_CHILD: 3 3988 3989 /** 3990 * Indicates domestic partner relationship type. 3991 * 3992 * @type { number } 3993 * @readonly 3994 * @static 3995 * @syscap SystemCapability.Applications.ContactsData 3996 * @since 7 3997 */ 3998 /** 3999 * Indicates domestic partner relationship type. 4000 * 4001 * @type { number } 4002 * @readonly 4003 * @static 4004 * @syscap SystemCapability.Applications.ContactsData 4005 * @atomicservice 4006 * @since 11 4007 */ 4008 static readonly RELATION_DOMESTIC_PARTNER: 4 4009 4010 /** 4011 * Indicates father relationship type. 4012 * 4013 * @type { number } 4014 * @readonly 4015 * @static 4016 * @syscap SystemCapability.Applications.ContactsData 4017 * @since 7 4018 */ 4019 /** 4020 * Indicates father relationship type. 4021 * 4022 * @type { number } 4023 * @readonly 4024 * @static 4025 * @syscap SystemCapability.Applications.ContactsData 4026 * @atomicservice 4027 * @since 11 4028 */ 4029 static readonly RELATION_FATHER: 5 4030 4031 /** 4032 * Indicates friend relationship type. 4033 * 4034 * @type { number } 4035 * @readonly 4036 * @static 4037 * @syscap SystemCapability.Applications.ContactsData 4038 * @since 7 4039 */ 4040 /** 4041 * Indicates friend relationship type. 4042 * 4043 * @type { number } 4044 * @readonly 4045 * @static 4046 * @syscap SystemCapability.Applications.ContactsData 4047 * @atomicservice 4048 * @since 11 4049 */ 4050 static readonly RELATION_FRIEND: 6 4051 4052 /** 4053 * Indicates manager relationship type. 4054 * 4055 * @type { number } 4056 * @readonly 4057 * @static 4058 * @syscap SystemCapability.Applications.ContactsData 4059 * @since 7 4060 */ 4061 /** 4062 * Indicates manager relationship type. 4063 * 4064 * @type { number } 4065 * @readonly 4066 * @static 4067 * @syscap SystemCapability.Applications.ContactsData 4068 * @atomicservice 4069 * @since 11 4070 */ 4071 static readonly RELATION_MANAGER: 7 4072 4073 /** 4074 * Indicates mother relationship type. 4075 * 4076 * @type { number } 4077 * @readonly 4078 * @static 4079 * @syscap SystemCapability.Applications.ContactsData 4080 * @since 7 4081 */ 4082 /** 4083 * Indicates mother relationship type. 4084 * 4085 * @type { number } 4086 * @readonly 4087 * @static 4088 * @syscap SystemCapability.Applications.ContactsData 4089 * @atomicservice 4090 * @since 11 4091 */ 4092 static readonly RELATION_MOTHER: 8 4093 4094 /** 4095 * Indicates parent relationship type. 4096 * 4097 * @type { number } 4098 * @readonly 4099 * @static 4100 * @syscap SystemCapability.Applications.ContactsData 4101 * @since 7 4102 */ 4103 /** 4104 * Indicates parent relationship type. 4105 * 4106 * @type { number } 4107 * @readonly 4108 * @static 4109 * @syscap SystemCapability.Applications.ContactsData 4110 * @atomicservice 4111 * @since 11 4112 */ 4113 static readonly RELATION_PARENT: 9 4114 4115 /** 4116 * Indicates partner relationship type. 4117 * 4118 * @type { number } 4119 * @readonly 4120 * @static 4121 * @syscap SystemCapability.Applications.ContactsData 4122 * @since 7 4123 */ 4124 /** 4125 * Indicates partner relationship type. 4126 * 4127 * @type { number } 4128 * @readonly 4129 * @static 4130 * @syscap SystemCapability.Applications.ContactsData 4131 * @atomicservice 4132 * @since 11 4133 */ 4134 static readonly RELATION_PARTNER: 10 4135 4136 /** 4137 * Indicates referrer relationship type. 4138 * 4139 * @type { number } 4140 * @readonly 4141 * @static 4142 * @syscap SystemCapability.Applications.ContactsData 4143 * @since 7 4144 */ 4145 /** 4146 * Indicates referrer relationship type. 4147 * 4148 * @type { number } 4149 * @readonly 4150 * @static 4151 * @syscap SystemCapability.Applications.ContactsData 4152 * @atomicservice 4153 * @since 11 4154 */ 4155 static readonly RELATION_REFERRED_BY: 11 4156 4157 /** 4158 * Indicates relative relationship type. 4159 * 4160 * @type { number } 4161 * @readonly 4162 * @static 4163 * @syscap SystemCapability.Applications.ContactsData 4164 * @since 7 4165 */ 4166 /** 4167 * Indicates relative relationship type. 4168 * 4169 * @type { number } 4170 * @readonly 4171 * @static 4172 * @syscap SystemCapability.Applications.ContactsData 4173 * @atomicservice 4174 * @since 11 4175 */ 4176 static readonly RELATION_RELATIVE: 12 4177 4178 /** 4179 * Indicates sister relationship type. 4180 * 4181 * @type { number } 4182 * @readonly 4183 * @static 4184 * @syscap SystemCapability.Applications.ContactsData 4185 * @since 7 4186 */ 4187 /** 4188 * Indicates sister relationship type. 4189 * 4190 * @type { number } 4191 * @readonly 4192 * @static 4193 * @syscap SystemCapability.Applications.ContactsData 4194 * @atomicservice 4195 * @since 11 4196 */ 4197 static readonly RELATION_SISTER: 13 4198 4199 /** 4200 * Indicates spouse relationship type. 4201 * 4202 * @type { number } 4203 * @readonly 4204 * @static 4205 * @syscap SystemCapability.Applications.ContactsData 4206 * @since 7 4207 */ 4208 /** 4209 * Indicates spouse relationship type. 4210 * 4211 * @type { number } 4212 * @readonly 4213 * @static 4214 * @syscap SystemCapability.Applications.ContactsData 4215 * @atomicservice 4216 * @since 11 4217 */ 4218 static readonly RELATION_SPOUSE: 14 4219 4220 /** 4221 * Indicates invalid relationship type. 4222 * 4223 * @type { number } 4224 * @readonly 4225 * @static 4226 * @syscap SystemCapability.Applications.ContactsData 4227 * @since 7 4228 */ 4229 /** 4230 * Indicates invalid relationship type. 4231 * 4232 * @type { number } 4233 * @readonly 4234 * @static 4235 * @syscap SystemCapability.Applications.ContactsData 4236 * @atomicservice 4237 * @since 11 4238 */ 4239 static readonly INVALID_LABEL_ID: -1 4240 4241 /** 4242 * Indicates the label name of an attribute. 4243 * 4244 * @type { ?string } 4245 * @syscap SystemCapability.Applications.ContactsData 4246 * @since 7 4247 */ 4248 /** 4249 * Indicates the label name of an attribute. 4250 * 4251 * @type { ?string } 4252 * @syscap SystemCapability.Applications.ContactsData 4253 * @atomicservice 4254 * @since 11 4255 */ 4256 labelName?: string 4257 4258 /** 4259 * Indicates the relation name. 4260 * 4261 * @type { string } 4262 * @syscap SystemCapability.Applications.ContactsData 4263 * @since 7 4264 */ 4265 /** 4266 * Indicates the relation name. 4267 * 4268 * @type { string } 4269 * @syscap SystemCapability.Applications.ContactsData 4270 * @atomicservice 4271 * @since 11 4272 */ 4273 relationName: string 4274 4275 /** 4276 * Indicates the label id. 4277 * 4278 * @type { ?number } 4279 * @syscap SystemCapability.Applications.ContactsData 4280 * @since 7 4281 */ 4282 /** 4283 * Indicates the label id. 4284 * 4285 * @type { ?number } 4286 * @syscap SystemCapability.Applications.ContactsData 4287 * @atomicservice 4288 * @since 11 4289 */ 4290 labelId?: number 4291 } 4292 4293 /** 4294 * Provides methods for sip address information 4295 * 4296 * @syscap SystemCapability.Applications.ContactsData 4297 * @since 7 4298 */ 4299 /** 4300 * Provides methods for sip address information 4301 * 4302 * @syscap SystemCapability.Applications.ContactsData 4303 * @atomicservice 4304 * @since 11 4305 */ 4306 class SipAddress { 4307 /** 4308 * Indicates a custom label. 4309 * 4310 * @type { number } 4311 * @readonly 4312 * @static 4313 * @syscap SystemCapability.Applications.ContactsData 4314 * @since 7 4315 */ 4316 /** 4317 * Indicates a custom label. 4318 * 4319 * @type { number } 4320 * @readonly 4321 * @static 4322 * @syscap SystemCapability.Applications.ContactsData 4323 * @atomicservice 4324 * @since 11 4325 */ 4326 static readonly CUSTOM_LABEL: 0 4327 4328 /** 4329 * Indicates a home SIP address. 4330 * 4331 * @type { number } 4332 * @readonly 4333 * @static 4334 * @syscap SystemCapability.Applications.ContactsData 4335 * @since 7 4336 */ 4337 /** 4338 * Indicates a home SIP address. 4339 * 4340 * @type { number } 4341 * @readonly 4342 * @static 4343 * @syscap SystemCapability.Applications.ContactsData 4344 * @atomicservice 4345 * @since 11 4346 */ 4347 static readonly SIP_HOME: 1 4348 4349 /** 4350 * Indicates a work SIP address. 4351 * 4352 * @type { number } 4353 * @readonly 4354 * @static 4355 * @syscap SystemCapability.Applications.ContactsData 4356 * @since 7 4357 */ 4358 /** 4359 * Indicates a work SIP address. 4360 * 4361 * @type { number } 4362 * @readonly 4363 * @static 4364 * @syscap SystemCapability.Applications.ContactsData 4365 * @atomicservice 4366 * @since 11 4367 */ 4368 static readonly SIP_WORK: 2 4369 4370 /** 4371 * Indicates an SIP address of the OTHER type. 4372 * 4373 * @type { number } 4374 * @readonly 4375 * @static 4376 * @syscap SystemCapability.Applications.ContactsData 4377 * @since 7 4378 */ 4379 /** 4380 * Indicates an SIP address of the OTHER type. 4381 * 4382 * @type { number } 4383 * @readonly 4384 * @static 4385 * @syscap SystemCapability.Applications.ContactsData 4386 * @atomicservice 4387 * @since 11 4388 */ 4389 static readonly SIP_OTHER: 3 4390 4391 /** 4392 * Indicates an invalid label ID. 4393 * 4394 * @type { number } 4395 * @readonly 4396 * @static 4397 * @syscap SystemCapability.Applications.ContactsData 4398 * @since 7 4399 */ 4400 /** 4401 * Indicates an invalid label ID. 4402 * 4403 * @type { number } 4404 * @readonly 4405 * @static 4406 * @syscap SystemCapability.Applications.ContactsData 4407 * @atomicservice 4408 * @since 11 4409 */ 4410 static readonly INVALID_LABEL_ID: -1 4411 4412 /** 4413 * Indicates the label name of an attribute. 4414 * 4415 * @type { ?string } 4416 * @syscap SystemCapability.Applications.ContactsData 4417 * @since 7 4418 */ 4419 /** 4420 * Indicates the label name of an attribute. 4421 * 4422 * @type { ?string } 4423 * @syscap SystemCapability.Applications.ContactsData 4424 * @atomicservice 4425 * @since 11 4426 */ 4427 labelName?: string 4428 4429 /** 4430 * Indicates the SIP address. 4431 * 4432 * @type { string } 4433 * @syscap SystemCapability.Applications.ContactsData 4434 * @since 7 4435 */ 4436 /** 4437 * Indicates the SIP address. 4438 * 4439 * @type { string } 4440 * @syscap SystemCapability.Applications.ContactsData 4441 * @atomicservice 4442 * @since 11 4443 */ 4444 sipAddress: string 4445 4446 /** 4447 * Indicates the label id. 4448 * 4449 * @type { ?number } 4450 * @syscap SystemCapability.Applications.ContactsData 4451 * @since 7 4452 */ 4453 /** 4454 * Indicates the label id. 4455 * 4456 * @type { ?number } 4457 * @syscap SystemCapability.Applications.ContactsData 4458 * @atomicservice 4459 * @since 11 4460 */ 4461 labelId?: number 4462 } 4463 4464 /** 4465 * Provides methods for website information 4466 * 4467 * @syscap SystemCapability.Applications.ContactsData 4468 * @since 7 4469 */ 4470 /** 4471 * Provides methods for website information 4472 * 4473 * @syscap SystemCapability.Applications.ContactsData 4474 * @atomicservice 4475 * @since 11 4476 */ 4477 class Website { 4478 /** 4479 * Indicates the website. 4480 * 4481 * @type { string } 4482 * @syscap SystemCapability.Applications.ContactsData 4483 * @since 7 4484 */ 4485 /** 4486 * Indicates the website. 4487 * 4488 * @type { string } 4489 * @syscap SystemCapability.Applications.ContactsData 4490 * @atomicservice 4491 * @since 11 4492 */ 4493 website: string 4494 } 4495} 4496 4497export default contact;