1/* 2 * Copyright (c) 2023-2024 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 ArkData 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import image from "./@ohos.multimedia.image"; 23import Want from "./@ohos.app.ability.Want"; 24 25/** 26 * Provide methods for sharing data between different applications across unified data channels. 27 * 28 * @namespace unifiedDataChannel 29 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 30 * @since 10 31 */ 32/** 33 * Provide methods for sharing data between different applications across unified data channels. 34 * 35 * @namespace unifiedDataChannel 36 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 37 * @atomicservice 38 * @since 11 39 */ 40/** 41 * Provide methods for sharing data between different applications across unified data channels. 42 * 43 * @namespace unifiedDataChannel 44 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 45 * @crossplatform 46 * @atomicservice 47 * @since 13 48 */ 49declare namespace unifiedDataChannel { 50 /** 51 * Types of scope that UnifiedData can be used. 52 * @enum { number } 53 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 54 * @atomicservice 55 * @since 12 56 */ 57 enum ShareOptions { 58 /** 59 * IN_APP indicates that only use in the same app is allowed. 60 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 61 * @atomicservice 62 * @since 12 63 */ 64 IN_APP, 65 /** 66 * CROSS_APP indicates that use in any app in this device is allowed. 67 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 68 * @atomicservice 69 * @since 12 70 */ 71 CROSS_APP 72 } 73 74 /** 75 * Indicated delay get UnifiedData 76 * 77 * @typedef {function} GetDelayData 78 * @param { string } type - the type of UnifiedData required. 79 * @returns { UnifiedData } Return the UnifiedData required. 80 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 81 * @atomicservice 82 * @since 12 83 */ 84 type GetDelayData = (type: string) => UnifiedData; 85 86 /** 87 * Indicates type of value. 88 * @typedef {number | string | boolean | image.PixelMap | Want | ArrayBuffer | object | null | undefined} 89 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 90 * @atomicservice 91 * @since 12 92 */ 93 /** 94 * Indicates type of value. 95 * @typedef {number | string | boolean | image.PixelMap | Want | ArrayBuffer | object | null | undefined} 96 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 97 * @crossplatform 98 * @atomicservice 99 * @since 13 100 */ 101 type ValueType = number | string | boolean | image.PixelMap | Want | ArrayBuffer | object | null | undefined; 102 103 /** 104 * Describe the unified data properties. 105 * 106 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 107 * @atomicservice 108 * @since 12 109 */ 110 class UnifiedDataProperties { 111 /** 112 * extra property data. key-value pairs. 113 * @type { ?Record<string, object> } 114 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 115 * @atomicservice 116 * @since 12 117 */ 118 extras?: Record<string, object>; 119 120 /** 121 * the user-defined tag of a UnifiedData object. 122 * @type { ?string } 123 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 124 * @atomicservice 125 * @since 12 126 */ 127 tag?: string; 128 /** 129 * a timestamp, which indicates when data is written. 130 * @type { ?Date } 131 * @readonly 132 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 133 * @atomicservice 134 * @since 12 135 */ 136 readonly timestamp?: Date; 137 /** 138 * Indicates the scope of clipboard data which can be used. 139 * If it is not set or is incorrectly set, The default value is CrossDevice. 140 * @type { ?ShareOptions } 141 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 142 * @atomicservice 143 * @since 12 144 */ 145 shareOptions?: ShareOptions; 146 147 /** 148 * Indicated delay get UnifiedData. 149 * @type { ?GetDelayData } 150 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 151 * @atomicservice 152 * @since 12 153 */ 154 getDelayData?: GetDelayData; 155 } 156 157 /** 158 * Describe the unified data. 159 * 160 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 161 * @since 10 162 */ 163 /** 164 * Describe the unified data. 165 * 166 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 167 * @atomicservice 168 * @since 11 169 */ 170 /** 171 * Describe the unified data. 172 * 173 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 174 * @crossplatform 175 * @atomicservice 176 * @since 13 177 */ 178 class UnifiedData { 179 /** 180 * Create unified data with a record 181 * 182 * @param { UnifiedRecord } record - Record will add into unified data. 183 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 184 * <br>2.Incorrect parameters types. 185 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 186 * @since 10 187 */ 188 /** 189 * Create unified data with a record 190 * 191 * @param { UnifiedRecord } record - Record will add into unified data. 192 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 193 * <br>2.Incorrect parameters types. 194 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 195 * @atomicservice 196 * @since 11 197 */ 198 /** 199 * Create unified data with a record 200 * 201 * @param { UnifiedRecord } record - Record will add into unified data. 202 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 203 * <br>2.Incorrect Parameters types. 204 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 205 * @crossplatform 206 * @atomicservice 207 * @since 13 208 */ 209 constructor(record: UnifiedRecord); 210 /** 211 * Create a empty unified data. 212 * 213 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 214 * @atomicservice 215 * @since 12 216 */ 217 /** 218 * Create a empty unified data. 219 * 220 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 221 * @crossplatform 222 * @atomicservice 223 * @since 13 224 */ 225 constructor(); 226 /** 227 * Add a record into unified data 228 * 229 * @param { UnifiedRecord } record - Record will add into unified data. 230 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 231 * <br>2.Incorrect parameters types. 232 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 233 * @since 10 234 */ 235 /** 236 * Add a record into unified data 237 * 238 * @param { UnifiedRecord } record - Record will add into unified data. 239 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 240 * <br>2.Incorrect parameters types. 241 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 242 * @atomicservice 243 * @since 11 244 */ 245 /** 246 * Add a record into unified data 247 * 248 * @param { UnifiedRecord } record - Record will add into unified data. 249 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 250 * <br>2.Incorrect Parameters types. 251 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 252 * @crossplatform 253 * @atomicservice 254 * @since 13 255 */ 256 addRecord(record: UnifiedRecord): void; 257 /** 258 * Get all records of unified data 259 * 260 * @returns { Array<UnifiedRecord> } Return the records of unified data 261 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 262 * @since 10 263 */ 264 /** 265 * Get all records of unified data 266 * 267 * @returns { Array<UnifiedRecord> } Return the records of unified data 268 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 269 * @atomicservice 270 * @since 11 271 */ 272 /** 273 * Get all records of unified data 274 * 275 * @returns { Array<UnifiedRecord> } Return the records of unified data 276 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 277 * @crossplatform 278 * @atomicservice 279 * @since 13 280 */ 281 getRecords(): Array<UnifiedRecord>; 282 283 /** 284 * Checks whether there is a specified type of data in DataProperties. 285 * @param { string } type - indicates to query data type. 286 * @returns { boolean } if having mimeType in UnifiedData returns true, else returns false. 287 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 288 * <br>2.Incorrect parameters types. 289 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 290 * @atomicservice 291 * @since 12 292 */ 293 /** 294 * Checks whether there is a specified type of data in DataProperties. 295 * @param { string } type - indicates to query data type. 296 * @returns { boolean } if having mimeType in UnifiedData returns true, else returns false. 297 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 298 * <br>2.Incorrect Parameters types. 299 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 300 * @crossplatform 301 * @atomicservice 302 * @since 13 303 */ 304 hasType(type: string): boolean; 305 306 /** 307 * UTD types of all content in the UnifiedData. 308 * @returns { Array<string> } type of array 309 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 310 * @atomicservice 311 * @since 12 312 */ 313 /** 314 * UTD types of all content in the UnifiedData. 315 * @returns { Array<string> } type of array 316 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 317 * @crossplatform 318 * @atomicservice 319 * @since 13 320 */ 321 getTypes(): Array<string>; 322 323 /** 324 * UnifiedData properties. 325 * @type { UnifiedDataProperties } 326 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 327 * @atomicservice 328 * @since 12 329 */ 330 properties: UnifiedDataProperties; 331 } 332 333 /** 334 * The data abstract supported by unified data 335 * 336 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 337 * @since 10 338 */ 339 /** 340 * The data abstract supported by unified data 341 * 342 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 343 * @atomicservice 344 * @since 11 345 */ 346 class Summary { 347 /** 348 * A map for each type and data size, key is data type, value is the corresponding data size 349 * 350 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 351 * @since 10 352 */ 353 /** 354 * A map for each type and data size, key is data type, value is the corresponding data size 355 * 356 * @type { Record<string, number> } 357 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 358 * @atomicservice 359 * @since 11 360 */ 361 summary: Record<string, number>; 362 /** 363 * Total data size of data in Bytes 364 * 365 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 366 * @since 10 367 */ 368 /** 369 * Total data size of data in Bytes 370 * 371 * @type { number } 372 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 373 * @atomicservice 374 * @since 11 375 */ 376 totalSize: number; 377 } 378 379 /** 380 * Describe the unified record 381 * 382 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 383 * @since 10 384 */ 385 /** 386 * Describe the unified record 387 * 388 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 389 * @atomicservice 390 * @since 11 391 */ 392 /** 393 * Describe the unified record 394 * 395 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 396 * @crossplatform 397 * @atomicservice 398 * @since 13 399 */ 400 class UnifiedRecord { 401 /** 402 * Get type of unified record 403 * 404 * @returns { string } Return the type of unified data 405 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 406 * @since 10 407 */ 408 /** 409 * Get type of unified record 410 * 411 * @returns { string } Return the type of unified data 412 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 413 * @atomicservice 414 * @since 11 415 */ 416 /** 417 * Get type of unified record 418 * 419 * @returns { string } Return the type of unified data 420 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 421 * @crossplatform 422 * @atomicservice 423 * @since 13 424 */ 425 getType(): string; 426 427 /** 428 * Create unified record. 429 * 430 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 431 * @atomicservice 432 * @since 12 433 */ 434 /** 435 * Create unified record. 436 * 437 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 438 * @crossplatform 439 * @atomicservice 440 * @since 13 441 */ 442 constructor(); 443 444 /** 445 * Create unified record by type and value. 446 * 447 * @param { string } type - indicates to data type of unified record. It can not be empty. When type of value is object, parameter type must be pixel-map or want UTD type. 448 * @param { ValueType } value - indicates to value of unified record. 449 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 450 * <br>2.Incorrect parameters types; 451 * <br>3.Parameter verification failed. 452 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 453 * @atomicservice 454 * @since 12 455 */ 456 /** 457 * Create unified record by type and value. 458 * 459 * @param { string } type - indicates to data type of unified record. It can not be empty. When type of value is object, parameter type must be pixel-map or want UTD type. 460 * @param { ValueType } value - indicates to value of unified record. 461 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 462 * <br>2.Incorrect Parameters types; 463 * <br>3.Parameter verification failed. 464 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 465 * @crossplatform 466 * @atomicservice 467 * @since 13 468 */ 469 constructor(type: string, value: ValueType); 470 471 /** 472 * Get the value of unified record. 473 * 474 * @returns { ValueType } Return the value of unified record. 475 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 476 * @atomicservice 477 * @since 12 478 */ 479 /** 480 * Get the value of unified record. 481 * 482 * @returns { ValueType } Return the value of unified record. 483 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 484 * @crossplatform 485 * @atomicservice 486 * @since 13 487 */ 488 getValue(): ValueType; 489 } 490 491 /** 492 * Describe the unified text data 493 * 494 * @extends UnifiedRecord 495 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 496 * @since 10 497 */ 498 /** 499 * Describe the unified text data 500 * 501 * @extends UnifiedRecord 502 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 503 * @atomicservice 504 * @since 11 505 */ 506 /** 507 * Describe the unified text data 508 * 509 * @extends UnifiedRecord 510 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 511 * @crossplatform 512 * @atomicservice 513 * @since 13 514 */ 515 class Text extends UnifiedRecord { 516 /** 517 * Indicates the details of unified text 518 * 519 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 520 * @since 10 521 */ 522 /** 523 * Indicates the details of unified text 524 * 525 * @type { ?Record<string, string> } 526 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 527 * @atomicservice 528 * @since 11 529 */ 530 /** 531 * Indicates the details of unified text 532 * 533 * @type { ?Record<string, string> } 534 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 535 * @crossplatform 536 * @atomicservice 537 * @since 13 538 */ 539 details?: Record<string, string>; 540 } 541 542 /** 543 * Describe the unified plain text data 544 * 545 * @extends Text 546 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 547 * @since 10 548 */ 549 /** 550 * Describe the unified plain text data 551 * 552 * @extends Text 553 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 554 * @atomicservice 555 * @since 11 556 */ 557 /** 558 * Describe the unified plain text data 559 * 560 * @extends Text 561 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 562 * @crossplatform 563 * @atomicservice 564 * @since 13 565 */ 566 class PlainText extends Text { 567 /** 568 * Indicates the content of text 569 * 570 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 571 * @since 10 572 */ 573 /** 574 * Indicates the content of text 575 * 576 * @type { string } 577 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 578 * @atomicservice 579 * @since 11 580 */ 581 /** 582 * Indicates the content of text 583 * 584 * @type { string } 585 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 586 * @crossplatform 587 * @atomicservice 588 * @since 13 589 */ 590 textContent: string; 591 /** 592 * Indicates the abstract of text 593 * 594 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 595 * @since 10 596 */ 597 /** 598 * Indicates the abstract of text 599 * 600 * @type { ?string } 601 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 602 * @atomicservice 603 * @since 11 604 */ 605 /** 606 * Indicates the abstract of text 607 * 608 * @type { ?string } 609 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 610 * @crossplatform 611 * @atomicservice 612 * @since 13 613 */ 614 abstract?: string; 615 } 616 617 /** 618 * Describe the unified link data 619 * 620 * @extends Text 621 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 622 * @since 10 623 */ 624 /** 625 * Describe the unified link data 626 * 627 * @extends Text 628 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 629 * @atomicservice 630 * @since 11 631 */ 632 /** 633 * Describe the unified link data 634 * 635 * @extends Text 636 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 637 * @crossplatform 638 * @atomicservice 639 * @since 13 640 */ 641 class Hyperlink extends Text { 642 /** 643 * Indicates the url of a link 644 * 645 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 646 * @since 10 647 */ 648 /** 649 * Indicates the url of a link 650 * 651 * @type { string } 652 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 653 * @atomicservice 654 * @since 11 655 */ 656 /** 657 * Indicates the url of a link 658 * 659 * @type { string } 660 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 661 * @crossplatform 662 * @atomicservice 663 * @since 13 664 */ 665 url: string; 666 /** 667 * Indicates the description of a link 668 * 669 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 670 * @since 10 671 */ 672 /** 673 * Indicates the description of a link 674 * 675 * @type { ?string } 676 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 677 * @atomicservice 678 * @since 11 679 */ 680 /** 681 * Indicates the description of a link 682 * 683 * @type { ?string } 684 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 685 * @crossplatform 686 * @atomicservice 687 * @since 13 688 */ 689 description?: string; 690 } 691 692 /** 693 * Describe the unified html data 694 * 695 * @extends Text 696 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 697 * @since 10 698 */ 699 /** 700 * Describe the unified html data 701 * 702 * @extends Text 703 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 704 * @atomicservice 705 * @since 11 706 */ 707 /** 708 * Describe the unified html data 709 * 710 * @extends Text 711 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 712 * @crossplatform 713 * @atomicservice 714 * @since 13 715 */ 716 class HTML extends Text { 717 /** 718 * Indicates the content of html, with html tags 719 * 720 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 721 * @since 10 722 */ 723 /** 724 * Indicates the content of html, with html tags 725 * 726 * @type { string } 727 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 728 * @atomicservice 729 * @since 11 730 */ 731 /** 732 * Indicates the content of html, with html tags 733 * 734 * @type { string } 735 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 736 * @crossplatform 737 * @atomicservice 738 * @since 13 739 */ 740 htmlContent: string; 741 /** 742 * Indicates the plain content of html 743 * 744 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 745 * @since 10 746 */ 747 /** 748 * Indicates the plain content of html 749 * 750 * @type { ?string } 751 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 752 * @atomicservice 753 * @since 11 754 */ 755 /** 756 * Indicates the plain content of html 757 * 758 * @type { ?string } 759 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 760 * @crossplatform 761 * @atomicservice 762 * @since 13 763 */ 764 plainContent?: string; 765 } 766 767 /** 768 * Describe the unified file data 769 * 770 * @extends UnifiedRecord 771 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 772 * @since 10 773 */ 774 /** 775 * Describe the unified file data 776 * 777 * @extends UnifiedRecord 778 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 779 * @atomicservice 780 * @since 11 781 */ 782 /** 783 * Describe the unified file data 784 * 785 * @extends UnifiedRecord 786 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 787 * @crossplatform 788 * @atomicservice 789 * @since 13 790 */ 791 class File extends UnifiedRecord { 792 /** 793 * Indicates the details of unified File 794 * 795 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 796 * @since 10 797 */ 798 /** 799 * Indicates the details of unified File 800 * 801 * @type { ?Record<string, string> } 802 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 803 * @atomicservice 804 * @since 11 805 */ 806 /** 807 * Indicates the details of unified File 808 * 809 * @type { ?Record<string, string> } 810 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 811 * @crossplatform 812 * @atomicservice 813 * @since 13 814 */ 815 details?: Record<string, string>; 816 /** 817 * Indicates the uri of file 818 * 819 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 820 * @since 10 821 */ 822 /** 823 * Indicates the uri of file 824 * 825 * @type { string } 826 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 827 * @atomicservice 828 * @since 11 829 */ 830 /** 831 * Indicates the uri of file 832 * 833 * @type { string } 834 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 835 * @crossplatform 836 * @atomicservice 837 * @since 13 838 */ 839 uri: string; 840 } 841 842 /** 843 * Describe the unified image data 844 * 845 * @extends File 846 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 847 * @since 10 848 */ 849 /** 850 * Describe the unified image data 851 * 852 * @extends File 853 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 854 * @atomicservice 855 * @since 11 856 */ 857 /** 858 * Describe the unified image data 859 * 860 * @extends File 861 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 862 * @crossplatform 863 * @atomicservice 864 * @since 13 865 */ 866 class Image extends File { 867 /** 868 * Indicates the uri of image 869 * 870 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 871 * @since 10 872 */ 873 /** 874 * Indicates the uri of image 875 * 876 * @type { string } 877 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 878 * @atomicservice 879 * @since 11 880 */ 881 /** 882 * Indicates the uri of image 883 * 884 * @type { string } 885 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 886 * @crossplatform 887 * @atomicservice 888 * @since 13 889 */ 890 imageUri: string; 891 } 892 893 /** 894 * Describe the unified video data 895 * 896 * @extends File 897 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 898 * @since 10 899 */ 900 /** 901 * Describe the unified video data 902 * 903 * @extends File 904 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 905 * @atomicservice 906 * @since 11 907 */ 908 /** 909 * Describe the unified video data 910 * 911 * @extends File 912 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 913 * @crossplatform 914 * @atomicservice 915 * @since 13 916 */ 917 class Video extends File { 918 /** 919 * Indicates the uri of video 920 * 921 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 922 * @since 10 923 */ 924 /** 925 * Indicates the uri of video 926 * 927 * @type { string } 928 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 929 * @atomicservice 930 * @since 11 931 */ 932 /** 933 * Indicates the uri of video 934 * 935 * @type { string } 936 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 937 * @crossplatform 938 * @atomicservice 939 * @since 13 940 */ 941 videoUri: string; 942 } 943 944 /** 945 * Describe the unified audio data 946 * 947 * @extends File 948 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 949 * @since 10 950 */ 951 /** 952 * Describe the unified audio data 953 * 954 * @extends File 955 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 956 * @atomicservice 957 * @since 11 958 */ 959 /** 960 * Describe the unified audio data 961 * 962 * @extends File 963 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 964 * @crossplatform 965 * @atomicservice 966 * @since 13 967 */ 968 class Audio extends File { 969 /** 970 * Indicates the uri of audio 971 * 972 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 973 * @since 10 974 */ 975 /** 976 * Indicates the uri of audio 977 * 978 * @type { string } 979 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 980 * @atomicservice 981 * @since 11 982 */ 983 /** 984 * Indicates the uri of audio 985 * 986 * @type { string } 987 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 988 * @crossplatform 989 * @atomicservice 990 * @since 13 991 */ 992 audioUri: string; 993 } 994 995 /** 996 * Describe the unified folder data 997 * 998 * @extends File 999 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1000 * @since 10 1001 */ 1002 /** 1003 * Describe the unified folder data 1004 * 1005 * @extends File 1006 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1007 * @atomicservice 1008 * @since 11 1009 */ 1010 /** 1011 * Describe the unified folder data 1012 * 1013 * @extends File 1014 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1015 * @crossplatform 1016 * @atomicservice 1017 * @since 13 1018 */ 1019 class Folder extends File { 1020 /** 1021 * Indicates the uri of folder 1022 * 1023 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1024 * @since 10 1025 */ 1026 /** 1027 * Indicates the uri of folder 1028 * 1029 * @type { string } 1030 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1031 * @atomicservice 1032 * @since 11 1033 */ 1034 /** 1035 * Indicates the uri of folder 1036 * 1037 * @type { string } 1038 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1039 * @crossplatform 1040 * @atomicservice 1041 * @since 13 1042 */ 1043 folderUri: string; 1044 } 1045 1046 /** 1047 * Describe system defined type data(this kind of data is provided and bound to OpenHarmony, 1048 * also can be parsed by system provided API) 1049 * 1050 * @extends UnifiedRecord 1051 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1052 * @since 10 1053 */ 1054 /** 1055 * Describe system defined type data(this kind of data is provided and bound to OpenHarmony, 1056 * also can be parsed by system provided API) 1057 * 1058 * @extends UnifiedRecord 1059 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1060 * @atomicservice 1061 * @since 11 1062 */ 1063 class SystemDefinedRecord extends UnifiedRecord { 1064 /** 1065 * Indicates the details of system defined data 1066 * 1067 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1068 * @since 10 1069 */ 1070 /** 1071 * Indicates the details of system defined data 1072 * 1073 * @type { ?Record<string, number | string | Uint8Array> } 1074 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1075 * @atomicservice 1076 * @since 11 1077 */ 1078 details?: Record<string, number | string | Uint8Array>; 1079 } 1080 1081 /** 1082 * Describe system defined form data(this kind of data is provided and bound to OpenHarmony, 1083 * also can be parsed by system provided API) 1084 * 1085 * @extends SystemDefinedRecord 1086 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1087 * @since 10 1088 */ 1089 /** 1090 * Describe system defined form data(this kind of data is provided and bound to OpenHarmony, 1091 * also can be parsed by system provided API) 1092 * 1093 * @extends SystemDefinedRecord 1094 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1095 * @atomicservice 1096 * @since 11 1097 */ 1098 class SystemDefinedForm extends SystemDefinedRecord { 1099 /** 1100 * Indicates the id of form 1101 * 1102 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1103 * @since 10 1104 */ 1105 /** 1106 * Indicates the id of form 1107 * 1108 * @type { number } 1109 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1110 * @atomicservice 1111 * @since 11 1112 */ 1113 formId: number; 1114 /** 1115 * Indicates the name of form 1116 * 1117 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1118 * @since 10 1119 */ 1120 /** 1121 * Indicates the name of form 1122 * 1123 * @type { string } 1124 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1125 * @atomicservice 1126 * @since 11 1127 */ 1128 formName: string; 1129 /** 1130 * Indicates the bundle name of form 1131 * 1132 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1133 * @since 10 1134 */ 1135 /** 1136 * Indicates the bundle name of form 1137 * 1138 * @type { string } 1139 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1140 * @atomicservice 1141 * @since 11 1142 */ 1143 bundleName: string; 1144 /** 1145 * Indicates the ability name of form 1146 * 1147 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1148 * @since 10 1149 */ 1150 /** 1151 * Indicates the ability name of form 1152 * 1153 * @type { string } 1154 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1155 * @atomicservice 1156 * @since 11 1157 */ 1158 abilityName: string; 1159 /** 1160 * Indicates the module of form 1161 * 1162 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1163 * @since 10 1164 */ 1165 /** 1166 * Indicates the module of form 1167 * 1168 * @type { string } 1169 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1170 * @atomicservice 1171 * @since 11 1172 */ 1173 module: string; 1174 } 1175 1176 /** 1177 * Describe system defined app item data(this kind of data is provided and bound to OpenHarmony, 1178 * also can be parsed by system provided API) 1179 * 1180 * @extends SystemDefinedRecord 1181 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1182 * @since 10 1183 */ 1184 /** 1185 * Describe system defined app item data(this kind of data is provided and bound to OpenHarmony, 1186 * also can be parsed by system provided API) 1187 * 1188 * @extends SystemDefinedRecord 1189 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1190 * @atomicservice 1191 * @since 11 1192 */ 1193 class SystemDefinedAppItem extends SystemDefinedRecord { 1194 /** 1195 * Indicates the app id 1196 * 1197 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1198 * @since 10 1199 */ 1200 /** 1201 * Indicates the app id 1202 * 1203 * @type { string } 1204 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1205 * @atomicservice 1206 * @since 11 1207 */ 1208 appId: string; 1209 /** 1210 * Indicates the app name 1211 * 1212 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1213 * @since 10 1214 */ 1215 /** 1216 * Indicates the app name 1217 * 1218 * @type { string } 1219 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1220 * @atomicservice 1221 * @since 11 1222 */ 1223 appName: string; 1224 /** 1225 * Indicates the id of app icon 1226 * 1227 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1228 * @since 10 1229 */ 1230 /** 1231 * Indicates the id of app icon 1232 * 1233 * @type { string } 1234 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1235 * @atomicservice 1236 * @since 11 1237 */ 1238 appIconId: string; 1239 /** 1240 * Indicates the id of app label 1241 * 1242 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1243 * @since 10 1244 */ 1245 /** 1246 * Indicates the id of app label 1247 * 1248 * @type { string } 1249 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1250 * @atomicservice 1251 * @since 11 1252 */ 1253 appLabelId: string; 1254 /** 1255 * Indicates the bundle name of app 1256 * 1257 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1258 * @since 10 1259 */ 1260 /** 1261 * Indicates the bundle name of app 1262 * 1263 * @type { string } 1264 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1265 * @atomicservice 1266 * @since 11 1267 */ 1268 bundleName: string; 1269 /** 1270 * Indicates the ability name of app 1271 * 1272 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1273 * @since 10 1274 */ 1275 /** 1276 * Indicates the ability name of app 1277 * 1278 * @type { string } 1279 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1280 * @atomicservice 1281 * @since 11 1282 */ 1283 abilityName: string; 1284 } 1285 1286 /** 1287 * Describe system defined pixel map data(this kind of data is provided and bound to OpenHarmony, 1288 * also can be parsed by system provided API) 1289 * 1290 * @extends SystemDefinedRecord 1291 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1292 * @since 10 1293 */ 1294 /** 1295 * Describe system defined pixel map data(this kind of data is provided and bound to OpenHarmony, 1296 * also can be parsed by system provided API) 1297 * 1298 * @extends SystemDefinedRecord 1299 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1300 * @atomicservice 1301 * @since 11 1302 */ 1303 class SystemDefinedPixelMap extends SystemDefinedRecord { 1304 /** 1305 * Indicates the raw data of pixel map 1306 * 1307 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1308 * @since 10 1309 */ 1310 /** 1311 * Indicates the raw data of pixel map 1312 * 1313 * @type { Uint8Array } 1314 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1315 * @atomicservice 1316 * @since 11 1317 */ 1318 rawData: Uint8Array; 1319 } 1320 1321 /** 1322 * Describe application defined data(this kind of data is provided and bound to OpenHarmony, 1323 * also can be parsed by system provided API) 1324 * 1325 * @extends UnifiedRecord 1326 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1327 * @since 10 1328 */ 1329 /** 1330 * Describe application defined data(this kind of data is provided and bound to OpenHarmony, 1331 * also can be parsed by system provided API) 1332 * 1333 * @extends UnifiedRecord 1334 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1335 * @atomicservice 1336 * @since 11 1337 */ 1338 class ApplicationDefinedRecord extends UnifiedRecord { 1339 /** 1340 * Indicates the type of data, should always be started with 'ApplicationDefined.', will 1341 * return error otherwise 1342 * 1343 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1344 * @since 10 1345 */ 1346 /** 1347 * Indicates the type of data, should always be started with 'ApplicationDefined.', will 1348 * return error otherwise 1349 * 1350 * @type { string } 1351 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1352 * @atomicservice 1353 * @since 11 1354 */ 1355 applicationDefinedType: string; 1356 /** 1357 * Indicates the raw data of application defined data 1358 * 1359 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1360 * @since 10 1361 */ 1362 /** 1363 * Indicates the raw data of application defined data 1364 * 1365 * @type { Uint8Array } 1366 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1367 * @atomicservice 1368 * @since 11 1369 */ 1370 rawData: Uint8Array; 1371 } 1372 1373 /** 1374 * Describe the sharing channel that UDMF support 1375 * 1376 * @enum { string } 1377 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1378 * @since 10 1379 */ 1380 /** 1381 * Describe the sharing channel that UDMF support 1382 * 1383 * @enum { string } 1384 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1385 * @atomicservice 1386 * @since 11 1387 */ 1388 enum Intention { 1389 /** 1390 * Indicates the intention of data hub 1391 * 1392 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1393 * @since 10 1394 */ 1395 /** 1396 * Indicates the intention of data hub 1397 * 1398 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1399 * @atomicservice 1400 * @since 11 1401 */ 1402 DATA_HUB = 'DataHub', 1403 1404 /** 1405 * Indicates the intention of drag 1406 * 1407 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1408 * @systemapi 1409 * @StageModelOnly 1410 * @since 12 1411 */ 1412 DRAG = 'Drag' 1413 } 1414 1415 /** 1416 * Describe the optional arguments of data operation 1417 * 1418 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1419 * @since 10 1420 */ 1421 /** 1422 * Describe the optional arguments of data operation 1423 * 1424 * @typedef { object } 1425 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1426 * @atomicservice 1427 * @since 11 1428 */ 1429 type Options = { 1430 /** 1431 * Indicates the target Intention 1432 * 1433 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1434 * @since 10 1435 */ 1436 /** 1437 * Indicates the target Intention 1438 * 1439 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1440 * @atomicservice 1441 * @since 11 1442 */ 1443 intention?: Intention; 1444 1445 /** 1446 * Indicates the unique identifier of target UnifiedData 1447 * 1448 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1449 * @since 10 1450 */ 1451 /** 1452 * Indicates the unique identifier of target UnifiedData 1453 * 1454 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1455 * @atomicservice 1456 * @since 11 1457 */ 1458 key?: string; 1459 }; 1460 1461 /** 1462 * Insert data into unified data channel by Intention 1463 * 1464 * @param { Options } options - fill the intention field to indicate the target {@link Intention}. 1465 * @param { UnifiedData } data - {@link UnifiedData} data object to insert into target intention. 1466 * @param { AsyncCallback<string> } callback - {string}: the unique identifier. 1467 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1468 * <br>2.Incorrect parameters types. 1469 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1470 * @since 10 1471 */ 1472 /** 1473 * Insert data into unified data channel by Intention 1474 * 1475 * @param { Options } options - fill the intention field to indicate the target {@link Intention}. 1476 * @param { UnifiedData } data - {@link UnifiedData} data object to insert into target intention. 1477 * @param { AsyncCallback<string> } callback - {string}: the unique identifier. 1478 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1479 * <br>2.Incorrect parameters types. 1480 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1481 * @atomicservice 1482 * @since 11 1483 */ 1484 function insertData(options: Options, data: UnifiedData, callback: AsyncCallback<string>): void; 1485 1486 /** 1487 * Insert data into unified data channel by Intention 1488 * 1489 * @param { Options } options - fill the intention field to indicate the target {@link Intention}. 1490 * @param { UnifiedData } data - {@link UnifiedData} data object to insert into target intention. 1491 * @returns { Promise<string> } {string}: the unique identifier. 1492 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1493 * <br>2.Incorrect parameters types. 1494 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1495 * @since 10 1496 */ 1497 /** 1498 * Insert data into unified data channel by Intention 1499 * 1500 * @param { Options } options - fill the intention field to indicate the target {@link Intention}. 1501 * @param { UnifiedData } data - {@link UnifiedData} data object to insert into target intention. 1502 * @returns { Promise<string> } {string}: the unique identifier. 1503 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1504 * <br>2.Incorrect parameters types. 1505 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1506 * @atomicservice 1507 * @since 11 1508 */ 1509 function insertData(options: Options, data: UnifiedData): Promise<string>; 1510 1511 /** 1512 * Update data to unified data channel by Unique Identifier 1513 * 1514 * @param { Options } options - fill the unique identifier field to indicate the target {@link UnifiedData}. 1515 * @param { UnifiedData } data - {@link UnifiedData} data object to update the target data. 1516 * @param { AsyncCallback<void> } callback - the callback of updateData. 1517 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1518 * <br>2.Incorrect parameters types. 1519 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1520 * @since 10 1521 */ 1522 /** 1523 * Update data to unified data channel by Unique Identifier 1524 * 1525 * @param { Options } options - fill the unique identifier field to indicate the target {@link UnifiedData}. 1526 * @param { UnifiedData } data - {@link UnifiedData} data object to update the target data. 1527 * @param { AsyncCallback<void> } callback - the callback of updateData. 1528 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1529 * <br>2.Incorrect parameters types. 1530 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1531 * @atomicservice 1532 * @since 11 1533 */ 1534 function updateData(options: Options, data: UnifiedData, callback: AsyncCallback<void>): void; 1535 1536 /** 1537 * Update data to unified data channel by Unique Identifier 1538 * 1539 * @param { Options } options - fill the unique identifier field to indicate the target {@link UnifiedData}. 1540 * @param { UnifiedData } data - {@link UnifiedData} data object to update the target data. 1541 * @returns { Promise<void> } the promise returned by the function. 1542 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1543 * <br>2.Incorrect parameters types. 1544 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1545 * @since 10 1546 */ 1547 /** 1548 * Update data to unified data channel by Unique Identifier 1549 * 1550 * @param { Options } options - fill the unique identifier field to indicate the target {@link UnifiedData}. 1551 * @param { UnifiedData } data - {@link UnifiedData} data object to update the target data. 1552 * @returns { Promise<void> } the promise returned by the function. 1553 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1554 * <br>2.Incorrect parameters types. 1555 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1556 * @atomicservice 1557 * @since 11 1558 */ 1559 function updateData(options: Options, data: UnifiedData): Promise<void>; 1560 1561 /** 1562 * Query data of unified data channel by Intention or Unique Identifier 1563 * 1564 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1565 * @param { AsyncCallback<Array<UnifiedData>> } callback - {Array<UnifiedData>}: the target {@link UnifiedData} object array. 1566 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1567 * <br>2.Incorrect parameters types. 1568 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1569 * @since 10 1570 */ 1571 /** 1572 * Query data of unified data channel by Intention or Unique Identifier 1573 * 1574 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1575 * @param { AsyncCallback<Array<UnifiedData>> } callback - {Array<UnifiedData>}: the target {@link UnifiedData} object array. 1576 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1577 * <br>2.Incorrect parameters types. 1578 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1579 * @atomicservice 1580 * @since 11 1581 */ 1582 function queryData(options: Options, callback: AsyncCallback<Array<UnifiedData>>): void; 1583 1584 /** 1585 * Query data of unified data channel by Intention or Unique Identifier 1586 * 1587 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1588 * @returns { Promise<Array<UnifiedData>> } {Array<UnifiedData>}: the target {@link UnifiedData} object array. 1589 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1590 * <br>2.Incorrect parameters types. 1591 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1592 * @since 10 1593 */ 1594 /** 1595 * Query data of unified data channel by Intention or Unique Identifier 1596 * 1597 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1598 * @returns { Promise<Array<UnifiedData>> } {Array<UnifiedData>}: the target {@link UnifiedData} object array. 1599 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1600 * <br>2.Incorrect parameters types. 1601 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1602 * @atomicservice 1603 * @since 11 1604 */ 1605 function queryData(options: Options): Promise<Array<UnifiedData>>; 1606 1607 /** 1608 * Delete data of unified data channel by Intention or Unique Identifier 1609 * 1610 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1611 * @param { AsyncCallback<Array<UnifiedData>> } callback - {Array<UnifiedData>}: the deleted {@link UnifiedData} object array. 1612 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1613 * <br>2.Incorrect parameters types. 1614 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1615 * @since 10 1616 */ 1617 /** 1618 * Delete data of unified data channel by Intention or Unique Identifier 1619 * 1620 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1621 * @param { AsyncCallback<Array<UnifiedData>> } callback - {Array<UnifiedData>}: the deleted {@link UnifiedData} object array. 1622 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1623 * <br>2.Incorrect parameters types. 1624 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1625 * @atomicservice 1626 * @since 11 1627 */ 1628 function deleteData(options: Options, callback: AsyncCallback<Array<UnifiedData>>): void; 1629 1630 /** 1631 * Delete data of unified data channel by Intention or Unique Identifier 1632 * 1633 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1634 * @returns { Promise<Array<UnifiedData>> } {Array<UnifiedData>}: the deleted {@link UnifiedData} object array. 1635 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1636 * <br>2.Incorrect parameters types. 1637 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1638 * @since 10 1639 */ 1640 /** 1641 * Delete data of unified data channel by Intention or Unique Identifier 1642 * 1643 * @param { Options } options - fill the intention or unique identifier field to indicate the target {@link Intention} or {@link UnifiedData}. 1644 * @returns { Promise<Array<UnifiedData>> } {Array<UnifiedData>}: the deleted {@link UnifiedData} object array. 1645 * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; 1646 * <br>2.Incorrect parameters types. 1647 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1648 * @atomicservice 1649 * @since 11 1650 */ 1651 function deleteData(options: Options): Promise<Array<UnifiedData>>; 1652 1653 /** 1654 * Set app sharing options. 1655 * 1656 * @param { Intention } intention - Describe the sharing channel that UDMF support. 1657 * @param { ShareOptions } shareOptions - Types of scope that UnifiedData can be used. 1658 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 1659 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1660 * 2. Incorrect parameter types. 1661 * @throws { BusinessError } 20400001 - Settings already exist. 1662 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1663 * @systemapi 1664 * @StageModelOnly 1665 * @since 12 1666 */ 1667 function setAppShareOptions(intention: Intention, shareOptions: ShareOptions): void; 1668 1669 /** 1670 * Remove app sharing options. 1671 * 1672 * @param { Intention } intention - Describe the sharing channel that UDMF support. 1673 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 1674 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1675 * 2. Incorrect parameter types. 1676 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 1677 * @systemapi 1678 * @StageModelOnly 1679 * @since 12 1680 */ 1681 function removeAppShareOptions(intention: Intention): void; 1682} 1683 1684export default unifiedDataChannel; 1685