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 * @readonly 1490 * @static 1491 * @syscap SystemCapability.Applications.ContactsData 1492 * @since 7 1493 */ 1494 /** 1495 * Indicates the contact invalid ID. 1496 * 1497 * @readonly 1498 * @static 1499 * @syscap SystemCapability.Applications.ContactsData 1500 * @atomicservice 1501 * @since 11 1502 */ 1503 static readonly INVALID_CONTACT_ID: -1 1504 1505 /** 1506 * Indicates the contact ID. 1507 * 1508 * @type { ?number } 1509 * @readonly 1510 * @syscap SystemCapability.Applications.ContactsData 1511 * @since 7 1512 */ 1513 /** 1514 * Indicates the contact ID. 1515 * 1516 * @type { ?number } 1517 * @readonly 1518 * @syscap SystemCapability.Applications.ContactsData 1519 * @atomicservice 1520 * @since 11 1521 */ 1522 readonly id?: number 1523 1524 /** 1525 * Indicates the query key that identifies the contact. 1526 * 1527 * @type { ?string } 1528 * @readonly 1529 * @syscap SystemCapability.Applications.ContactsData 1530 * @since 7 1531 */ 1532 /** 1533 * Indicates the query key that identifies the contact. 1534 * 1535 * @type { ?string } 1536 * @readonly 1537 * @syscap SystemCapability.Applications.ContactsData 1538 * @atomicservice 1539 * @since 11 1540 */ 1541 readonly key?: string 1542 1543 /** 1544 * Indicates the contact attributes. 1545 * 1546 * @type { ?ContactAttributes } 1547 * @syscap SystemCapability.Applications.ContactsData 1548 * @since 7 1549 */ 1550 /** 1551 * Indicates the contact attributes. 1552 * 1553 * @type { ?ContactAttributes } 1554 * @syscap SystemCapability.Applications.ContactsData 1555 * @atomicservice 1556 * @since 11 1557 */ 1558 contactAttributes?: ContactAttributes 1559 1560 /** 1561 * Indicates list of contact email addresses. 1562 * 1563 * @type { ?Email[] } 1564 * @syscap SystemCapability.Applications.ContactsData 1565 * @since 7 1566 */ 1567 /** 1568 * Indicates list of contact email addresses. 1569 * 1570 * @type { ?Email[] } 1571 * @syscap SystemCapability.Applications.ContactsData 1572 * @atomicservice 1573 * @since 11 1574 */ 1575 emails?: Email[] 1576 1577 /** 1578 * Indicates an event (special date) of the contact. 1579 * 1580 * @type { ?Event[] } 1581 * @syscap SystemCapability.Applications.ContactsData 1582 * @since 7 1583 */ 1584 /** 1585 * Indicates an event (special date) of the contact. 1586 * 1587 * @type { ?Event[] } 1588 * @syscap SystemCapability.Applications.ContactsData 1589 * @atomicservice 1590 * @since 11 1591 */ 1592 events?: Event[] 1593 1594 /** 1595 * Indicates a group of the contact. 1596 * 1597 * @type { ?Group[] } 1598 * @syscap SystemCapability.Applications.ContactsData 1599 * @since 7 1600 */ 1601 /** 1602 * Indicates a group of the contact. 1603 * 1604 * @type { ?Group[] } 1605 * @syscap SystemCapability.Applications.ContactsData 1606 * @atomicservice 1607 * @since 11 1608 */ 1609 groups?: Group[] 1610 1611 /** 1612 * Indicates an IM address of the contact. 1613 * 1614 * @type { ?ImAddress[] } 1615 * @syscap SystemCapability.Applications.ContactsData 1616 * @since 7 1617 */ 1618 /** 1619 * Indicates an IM address of the contact. 1620 * 1621 * @type { ?ImAddress[] } 1622 * @syscap SystemCapability.Applications.ContactsData 1623 * @atomicservice 1624 * @since 11 1625 */ 1626 imAddresses?: ImAddress[] 1627 1628 /** 1629 * Indicates a phone number of the contact. 1630 * 1631 * @type { ?PhoneNumber[] } 1632 * @syscap SystemCapability.Applications.ContactsData 1633 * @since 7 1634 */ 1635 /** 1636 * Indicates a phone number of the contact. 1637 * 1638 * @type { ?PhoneNumber[] } 1639 * @syscap SystemCapability.Applications.ContactsData 1640 * @atomicservice 1641 * @since 11 1642 */ 1643 phoneNumbers?: PhoneNumber[] 1644 1645 /** 1646 * Indicates the contact portrait. 1647 * 1648 * @type { ?Portrait } 1649 * @syscap SystemCapability.Applications.ContactsData 1650 * @since 7 1651 */ 1652 /** 1653 * Indicates the contact portrait. 1654 * 1655 * @type { ?Portrait } 1656 * @syscap SystemCapability.Applications.ContactsData 1657 * @atomicservice 1658 * @since 11 1659 */ 1660 portrait?: Portrait 1661 1662 /** 1663 * Indicates a postal address of the contact. 1664 * 1665 * @type { ?PostalAddress[] } 1666 * @syscap SystemCapability.Applications.ContactsData 1667 * @since 7 1668 */ 1669 /** 1670 * Indicates a postal address of the contact. 1671 * 1672 * @type { ?PostalAddress[] } 1673 * @syscap SystemCapability.Applications.ContactsData 1674 * @atomicservice 1675 * @since 11 1676 */ 1677 postalAddresses?: PostalAddress[] 1678 1679 /** 1680 * Indicates a relation of the contact. 1681 * 1682 * @type { ?Relation[] } 1683 * @syscap SystemCapability.Applications.ContactsData 1684 * @since 7 1685 */ 1686 /** 1687 * Indicates a relation of the contact. 1688 * 1689 * @type { ?Relation[] } 1690 * @syscap SystemCapability.Applications.ContactsData 1691 * @atomicservice 1692 * @since 11 1693 */ 1694 relations?: Relation[] 1695 1696 /** 1697 * Indicates a Session Initiation Protocol (SIP) address of the contact. 1698 * 1699 * @type { ?SipAddress[] } 1700 * @syscap SystemCapability.Applications.ContactsData 1701 * @since 7 1702 */ 1703 /** 1704 * Indicates a Session Initiation Protocol (SIP) address of the contact. 1705 * 1706 * @type { ?SipAddress[] } 1707 * @syscap SystemCapability.Applications.ContactsData 1708 * @atomicservice 1709 * @since 11 1710 */ 1711 sipAddresses?: SipAddress[] 1712 1713 /** 1714 * Indicates a website of the contact. 1715 * 1716 * @type { ?Website[] } 1717 * @syscap SystemCapability.Applications.ContactsData 1718 * @since 7 1719 */ 1720 /** 1721 * Indicates a website of the contact. 1722 * 1723 * @type { ?Website[] } 1724 * @syscap SystemCapability.Applications.ContactsData 1725 * @atomicservice 1726 * @since 11 1727 */ 1728 websites?: Website[] 1729 1730 /** 1731 * Indicates the contact name. 1732 * 1733 * @type { ?Name } 1734 * @syscap SystemCapability.Applications.ContactsData 1735 * @since 7 1736 */ 1737 /** 1738 * Indicates the contact name. 1739 * 1740 * @type { ?Name } 1741 * @syscap SystemCapability.Applications.ContactsData 1742 * @atomicservice 1743 * @since 11 1744 */ 1745 name?: Name 1746 1747 /** 1748 * Indicates the contact nickname. 1749 * 1750 * @type { ?NickName } 1751 * @syscap SystemCapability.Applications.ContactsData 1752 * @since 7 1753 */ 1754 /** 1755 * Indicates the contact nickname. 1756 * 1757 * @type { ?NickName } 1758 * @syscap SystemCapability.Applications.ContactsData 1759 * @atomicservice 1760 * @since 11 1761 */ 1762 nickName?: NickName 1763 1764 /** 1765 * Indicates the contact note. 1766 * 1767 * @type { ?Note } 1768 * @syscap SystemCapability.Applications.ContactsData 1769 * @since 7 1770 */ 1771 /** 1772 * Indicates the contact note. 1773 * 1774 * @type { ?Note } 1775 * @syscap SystemCapability.Applications.ContactsData 1776 * @atomicservice 1777 * @since 11 1778 */ 1779 note?: Note 1780 1781 /** 1782 * Indicates organization information about the contact. 1783 * 1784 * @type { ?Organization } 1785 * @syscap SystemCapability.Applications.ContactsData 1786 * @since 7 1787 */ 1788 /** 1789 * Indicates organization information about the contact. 1790 * 1791 * @type { ?Organization } 1792 * @syscap SystemCapability.Applications.ContactsData 1793 * @atomicservice 1794 * @since 11 1795 */ 1796 organization?: Organization 1797 } 1798 1799 /** 1800 * Provides methods for contact attributes information 1801 * 1802 * @syscap SystemCapability.Applications.ContactsData 1803 * @since 7 1804 */ 1805 /** 1806 * Provides methods for contact attributes information 1807 * 1808 * @syscap SystemCapability.Applications.ContactsData 1809 * @atomicservice 1810 * @since 11 1811 */ 1812 class ContactAttributes { 1813 /** 1814 * Indicates the contact attributes. 1815 * 1816 * @type { Attribute[] } 1817 * @syscap SystemCapability.Applications.ContactsData 1818 * @since 7 1819 */ 1820 /** 1821 * Indicates the contact attributes. 1822 * 1823 * @type { Attribute[] } 1824 * @syscap SystemCapability.Applications.ContactsData 1825 * @atomicservice 1826 * @since 11 1827 */ 1828 attributes: Attribute[] 1829 } 1830 1831 /** 1832 * Provides methods for attribute information 1833 * 1834 * @enum { number } 1835 * @syscap SystemCapability.Applications.ContactsData 1836 * @since 7 1837 */ 1838 /** 1839 * Provides methods for attribute information 1840 * 1841 * @enum { number } 1842 * @syscap SystemCapability.Applications.ContactsData 1843 * @atomicservice 1844 * @since 11 1845 */ 1846 enum Attribute { 1847 /** 1848 * Indicates the contact event. 1849 * 1850 * @syscap SystemCapability.Applications.ContactsData 1851 * @since 7 1852 */ 1853 /** 1854 * Indicates the contact event. 1855 * 1856 * @syscap SystemCapability.Applications.ContactsData 1857 * @atomicservice 1858 * @since 11 1859 */ 1860 ATTR_CONTACT_EVENT, 1861 1862 /** 1863 * Indicates the email address. 1864 * 1865 * @syscap SystemCapability.Applications.ContactsData 1866 * @since 7 1867 */ 1868 /** 1869 * Indicates the email address. 1870 * 1871 * @syscap SystemCapability.Applications.ContactsData 1872 * @atomicservice 1873 * @since 11 1874 */ 1875 ATTR_EMAIL, 1876 1877 /** 1878 * Indicates the contact group. 1879 * 1880 * @syscap SystemCapability.Applications.ContactsData 1881 * @since 7 1882 */ 1883 /** 1884 * Indicates the contact group. 1885 * 1886 * @syscap SystemCapability.Applications.ContactsData 1887 * @atomicservice 1888 * @since 11 1889 */ 1890 ATTR_GROUP_MEMBERSHIP, 1891 1892 /** 1893 * Indicates the instant messaging (IM) address. 1894 * 1895 * @syscap SystemCapability.Applications.ContactsData 1896 * @since 7 1897 */ 1898 /** 1899 * Indicates the instant messaging (IM) address. 1900 * 1901 * @syscap SystemCapability.Applications.ContactsData 1902 * @atomicservice 1903 * @since 11 1904 */ 1905 ATTR_IM, 1906 1907 /** 1908 * Indicates the name. 1909 * 1910 * @syscap SystemCapability.Applications.ContactsData 1911 * @since 7 1912 */ 1913 /** 1914 * Indicates the name. 1915 * 1916 * @syscap SystemCapability.Applications.ContactsData 1917 * @atomicservice 1918 * @since 11 1919 */ 1920 ATTR_NAME, 1921 1922 /** 1923 * Indicates the nickname. 1924 * 1925 * @syscap SystemCapability.Applications.ContactsData 1926 * @since 7 1927 */ 1928 /** 1929 * Indicates the nickname. 1930 * 1931 * @syscap SystemCapability.Applications.ContactsData 1932 * @atomicservice 1933 * @since 11 1934 */ 1935 ATTR_NICKNAME, 1936 1937 /** 1938 * Indicates the note. 1939 * 1940 * @syscap SystemCapability.Applications.ContactsData 1941 * @since 7 1942 */ 1943 /** 1944 * Indicates the note. 1945 * 1946 * @syscap SystemCapability.Applications.ContactsData 1947 * @atomicservice 1948 * @since 11 1949 */ 1950 ATTR_NOTE, 1951 1952 /** 1953 * Indicates the organization. 1954 * 1955 * @syscap SystemCapability.Applications.ContactsData 1956 * @since 7 1957 */ 1958 /** 1959 * Indicates the organization. 1960 * 1961 * @syscap SystemCapability.Applications.ContactsData 1962 * @atomicservice 1963 * @since 11 1964 */ 1965 ATTR_ORGANIZATION, 1966 1967 /** 1968 * Indicates the phone number. 1969 * 1970 * @syscap SystemCapability.Applications.ContactsData 1971 * @since 7 1972 */ 1973 /** 1974 * Indicates the phone number. 1975 * 1976 * @syscap SystemCapability.Applications.ContactsData 1977 * @atomicservice 1978 * @since 11 1979 */ 1980 ATTR_PHONE, 1981 1982 /** 1983 * Indicates the portrait. 1984 * 1985 * @syscap SystemCapability.Applications.ContactsData 1986 * @since 7 1987 */ 1988 /** 1989 * Indicates the portrait. 1990 * 1991 * @syscap SystemCapability.Applications.ContactsData 1992 * @atomicservice 1993 * @since 11 1994 */ 1995 ATTR_PORTRAIT, 1996 1997 /** 1998 * Indicates the postal address. 1999 * 2000 * @syscap SystemCapability.Applications.ContactsData 2001 * @since 7 2002 */ 2003 /** 2004 * Indicates the postal address. 2005 * 2006 * @syscap SystemCapability.Applications.ContactsData 2007 * @atomicservice 2008 * @since 11 2009 */ 2010 ATTR_POSTAL_ADDRESS, 2011 2012 /** 2013 * Indicates the relation. 2014 * 2015 * @syscap SystemCapability.Applications.ContactsData 2016 * @since 7 2017 */ 2018 /** 2019 * Indicates the relation. 2020 * 2021 * @syscap SystemCapability.Applications.ContactsData 2022 * @atomicservice 2023 * @since 11 2024 */ 2025 ATTR_RELATION, 2026 2027 /** 2028 * Indicates the Session Initiation Protocol (SIP) address. 2029 * 2030 * @syscap SystemCapability.Applications.ContactsData 2031 * @since 7 2032 */ 2033 /** 2034 * Indicates the Session Initiation Protocol (SIP) address. 2035 * 2036 * @syscap SystemCapability.Applications.ContactsData 2037 * @atomicservice 2038 * @since 11 2039 */ 2040 ATTR_SIP_ADDRESS, 2041 2042 /** 2043 * Indicates the website. 2044 * 2045 * @syscap SystemCapability.Applications.ContactsData 2046 * @since 7 2047 */ 2048 /** 2049 * Indicates the website. 2050 * 2051 * @syscap SystemCapability.Applications.ContactsData 2052 * @atomicservice 2053 * @since 11 2054 */ 2055 ATTR_WEBSITE 2056 } 2057 2058 /** 2059 * Provides methods for email information 2060 * 2061 * @syscap SystemCapability.Applications.ContactsData 2062 * @since 7 2063 */ 2064 /** 2065 * Provides methods for email information 2066 * 2067 * @syscap SystemCapability.Applications.ContactsData 2068 * @atomicservice 2069 * @since 11 2070 */ 2071 class Email { 2072 /** 2073 * Indicates a custom label. 2074 * 2075 * @readonly 2076 * @static 2077 * @syscap SystemCapability.Applications.ContactsData 2078 * @since 7 2079 */ 2080 /** 2081 * Indicates a custom label. 2082 * 2083 * @readonly 2084 * @static 2085 * @syscap SystemCapability.Applications.ContactsData 2086 * @atomicservice 2087 * @since 11 2088 */ 2089 static readonly CUSTOM_LABEL: 0 2090 2091 /** 2092 * Indicates a home email. 2093 * 2094 * @readonly 2095 * @static 2096 * @syscap SystemCapability.Applications.ContactsData 2097 * @since 7 2098 */ 2099 /** 2100 * Indicates a home email. 2101 * 2102 * @readonly 2103 * @static 2104 * @syscap SystemCapability.Applications.ContactsData 2105 * @atomicservice 2106 * @since 11 2107 */ 2108 static readonly EMAIL_HOME: 1 2109 2110 /** 2111 * Indicates a work email. 2112 * 2113 * @readonly 2114 * @static 2115 * @syscap SystemCapability.Applications.ContactsData 2116 * @since 7 2117 */ 2118 /** 2119 * Indicates a work email. 2120 * 2121 * @readonly 2122 * @static 2123 * @syscap SystemCapability.Applications.ContactsData 2124 * @atomicservice 2125 * @since 11 2126 */ 2127 static readonly EMAIL_WORK: 2 2128 2129 /** 2130 * Indicates an email of the OTHER type. 2131 * 2132 * @readonly 2133 * @static 2134 * @syscap SystemCapability.Applications.ContactsData 2135 * @since 7 2136 */ 2137 /** 2138 * Indicates an email of the OTHER type. 2139 * 2140 * @readonly 2141 * @static 2142 * @syscap SystemCapability.Applications.ContactsData 2143 * @atomicservice 2144 * @since 11 2145 */ 2146 static readonly EMAIL_OTHER: 3 2147 2148 /** 2149 * Indicates an invalid label ID. 2150 * 2151 * @readonly 2152 * @static 2153 * @syscap SystemCapability.Applications.ContactsData 2154 * @since 7 2155 */ 2156 /** 2157 * Indicates an invalid label ID. 2158 * 2159 * @readonly 2160 * @static 2161 * @syscap SystemCapability.Applications.ContactsData 2162 * @atomicservice 2163 * @since 11 2164 */ 2165 static readonly INVALID_LABEL_ID: -1 2166 2167 /** 2168 * Indicates the email address. 2169 * 2170 * @type { string } 2171 * @syscap SystemCapability.Applications.ContactsData 2172 * @since 7 2173 */ 2174 /** 2175 * Indicates the email address. 2176 * 2177 * @type { string } 2178 * @syscap SystemCapability.Applications.ContactsData 2179 * @atomicservice 2180 * @since 11 2181 */ 2182 email: string 2183 2184 /** 2185 * Indicates the label name of an attribute. 2186 * 2187 * @type { ?string } 2188 * @syscap SystemCapability.Applications.ContactsData 2189 * @since 7 2190 */ 2191 /** 2192 * Indicates the label name of an attribute. 2193 * 2194 * @type { ?string } 2195 * @syscap SystemCapability.Applications.ContactsData 2196 * @atomicservice 2197 * @since 11 2198 */ 2199 labelName?: string 2200 2201 /** 2202 * Indicates the displayed email name. 2203 * 2204 * @type { ?string } 2205 * @syscap SystemCapability.Applications.ContactsData 2206 * @since 7 2207 */ 2208 /** 2209 * Indicates the displayed email name. 2210 * 2211 * @type { ?string } 2212 * @syscap SystemCapability.Applications.ContactsData 2213 * @atomicservice 2214 * @since 11 2215 */ 2216 displayName?: string 2217 2218 /** 2219 * Indicates the label id. 2220 * 2221 * @type { ?number } 2222 * @syscap SystemCapability.Applications.ContactsData 2223 * @since 7 2224 */ 2225 /** 2226 * Indicates the label id. 2227 * 2228 * @type { ?number } 2229 * @syscap SystemCapability.Applications.ContactsData 2230 * @atomicservice 2231 * @since 11 2232 */ 2233 labelId?: number 2234 } 2235 2236 /** 2237 * Provides methods for event information 2238 * 2239 * @syscap SystemCapability.Applications.ContactsData 2240 * @since 7 2241 */ 2242 /** 2243 * Provides methods for event information 2244 * 2245 * @syscap SystemCapability.Applications.ContactsData 2246 * @atomicservice 2247 * @since 11 2248 */ 2249 class Event { 2250 /** 2251 * Indicates a custom label. 2252 * 2253 * @readonly 2254 * @static 2255 * @syscap SystemCapability.Applications.ContactsData 2256 * @since 7 2257 */ 2258 /** 2259 * Indicates a custom label. 2260 * 2261 * @readonly 2262 * @static 2263 * @syscap SystemCapability.Applications.ContactsData 2264 * @atomicservice 2265 * @since 11 2266 */ 2267 static readonly CUSTOM_LABEL: 0 2268 2269 /** 2270 * Indicates an anniversary event. 2271 * 2272 * @readonly 2273 * @static 2274 * @syscap SystemCapability.Applications.ContactsData 2275 * @since 7 2276 */ 2277 /** 2278 * Indicates an anniversary event. 2279 * 2280 * @readonly 2281 * @static 2282 * @syscap SystemCapability.Applications.ContactsData 2283 * @atomicservice 2284 * @since 11 2285 */ 2286 static readonly EVENT_ANNIVERSARY: 1 2287 2288 /** 2289 * Indicates an event of the OTHER type. 2290 * 2291 * @readonly 2292 * @static 2293 * @syscap SystemCapability.Applications.ContactsData 2294 * @since 7 2295 */ 2296 /** 2297 * Indicates an event of the OTHER type. 2298 * 2299 * @readonly 2300 * @static 2301 * @syscap SystemCapability.Applications.ContactsData 2302 * @atomicservice 2303 * @since 11 2304 */ 2305 static readonly EVENT_OTHER: 2 2306 2307 /** 2308 * Indicates an birthday event. 2309 * 2310 * @readonly 2311 * @static 2312 * @syscap SystemCapability.Applications.ContactsData 2313 * @since 7 2314 */ 2315 /** 2316 * Indicates an birthday event. 2317 * 2318 * @readonly 2319 * @static 2320 * @syscap SystemCapability.Applications.ContactsData 2321 * @atomicservice 2322 * @since 11 2323 */ 2324 static readonly EVENT_BIRTHDAY: 3 2325 2326 /** 2327 * Indicates an invalid label ID. 2328 * 2329 * @readonly 2330 * @static 2331 * @syscap SystemCapability.Applications.ContactsData 2332 * @since 7 2333 */ 2334 /** 2335 * Indicates an invalid label ID. 2336 * 2337 * @readonly 2338 * @static 2339 * @syscap SystemCapability.Applications.ContactsData 2340 * @atomicservice 2341 * @since 11 2342 */ 2343 static readonly INVALID_LABEL_ID: -1 2344 2345 /** 2346 * Indicates the event date. 2347 * 2348 * @type { string } 2349 * @syscap SystemCapability.Applications.ContactsData 2350 * @since 7 2351 */ 2352 /** 2353 * Indicates the event date. 2354 * 2355 * @type { string } 2356 * @syscap SystemCapability.Applications.ContactsData 2357 * @atomicservice 2358 * @since 11 2359 */ 2360 eventDate: string 2361 2362 /** 2363 * Indicates the label name of an attribute. 2364 * 2365 * @type { ?string } 2366 * @syscap SystemCapability.Applications.ContactsData 2367 * @since 7 2368 */ 2369 /** 2370 * Indicates the label name of an attribute. 2371 * 2372 * @type { ?string } 2373 * @syscap SystemCapability.Applications.ContactsData 2374 * @atomicservice 2375 * @since 11 2376 */ 2377 labelName?: string 2378 2379 /** 2380 * Indicates the label id. 2381 * 2382 * @type { ?number } 2383 * @syscap SystemCapability.Applications.ContactsData 2384 * @since 7 2385 */ 2386 /** 2387 * Indicates the label id. 2388 * 2389 * @type { ?number } 2390 * @syscap SystemCapability.Applications.ContactsData 2391 * @atomicservice 2392 * @since 11 2393 */ 2394 labelId?: number 2395 } 2396 2397 /** 2398 * Provides methods for group information 2399 * 2400 * @syscap SystemCapability.Applications.ContactsData 2401 * @since 7 2402 */ 2403 /** 2404 * Provides methods for group information 2405 * 2406 * @syscap SystemCapability.Applications.ContactsData 2407 * @atomicservice 2408 * @since 11 2409 */ 2410 class Group { 2411 /** 2412 * Indicates the contact group ID. 2413 * 2414 * @type { ?number } 2415 * @syscap SystemCapability.Applications.ContactsData 2416 * @since 7 2417 */ 2418 /** 2419 * Indicates the contact group ID. 2420 * 2421 * @type { ?number } 2422 * @syscap SystemCapability.Applications.ContactsData 2423 * @atomicservice 2424 * @since 11 2425 */ 2426 groupId?: number 2427 2428 /** 2429 * Indicates the contact group title. 2430 * 2431 * @type { string } 2432 * @syscap SystemCapability.Applications.ContactsData 2433 * @since 7 2434 */ 2435 /** 2436 * Indicates the contact group title. 2437 * 2438 * @type { string } 2439 * @syscap SystemCapability.Applications.ContactsData 2440 * @atomicservice 2441 * @since 11 2442 */ 2443 title: string 2444 } 2445 2446 /** 2447 * Provides methods for holder information 2448 * 2449 * @syscap SystemCapability.Applications.ContactsData 2450 * @since 7 2451 */ 2452 class Holder { 2453 /** 2454 * Indicates the bundle name of a contact holder. 2455 * 2456 * @type { string } 2457 * @readonly 2458 * @syscap SystemCapability.Applications.ContactsData 2459 * @since 7 2460 */ 2461 readonly bundleName: string 2462 2463 /** 2464 * Indicates the displayed name of a contact holder. 2465 * 2466 * @type { ?string } 2467 * @readonly 2468 * @syscap SystemCapability.Applications.ContactsData 2469 * @since 7 2470 */ 2471 readonly displayName?: string 2472 2473 /** 2474 * Indicates the holder ID. 2475 * 2476 * @type { ?number } 2477 * @syscap SystemCapability.Applications.ContactsData 2478 * @since 7 2479 */ 2480 holderId?: number 2481 } 2482 2483 /** 2484 * Provides methods for ImAddress information 2485 * 2486 * @syscap SystemCapability.Applications.ContactsData 2487 * @since 7 2488 */ 2489 /** 2490 * Provides methods for ImAddress information 2491 * 2492 * @syscap SystemCapability.Applications.ContactsData 2493 * @atomicservice 2494 * @since 11 2495 */ 2496 class ImAddress { 2497 /** 2498 * Indicates a custom label. 2499 * 2500 * @readonly 2501 * @static 2502 * @syscap SystemCapability.Applications.ContactsData 2503 * @since 7 2504 */ 2505 /** 2506 * Indicates a custom label. 2507 * 2508 * @readonly 2509 * @static 2510 * @syscap SystemCapability.Applications.ContactsData 2511 * @atomicservice 2512 * @since 11 2513 */ 2514 static readonly CUSTOM_LABEL: -1 2515 2516 /** 2517 * Indicates an AIM instant message. 2518 * 2519 * @readonly 2520 * @static 2521 * @syscap SystemCapability.Applications.ContactsData 2522 * @since 7 2523 */ 2524 /** 2525 * Indicates an AIM instant message. 2526 * 2527 * @readonly 2528 * @static 2529 * @syscap SystemCapability.Applications.ContactsData 2530 * @atomicservice 2531 * @since 11 2532 */ 2533 static readonly IM_AIM: 0 2534 2535 /** 2536 * Indicates a Windows Live instant message. 2537 * 2538 * @readonly 2539 * @static 2540 * @syscap SystemCapability.Applications.ContactsData 2541 * @since 7 2542 */ 2543 /** 2544 * Indicates a Windows Live instant message. 2545 * 2546 * @readonly 2547 * @static 2548 * @syscap SystemCapability.Applications.ContactsData 2549 * @atomicservice 2550 * @since 11 2551 */ 2552 static readonly IM_MSN: 1 2553 2554 /** 2555 * Indicates a Yahoo instant message. 2556 * 2557 * @readonly 2558 * @static 2559 * @syscap SystemCapability.Applications.ContactsData 2560 * @since 7 2561 */ 2562 /** 2563 * Indicates a Yahoo instant message. 2564 * 2565 * @readonly 2566 * @static 2567 * @syscap SystemCapability.Applications.ContactsData 2568 * @atomicservice 2569 * @since 11 2570 */ 2571 static readonly IM_YAHOO: 2 2572 2573 /** 2574 * Indicates a Skype instant message. 2575 * 2576 * @readonly 2577 * @static 2578 * @syscap SystemCapability.Applications.ContactsData 2579 * @since 7 2580 */ 2581 /** 2582 * Indicates a Skype instant message. 2583 * 2584 * @readonly 2585 * @static 2586 * @syscap SystemCapability.Applications.ContactsData 2587 * @atomicservice 2588 * @since 11 2589 */ 2590 static readonly IM_SKYPE: 3 2591 2592 /** 2593 * Indicates a QQ instant message. 2594 * 2595 * @readonly 2596 * @static 2597 * @syscap SystemCapability.Applications.ContactsData 2598 * @since 7 2599 */ 2600 /** 2601 * Indicates a QQ instant message. 2602 * 2603 * @readonly 2604 * @static 2605 * @syscap SystemCapability.Applications.ContactsData 2606 * @atomicservice 2607 * @since 11 2608 */ 2609 static readonly IM_QQ: 4 2610 2611 /** 2612 * Indicates an ICQ instant message. 2613 * 2614 * @readonly 2615 * @static 2616 * @syscap SystemCapability.Applications.ContactsData 2617 * @since 7 2618 */ 2619 /** 2620 * Indicates an ICQ instant message. 2621 * 2622 * @readonly 2623 * @static 2624 * @syscap SystemCapability.Applications.ContactsData 2625 * @atomicservice 2626 * @since 11 2627 */ 2628 static readonly IM_ICQ: 6 2629 2630 /** 2631 * Indicates a Jabber instant message. 2632 * 2633 * @readonly 2634 * @static 2635 * @syscap SystemCapability.Applications.ContactsData 2636 * @since 7 2637 */ 2638 /** 2639 * Indicates a Jabber instant message. 2640 * 2641 * @readonly 2642 * @static 2643 * @syscap SystemCapability.Applications.ContactsData 2644 * @atomicservice 2645 * @since 11 2646 */ 2647 static readonly IM_JABBER: 7 2648 2649 /** 2650 * Indicates an invalid label ID. 2651 * 2652 * @readonly 2653 * @static 2654 * @syscap SystemCapability.Applications.ContactsData 2655 * @since 7 2656 */ 2657 /** 2658 * Indicates an invalid label ID. 2659 * 2660 * @readonly 2661 * @static 2662 * @syscap SystemCapability.Applications.ContactsData 2663 * @atomicservice 2664 * @since 11 2665 */ 2666 static readonly INVALID_LABEL_ID: -2 2667 2668 /** 2669 * Indicates the IM address. 2670 * 2671 * @type { string } 2672 * @syscap SystemCapability.Applications.ContactsData 2673 * @since 7 2674 */ 2675 /** 2676 * Indicates the IM address. 2677 * 2678 * @type { string } 2679 * @syscap SystemCapability.Applications.ContactsData 2680 * @atomicservice 2681 * @since 11 2682 */ 2683 imAddress: string 2684 2685 /** 2686 * Indicates the label name of an attribute. 2687 * 2688 * @type { ?string } 2689 * @syscap SystemCapability.Applications.ContactsData 2690 * @since 7 2691 */ 2692 /** 2693 * Indicates the label name of an attribute. 2694 * 2695 * @type { ?string } 2696 * @syscap SystemCapability.Applications.ContactsData 2697 * @atomicservice 2698 * @since 11 2699 */ 2700 labelName?: string 2701 2702 /** 2703 * Indicates the label id. 2704 * 2705 * @type { ?number } 2706 * @syscap SystemCapability.Applications.ContactsData 2707 * @since 7 2708 */ 2709 /** 2710 * Indicates the label id. 2711 * 2712 * @type { ?number } 2713 * @syscap SystemCapability.Applications.ContactsData 2714 * @atomicservice 2715 * @since 11 2716 */ 2717 labelId?: number 2718 } 2719 2720 /** 2721 * Provides methods for name information 2722 * 2723 * @syscap SystemCapability.Applications.ContactsData 2724 * @since 7 2725 */ 2726 /** 2727 * Provides methods for name information 2728 * 2729 * @syscap SystemCapability.Applications.ContactsData 2730 * @atomicservice 2731 * @since 11 2732 */ 2733 class Name { 2734 /** 2735 * Indicates the family name of the contact. 2736 * 2737 * @type { ?string } 2738 * @syscap SystemCapability.Applications.ContactsData 2739 * @since 7 2740 */ 2741 /** 2742 * Indicates the family name of the contact. 2743 * 2744 * @type { ?string } 2745 * @syscap SystemCapability.Applications.ContactsData 2746 * @atomicservice 2747 * @since 11 2748 */ 2749 familyName?: string 2750 2751 /** 2752 * Indicates the phonetic family name of the contact. 2753 * 2754 * @type { ?string } 2755 * @syscap SystemCapability.Applications.ContactsData 2756 * @since 7 2757 */ 2758 /** 2759 * Indicates the phonetic family name of the contact. 2760 * 2761 * @type { ?string } 2762 * @syscap SystemCapability.Applications.ContactsData 2763 * @atomicservice 2764 * @since 11 2765 */ 2766 familyNamePhonetic?: string 2767 2768 /** 2769 * Indicates the full name of the contact. 2770 * 2771 * @type { string } 2772 * @syscap SystemCapability.Applications.ContactsData 2773 * @since 7 2774 */ 2775 /** 2776 * Indicates the full name of the contact. 2777 * 2778 * @type { string } 2779 * @syscap SystemCapability.Applications.ContactsData 2780 * @atomicservice 2781 * @since 11 2782 */ 2783 fullName: string 2784 2785 /** 2786 * Indicates the given name of the contact. 2787 * 2788 * @type { ?string } 2789 * @syscap SystemCapability.Applications.ContactsData 2790 * @since 7 2791 */ 2792 /** 2793 * Indicates the given name of the contact. 2794 * 2795 * @type { ?string } 2796 * @syscap SystemCapability.Applications.ContactsData 2797 * @atomicservice 2798 * @since 11 2799 */ 2800 givenName?: string 2801 2802 /** 2803 * Indicates the phonetic given name of the contact. 2804 * 2805 * @type { ?string } 2806 * @syscap SystemCapability.Applications.ContactsData 2807 * @since 7 2808 */ 2809 /** 2810 * Indicates the phonetic given name of the contact. 2811 * 2812 * @type { ?string } 2813 * @syscap SystemCapability.Applications.ContactsData 2814 * @atomicservice 2815 * @since 11 2816 */ 2817 givenNamePhonetic?: string 2818 2819 /** 2820 * Indicates the middle name of the contact. 2821 * 2822 * @type { ?string } 2823 * @syscap SystemCapability.Applications.ContactsData 2824 * @since 7 2825 */ 2826 /** 2827 * Indicates the middle name of the contact. 2828 * 2829 * @type { ?string } 2830 * @syscap SystemCapability.Applications.ContactsData 2831 * @atomicservice 2832 * @since 11 2833 */ 2834 middleName?: string 2835 2836 /** 2837 * Indicates the phonetic middle name of the contact. 2838 * 2839 * @type { ?string } 2840 * @syscap SystemCapability.Applications.ContactsData 2841 * @since 7 2842 */ 2843 /** 2844 * Indicates the phonetic middle name of the contact. 2845 * 2846 * @type { ?string } 2847 * @syscap SystemCapability.Applications.ContactsData 2848 * @atomicservice 2849 * @since 11 2850 */ 2851 middleNamePhonetic?: string 2852 2853 /** 2854 * Indicates the prefix of the contact name. 2855 * 2856 * @type { ?string } 2857 * @syscap SystemCapability.Applications.ContactsData 2858 * @since 7 2859 */ 2860 /** 2861 * Indicates the prefix of the contact name. 2862 * 2863 * @type { ?string } 2864 * @syscap SystemCapability.Applications.ContactsData 2865 * @atomicservice 2866 * @since 11 2867 */ 2868 namePrefix?: string 2869 2870 /** 2871 * Indicates the suffix of this contact name. 2872 * 2873 * @type { ?string } 2874 * @syscap SystemCapability.Applications.ContactsData 2875 * @since 7 2876 */ 2877 /** 2878 * Indicates the suffix of this contact name. 2879 * 2880 * @type { ?string } 2881 * @syscap SystemCapability.Applications.ContactsData 2882 * @atomicservice 2883 * @since 11 2884 */ 2885 nameSuffix?: string 2886 } 2887 2888 /** 2889 * Provides methods for nick name information 2890 * 2891 * @syscap SystemCapability.Applications.ContactsData 2892 * @since 7 2893 */ 2894 /** 2895 * Provides methods for nick name information 2896 * 2897 * @syscap SystemCapability.Applications.ContactsData 2898 * @atomicservice 2899 * @since 11 2900 */ 2901 class NickName { 2902 /** 2903 * Indicates the nickname of the contact. 2904 * 2905 * @type { string } 2906 * @syscap SystemCapability.Applications.ContactsData 2907 * @since 7 2908 */ 2909 /** 2910 * Indicates the nickname of the contact. 2911 * 2912 * @type { string } 2913 * @syscap SystemCapability.Applications.ContactsData 2914 * @atomicservice 2915 * @since 11 2916 */ 2917 nickName: string 2918 } 2919 2920 /** 2921 * Provides methods for note information 2922 * 2923 * @syscap SystemCapability.Applications.ContactsData 2924 * @since 7 2925 */ 2926 /** 2927 * Provides methods for note information 2928 * 2929 * @syscap SystemCapability.Applications.ContactsData 2930 * @atomicservice 2931 * @since 11 2932 */ 2933 class Note { 2934 /** 2935 * Indicates the note content. 2936 * 2937 * @type { string } 2938 * @syscap SystemCapability.Applications.ContactsData 2939 * @since 7 2940 */ 2941 /** 2942 * Indicates the note content. 2943 * 2944 * @type { string } 2945 * @syscap SystemCapability.Applications.ContactsData 2946 * @atomicservice 2947 * @since 11 2948 */ 2949 noteContent: string 2950 } 2951 2952 /** 2953 * Provides methods for organization information 2954 * 2955 * @syscap SystemCapability.Applications.ContactsData 2956 * @since 7 2957 */ 2958 /** 2959 * Provides methods for organization information 2960 * 2961 * @syscap SystemCapability.Applications.ContactsData 2962 * @atomicservice 2963 * @since 11 2964 */ 2965 class Organization { 2966 /** 2967 * Indicates the name of the organization to which the contact belongs. 2968 * 2969 * @type { string } 2970 * @syscap SystemCapability.Applications.ContactsData 2971 * @since 7 2972 */ 2973 /** 2974 * Indicates the name of the organization to which the contact belongs. 2975 * 2976 * @type { string } 2977 * @syscap SystemCapability.Applications.ContactsData 2978 * @atomicservice 2979 * @since 11 2980 */ 2981 name: string 2982 2983 /** 2984 * Indicates the title of the organization. 2985 * 2986 * @type { ?string } 2987 * @syscap SystemCapability.Applications.ContactsData 2988 * @since 7 2989 */ 2990 /** 2991 * Indicates the title of the organization. 2992 * 2993 * @type { ?string } 2994 * @syscap SystemCapability.Applications.ContactsData 2995 * @atomicservice 2996 * @since 11 2997 */ 2998 title?: string 2999 } 3000 3001 /** 3002 * Provides methods for phone number information 3003 * 3004 * @syscap SystemCapability.Applications.ContactsData 3005 * @since 7 3006 */ 3007 /** 3008 * Provides methods for phone number information 3009 * 3010 * @syscap SystemCapability.Applications.ContactsData 3011 * @atomicservice 3012 * @since 11 3013 */ 3014 class PhoneNumber { 3015 /** 3016 * Indicates a custom label. 3017 * 3018 * @readonly 3019 * @static 3020 * @syscap SystemCapability.Applications.ContactsData 3021 * @since 7 3022 */ 3023 /** 3024 * Indicates a custom label. 3025 * 3026 * @readonly 3027 * @static 3028 * @syscap SystemCapability.Applications.ContactsData 3029 * @atomicservice 3030 * @since 11 3031 */ 3032 static readonly CUSTOM_LABEL: 0 3033 3034 /** 3035 * Indicates a home number. 3036 * 3037 * @readonly 3038 * @static 3039 * @syscap SystemCapability.Applications.ContactsData 3040 * @since 7 3041 */ 3042 /** 3043 * Indicates a home number. 3044 * 3045 * @readonly 3046 * @static 3047 * @syscap SystemCapability.Applications.ContactsData 3048 * @atomicservice 3049 * @since 11 3050 */ 3051 static readonly NUM_HOME: 1 3052 3053 /** 3054 * Indicates a mobile phone number. 3055 * 3056 * @readonly 3057 * @static 3058 * @syscap SystemCapability.Applications.ContactsData 3059 * @since 7 3060 */ 3061 /** 3062 * Indicates a mobile phone number. 3063 * 3064 * @readonly 3065 * @static 3066 * @syscap SystemCapability.Applications.ContactsData 3067 * @atomicservice 3068 * @since 11 3069 */ 3070 static readonly NUM_MOBILE: 2 3071 3072 /** 3073 * Indicates a work number. 3074 * 3075 * @readonly 3076 * @static 3077 * @syscap SystemCapability.Applications.ContactsData 3078 * @since 7 3079 */ 3080 /** 3081 * Indicates a work number. 3082 * 3083 * @readonly 3084 * @static 3085 * @syscap SystemCapability.Applications.ContactsData 3086 * @atomicservice 3087 * @since 11 3088 */ 3089 static readonly NUM_WORK: 3 3090 3091 /** 3092 * Indicates a work fax number. 3093 * 3094 * @readonly 3095 * @static 3096 * @syscap SystemCapability.Applications.ContactsData 3097 * @since 7 3098 */ 3099 /** 3100 * Indicates a work fax number. 3101 * 3102 * @readonly 3103 * @static 3104 * @syscap SystemCapability.Applications.ContactsData 3105 * @atomicservice 3106 * @since 11 3107 */ 3108 static readonly NUM_FAX_WORK: 4 3109 3110 /** 3111 * Indicates a home fax number. 3112 * 3113 * @readonly 3114 * @static 3115 * @syscap SystemCapability.Applications.ContactsData 3116 * @since 7 3117 */ 3118 /** 3119 * Indicates a home fax number. 3120 * 3121 * @readonly 3122 * @static 3123 * @syscap SystemCapability.Applications.ContactsData 3124 * @atomicservice 3125 * @since 11 3126 */ 3127 static readonly NUM_FAX_HOME: 5 3128 3129 /** 3130 * Indicates a pager number. 3131 * 3132 * @readonly 3133 * @static 3134 * @syscap SystemCapability.Applications.ContactsData 3135 * @since 7 3136 */ 3137 /** 3138 * Indicates a pager number. 3139 * 3140 * @readonly 3141 * @static 3142 * @syscap SystemCapability.Applications.ContactsData 3143 * @atomicservice 3144 * @since 11 3145 */ 3146 static readonly NUM_PAGER: 6 3147 3148 /** 3149 * Indicates a number of the OTHER type. 3150 * 3151 * @readonly 3152 * @static 3153 * @syscap SystemCapability.Applications.ContactsData 3154 * @since 7 3155 */ 3156 /** 3157 * Indicates a number of the OTHER type. 3158 * 3159 * @readonly 3160 * @static 3161 * @syscap SystemCapability.Applications.ContactsData 3162 * @atomicservice 3163 * @since 11 3164 */ 3165 static readonly NUM_OTHER: 7 3166 3167 /** 3168 * Indicates a callback number. 3169 * 3170 * @readonly 3171 * @static 3172 * @syscap SystemCapability.Applications.ContactsData 3173 * @since 7 3174 */ 3175 /** 3176 * Indicates a callback number. 3177 * 3178 * @readonly 3179 * @static 3180 * @syscap SystemCapability.Applications.ContactsData 3181 * @atomicservice 3182 * @since 11 3183 */ 3184 static readonly NUM_CALLBACK: 8 3185 3186 /** 3187 * Indicates a car number. 3188 * 3189 * @readonly 3190 * @static 3191 * @syscap SystemCapability.Applications.ContactsData 3192 * @since 7 3193 */ 3194 /** 3195 * Indicates a car number. 3196 * 3197 * @readonly 3198 * @static 3199 * @syscap SystemCapability.Applications.ContactsData 3200 * @atomicservice 3201 * @since 11 3202 */ 3203 static readonly NUM_CAR: 9 3204 3205 /** 3206 * Indicates a company director number. 3207 * 3208 * @readonly 3209 * @static 3210 * @syscap SystemCapability.Applications.ContactsData 3211 * @since 7 3212 */ 3213 /** 3214 * Indicates a company director number. 3215 * 3216 * @readonly 3217 * @static 3218 * @syscap SystemCapability.Applications.ContactsData 3219 * @atomicservice 3220 * @since 11 3221 */ 3222 static readonly NUM_COMPANY_MAIN: 10 3223 3224 /** 3225 * Indicates an Integrated Services Digital Network (ISDN) number. 3226 * 3227 * @readonly 3228 * @static 3229 * @syscap SystemCapability.Applications.ContactsData 3230 * @since 7 3231 */ 3232 /** 3233 * Indicates an Integrated Services Digital Network (ISDN) number. 3234 * 3235 * @readonly 3236 * @static 3237 * @syscap SystemCapability.Applications.ContactsData 3238 * @atomicservice 3239 * @since 11 3240 */ 3241 static readonly NUM_ISDN: 11 3242 3243 /** 3244 * Indicates a main number. 3245 * 3246 * @readonly 3247 * @static 3248 * @syscap SystemCapability.Applications.ContactsData 3249 * @since 7 3250 */ 3251 /** 3252 * Indicates a main number. 3253 * 3254 * @readonly 3255 * @static 3256 * @syscap SystemCapability.Applications.ContactsData 3257 * @atomicservice 3258 * @since 11 3259 */ 3260 static readonly NUM_MAIN: 12 3261 3262 /** 3263 * Indicates a number of the OTHER_FAX type. 3264 * 3265 * @readonly 3266 * @static 3267 * @syscap SystemCapability.Applications.ContactsData 3268 * @since 7 3269 */ 3270 /** 3271 * Indicates a number of the OTHER_FAX type. 3272 * 3273 * @readonly 3274 * @static 3275 * @syscap SystemCapability.Applications.ContactsData 3276 * @atomicservice 3277 * @since 11 3278 */ 3279 static readonly NUM_OTHER_FAX: 13 3280 3281 /** 3282 * Indicates a radio number. 3283 * 3284 * @readonly 3285 * @static 3286 * @syscap SystemCapability.Applications.ContactsData 3287 * @since 7 3288 */ 3289 /** 3290 * Indicates a radio number. 3291 * 3292 * @readonly 3293 * @static 3294 * @syscap SystemCapability.Applications.ContactsData 3295 * @atomicservice 3296 * @since 11 3297 */ 3298 static readonly NUM_RADIO: 14 3299 3300 /** 3301 * Indicates a telex number. 3302 * 3303 * @readonly 3304 * @static 3305 * @syscap SystemCapability.Applications.ContactsData 3306 * @since 7 3307 */ 3308 /** 3309 * Indicates a telex number. 3310 * 3311 * @readonly 3312 * @static 3313 * @syscap SystemCapability.Applications.ContactsData 3314 * @atomicservice 3315 * @since 11 3316 */ 3317 static readonly NUM_TELEX: 15 3318 3319 /** 3320 * Indicates a teletypewriter (TTY) or test-driven development (TDD) number. 3321 * 3322 * @readonly 3323 * @static 3324 * @syscap SystemCapability.Applications.ContactsData 3325 * @since 7 3326 */ 3327 /** 3328 * Indicates a teletypewriter (TTY) or test-driven development (TDD) number. 3329 * 3330 * @readonly 3331 * @static 3332 * @syscap SystemCapability.Applications.ContactsData 3333 * @atomicservice 3334 * @since 11 3335 */ 3336 static readonly NUM_TTY_TDD: 16 3337 3338 /** 3339 * Indicates a work mobile phone number. 3340 * 3341 * @readonly 3342 * @static 3343 * @syscap SystemCapability.Applications.ContactsData 3344 * @since 7 3345 */ 3346 /** 3347 * Indicates a work mobile phone number. 3348 * 3349 * @readonly 3350 * @static 3351 * @syscap SystemCapability.Applications.ContactsData 3352 * @atomicservice 3353 * @since 11 3354 */ 3355 static readonly NUM_WORK_MOBILE: 17 3356 3357 /** 3358 * Indicates a work pager number. 3359 * 3360 * @readonly 3361 * @static 3362 * @syscap SystemCapability.Applications.ContactsData 3363 * @since 7 3364 */ 3365 /** 3366 * Indicates a work pager number. 3367 * 3368 * @readonly 3369 * @static 3370 * @syscap SystemCapability.Applications.ContactsData 3371 * @atomicservice 3372 * @since 11 3373 */ 3374 static readonly NUM_WORK_PAGER: 18 3375 3376 /** 3377 * Indicates an assistant number. 3378 * 3379 * @readonly 3380 * @static 3381 * @syscap SystemCapability.Applications.ContactsData 3382 * @since 7 3383 */ 3384 /** 3385 * Indicates an assistant number. 3386 * 3387 * @readonly 3388 * @static 3389 * @syscap SystemCapability.Applications.ContactsData 3390 * @atomicservice 3391 * @since 11 3392 */ 3393 static readonly NUM_ASSISTANT: 19 3394 3395 /** 3396 * Indicates an MMS number. 3397 * 3398 * @readonly 3399 * @static 3400 * @syscap SystemCapability.Applications.ContactsData 3401 * @since 7 3402 */ 3403 /** 3404 * Indicates an MMS number. 3405 * 3406 * @readonly 3407 * @static 3408 * @syscap SystemCapability.Applications.ContactsData 3409 * @atomicservice 3410 * @since 11 3411 */ 3412 static readonly NUM_MMS: 20 3413 3414 /** 3415 * Indicates an invalid label ID. 3416 * 3417 * @readonly 3418 * @static 3419 * @syscap SystemCapability.Applications.ContactsData 3420 * @since 7 3421 */ 3422 /** 3423 * Indicates an invalid label ID. 3424 * 3425 * @readonly 3426 * @static 3427 * @syscap SystemCapability.Applications.ContactsData 3428 * @atomicservice 3429 * @since 11 3430 */ 3431 static readonly INVALID_LABEL_ID: -1 3432 3433 /** 3434 * Indicates the label name of an attribute. 3435 * 3436 * @type { ?string } 3437 * @syscap SystemCapability.Applications.ContactsData 3438 * @since 7 3439 */ 3440 /** 3441 * Indicates the label name of an attribute. 3442 * 3443 * @type { ?string } 3444 * @syscap SystemCapability.Applications.ContactsData 3445 * @atomicservice 3446 * @since 11 3447 */ 3448 labelName?: string 3449 3450 /** 3451 * Indicates the phone number of the contact. 3452 * 3453 * @type { string } 3454 * @syscap SystemCapability.Applications.ContactsData 3455 * @since 7 3456 */ 3457 /** 3458 * Indicates the phone number of the contact. 3459 * 3460 * @type { string } 3461 * @syscap SystemCapability.Applications.ContactsData 3462 * @atomicservice 3463 * @since 11 3464 */ 3465 phoneNumber: string 3466 3467 /** 3468 * Indicates the label id. 3469 * 3470 * @type { ?number } 3471 * @syscap SystemCapability.Applications.ContactsData 3472 * @since 7 3473 */ 3474 /** 3475 * Indicates the label id. 3476 * 3477 * @type { ?number } 3478 * @syscap SystemCapability.Applications.ContactsData 3479 * @atomicservice 3480 * @since 11 3481 */ 3482 labelId?: number 3483 } 3484 3485 /** 3486 * Provides methods for portrait information 3487 * 3488 * @syscap SystemCapability.Applications.ContactsData 3489 * @since 7 3490 */ 3491 /** 3492 * Provides methods for portrait information 3493 * 3494 * @syscap SystemCapability.Applications.ContactsData 3495 * @atomicservice 3496 * @since 11 3497 */ 3498 class Portrait { 3499 /** 3500 * Indicates the uri of the contact portrait. 3501 * 3502 * @type { string } 3503 * @syscap SystemCapability.Applications.ContactsData 3504 * @since 7 3505 */ 3506 /** 3507 * Indicates the uri of the contact portrait. 3508 * 3509 * @type { string } 3510 * @syscap SystemCapability.Applications.ContactsData 3511 * @atomicservice 3512 * @since 11 3513 */ 3514 uri: string 3515 } 3516 3517 /** 3518 * Provides methods for postal address information 3519 * 3520 * @syscap SystemCapability.Applications.ContactsData 3521 * @since 7 3522 */ 3523 /** 3524 * Provides methods for postal address information 3525 * 3526 * @syscap SystemCapability.Applications.ContactsData 3527 * @atomicservice 3528 * @since 11 3529 */ 3530 class PostalAddress { 3531 /** 3532 * Indicates a custom label. 3533 * 3534 * @readonly 3535 * @static 3536 * @syscap SystemCapability.Applications.ContactsData 3537 * @since 7 3538 */ 3539 /** 3540 * Indicates a custom label. 3541 * 3542 * @readonly 3543 * @static 3544 * @syscap SystemCapability.Applications.ContactsData 3545 * @atomicservice 3546 * @since 11 3547 */ 3548 static readonly CUSTOM_LABEL: 0 3549 3550 /** 3551 * Indicates a home address. 3552 * 3553 * @readonly 3554 * @static 3555 * @syscap SystemCapability.Applications.ContactsData 3556 * @since 7 3557 */ 3558 /** 3559 * Indicates a home address. 3560 * 3561 * @readonly 3562 * @static 3563 * @syscap SystemCapability.Applications.ContactsData 3564 * @atomicservice 3565 * @since 11 3566 */ 3567 static readonly ADDR_HOME: 1 3568 3569 /** 3570 * Indicates a work address. 3571 * 3572 * @readonly 3573 * @static 3574 * @syscap SystemCapability.Applications.ContactsData 3575 * @since 7 3576 */ 3577 /** 3578 * Indicates a work address. 3579 * 3580 * @readonly 3581 * @static 3582 * @syscap SystemCapability.Applications.ContactsData 3583 * @atomicservice 3584 * @since 11 3585 */ 3586 static readonly ADDR_WORK: 2 3587 3588 /** 3589 * Indicates an address of the OTHER type. 3590 * 3591 * @readonly 3592 * @static 3593 * @syscap SystemCapability.Applications.ContactsData 3594 * @since 7 3595 */ 3596 /** 3597 * Indicates an address of the OTHER type. 3598 * 3599 * @readonly 3600 * @static 3601 * @syscap SystemCapability.Applications.ContactsData 3602 * @atomicservice 3603 * @since 11 3604 */ 3605 static readonly ADDR_OTHER: 3 3606 3607 /** 3608 * Indicates an invalid label ID. 3609 * 3610 * @readonly 3611 * @static 3612 * @syscap SystemCapability.Applications.ContactsData 3613 * @since 7 3614 */ 3615 /** 3616 * Indicates an invalid label ID. 3617 * 3618 * @readonly 3619 * @static 3620 * @syscap SystemCapability.Applications.ContactsData 3621 * @atomicservice 3622 * @since 11 3623 */ 3624 static readonly INVALID_LABEL_ID: -1 3625 3626 /** 3627 * Indicates the city where this contact is located. 3628 * 3629 * @type { ?string } 3630 * @syscap SystemCapability.Applications.ContactsData 3631 * @since 7 3632 */ 3633 /** 3634 * Indicates the city where this contact is located. 3635 * 3636 * @type { ?string } 3637 * @syscap SystemCapability.Applications.ContactsData 3638 * @atomicservice 3639 * @since 11 3640 */ 3641 city?: string 3642 3643 /** 3644 * Indicates the country/region where this contact is located. 3645 * 3646 * @type { ?string } 3647 * @syscap SystemCapability.Applications.ContactsData 3648 * @since 7 3649 */ 3650 /** 3651 * Indicates the country/region where this contact is located. 3652 * 3653 * @type { ?string } 3654 * @syscap SystemCapability.Applications.ContactsData 3655 * @atomicservice 3656 * @since 11 3657 */ 3658 country?: string 3659 3660 /** 3661 * Indicates the label name of an attribute. 3662 * 3663 * @type { ?string } 3664 * @syscap SystemCapability.Applications.ContactsData 3665 * @since 7 3666 */ 3667 /** 3668 * Indicates the label name of an attribute. 3669 * 3670 * @type { ?string } 3671 * @syscap SystemCapability.Applications.ContactsData 3672 * @atomicservice 3673 * @since 11 3674 */ 3675 labelName?: string 3676 3677 /** 3678 * Indicates the neighborhood where this contact is located. 3679 * 3680 * @type { ?string } 3681 * @syscap SystemCapability.Applications.ContactsData 3682 * @since 7 3683 */ 3684 /** 3685 * Indicates the neighborhood where this contact is located. 3686 * 3687 * @type { ?string } 3688 * @syscap SystemCapability.Applications.ContactsData 3689 * @atomicservice 3690 * @since 11 3691 */ 3692 neighborhood?: string 3693 3694 /** 3695 * Indicates the post box of this contact. 3696 * 3697 * @type { ?string } 3698 * @syscap SystemCapability.Applications.ContactsData 3699 * @since 7 3700 */ 3701 /** 3702 * Indicates the post box of this contact. 3703 * 3704 * @type { ?string } 3705 * @syscap SystemCapability.Applications.ContactsData 3706 * @atomicservice 3707 * @since 11 3708 */ 3709 pobox?: string 3710 3711 /** 3712 * Indicates the postal address of this contact. 3713 * 3714 * @type { string } 3715 * @syscap SystemCapability.Applications.ContactsData 3716 * @since 7 3717 */ 3718 /** 3719 * Indicates the postal address of this contact. 3720 * 3721 * @type { string } 3722 * @syscap SystemCapability.Applications.ContactsData 3723 * @atomicservice 3724 * @since 11 3725 */ 3726 postalAddress: string 3727 3728 /** 3729 * Indicates the postal code of this contact. 3730 * 3731 * @type { ?string } 3732 * @syscap SystemCapability.Applications.ContactsData 3733 * @since 7 3734 */ 3735 /** 3736 * Indicates the postal code of this contact. 3737 * 3738 * @type { ?string } 3739 * @syscap SystemCapability.Applications.ContactsData 3740 * @atomicservice 3741 * @since 11 3742 */ 3743 postcode?: string 3744 3745 /** 3746 * Indicates the area where this contact is located. 3747 * 3748 * @type { ?string } 3749 * @syscap SystemCapability.Applications.ContactsData 3750 * @since 7 3751 */ 3752 /** 3753 * Indicates the area where this contact is located. 3754 * 3755 * @type { ?string } 3756 * @syscap SystemCapability.Applications.ContactsData 3757 * @atomicservice 3758 * @since 11 3759 */ 3760 region?: string 3761 3762 /** 3763 * Indicates the street where this contact is located. 3764 * 3765 * @type { ?string } 3766 * @syscap SystemCapability.Applications.ContactsData 3767 * @since 7 3768 */ 3769 /** 3770 * Indicates the street where this contact is located. 3771 * 3772 * @type { ?string } 3773 * @syscap SystemCapability.Applications.ContactsData 3774 * @atomicservice 3775 * @since 11 3776 */ 3777 street?: string 3778 3779 /** 3780 * Indicates the label id. 3781 * 3782 * @type { ?number } 3783 * @syscap SystemCapability.Applications.ContactsData 3784 * @since 7 3785 */ 3786 /** 3787 * Indicates the label id. 3788 * 3789 * @type { ?number } 3790 * @syscap SystemCapability.Applications.ContactsData 3791 * @atomicservice 3792 * @since 11 3793 */ 3794 labelId?: number 3795 } 3796 3797 /** 3798 * Provides methods for relation information 3799 * 3800 * @syscap SystemCapability.Applications.ContactsData 3801 * @since 7 3802 */ 3803 /** 3804 * Provides methods for relation information 3805 * 3806 * @syscap SystemCapability.Applications.ContactsData 3807 * @atomicservice 3808 * @since 11 3809 */ 3810 class Relation { 3811 /** 3812 * Indicates custom relationship type. 3813 * 3814 * @readonly 3815 * @static 3816 * @syscap SystemCapability.Applications.ContactsData 3817 * @since 7 3818 */ 3819 /** 3820 * Indicates custom relationship type. 3821 * 3822 * @readonly 3823 * @static 3824 * @syscap SystemCapability.Applications.ContactsData 3825 * @atomicservice 3826 * @since 11 3827 */ 3828 static readonly CUSTOM_LABEL: 0 3829 3830 /** 3831 * Indicates assistant relationship type. 3832 * 3833 * @readonly 3834 * @static 3835 * @syscap SystemCapability.Applications.ContactsData 3836 * @since 7 3837 */ 3838 /** 3839 * Indicates assistant relationship type. 3840 * 3841 * @readonly 3842 * @static 3843 * @syscap SystemCapability.Applications.ContactsData 3844 * @atomicservice 3845 * @since 11 3846 */ 3847 static readonly RELATION_ASSISTANT: 1 3848 3849 /** 3850 * Indicates brother relationship type. 3851 * 3852 * @readonly 3853 * @static 3854 * @syscap SystemCapability.Applications.ContactsData 3855 * @since 7 3856 */ 3857 /** 3858 * Indicates brother relationship type. 3859 * 3860 * @readonly 3861 * @static 3862 * @syscap SystemCapability.Applications.ContactsData 3863 * @atomicservice 3864 * @since 11 3865 */ 3866 static readonly RELATION_BROTHER: 2 3867 3868 /** 3869 * Indicates child relationship type. 3870 * 3871 * @readonly 3872 * @static 3873 * @syscap SystemCapability.Applications.ContactsData 3874 * @since 7 3875 */ 3876 /** 3877 * Indicates child relationship type. 3878 * 3879 * @readonly 3880 * @static 3881 * @syscap SystemCapability.Applications.ContactsData 3882 * @atomicservice 3883 * @since 11 3884 */ 3885 static readonly RELATION_CHILD: 3 3886 3887 /** 3888 * Indicates domestic partner relationship type. 3889 * 3890 * @readonly 3891 * @static 3892 * @syscap SystemCapability.Applications.ContactsData 3893 * @since 7 3894 */ 3895 /** 3896 * Indicates domestic partner relationship type. 3897 * 3898 * @readonly 3899 * @static 3900 * @syscap SystemCapability.Applications.ContactsData 3901 * @atomicservice 3902 * @since 11 3903 */ 3904 static readonly RELATION_DOMESTIC_PARTNER: 4 3905 3906 /** 3907 * Indicates father relationship type. 3908 * 3909 * @readonly 3910 * @static 3911 * @syscap SystemCapability.Applications.ContactsData 3912 * @since 7 3913 */ 3914 /** 3915 * Indicates father relationship type. 3916 * 3917 * @readonly 3918 * @static 3919 * @syscap SystemCapability.Applications.ContactsData 3920 * @atomicservice 3921 * @since 11 3922 */ 3923 static readonly RELATION_FATHER: 5 3924 3925 /** 3926 * Indicates friend relationship type. 3927 * 3928 * @readonly 3929 * @static 3930 * @syscap SystemCapability.Applications.ContactsData 3931 * @since 7 3932 */ 3933 /** 3934 * Indicates friend relationship type. 3935 * 3936 * @readonly 3937 * @static 3938 * @syscap SystemCapability.Applications.ContactsData 3939 * @atomicservice 3940 * @since 11 3941 */ 3942 static readonly RELATION_FRIEND: 6 3943 3944 /** 3945 * Indicates manager relationship type. 3946 * 3947 * @readonly 3948 * @static 3949 * @syscap SystemCapability.Applications.ContactsData 3950 * @since 7 3951 */ 3952 /** 3953 * Indicates manager relationship type. 3954 * 3955 * @readonly 3956 * @static 3957 * @syscap SystemCapability.Applications.ContactsData 3958 * @atomicservice 3959 * @since 11 3960 */ 3961 static readonly RELATION_MANAGER: 7 3962 3963 /** 3964 * Indicates mother relationship type. 3965 * 3966 * @readonly 3967 * @static 3968 * @syscap SystemCapability.Applications.ContactsData 3969 * @since 7 3970 */ 3971 /** 3972 * Indicates mother relationship type. 3973 * 3974 * @readonly 3975 * @static 3976 * @syscap SystemCapability.Applications.ContactsData 3977 * @atomicservice 3978 * @since 11 3979 */ 3980 static readonly RELATION_MOTHER: 8 3981 3982 /** 3983 * Indicates parent relationship type. 3984 * 3985 * @readonly 3986 * @static 3987 * @syscap SystemCapability.Applications.ContactsData 3988 * @since 7 3989 */ 3990 /** 3991 * Indicates parent relationship type. 3992 * 3993 * @readonly 3994 * @static 3995 * @syscap SystemCapability.Applications.ContactsData 3996 * @atomicservice 3997 * @since 11 3998 */ 3999 static readonly RELATION_PARENT: 9 4000 4001 /** 4002 * Indicates partner relationship type. 4003 * 4004 * @readonly 4005 * @static 4006 * @syscap SystemCapability.Applications.ContactsData 4007 * @since 7 4008 */ 4009 /** 4010 * Indicates partner relationship type. 4011 * 4012 * @readonly 4013 * @static 4014 * @syscap SystemCapability.Applications.ContactsData 4015 * @atomicservice 4016 * @since 11 4017 */ 4018 static readonly RELATION_PARTNER: 10 4019 4020 /** 4021 * Indicates referrer relationship type. 4022 * 4023 * @readonly 4024 * @static 4025 * @syscap SystemCapability.Applications.ContactsData 4026 * @since 7 4027 */ 4028 /** 4029 * Indicates referrer relationship type. 4030 * 4031 * @readonly 4032 * @static 4033 * @syscap SystemCapability.Applications.ContactsData 4034 * @atomicservice 4035 * @since 11 4036 */ 4037 static readonly RELATION_REFERRED_BY: 11 4038 4039 /** 4040 * Indicates relative relationship type. 4041 * 4042 * @readonly 4043 * @static 4044 * @syscap SystemCapability.Applications.ContactsData 4045 * @since 7 4046 */ 4047 /** 4048 * Indicates relative relationship type. 4049 * 4050 * @readonly 4051 * @static 4052 * @syscap SystemCapability.Applications.ContactsData 4053 * @atomicservice 4054 * @since 11 4055 */ 4056 static readonly RELATION_RELATIVE: 12 4057 4058 /** 4059 * Indicates sister relationship type. 4060 * 4061 * @readonly 4062 * @static 4063 * @syscap SystemCapability.Applications.ContactsData 4064 * @since 7 4065 */ 4066 /** 4067 * Indicates sister relationship type. 4068 * 4069 * @readonly 4070 * @static 4071 * @syscap SystemCapability.Applications.ContactsData 4072 * @atomicservice 4073 * @since 11 4074 */ 4075 static readonly RELATION_SISTER: 13 4076 4077 /** 4078 * Indicates spouse relationship type. 4079 * 4080 * @readonly 4081 * @static 4082 * @syscap SystemCapability.Applications.ContactsData 4083 * @since 7 4084 */ 4085 /** 4086 * Indicates spouse relationship type. 4087 * 4088 * @readonly 4089 * @static 4090 * @syscap SystemCapability.Applications.ContactsData 4091 * @atomicservice 4092 * @since 11 4093 */ 4094 static readonly RELATION_SPOUSE: 14 4095 4096 /** 4097 * Indicates invalid relationship type. 4098 * 4099 * @readonly 4100 * @static 4101 * @syscap SystemCapability.Applications.ContactsData 4102 * @since 7 4103 */ 4104 /** 4105 * Indicates invalid relationship type. 4106 * 4107 * @readonly 4108 * @static 4109 * @syscap SystemCapability.Applications.ContactsData 4110 * @atomicservice 4111 * @since 11 4112 */ 4113 static readonly INVALID_LABEL_ID: -1 4114 4115 /** 4116 * Indicates the label name of an attribute. 4117 * 4118 * @type { ?string } 4119 * @syscap SystemCapability.Applications.ContactsData 4120 * @since 7 4121 */ 4122 /** 4123 * Indicates the label name of an attribute. 4124 * 4125 * @type { ?string } 4126 * @syscap SystemCapability.Applications.ContactsData 4127 * @atomicservice 4128 * @since 11 4129 */ 4130 labelName?: string 4131 4132 /** 4133 * Indicates the relation name. 4134 * 4135 * @type { string } 4136 * @syscap SystemCapability.Applications.ContactsData 4137 * @since 7 4138 */ 4139 /** 4140 * Indicates the relation name. 4141 * 4142 * @type { string } 4143 * @syscap SystemCapability.Applications.ContactsData 4144 * @atomicservice 4145 * @since 11 4146 */ 4147 relationName: string 4148 4149 /** 4150 * Indicates the label id. 4151 * 4152 * @type { ?number } 4153 * @syscap SystemCapability.Applications.ContactsData 4154 * @since 7 4155 */ 4156 /** 4157 * Indicates the label id. 4158 * 4159 * @type { ?number } 4160 * @syscap SystemCapability.Applications.ContactsData 4161 * @atomicservice 4162 * @since 11 4163 */ 4164 labelId?: number 4165 } 4166 4167 /** 4168 * Provides methods for sip address information 4169 * 4170 * @syscap SystemCapability.Applications.ContactsData 4171 * @since 7 4172 */ 4173 /** 4174 * Provides methods for sip address information 4175 * 4176 * @syscap SystemCapability.Applications.ContactsData 4177 * @atomicservice 4178 * @since 11 4179 */ 4180 class SipAddress { 4181 /** 4182 * Indicates a custom label. 4183 * 4184 * @readonly 4185 * @static 4186 * @syscap SystemCapability.Applications.ContactsData 4187 * @since 7 4188 */ 4189 /** 4190 * Indicates a custom label. 4191 * 4192 * @readonly 4193 * @static 4194 * @syscap SystemCapability.Applications.ContactsData 4195 * @atomicservice 4196 * @since 11 4197 */ 4198 static readonly CUSTOM_LABEL: 0 4199 4200 /** 4201 * Indicates a home SIP address. 4202 * 4203 * @readonly 4204 * @static 4205 * @syscap SystemCapability.Applications.ContactsData 4206 * @since 7 4207 */ 4208 /** 4209 * Indicates a home SIP address. 4210 * 4211 * @readonly 4212 * @static 4213 * @syscap SystemCapability.Applications.ContactsData 4214 * @atomicservice 4215 * @since 11 4216 */ 4217 static readonly SIP_HOME: 1 4218 4219 /** 4220 * Indicates a work SIP address. 4221 * 4222 * @readonly 4223 * @static 4224 * @syscap SystemCapability.Applications.ContactsData 4225 * @since 7 4226 */ 4227 /** 4228 * Indicates a work SIP address. 4229 * 4230 * @readonly 4231 * @static 4232 * @syscap SystemCapability.Applications.ContactsData 4233 * @atomicservice 4234 * @since 11 4235 */ 4236 static readonly SIP_WORK: 2 4237 4238 /** 4239 * Indicates an SIP address of the OTHER type. 4240 * 4241 * @readonly 4242 * @static 4243 * @syscap SystemCapability.Applications.ContactsData 4244 * @since 7 4245 */ 4246 /** 4247 * Indicates an SIP address of the OTHER type. 4248 * 4249 * @readonly 4250 * @static 4251 * @syscap SystemCapability.Applications.ContactsData 4252 * @atomicservice 4253 * @since 11 4254 */ 4255 static readonly SIP_OTHER: 3 4256 4257 /** 4258 * Indicates an invalid label ID. 4259 * 4260 * @readonly 4261 * @static 4262 * @syscap SystemCapability.Applications.ContactsData 4263 * @since 7 4264 */ 4265 /** 4266 * Indicates an invalid label ID. 4267 * 4268 * @readonly 4269 * @static 4270 * @syscap SystemCapability.Applications.ContactsData 4271 * @atomicservice 4272 * @since 11 4273 */ 4274 static readonly INVALID_LABEL_ID: -1 4275 4276 /** 4277 * Indicates the label name of an attribute. 4278 * 4279 * @type { ?string } 4280 * @syscap SystemCapability.Applications.ContactsData 4281 * @since 7 4282 */ 4283 /** 4284 * Indicates the label name of an attribute. 4285 * 4286 * @type { ?string } 4287 * @syscap SystemCapability.Applications.ContactsData 4288 * @atomicservice 4289 * @since 11 4290 */ 4291 labelName?: string 4292 4293 /** 4294 * Indicates the SIP address. 4295 * 4296 * @type { string } 4297 * @syscap SystemCapability.Applications.ContactsData 4298 * @since 7 4299 */ 4300 /** 4301 * Indicates the SIP address. 4302 * 4303 * @type { string } 4304 * @syscap SystemCapability.Applications.ContactsData 4305 * @atomicservice 4306 * @since 11 4307 */ 4308 sipAddress: string 4309 4310 /** 4311 * Indicates the label id. 4312 * 4313 * @type { ?number } 4314 * @syscap SystemCapability.Applications.ContactsData 4315 * @since 7 4316 */ 4317 /** 4318 * Indicates the label id. 4319 * 4320 * @type { ?number } 4321 * @syscap SystemCapability.Applications.ContactsData 4322 * @atomicservice 4323 * @since 11 4324 */ 4325 labelId?: number 4326 } 4327 4328 /** 4329 * Provides methods for website information 4330 * 4331 * @syscap SystemCapability.Applications.ContactsData 4332 * @since 7 4333 */ 4334 /** 4335 * Provides methods for website information 4336 * 4337 * @syscap SystemCapability.Applications.ContactsData 4338 * @atomicservice 4339 * @since 11 4340 */ 4341 class Website { 4342 /** 4343 * Indicates the website. 4344 * 4345 * @type { string } 4346 * @syscap SystemCapability.Applications.ContactsData 4347 * @since 7 4348 */ 4349 /** 4350 * Indicates the website. 4351 * 4352 * @type { string } 4353 * @syscap SystemCapability.Applications.ContactsData 4354 * @atomicservice 4355 * @since 11 4356 */ 4357 website: string 4358 } 4359} 4360 4361export default contact;