1/* 2 * Copyright (C) 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 Helper functions to access image and video assets 18 * @kit MediaLibraryKit 19 */ 20 21import type { AsyncCallback, Callback } from './@ohos.base'; 22import type Context from './application/Context'; 23import type image from './@ohos.multimedia.image'; 24import type dataSharePredicates from './@ohos.data.dataSharePredicates'; 25import type { CustomColors } from './@ohos.arkui.theme'; 26 27/** 28 * Helper functions to access image and video assets 29 * 30 * @namespace photoAccessHelper 31 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 32 * @since 10 33 */ 34/** 35 * Helper functions to access image and video assets 36 * 37 * @namespace photoAccessHelper 38 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 39 * @atomicservice 40 * @since 11 41 */ 42/** 43 * Helper functions to access image and video assets 44 * 45 * @namespace photoAccessHelper 46 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 47 * @crossplatform 48 * @atomicservice 49 * @since 12 50 */ 51declare namespace photoAccessHelper { 52 /** 53 * Returns an instance of PhotoAccessHelper 54 * 55 * @param { Context } context - Hap context information 56 * @returns { PhotoAccessHelper } Instance of PhotoAccessHelper 57 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 58 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 59 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 60 * @StageModelOnly 61 * @since 10 62 */ 63 /** 64 * Returns an instance of PhotoAccessHelper 65 * 66 * @param { Context } context - Hap context information 67 * @returns { PhotoAccessHelper } Instance of PhotoAccessHelper 68 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 69 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 70 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 71 * @StageModelOnly 72 * @atomicservice 73 * @since 11 74 */ 75 /** 76 * Returns an instance of PhotoAccessHelper 77 * 78 * @param { Context } context - Hap context information 79 * @returns { PhotoAccessHelper } Instance of PhotoAccessHelper 80 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 81 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 82 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 83 * @StageModelOnly 84 * @crossplatform 85 * @atomicservice 86 * @since 12 87 */ 88 function getPhotoAccessHelper(context: Context): PhotoAccessHelper; 89 90 /** 91 * Enumeration of different types of photos 92 * 93 * @enum { number } PhotoType 94 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 95 * @since 10 96 */ 97 /** 98 * Enumeration of different types of photos 99 * 100 * @enum { number } PhotoType 101 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 102 * @atomicservice 103 * @since 11 104 */ 105 /** 106 * Enumeration of different types of photos 107 * 108 * @enum { number } PhotoType 109 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 110 * @crossplatform 111 * @atomicservice 112 * @since 12 113 */ 114 enum PhotoType { 115 /** 116 * Image asset 117 * 118 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 119 * @since 10 120 */ 121 /** 122 * Image asset 123 * 124 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 125 * @atomicservice 126 * @since 11 127 */ 128 /** 129 * Image asset 130 * 131 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 132 * @crossplatform 133 * @atomicservice 134 * @since 12 135 */ 136 IMAGE = 1, 137 /** 138 * Video asset 139 * 140 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 141 * @since 10 142 */ 143 /** 144 * Video asset 145 * 146 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 147 * @atomicservice 148 * @since 11 149 */ 150 /** 151 * Video asset 152 * 153 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 154 * @crossplatform 155 * @atomicservice 156 * @since 12 157 */ 158 VIDEO 159 } 160 161 /** 162 * Enumeration of different categories of photos 163 * 164 * @enum { number } PhotoSubtype 165 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 166 * @systemapi 167 * @since 10 168 */ 169 /** 170 * Enumeration of different categories of photos 171 * 172 * @enum { number } PhotoSubtype 173 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 174 * @atomicservice 175 * @since 12 176 */ 177 enum PhotoSubtype { 178 /** 179 * Default Photo Type 180 * 181 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 182 * @systemapi 183 * @since 10 184 */ 185 /** 186 * Default Photo Type 187 * 188 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 189 * @atomicservice 190 * @since 12 191 */ 192 DEFAULT = 0, 193 /** 194 * Screenshot Photo Type 195 * 196 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 197 * @systemapi 198 * @since 10 199 */ 200 SCREENSHOT = 1, 201 /** 202 * Moving Photo Type 203 * 204 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 205 * @atomicservice 206 * @since 12 207 */ 208 MOVING_PHOTO = 3, 209 /** 210 * Burst Photo Type 211 * 212 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 213 * @atomicservice 214 * @since 12 215 */ 216 BURST = 4, 217 } 218 219 /** 220 * Enumeration of dynamic range type 221 * 222 * @enum { number } DynamicRangeType 223 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 224 * @since 12 225 */ 226 enum DynamicRangeType { 227 /** 228 * SDR(Standard-Dynamic Range) format 229 * 230 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 231 * @since 12 232 */ 233 SDR = 0, 234 /** 235 * HDR(High-Dynamic Range) format 236 * 237 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 238 * @since 12 239 */ 240 HDR = 1 241 } 242 243 /** 244 * Ability to access thumbnail 245 * 246 * @enum { number } ThumbnailVisibility 247 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 248 * @systemapi 249 * @since 14 250 */ 251 enum ThumbnailVisibility { 252 /** 253 * Unable to access thumbnail 254 * 255 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 256 * @systemapi 257 * @since 14 258 */ 259 INVISIBLE = 0, 260 /** 261 * able to access thumbnail 262 * 263 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 264 * @systemapi 265 * @since 14 266 */ 267 VISIBLE = 1 268 } 269 270 /** 271 * Photo asset position 272 * 273 * @enum { number } Photo asset position, such as local device or cloud 274 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 275 * @systemapi 276 * @since 10 277 */ 278 enum PositionType { 279 /** 280 * Asset exists only in local device 281 * 282 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 283 * @systemapi 284 * @since 10 285 */ 286 LOCAL = 1 << 0, 287 /** 288 * Asset exists only in cloud 289 * 290 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 291 * @systemapi 292 * @since 10 293 */ 294 CLOUD = 1 << 1 295 } 296 297 /** 298 * Analysis type 299 * 300 * @enum { number } AnalysisType 301 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 302 * @systemapi 303 * @since 11 304 */ 305 enum AnalysisType { 306 /** 307 * Analysis of aesthetics score 308 * 309 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 310 * @systemapi 311 * @since 11 312 */ 313 ANALYSIS_AESTHETICS_SCORE = 0, 314 /** 315 * Analysis of label 316 * 317 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 318 * @systemapi 319 * @since 11 320 */ 321 ANALYSIS_LABEL, 322 /** 323 * Analysis of ocr 324 * 325 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 326 * @systemapi 327 * @since 11 328 */ 329 ANALYSIS_OCR, 330 /** 331 * Analysis of face 332 * 333 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 334 * @systemapi 335 * @since 11 336 */ 337 ANALYSIS_FACE, 338 /** 339 * Analysis of object 340 * 341 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 342 * @systemapi 343 * @since 11 344 */ 345 ANALYSIS_OBJECT, 346 /** 347 * Analysis of recommendation 348 * 349 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 350 * @systemapi 351 * @since 11 352 */ 353 ANALYSIS_RECOMMENDATION, 354 /** 355 * Analysis of segmentation 356 * 357 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 358 * @systemapi 359 * @since 11 360 */ 361 ANALYSIS_SEGMENTATION, 362 /** 363 * Analysis of composition 364 * 365 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 366 * @systemapi 367 * @since 11 368 */ 369 ANALYSIS_COMPOSITION, 370 /** 371 * Analysis of saliency 372 * 373 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 374 * @systemapi 375 * @since 11 376 */ 377 ANALYSIS_SALIENCY, 378 /** 379 * Analysis of photo detail address info 380 * 381 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 382 * @systemapi 383 * @since 11 384 */ 385 ANALYSIS_DETAIL_ADDRESS, 386 /** 387 * Analysis of human face tag 388 * 389 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 390 * @systemapi 391 * @since 12 392 */ 393 ANALYSIS_HUMAN_FACE_TAG, 394 /** 395 * Analysis of head position 396 * 397 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 398 * @systemapi 399 * @since 12 400 */ 401 ANALYSIS_HEAD_POSITION, 402 /** 403 * Analysis of bone pose 404 * 405 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 406 * @systemapi 407 * @since 12 408 */ 409 ANALYSIS_BONE_POSE, 410 /** 411 * Analysis of video label 412 * 413 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 414 * @systemapi 415 * @since 12 416 */ 417 ANALYSIS_VIDEO_LABEL, 418 /** 419 * Analysis of highlight 420 * 421 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 422 * @systemapi 423 * @since 12 424 */ 425 ANALYSIS_HIGHLIGHT, 426 /** 427 * Analysis of multi crop 428 * 429 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 430 * @systemapi 431 * @since 12 432 */ 433 ANALYSIS_MULTI_CROP 434 } 435 436 /** 437 * Enumeration of different recommendation type 438 * 439 * @enum { number } RecommendationType 440 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 441 * @atomicservice 442 * @since 11 443 */ 444 enum RecommendationType { 445 /** 446 * QR_OR_BAR_CODE indicates that QR code or barcode photos can be recommended 447 * 448 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 449 * @atomicservice 450 * @since 11 451 */ 452 QR_OR_BAR_CODE = 1, 453 454 /** 455 * QR_CODE indicates that QR code photos can be recommended 456 * 457 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 458 * @atomicservice 459 * @since 11 460 */ 461 QR_CODE = 2, 462 463 /** 464 * BAR_CODE indicates that barcode photos can be recommended 465 * 466 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 467 * @atomicservice 468 * @since 11 469 */ 470 BAR_CODE = 3, 471 472 /** 473 * ID_CARD indicates that QR code or barcode photos can be recommended 474 * 475 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 476 * @atomicservice 477 * @since 11 478 */ 479 ID_CARD = 4, 480 481 /** 482 * PROFILE_PICTURE indicates that profile picture photos can be recommended 483 * 484 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 485 * @atomicservice 486 * @since 11 487 */ 488 PROFILE_PICTURE = 5, 489 490 /** 491 * PASSPORT indicates that passport photos can be recommended 492 * 493 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 494 * @atomicservice 495 * @since 12 496 */ 497 PASSPORT = 6, 498 499 /** 500 * BANK_CARD indicates that bank card photos can be recommended 501 * 502 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 503 * @atomicservice 504 * @since 12 505 */ 506 BANK_CARD = 7, 507 508 /** 509 * DRIVER_LICENSE indicates that driver license photos can be recommended 510 * 511 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 512 * @atomicservice 513 * @since 12 514 */ 515 DRIVER_LICENSE = 8, 516 517 /** 518 * DRIVING_LICENSE indicates that driving license photos can be recommended 519 * 520 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 521 * @atomicservice 522 * @since 12 523 */ 524 DRIVING_LICENSE = 9, 525 526 /** 527 * FEATURED_SINGLE_PORTRAIT indicates that featured single portrait photos can be recommended 528 * 529 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 530 * @atomicservice 531 * @since 12 532 */ 533 FEATURED_SINGLE_PORTRAIT = 10 534 } 535 536 /** 537 * Enumeration of delivery mode. 538 * 539 * @enum { number } DeliveryMode 540 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 541 * @since 11 542 */ 543 enum DeliveryMode { 544 /** 545 * Fast delivery mode 546 * 547 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 548 * @since 11 549 */ 550 FAST_MODE = 0, 551 552 /** 553 * High quality delivery mode 554 * 555 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 556 * @since 11 557 */ 558 HIGH_QUALITY_MODE = 1, 559 560 /** 561 * Balance delivery mode 562 * 563 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 564 * @since 11 565 */ 566 BALANCE_MODE = 2 567 } 568 569 /** 570 * Enumeration of compatible mode. 571 * 572 * @enum { number } CompatibleMode 573 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 574 * @since 15 575 */ 576 enum CompatibleMode { 577 /** 578 * Original format mode 579 * 580 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 581 * @since 15 582 */ 583 ORIGINAL_FORMAT_MODE = 0, 584 585 /** 586 * Compatible format mode. 587 * 588 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 589 * @since 15 590 */ 591 COMPATIBLE_FORMAT_MODE = 1 592 } 593 594 /** 595 * Data handler used to notify the progress of required media asset data 596 * 597 * @interface MediaAssetProgressHandler 598 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 599 * @since 15 600 */ 601 interface MediaAssetProgressHandler { 602 /** 603 * Indicates the progress of required media asset data 604 * 605 * @param { number } progress - the progress of required media asset data; from 0 to 100. 606 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 607 * @since 15 608 */ 609 onProgress(progress: number): void; 610 } 611 612 /** 613 * Enumeration of source mode 614 * 615 * @enum { number } SourceMode 616 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 617 * @systemapi 618 * @since 11 619 */ 620 enum SourceMode { 621 /** 622 * Original mode 623 * 624 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 625 * @systemapi 626 * @since 11 627 */ 628 ORIGINAL_MODE = 0, 629 630 /** 631 * Edited mode 632 * 633 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 634 * @systemapi 635 * @since 11 636 */ 637 EDITED_MODE = 1 638 } 639 640 /** 641 * Enumeration type of permissions for accessing asset uri. 642 * 643 * @enum { number } PhotoPermissionType 644 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 645 * @systemapi 646 * @since 12 647 */ 648 enum PhotoPermissionType { 649 /** 650 * Temporary access to photos, this permission could be canceled when APP dies. 651 * 652 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 653 * @systemapi 654 * @since 12 655 */ 656 TEMPORARY_READ_IMAGEVIDEO = 0, 657 658 /** 659 * Persistence access to photos. 660 * 661 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 662 * @systemapi 663 * @since 12 664 */ 665 PERSISTENT_READ_IMAGEVIDEO = 1 666 } 667 668 /** 669 * Enumeration type of hide sensitive information. 670 * 671 * @enum { number } HideSensitiveType 672 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 673 * @systemapi 674 * @since 12 675 */ 676 enum HideSensitiveType { 677 /** 678 * Hide location information and shooting param. 679 * 680 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 681 * @systemapi 682 * @since 12 683 */ 684 HIDE_LOCATION_AND_SHOOTING_PARAM = 0, 685 686 /** 687 * Hide location information. 688 * 689 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 690 * @systemapi 691 * @since 12 692 */ 693 HIDE_LOCATION_ONLY = 1, 694 695 /** 696 * Hide shooting param. 697 * 698 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 699 * @systemapi 700 * @since 12 701 */ 702 HIDE_SHOOTING_PARAM_ONLY = 2, 703 704 /** 705 * Hide nothing. 706 * 707 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 708 * @systemapi 709 * @since 12 710 */ 711 NO_HIDE_SENSITIVE_TYPE = 3 712 } 713 714 /** 715 * Enumeration type of authorization mode. 716 * 717 * @enum { number } AuthorizationMode 718 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 719 * @systemapi 720 * @since 12 721 */ 722 enum AuthorizationMode { 723 /** 724 * Short time authorization. 725 * 726 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 727 * @systemapi 728 * @since 12 729 */ 730 SHORT_TIME_AUTHORIZATION = 0 731 } 732 733 /** 734 * Enumeration type of watermarktypes of photos 735 * 736 * @enum { number } WatermarkType 737 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 738 * @systemapi 739 * @since 14 740 */ 741 enum WatermarkType { 742 /** 743 * WatermarkType of Default 744 * 745 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 746 * @systemapi 747 * @since 14 748 */ 749 DEFAULT = 0, 750 751 /** 752 * WatermarkType of BRAND_COMMON 753 * 754 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 755 * @systemapi 756 * @since 14 757 */ 758 BRAND_COMMON = 1, 759 760 /** 761 * WatermarkType of COMMON 762 * 763 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 764 * @systemapi 765 * @since 14 766 */ 767 COMMON = 2, 768 769 /** 770 * WatermarkType of BRAND 771 * 772 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 773 * @systemapi 774 * @since 14 775 */ 776 BRAND = 3, 777 } 778 779 /** 780 * Enum: complete button text 781 * 782 * @enum { number } CompleteButtonText 783 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 784 * @atomicservice 785 * @since 14 786 */ 787 enum CompleteButtonText { 788 /** 789 * Complete button text: done 790 * 791 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 792 * @atomicservice 793 * @since 14 794 */ 795 TEXT_DONE = 0, 796 /** 797 * Complete button text: send 798 * 799 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 800 * @atomicservice 801 * @since 14 802 */ 803 TEXT_SEND = 1, 804 805 /** 806 * Complete button text: add 807 * 808 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 809 * @atomicservice 810 * @since 14 811 */ 812 TEXT_ADD = 2, 813 } 814 815 /** 816 * Options to request media asset 817 * 818 * @interface RequestOptions 819 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 820 * @since 11 821 */ 822 interface RequestOptions { 823 /** 824 * Indicates the delivery mode 825 * 826 * @type { DeliveryMode } 827 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 828 * @since 11 829 */ 830 deliveryMode: DeliveryMode; 831 832 /** 833 * Indicates the source mode 834 * 835 * @type { ?SourceMode } 836 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 837 * @systemapi 838 * @since 11 839 */ 840 sourceMode?: SourceMode; 841 842 /** 843 * Indicates the compatible mode 844 * 845 * @type { ?CompatibleMode } 846 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 847 * @since 15 848 */ 849 compatibleMode?: CompatibleMode; 850 851 /** 852 * data handler used to notify the progress of required media asset data 853 * 854 * @type { ?MediaAssetProgressHandler } 855 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 856 * @since 15 857 */ 858 mediaAssetProgressHandler?: MediaAssetProgressHandler; 859 } 860 861 /** 862 * Media asset data handler 863 * 864 * @interface MediaAssetDataHandler 865 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 866 * @since 11 867 */ 868 interface MediaAssetDataHandler<T> { 869 /** 870 * Indicates required media asset data is prepared 871 * 872 * @param { T } data - the returned data of media asset 873 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 874 * @since 11 875 */ 876 /** 877 * Indicates required media asset data is prepared 878 * 879 * @param { T } data - the returned data of media asset 880 * @param { Map<string, string> } [map] - additional information for the data 881 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 882 * @since 12 883 */ 884 onDataPrepared(data: T, map?: Map<string, string>): void; 885 } 886 887 /** 888 * Data handler when quick request image is finished 889 * 890 * @typedef QuickImageDataHandler 891 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 892 * @since 13 893 */ 894 interface QuickImageDataHandler<T> { 895 /** 896 * Indicates required media asset data quickly is prepared 897 * 898 * @param { T } data - the returned data of picture 899 * @param { image.ImageSource } imageSource - the returned data of imageSource 900 * @param { Map<string, string> } map - additional information for the data 901 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 902 * @since 13 903 */ 904 onDataPrepared(data: T, imageSource: image.ImageSource, map: Map<string, string>): void; 905 } 906 907 /** 908 * Photo Proxy used to save image data 909 * 910 * @interface PhotoProxy 911 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 912 * @systemapi 913 * @since 11 914 */ 915 interface PhotoProxy {} 916 917 /** 918 * Media asset manager 919 * 920 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 921 * @since 11 922 */ 923 /** 924 * Media asset manager 925 * 926 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 927 * @atomicservice 928 * @since 14 929 */ 930 class MediaAssetManager { 931 /** 932 * Request image 933 * 934 * @permission ohos.permission.READ_IMAGEVIDEO 935 * @param { Context } context - Hap context information 936 * @param { PhotoAsset } asset - the photo asset requested 937 * @param { RequestOptions } requestOptions - the request options 938 * @param { MediaAssetDataHandler<image.ImageSource> } dataHandler - data handler used to obtain media asset data when ImageSource is prepared 939 * @returns { Promise<string> } Returns request id 940 * @throws { BusinessError } 201 - Permission denied 941 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 942 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 943 * @throws { BusinessError } 14000011 - System inner fail 944 * @static 945 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 946 * @since 11 947 */ 948 static requestImage( 949 context: Context, 950 asset: PhotoAsset, 951 requestOptions: RequestOptions, 952 dataHandler: MediaAssetDataHandler<image.ImageSource> 953 ): Promise<string>; 954 955 /** 956 * Quick request image 957 * 958 * @permission ohos.permission.READ_IMAGEVIDEO 959 * @param { Context } context - Hap context information 960 * @param { PhotoAsset } asset - the photo asset requested 961 * @param { RequestOptions } requestOptions - the request options 962 * @param { QuickImageDataHandler<image.Picture> } dataHandler - data handler used to obtain image data quickly when picture is prepared 963 * @returns { Promise<string> } Returns request id 964 * @throws { BusinessError } 201 - Permission denied 965 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 966 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 967 * @throws { BusinessError } 14000011 - Internal system error 968 * @static 969 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 970 * @since 13 971 */ 972 static quickRequestImage( 973 context: Context, 974 asset: PhotoAsset, 975 requestOptions: RequestOptions, 976 dataHandler: QuickImageDataHandler<image.Picture> 977 ): Promise<string>; 978 979 /** 980 * Request image data 981 * 982 * @permission ohos.permission.READ_IMAGEVIDEO 983 * @param { Context } context - Hap context information 984 * @param { PhotoAsset } asset - the photo asset requested 985 * @param { RequestOptions } requestOptions - the request options 986 * @param { MediaAssetDataHandler<ArrayBuffer> } dataHandler - data handler used obtain media asset data when data is prepared 987 * @returns { Promise<string> } Returns request id 988 * @throws { BusinessError } 201 - Permission denied 989 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 990 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 991 * @throws { BusinessError } 14000011 - System inner fail 992 * @static 993 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 994 * @since 11 995 */ 996 static requestImageData( 997 context: Context, 998 asset: PhotoAsset, 999 requestOptions: RequestOptions, 1000 dataHandler: MediaAssetDataHandler<ArrayBuffer> 1001 ): Promise<string>; 1002 1003 /** 1004 * Request moving photo 1005 * 1006 * @permission ohos.permission.READ_IMAGEVIDEO 1007 * @param { Context } context - Hap context information 1008 * @param { PhotoAsset } asset - the photo asset requested 1009 * @param { RequestOptions } requestOptions - the request options 1010 * @param { MediaAssetDataHandler<MovingPhoto> } dataHandler - data handler used to obtain moving photo when data is prepared 1011 * @returns { Promise<string> } Returns request id 1012 * @throws { BusinessError } 201 - Permission denied 1013 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1014 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1015 * @throws { BusinessError } 14000011 - System inner fail 1016 * @static 1017 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1018 * @since 12 1019 */ 1020 static requestMovingPhoto( 1021 context: Context, 1022 asset: PhotoAsset, 1023 requestOptions: RequestOptions, 1024 dataHandler: MediaAssetDataHandler<MovingPhoto> 1025 ): Promise<string>; 1026 1027 /** 1028 * Cancel request 1029 * 1030 * @permission ohos.permission.READ_IMAGEVIDEO 1031 * @param { Context } context - Hap context information 1032 * @param { string } requestId - the request id to be canceled 1033 * @returns { Promise<void> } Returns void 1034 * @throws { BusinessError } 201 - Permission denied 1035 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1036 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1037 * @throws { BusinessError } 14000011 - System inner fail 1038 * @static 1039 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1040 * @since 12 1041 */ 1042 static cancelRequest(context: Context, requestId: string): Promise<void>; 1043 1044 /** 1045 * Request video file 1046 * 1047 * @permission ohos.permission.READ_IMAGEVIDEO 1048 * @param { Context } context - Hap context information 1049 * @param { PhotoAsset } asset - the photo asset requested 1050 * @param { RequestOptions } requestOptions - the request options 1051 * @param { string } fileUri - the destination file uri to save the video data 1052 * @param { MediaAssetDataHandler<boolean> } dataHandler - data handler used to notify the client that data has been written to the application sandbox 1053 * @returns { Promise<string> } Returns request id 1054 * @throws { BusinessError } 201 - Permission denied 1055 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1056 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1057 * @throws { BusinessError } 14000011 - System inner fail 1058 * @static 1059 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1060 * @since 12 1061 */ 1062 /** 1063 * Request video file 1064 * 1065 * @permission ohos.permission.READ_IMAGEVIDEO 1066 * @param { Context } context - Hap context information 1067 * @param { PhotoAsset } asset - the photo asset requested 1068 * @param { RequestOptions } requestOptions - the request options 1069 * @param { string } fileUri - the destination file uri to save the video data 1070 * @param { MediaAssetDataHandler<boolean> } dataHandler - data handler used to notify the client that data has been written to the application sandbox 1071 * @returns { Promise<string> } Returns request id 1072 * @throws { BusinessError } 201 - Permission denied 1073 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1074 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1075 * @throws { BusinessError } 801 - Capability not supported. 1076 * @throws { BusinessError } 14000011 - System inner fail 1077 * @static 1078 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1079 * @since 15 1080 */ 1081 static requestVideoFile( 1082 context: Context, 1083 asset: PhotoAsset, 1084 requestOptions: RequestOptions, 1085 fileUri: string, 1086 dataHandler: MediaAssetDataHandler<boolean> 1087 ): Promise<string>; 1088 1089 /** 1090 * Load moving photo 1091 * 1092 * @param { Context } context - Hap context information 1093 * @param { string } imageFileUri - image file uri of the moving photo to be loaded 1094 * @param { string } videoFileUri - video file uri of the moving photo to be loaded 1095 * @returns { Promise<MovingPhoto> } Returns moving photo 1096 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1097 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1098 * @throws { BusinessError } 14000011 - Internal system error 1099 * @static 1100 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1101 * @since 12 1102 */ 1103 /** 1104 * Load moving photo 1105 * 1106 * @param { Context } context - Hap context information 1107 * @param { string } imageFileUri - image file uri of the moving photo to be loaded 1108 * @param { string } videoFileUri - video file uri of the moving photo to be loaded 1109 * @returns { Promise<MovingPhoto> } Returns moving photo 1110 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1111 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1112 * @throws { BusinessError } 14000011 - Internal system error 1113 * @static 1114 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1115 * @atomicservice 1116 * @since 14 1117 */ 1118 static loadMovingPhoto( 1119 context: Context, 1120 imageFileUri: string, 1121 videoFileUri: string 1122 ): Promise<MovingPhoto>; 1123 } 1124 1125 /** 1126 * Indicates the type of photo asset member. 1127 * 1128 * @typedef { number | string | boolean } MemberType 1129 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1130 * @since 10 1131 */ 1132 /** 1133 * Indicates the type of photo asset member. 1134 * 1135 * @typedef { number | string | boolean } MemberType 1136 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1137 * @crossplatform 1138 * @since 12 1139 */ 1140 type MemberType = number | string | boolean; 1141 1142 /** 1143 * Defines the photo asset 1144 * 1145 * @interface PhotoAsset 1146 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1147 * @since 10 1148 */ 1149 /** 1150 * Defines the photo asset 1151 * 1152 * @interface PhotoAsset 1153 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1154 * @atomicservice 1155 * @since 11 1156 */ 1157 /** 1158 * Defines the photo asset 1159 * 1160 * @interface PhotoAsset 1161 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1162 * @crossplatform 1163 * @atomicservice 1164 * @since 12 1165 */ 1166 interface PhotoAsset { 1167 /** 1168 * uri of the asset. 1169 * 1170 * @type { string } 1171 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1172 * @since 10 1173 */ 1174 /** 1175 * uri of the asset. 1176 * 1177 * @type { string } 1178 * @readonly 1179 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1180 * @crossplatform 1181 * @atomicservice 1182 * @since 12 1183 */ 1184 readonly uri: string; 1185 /** 1186 * Photo type, image or video 1187 * 1188 * @type { PhotoType } 1189 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1190 * @since 10 1191 */ 1192 /** 1193 * Photo type, image or video 1194 * 1195 * @type { PhotoType } 1196 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1197 * @crossplatform 1198 * @since 12 1199 */ 1200 readonly photoType: PhotoType; 1201 /** 1202 * Display name (with a file name extension) of the asset. 1203 * 1204 * @type { string } 1205 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1206 * @since 10 1207 */ 1208 /** 1209 * Display name (with a file name extension) of the asset. 1210 * 1211 * @type { string } 1212 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1213 * @crossplatform 1214 * @since 12 1215 */ 1216 readonly displayName: string; 1217 /** 1218 * Returns the value of the specified member. 1219 * 1220 * @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE) 1221 * @returns { MemberType } Returns the value of the specified photo asset member 1222 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1223 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1224 * @throws { BusinessError } 13900020 - Invalid argument 1225 * @throws { BusinessError } 14000014 - Member is not a valid PhotoKey 1226 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1227 * @since 10 1228 */ 1229 /** 1230 * Returns the value of the specified member. 1231 * 1232 * @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE) 1233 * @returns { MemberType } Returns the value of the specified photo asset member 1234 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1235 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1236 * @throws { BusinessError } 13900020 - Invalid argument 1237 * @throws { BusinessError } 14000014 - Member is not a valid PhotoKey 1238 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1239 * @crossplatform 1240 * @since 12 1241 */ 1242 get(member: string): MemberType; 1243 /** 1244 * Set a new value to the specified member 1245 * 1246 * @param { string } member - Photo asset member 1247 * @param { string } value - The new value of the member. 1248 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1249 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1250 * @throws { BusinessError } 13900020 - Invalid argument 1251 * @throws { BusinessError } 14000014 - Member is not a valid PhotoKey 1252 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1253 * @since 10 1254 * @example : set(PhotoKeys.TITLE, "newTitle"), call commitModify after set 1255 */ 1256 set(member: string, value: string): void; 1257 /** 1258 * Modify metadata of the asset 1259 * 1260 * @permission ohos.permission.WRITE_IMAGEVIDEO 1261 * @param { AsyncCallback<void> } callback - Returns void. 1262 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1263 * <br>2. Incorrect parameter types. 1264 * @throws { BusinessError } 13900012 - Permission denied 1265 * @throws { BusinessError } 13900020 - Invalid argument 1266 * @throws { BusinessError } 14000001 - Invalid display name 1267 * @throws { BusinessError } 14000011 - System inner fail 1268 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1269 * @since 10 1270 */ 1271 /** 1272 * Modify metadata of the asset 1273 * 1274 * @permission ohos.permission.WRITE_IMAGEVIDEO 1275 * @param { AsyncCallback<void> } callback - Returns void. 1276 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1277 * <br>2. Incorrect parameter types. 1278 * @throws { BusinessError } 13900012 - Permission denied 1279 * @throws { BusinessError } 13900020 - Invalid argument 1280 * @throws { BusinessError } 14000001 - Invalid display name 1281 * @throws { BusinessError } 14000011 - System inner fail 1282 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1283 * @atomicservice 1284 * @since 11 1285 */ 1286 commitModify(callback: AsyncCallback<void>): void; 1287 /** 1288 * Modify metadata of the asset 1289 * 1290 * @permission ohos.permission.WRITE_IMAGEVIDEO 1291 * @returns { Promise<void> } Returns void 1292 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1293 * <br>2. Incorrect parameter types. 1294 * @throws { BusinessError } 13900012 - Permission denied 1295 * @throws { BusinessError } 13900020 - Invalid argument 1296 * @throws { BusinessError } 14000001 - Invalid display name 1297 * @throws { BusinessError } 14000011 - System inner fail 1298 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1299 * @since 10 1300 */ 1301 /** 1302 * Modify metadata of the asset 1303 * 1304 * @permission ohos.permission.WRITE_IMAGEVIDEO 1305 * @returns { Promise<void> } Returns void 1306 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1307 * <br>2. Incorrect parameter types. 1308 * @throws { BusinessError } 13900012 - Permission denied 1309 * @throws { BusinessError } 13900020 - Invalid argument 1310 * @throws { BusinessError } 14000001 - Invalid display name 1311 * @throws { BusinessError } 14000011 - System inner fail 1312 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1313 * @atomicservice 1314 * @since 11 1315 */ 1316 commitModify(): Promise<void>; 1317 /** 1318 * Open the asset 1319 * 1320 * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.WRITE_IMAGEVIDEO 1321 * @param { string } mode - Mode for open, for example: rw, r, w. 1322 * @param { AsyncCallback<number> } callback - Callback return the fd of the asset. 1323 * @throws { BusinessError } 202 - Called by non-system application. 1324 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1325 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1326 * @throws { BusinessError } 13900012 - Permission denied 1327 * @throws { BusinessError } 13900020 - Invalid argument 1328 * @throws { BusinessError } 14000011 - System inner fail 1329 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1330 * @systemapi 1331 * @since 10 1332 * @deprecated since 11 1333 */ 1334 open(mode: string, callback: AsyncCallback<number>): void; 1335 /** 1336 * Open the asset 1337 * 1338 * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.WRITE_IMAGEVIDEO 1339 * @param { string } mode - Mode for open, for example: rw, r, w. 1340 * @returns { Promise<number> } Returns the fd 1341 * @throws { BusinessError } 202 - Called by non-system application. 1342 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1343 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1344 * @throws { BusinessError } 13900012 - Permission denied 1345 * @throws { BusinessError } 13900020 - Invalid argument 1346 * @throws { BusinessError } 14000011 - System inner fail 1347 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1348 * @systemapi 1349 * @since 10 1350 * @deprecated since 11 1351 */ 1352 open(mode: string): Promise<number>; 1353 /** 1354 * Open the asset in read only mode 1355 * 1356 * @permission ohos.permission.READ_IMAGEVIDEO 1357 * @param { AsyncCallback<number> } callback - Returns the read only fd 1358 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1359 * <br>2. Incorrect parameter types. 1360 * @throws { BusinessError } 13900012 - Permission denied 1361 * @throws { BusinessError } 13900020 - Invalid argument 1362 * @throws { BusinessError } 14000011 - System inner fail 1363 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1364 * @since 10 1365 * @deprecated since 11 1366 */ 1367 getReadOnlyFd(callback: AsyncCallback<number>): void; 1368 /** 1369 * Open the asset in read only mode 1370 * 1371 * @permission ohos.permission.READ_IMAGEVIDEO 1372 * @returns { Promise<number> } Returns the read only fd 1373 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1374 * <br>2. Incorrect parameter types. 1375 * @throws { BusinessError } 13900012 - Permission denied 1376 * @throws { BusinessError } 13900020 - Invalid argument 1377 * @throws { BusinessError } 14000011 - System inner fail 1378 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1379 * @since 10 1380 * @deprecated since 11 1381 */ 1382 getReadOnlyFd(): Promise<number>; 1383 /** 1384 * Close the asset 1385 * 1386 * @param { number } fd - The opened fd of the asset. 1387 * @param { AsyncCallback<void> } callback - Returns void 1388 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1389 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1390 * @throws { BusinessError } 13900020 - Invalid argument 1391 * @throws { BusinessError } 14000011 - System inner fail 1392 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1393 * @since 10 1394 * @deprecated since 11 1395 */ 1396 close(fd: number, callback: AsyncCallback<void>): void; 1397 /** 1398 * Close the asset 1399 * 1400 * @param { number } fd - The opened fd of the asset. 1401 * @returns { Promise<void> } Returns void 1402 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1403 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1404 * @throws { BusinessError } 13900020 - Invalid argument 1405 * @throws { BusinessError } 14000011 - System inner fail 1406 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1407 * @since 10 1408 * @deprecated since 11 1409 */ 1410 close(fd: number): Promise<void>; 1411 /** 1412 * Get thumbnail of the asset 1413 * 1414 * @permission ohos.permission.READ_IMAGEVIDEO 1415 * @param { AsyncCallback<image.PixelMap> } callback - Returns the thumbnail's pixelMap. 1416 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1417 * <br>2. Incorrect parameter types. 1418 * @throws { BusinessError } 13900012 - Permission denied 1419 * @throws { BusinessError } 13900020 - Invalid argument 1420 * @throws { BusinessError } 14000011 - System inner fail 1421 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1422 * @since 10 1423 */ 1424 getThumbnail(callback: AsyncCallback<image.PixelMap>): void; 1425 /** 1426 * Get thumbnail of the asset 1427 * 1428 * @permission ohos.permission.READ_IMAGEVIDEO 1429 * @param { image.Size } size - Thumbnail's size 1430 * @param { AsyncCallback<image.PixelMap> } callback - Returns the thumbnail's pixelMap. 1431 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1432 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1433 * @throws { BusinessError } 13900012 - Permission denied 1434 * @throws { BusinessError } 13900020 - Invalid argument 1435 * @throws { BusinessError } 14000011 - System inner fail 1436 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1437 * @since 10 1438 */ 1439 getThumbnail(size: image.Size, callback: AsyncCallback<image.PixelMap>): void; 1440 /** 1441 * Get thumbnail of the asset 1442 * 1443 * @permission ohos.permission.READ_IMAGEVIDEO 1444 * @param { image.Size } [size] - Thumbnail's size 1445 * @returns { Promise<image.PixelMap> } Returns the thumbnail's pixelMap. 1446 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1447 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1448 * @throws { BusinessError } 13900012 - Permission denied 1449 * @throws { BusinessError } 13900020 - Invalid argument 1450 * @throws { BusinessError } 14000011 - System inner fail 1451 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1452 * @since 10 1453 */ 1454 getThumbnail(size?: image.Size): Promise<image.PixelMap>; 1455 /** 1456 * Set favorite state for the asset 1457 * 1458 * @permission ohos.permission.WRITE_IMAGEVIDEO 1459 * @param { boolean } favoriteState - true: Put the asset into favorite album; false: Remove the asset from favorite album. 1460 * @param { AsyncCallback<void> } callback - Returns void 1461 * @throws { BusinessError } 202 - Called by non-system application. 1462 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1463 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1464 * @throws { BusinessError } 13900012 - Permission denied 1465 * @throws { BusinessError } 13900020 - Invalid argument 1466 * @throws { BusinessError } 14000011 - System inner fail 1467 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1468 * @systemapi 1469 * @since 10 1470 * @deprecated since 11 1471 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setFavorite 1472 */ 1473 setFavorite(favoriteState: boolean, callback: AsyncCallback<void>): void; 1474 /** 1475 * Set favorite state for the asset 1476 * 1477 * @permission ohos.permission.WRITE_IMAGEVIDEO 1478 * @param { boolean } favoriteState - true: Put the asset into favorite album; false: Remove the asset from favorite album. 1479 * @returns { Promise<void> } Returns void 1480 * @throws { BusinessError } 202 - Called by non-system application. 1481 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1482 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1483 * @throws { BusinessError } 13900012 - Permission denied 1484 * @throws { BusinessError } 13900020 - Invalid argument 1485 * @throws { BusinessError } 14000011 - System inner fail 1486 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1487 * @systemapi 1488 * @since 10 1489 * @deprecated since 11 1490 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setFavorite 1491 */ 1492 setFavorite(favoriteState: boolean): Promise<void>; 1493 /** 1494 * Set asset hidden state. 1495 * 1496 * @permission ohos.permission.WRITE_IMAGEVIDEO 1497 * @param { boolean } hiddenState - true: Put the asset into hidden album; false: Recover the asset from hidden album. 1498 * @param { AsyncCallback<void> } callback - Returns void. 1499 * @throws { BusinessError } 202 - Called by non-system application. 1500 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1501 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1502 * @throws { BusinessError } 13900012 - Permission denied 1503 * @throws { BusinessError } 13900020 - Invalid argument 1504 * @throws { BusinessError } 14000011 - System inner fail 1505 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1506 * @systemapi 1507 * @since 10 1508 * @deprecated since 11 1509 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setHidden 1510 */ 1511 setHidden(hiddenState: boolean, callback: AsyncCallback<void>): void; 1512 /** 1513 * Set asset hidden state. 1514 * 1515 * @permission ohos.permission.WRITE_IMAGEVIDEO 1516 * @param { boolean } hiddenState - true: Put the asset into hidden album; false: Recover the asset from hidden album. 1517 * @returns { Promise<void> } Returns void 1518 * @throws { BusinessError } 202 - Called by non-system application. 1519 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1520 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1521 * @throws { BusinessError } 13900012 - Permission denied 1522 * @throws { BusinessError } 13900020 - Invalid argument 1523 * @throws { BusinessError } 14000011 - System inner fail 1524 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1525 * @systemapi 1526 * @since 10 1527 * @deprecated since 11 1528 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setHidden 1529 */ 1530 setHidden(hiddenState: boolean): Promise<void>; 1531 /** 1532 * Set user comment info to the asset. 1533 * 1534 * @permission ohos.permission.WRITE_IMAGEVIDEO 1535 * @param { string } userComment - user comment info 1536 * @param { AsyncCallback<void> } callback - Returns void. 1537 * @throws { BusinessError } 202 - Called by non-system application. 1538 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1539 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1540 * @throws { BusinessError } 13900012 - Permission denied 1541 * @throws { BusinessError } 13900020 - Invalid argument 1542 * @throws { BusinessError } 14000011 - System inner fail 1543 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1544 * @systemapi 1545 * @since 10 1546 * @deprecated since 11 1547 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setUserComment 1548 */ 1549 setUserComment(userComment: string, callback: AsyncCallback<void>): void; 1550 /** 1551 * Set user comment info to the asset. 1552 * 1553 * @permission ohos.permission.WRITE_IMAGEVIDEO 1554 * @param { string } userComment - user comment info 1555 * @returns { Promise<void> } Returns void 1556 * @throws { BusinessError } 202 - Called by non-system application. 1557 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1558 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1559 * @throws { BusinessError } 13900012 - Permission denied 1560 * @throws { BusinessError } 13900020 - Invalid argument 1561 * @throws { BusinessError } 14000011 - System inner fail 1562 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1563 * @systemapi 1564 * @since 10 1565 * @deprecated since 11 1566 * @useinstead photoAccessHelper.MediaAssetChangeRequest#setUserComment 1567 */ 1568 setUserComment(userComment: string): Promise<void>; 1569 /** 1570 * Get exif info of the asset. 1571 * 1572 * @permission ohos.permission.READ_IMAGEVIDEO 1573 * @param { AsyncCallback<string> } callback - Returns exif info into a json string 1574 * @throws { BusinessError } 202 - Called by non-system application. 1575 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1576 * <br>2. Incorrect parameter types. 1577 * @throws { BusinessError } 13900012 - Permission denied 1578 * @throws { BusinessError } 13900020 - Invalid argument 1579 * @throws { BusinessError } 14000011 - System inner fail 1580 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1581 * @systemapi 1582 * @since 10 1583 */ 1584 getExif(callback: AsyncCallback<string>): void; 1585 /** 1586 * Get analysis data of the asset. 1587 * 1588 * @permission ohos.permission.READ_IMAGEVIDEO 1589 * @param { AnalysisType } analysisType - Analysis type 1590 * @returns { Promise<string> } Returns analysis info into a json string 1591 * @throws { BusinessError } 201 - Permission denied 1592 * @throws { BusinessError } 202 - Called by non-system application 1593 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1594 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1595 * @throws { BusinessError } 14000011 - System inner fail 1596 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1597 * @systemapi 1598 * @since 11 1599 */ 1600 getAnalysisData(analysisType: AnalysisType): Promise<string>; 1601 /** 1602 * Get exif info of the asset. 1603 * 1604 * @permission ohos.permission.READ_IMAGEVIDEO 1605 * @returns { Promise<string> } Returns exif info into a json string 1606 * @throws { BusinessError } 202 - Called by non-system application. 1607 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1608 * <br>2. Incorrect parameter types. 1609 * @throws { BusinessError } 13900012 - Permission denied 1610 * @throws { BusinessError } 13900020 - Invalid argument 1611 * @throws { BusinessError } 14000011 - System inner fail 1612 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1613 * @systemapi 1614 * @since 10 1615 */ 1616 getExif(): Promise<string>; 1617 /** 1618 * Set asset pending state. 1619 * 1620 * @permission ohos.permission.WRITE_IMAGEVIDEO 1621 * @param { boolean } pendingState - true: Set asset in pending status; false: Recover asset from pending status. 1622 * @param { AsyncCallback<void> } callback - Returns void 1623 * @throws { BusinessError } 201 - Permission denied 1624 * @throws { BusinessError } 202 - Called by non-system application. 1625 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1626 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1627 * @throws { BusinessError } 14000011 - System inner fail 1628 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1629 * @systemapi 1630 * @since 11 1631 */ 1632 setPending(pendingState: boolean, callback: AsyncCallback<void>): void; 1633 /** 1634 * Set asset pending state. 1635 * 1636 * @permission ohos.permission.WRITE_IMAGEVIDEO 1637 * @param { boolean } pendingState - true: Set asset in pending status; false: Recover asset from pending status. 1638 * @returns { Promise<void> } Returns void 1639 * @throws { BusinessError } 201 - Permission denied. 1640 * @throws { BusinessError } 202 - Called by non-system application. 1641 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1642 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1643 * @throws { BusinessError } 14000011 - System inner fail 1644 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1645 * @systemapi 1646 * @since 11 1647 */ 1648 setPending(pendingState: boolean): Promise<void>; 1649 /** 1650 * Check if asset has been edited. 1651 * 1652 * @permission ohos.permission.READ_IMAGEVIDEO 1653 * @param { AsyncCallback<boolean> } callback - Returns whether the asset has been edited. 1654 * @throws { BusinessError } 201 - Permission denied. 1655 * @throws { BusinessError } 202 - Called by non-system application. 1656 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1657 * <br>2. Incorrect parameter types. 1658 * @throws { BusinessError } 14000011 - System inner fail 1659 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1660 * @systemapi 1661 * @since 11 1662 */ 1663 isEdited(callback: AsyncCallback<boolean>): void; 1664 /** 1665 * Check if asset has been edited. 1666 * 1667 * @permission ohos.permission.READ_IMAGEVIDEO 1668 * @returns { Promise<boolean> } Returns whether the asset has been edited. 1669 * @throws { BusinessError } 201 - Permission denied. 1670 * @throws { BusinessError } 202 - Called by non-system application. 1671 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1672 * <br>2. Incorrect parameter types. 1673 * @throws { BusinessError } 14000011 - System inner fail 1674 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1675 * @systemapi 1676 * @since 11 1677 */ 1678 isEdited(): Promise<boolean>; 1679 /** 1680 * Request asset edit data. 1681 * 1682 * @permission ohos.permission.READ_IMAGEVIDEO 1683 * @param { AsyncCallback<string> } callback - Returns asset edit data. 1684 * @throws { BusinessError } 201 - Permission denied. 1685 * @throws { BusinessError } 202 - Called by non-system application. 1686 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1687 * <br>2. Incorrect parameter types. 1688 * @throws { BusinessError } 14000011 - System inner fail 1689 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1690 * @systemapi 1691 * @since 11 1692 */ 1693 requestEditData(callback: AsyncCallback<string>): void; 1694 /** 1695 * Request asset edit data. 1696 * 1697 * @permission ohos.permission.READ_IMAGEVIDEO 1698 * @returns { Promise<string> } Returns asset edit data. 1699 * @throws { BusinessError } 201 - Permission denied. 1700 * @throws { BusinessError } 202 - Called by non-system application. 1701 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1702 * <br>2. Incorrect parameter types. 1703 * @throws { BusinessError } 14000011 - System inner fail 1704 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1705 * @systemapi 1706 * @since 11 1707 */ 1708 requestEditData(): Promise<string>; 1709 /** 1710 * Get media asset edit data. 1711 * 1712 * @permission ohos.permission.READ_IMAGEVIDEO 1713 * @returns { Promise<MediaAssetEditData> } Returns media asset edit data 1714 * @throws { BusinessError } 201 - Permission denied 1715 * @throws { BusinessError } 202 - Called by non-system application 1716 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1717 * <br>2. Incorrect parameter types. 1718 * @throws { BusinessError } 14000011 - System inner fail 1719 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1720 * @systemapi 1721 * @since 11 1722 */ 1723 getEditData(): Promise<MediaAssetEditData>; 1724 /** 1725 * Clone asset. 1726 * 1727 * @permission ohos.permission.WRITE_IMAGEVIDEO 1728 * @param { string } title - The title of asset. 1729 * @returns { Promise<PhotoAsset> } Returns asset 1730 * @throws { BusinessError } 201 - Permission denied 1731 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1732 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1733 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 1734 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 1735 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1736 * @since 14 1737 */ 1738 clone(title: string): Promise<PhotoAsset>; 1739 /** 1740 * Requests the read-only FD of the source asset. 1741 * 1742 * @permission ohos.permission.READ_IMAGEVIDEO 1743 * @param { AsyncCallback<number> } callback - Returns opened source asset fd. 1744 * @throws { BusinessError } 201 - Permission denied. 1745 * @throws { BusinessError } 202 - Called by non-system application. 1746 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1747 * <br>2. Incorrect parameter types. 1748 * @throws { BusinessError } 14000011 - System inner fail 1749 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1750 * @systemapi 1751 * @since 11 1752 */ 1753 requestSource(callback: AsyncCallback<number>): void; 1754 /** 1755 * Requests the read-only FD of the source asset. 1756 * 1757 * @permission ohos.permission.READ_IMAGEVIDEO 1758 * @returns { Promise<number> } Returns opened source asset fd. 1759 * @throws { BusinessError } 201 - Permission denied. 1760 * @throws { BusinessError } 202 - Called by non-system application. 1761 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1762 * <br>2. Incorrect parameter types. 1763 * @throws { BusinessError } 14000011 - System inner fail 1764 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1765 * @systemapi 1766 * @since 11 1767 */ 1768 requestSource(): Promise<number>; 1769 /** 1770 * Commit edit data and edited asset. 1771 * 1772 * @permission ohos.permission.WRITE_IMAGEVIDEO 1773 * @param { string } editData - editData to be saved. 1774 * @param { string } uri - uri of the edited asset within the applications's own sandbox. 1775 * @param { AsyncCallback<void> } callback - Returns void. 1776 * @throws { BusinessError } 201 - Permission denied. 1777 * @throws { BusinessError } 202 - Called by non-system application. 1778 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1779 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1780 * @throws { BusinessError } 14000011 - System inner fail 1781 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1782 * @systemapi 1783 * @since 11 1784 */ 1785 commitEditedAsset(editData: string, uri: string, callback: AsyncCallback<void>); 1786 /** 1787 * Commit edit data and edited asset. 1788 * 1789 * @permission ohos.permission.WRITE_IMAGEVIDEO 1790 * @param { string } editData - editData to be saved. 1791 * @param { string } uri - uri of the edited asset within the applications's own sandbox. 1792 * @returns { Promise<void> } Returns void. 1793 * @throws { BusinessError } 201 - Permission denied. 1794 * @throws { BusinessError } 202 - Called by non-system application. 1795 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1796 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1797 * @throws { BusinessError } 14000011 - System inner fail 1798 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1799 * @systemapi 1800 * @since 11 1801 */ 1802 commitEditedAsset(editData: string, uri: string): Promise<void>; 1803 /** 1804 * Revert asset edits to original state. 1805 * 1806 * @permission ohos.permission.WRITE_IMAGEVIDEO 1807 * @param { AsyncCallback<void> } callback - Returns void. 1808 * @throws { BusinessError } 201 - Permission denied. 1809 * @throws { BusinessError } 202 - Called by non-system application. 1810 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1811 * <br>2. Incorrect parameter types. 1812 * @throws { BusinessError } 14000011 - System inner fail 1813 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1814 * @systemapi 1815 * @since 11 1816 */ 1817 revertToOriginal(callback: AsyncCallback<void>); 1818 /** 1819 * Revert asset edits to original state. 1820 * 1821 * @permission ohos.permission.WRITE_IMAGEVIDEO 1822 * @returns { Promise<void> } Returns void. 1823 * @throws { BusinessError } 201 - Permission denied. 1824 * @throws { BusinessError } 202 - Called by non-system application. 1825 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1826 * <br>2. Incorrect parameter types. 1827 * @throws { BusinessError } 14000011 - System inner fail 1828 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1829 * @systemapi 1830 * @since 11 1831 */ 1832 revertToOriginal(): Promise<void>; 1833 /** 1834 * Request thumbnails of the asset. 1835 * 1836 * @permission ohos.permission.READ_IMAGEVIDEO 1837 * @param { AsyncCallback<image.PixelMap> } callback - Returns the required pixels 1838 * @returns { string } Returns request photo task id. 1839 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 1840 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 1841 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1842 * <br>2. Incorrect parameter types. 1843 * @throws { BusinessError } 14000011 - System inner fail 1844 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1845 * @systemapi 1846 * @since 11 1847 */ 1848 requestPhoto(callback: AsyncCallback<image.PixelMap>): string; 1849 /** 1850 * Request thumbnails of the asset. 1851 * 1852 * @permission ohos.permission.READ_IMAGEVIDEO 1853 * @param { RequestPhotoOptions } options - Request photo options 1854 * @param { AsyncCallback<image.PixelMap> } callback - Returns the required pixels 1855 * @returns { string } Returns request photo task id. 1856 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 1857 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 1858 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1859 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1860 * @throws { BusinessError } 14000011 - System inner fail 1861 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1862 * @systemapi 1863 * @since 11 1864 */ 1865 requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback<image.PixelMap>): string; 1866 /** 1867 * Cancel photo request 1868 * 1869 * @permission ohos.permission.READ_IMAGEVIDEO 1870 * @param { string } requestId - The request id to be canceled 1871 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 1872 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 1873 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1874 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 1875 * @throws { BusinessError } 14000011 - System inner fail 1876 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1877 * @systemapi 1878 * @since 11 1879 */ 1880 cancelPhotoRequest(requestId: string): void; 1881 } 1882 1883 /** 1884 * Enumeration of photo asset members 1885 * 1886 * @enum { string } PhotoKeys 1887 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1888 * @since 10 1889 */ 1890 /** 1891 * Enumeration of photo asset members 1892 * 1893 * @enum { string } PhotoKeys 1894 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1895 * @crossplatform 1896 * @since 12 1897 */ 1898 enum PhotoKeys { 1899 /** 1900 * Asset uri, read only 1901 * 1902 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1903 * @since 10 1904 */ 1905 /** 1906 * Asset uri, read only 1907 * 1908 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1909 * @crossplatform 1910 * @since 12 1911 */ 1912 URI = 'uri', 1913 /** 1914 * Photo type of the asset, read only 1915 * 1916 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1917 * @since 10 1918 */ 1919 /** 1920 * Photo type of the asset, read only 1921 * 1922 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1923 * @crossplatform 1924 * @since 12 1925 */ 1926 PHOTO_TYPE = 'media_type', 1927 /** 1928 * Asset name, read only 1929 * 1930 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1931 * @since 10 1932 */ 1933 /** 1934 * Asset name, read only 1935 * 1936 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1937 * @crossplatform 1938 * @since 12 1939 */ 1940 DISPLAY_NAME = 'display_name', 1941 /** 1942 * Size of the asset, read only 1943 * 1944 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1945 * @since 10 1946 */ 1947 /** 1948 * Size of the asset, read only 1949 * 1950 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1951 * @crossplatform 1952 * @since 12 1953 */ 1954 SIZE = 'size', 1955 /** 1956 * Creation date of the asset, read only 1957 * 1958 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1959 * @since 10 1960 */ 1961 /** 1962 * Creation date of the asset, read only 1963 * 1964 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1965 * @crossplatform 1966 * @since 12 1967 */ 1968 DATE_ADDED = 'date_added', 1969 /** 1970 * Modified date of the asset, read only 1971 * 1972 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1973 * @since 10 1974 */ 1975 /** 1976 * Modified date of the asset, read only 1977 * 1978 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1979 * @crossplatform 1980 * @since 12 1981 */ 1982 DATE_MODIFIED = 'date_modified', 1983 /** 1984 * Duration of video files, read only 1985 * 1986 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1987 * @since 10 1988 */ 1989 /** 1990 * Duration of video files, read only 1991 * 1992 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 1993 * @crossplatform 1994 * @since 12 1995 */ 1996 DURATION = 'duration', 1997 /** 1998 * Width of the image asset, read only 1999 * 2000 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2001 * @since 10 2002 */ 2003 /** 2004 * Width of the image asset, read only 2005 * 2006 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2007 * @crossplatform 2008 * @since 12 2009 */ 2010 WIDTH = 'width', 2011 /** 2012 * Height of the image asset, read only 2013 * 2014 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2015 * @since 10 2016 */ 2017 /** 2018 * Height of the image asset, read only 2019 * 2020 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2021 * @crossplatform 2022 * @since 12 2023 */ 2024 HEIGHT = 'height', 2025 /** 2026 * Date taken of the asset, read only 2027 * 2028 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2029 * @since 10 2030 */ 2031 /** 2032 * Date taken of the asset, read only 2033 * 2034 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2035 * @crossplatform 2036 * @since 12 2037 */ 2038 DATE_TAKEN = 'date_taken', 2039 /** 2040 * Orientation of the image asset, read only 2041 * 2042 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2043 * @since 10 2044 */ 2045 /** 2046 * Orientation of the image asset, read only 2047 * 2048 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2049 * @crossplatform 2050 * @since 12 2051 */ 2052 ORIENTATION = 'orientation', 2053 /** 2054 * Favorite state of the asset, read only 2055 * 2056 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2057 * @since 10 2058 */ 2059 /** 2060 * Favorite state of the asset, read only 2061 * 2062 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2063 * @crossplatform 2064 * @since 12 2065 */ 2066 FAVORITE = 'is_favorite', 2067 /** 2068 * Title of the asset 2069 * 2070 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2071 * @since 10 2072 */ 2073 /** 2074 * Title of the asset 2075 * 2076 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2077 * @crossplatform 2078 * @since 12 2079 */ 2080 TITLE = 'title', 2081 /** 2082 * Asset position, read only 2083 * 2084 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2085 * @systemapi 2086 * @since 10 2087 */ 2088 POSITION = 'position', 2089 /** 2090 * Trashed date of the asset, read only 2091 * 2092 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2093 * @systemapi 2094 * @since 10 2095 */ 2096 DATE_TRASHED = 'date_trashed', 2097 /** 2098 * Hidden state of the asset, read only 2099 * 2100 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2101 * @systemapi 2102 * @since 10 2103 */ 2104 HIDDEN = 'hidden', 2105 /** 2106 * User comment info 2107 * 2108 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2109 * @systemapi 2110 * @since 10 2111 */ 2112 USER_COMMENT = 'user_comment', 2113 /** 2114 * Camera shot key 2115 * 2116 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2117 * @systemapi 2118 * @since 10 2119 */ 2120 CAMERA_SHOT_KEY = 'camera_shot_key', 2121 /** 2122 * The year of the file created, read only 2123 * 2124 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2125 * @systemapi 2126 * @since 11 2127 */ 2128 DATE_YEAR = 'date_year', 2129 /** 2130 * The month of the file created, read only 2131 * 2132 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2133 * @systemapi 2134 * @since 11 2135 */ 2136 DATE_MONTH = 'date_month', 2137 /** 2138 * The day of the file created, read only 2139 * 2140 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2141 * @systemapi 2142 * @since 11 2143 */ 2144 DATE_DAY = 'date_day', 2145 /** 2146 * Pending state of the asset, true means asset is pending, read only 2147 * 2148 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2149 * @systemapi 2150 * @since 11 2151 */ 2152 PENDING = 'pending', 2153 /** 2154 * Creation time of the asset in milliseconds, read only 2155 * 2156 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2157 * @since 12 2158 */ 2159 DATE_ADDED_MS = 'date_added_ms', 2160 /** 2161 * Modified time of the asset in milliseconds, read only 2162 * 2163 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2164 * @since 12 2165 */ 2166 DATE_MODIFIED_MS = 'date_modified_ms', 2167 /** 2168 * Trashed time of the asset in milliseconds, read only 2169 * 2170 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2171 * @systemapi 2172 * @since 12 2173 */ 2174 DATE_TRASHED_MS = 'date_trashed_ms', 2175 /** 2176 * Photo subtype of the asset, read only 2177 * 2178 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2179 * @since 12 2180 */ 2181 PHOTO_SUBTYPE = 'subtype', 2182 /** 2183 * Effect mode of moving photo, read only 2184 * 2185 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2186 * @systemapi 2187 * @since 12 2188 */ 2189 MOVING_PHOTO_EFFECT_MODE = 'moving_photo_effect_mode', 2190 /** 2191 * Cover position of the asset, read only 2192 * 2193 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2194 * @since 12 2195 */ 2196 COVER_POSITION = 'cover_position', 2197 /** 2198 * Dynamic range type of the asset, read only 2199 * 2200 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2201 * @since 12 2202 */ 2203 DYNAMIC_RANGE_TYPE = 'dynamic_range_type', 2204 /** 2205 * Unique uuid of the burst photos, read only 2206 * 2207 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2208 * @since 12 2209 */ 2210 BURST_KEY = 'burst_key', 2211 /** 2212 * Thumbnail of photo asset has been ready, read only 2213 * 2214 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2215 * @systemapi 2216 * @since 13 2217 */ 2218 THUMBNAIL_READY = 'thumbnail_ready', 2219 /** 2220 * Width and height information of lcd picture, read only 2221 * 2222 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2223 * @since 12 2224 */ 2225 LCD_SIZE = 'lcd_size', 2226 /** 2227 * Width and height information of thumbnail picture, read only 2228 * 2229 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2230 * @since 12 2231 */ 2232 THM_SIZE = 'thm_size', 2233 /** 2234 * Detail time of the asset, read only 2235 * 2236 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2237 * @since 13 2238 */ 2239 DETAIL_TIME = 'detail_time', 2240 /** 2241 * Date taken of the asset in milliseconds, read only 2242 * 2243 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2244 * @since 13 2245 */ 2246 DATE_TAKEN_MS = 'date_taken_ms', 2247 /** 2248 * Cloud enhancement status of the asset, read only 2249 * 2250 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2251 * @systemapi 2252 * @since 13 2253 */ 2254 CE_AVAILABLE = 'ce_available', 2255 /** 2256 * watermark type of the asset, read only 2257 * 2258 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2259 * @systemapi 2260 * @since 14 2261 */ 2262 SUPPORTED_WATERMARK_TYPE = 'supported_watermark_type', 2263 /** 2264 * visibility of thumbnails 2265 * 2266 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2267 * @systemapi 2268 * @since 14 2269 */ 2270 THUMBNAIL_VISIBLE = 'thumbnail_visible' 2271 2272 } 2273 2274 /** 2275 * Enumeration of photo album members. 2276 * 2277 * @enum { string } AlbumKeys 2278 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2279 * @since 10 2280 */ 2281 /** 2282 * Enumeration of photo album members. 2283 * 2284 * @enum { string } AlbumKeys 2285 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2286 * @crossplatform 2287 * @since 12 2288 */ 2289 enum AlbumKeys { 2290 /** 2291 * Album uri 2292 * 2293 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2294 * @since 10 2295 */ 2296 /** 2297 * Album uri 2298 * 2299 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2300 * @crossplatform 2301 * @since 12 2302 */ 2303 URI = 'uri', 2304 /** 2305 * Album name 2306 * 2307 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2308 * @since 10 2309 */ 2310 /** 2311 * Album name 2312 * 2313 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2314 * @crossplatform 2315 * @since 12 2316 */ 2317 ALBUM_NAME = 'album_name' 2318 } 2319 2320 /** 2321 * Enumeration of mode for displaying albums containing hidden assets 2322 * 2323 * @enum { number } HiddenPhotosDisplayMode 2324 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2325 * @systemapi 2326 * @since 11 2327 */ 2328 enum HiddenPhotosDisplayMode { 2329 /** 2330 * Display the system hidden album that contains all the hidden assets. 2331 * 2332 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2333 * @systemapi 2334 * @since 11 2335 */ 2336 ASSETS_MODE, 2337 /** 2338 * Display all albums containing hidden assets(excluding the system hidden album and the system trash album). 2339 * 2340 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2341 * @systemapi 2342 * @since 11 2343 */ 2344 ALBUMS_MODE 2345 } 2346 2347 /** 2348 * Options to fetch assets or albums 2349 * 2350 * @interface FetchOptions 2351 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2352 * @since 10 2353 */ 2354 /** 2355 * Options to fetch assets or albums 2356 * 2357 * @interface FetchOptions 2358 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2359 * @crossplatform 2360 * @since 12 2361 */ 2362 interface FetchOptions { 2363 /** 2364 * Indicates the members to query. 2365 * 2366 * @type { Array<string> } 2367 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2368 * @since 10 2369 */ 2370 /** 2371 * Indicates the members to query. 2372 * 2373 * @type { Array<string> } 2374 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2375 * @crossplatform 2376 * @since 12 2377 */ 2378 fetchColumns: Array<string>; 2379 /** 2380 * Predicates to query 2381 * 2382 * @type { dataSharePredicates.DataSharePredicates } 2383 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2384 * @since 10 2385 */ 2386 /** 2387 * Predicates to query 2388 * 2389 * @type { dataSharePredicates.DataSharePredicates } 2390 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2391 * @crossplatform 2392 * @since 12 2393 */ 2394 predicates: dataSharePredicates.DataSharePredicates; 2395 } 2396 2397 /** 2398 * Options to create a photo asset for system apps 2399 * 2400 * @interface PhotoCreateOptions 2401 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2402 * @systemapi 2403 * @since 10 2404 */ 2405 interface PhotoCreateOptions { 2406 /** 2407 * Specify subtype of the asset to create 2408 * 2409 * @type { ?PhotoSubtype } 2410 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2411 * @systemapi 2412 * @since 10 2413 */ 2414 subtype?: PhotoSubtype; 2415 /** 2416 * Camera shot key 2417 * 2418 * @type { ?string } 2419 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2420 * @systemapi 2421 * @since 10 2422 */ 2423 cameraShotKey?: string; 2424 } 2425 2426 /** 2427 * Config to create photo asset 2428 * 2429 * @interface PhotoCreationConfig 2430 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2431 * @atomicservice 2432 * @since 12 2433 */ 2434 interface PhotoCreationConfig { 2435 /** 2436 * Title of the asset 2437 * 2438 * @type { ?string } 2439 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2440 * @atomicservice 2441 * @since 12 2442 */ 2443 title?: string; 2444 2445 /** 2446 * Extension of the asset 2447 * 2448 * @type { string } 2449 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2450 * @atomicservice 2451 * @since 12 2452 */ 2453 fileNameExtension: string; 2454 2455 /** 2456 * Specify photo type of the asset to create, include image or video 2457 * 2458 * @type { PhotoType } 2459 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2460 * @atomicservice 2461 * @since 12 2462 */ 2463 photoType: PhotoType; 2464 2465 /** 2466 * Specify photo subtype of the asset to create, include default or moving_photo 2467 * 2468 * @type { ?PhotoSubtype } 2469 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2470 * @atomicservice 2471 * @since 12 2472 */ 2473 subtype?: PhotoSubtype; 2474 } 2475 2476 /** 2477 * Options to create a photo asset 2478 * 2479 * @interface CreateOptions 2480 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2481 * @since 10 2482 */ 2483 /** 2484 * Options to create a photo asset 2485 * 2486 * @interface CreateOptions 2487 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2488 * @atomicservice 2489 * @since 11 2490 */ 2491 interface CreateOptions { 2492 /** 2493 * Title of the asset 2494 * 2495 * @type { ?string } 2496 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2497 * @since 10 2498 */ 2499 /** 2500 * Title of the asset 2501 * 2502 * @type { ?string } 2503 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2504 * @atomicservice 2505 * @since 11 2506 */ 2507 title?: string; 2508 /** 2509 * Specify subtype of the asset to create 2510 * 2511 * @type { ?PhotoSubtype } 2512 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2513 * @atomicservice 2514 * @since 12 2515 */ 2516 subtype?: PhotoSubtype; 2517 } 2518 2519 /** 2520 * Options to request photo 2521 * 2522 * @interface RequestPhotoOptions 2523 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2524 * @systemapi 2525 * @since 11 2526 */ 2527 interface RequestPhotoOptions { 2528 /** 2529 * Size of thumbnail 2530 * 2531 * @type { ?image.Size } 2532 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2533 * @systemapi 2534 * @since 11 2535 */ 2536 size?: image.Size; 2537 /** 2538 * Type of photo request 2539 * 2540 * @type { ?RequestPhotoType } 2541 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2542 * @systemapi 2543 * @since 11 2544 */ 2545 requestPhotoType?: RequestPhotoType; 2546 } 2547 2548 /** 2549 * The fetch result of assets or albums 2550 * 2551 * @interface FetchResult 2552 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2553 * @since 10 2554 */ 2555 /** 2556 * The fetch result of assets or albums 2557 * 2558 * @interface FetchResult 2559 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2560 * @crossplatform 2561 * @since 12 2562 */ 2563 interface FetchResult<T> { 2564 /** 2565 * Obtains the total number of objects in the fetch result. 2566 * 2567 * @returns { number } Total number of objects. 2568 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2569 * <br>2. Incorrect parameter types. 2570 * @throws { BusinessError } 13900020 - Invalid argument 2571 * @throws { BusinessError } 14000011 - System inner fail 2572 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2573 * @since 10 2574 */ 2575 /** 2576 * Obtains the total number of objects in the fetch result. 2577 * 2578 * @returns { number } Total number of objects. 2579 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2580 * <br>2. Incorrect parameter types. 2581 * @throws { BusinessError } 13900020 - Invalid argument 2582 * @throws { BusinessError } 14000011 - System inner fail 2583 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2584 * @crossplatform 2585 * @since 12 2586 */ 2587 getCount(): number; 2588 /** 2589 * Checks whether the result set points to the last row. 2590 * You need to check whether the object is the last one before calling getNextObject. 2591 * 2592 * @returns { boolean } Whether the object is the last one in the fetch result. 2593 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2594 * <br>2. Incorrect parameter types. 2595 * @throws { BusinessError } 13900020 - Invalid argument 2596 * @throws { BusinessError } 14000011 - System inner fail 2597 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2598 * @since 10 2599 */ 2600 /** 2601 * Checks whether the result set points to the last row. 2602 * You need to check whether the object is the last one before calling getNextObject. 2603 * 2604 * @returns { boolean } Whether the object is the last one in the fetch result. 2605 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2606 * <br>2. Incorrect parameter types. 2607 * @throws { BusinessError } 13900020 - Invalid argument 2608 * @throws { BusinessError } 14000011 - System inner fail 2609 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2610 * @crossplatform 2611 * @since 12 2612 */ 2613 isAfterLast(): boolean; 2614 /** 2615 * Obtains the first object in the fetch result. 2616 * 2617 * @param { AsyncCallback<T> } callback - Returns the first object in the fetch result. 2618 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2619 * <br>2. Incorrect parameter types. 2620 * @throws { BusinessError } 13900020 - Invalid argument 2621 * @throws { BusinessError } 14000011 - System inner fail 2622 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2623 * @since 10 2624 */ 2625 /** 2626 * Obtains the first object in the fetch result. 2627 * 2628 * @param { AsyncCallback<T> } callback - Returns the first object in the fetch result. 2629 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2630 * <br>2. Incorrect parameter types. 2631 * @throws { BusinessError } 13900020 - Invalid argument 2632 * @throws { BusinessError } 14000011 - System inner fail 2633 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2634 * @crossplatform 2635 * @since 12 2636 */ 2637 getFirstObject(callback: AsyncCallback<T>): void; 2638 /** 2639 * Obtains the first object in the fetch result. 2640 * 2641 * @returns { Promise<T> } Returns the first object in the fetch result. 2642 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2643 * <br>2. Incorrect parameter types. 2644 * @throws { BusinessError } 13900020 - Invalid argument 2645 * @throws { BusinessError } 14000011 - System inner fail 2646 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2647 * @since 10 2648 */ 2649 /** 2650 * Obtains the first object in the fetch result. 2651 * 2652 * @returns { Promise<T> } Returns the first object in the fetch result. 2653 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2654 * <br>2. Incorrect parameter types. 2655 * @throws { BusinessError } 13900020 - Invalid argument 2656 * @throws { BusinessError } 14000011 - System inner fail 2657 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2658 * @crossplatform 2659 * @since 12 2660 */ 2661 getFirstObject(): Promise<T>; 2662 /** 2663 * Obtains the next object in the fetch result. 2664 * Before calling this method, you must use isAfterLast() to check whether the current position is the last row 2665 * in the fetch result. This method only works when the current position is not the last row. 2666 * 2667 * @param { AsyncCallback<T> } callback - Returns the next object 2668 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2669 * <br>2. Incorrect parameter types. 2670 * @throws { BusinessError } 13900020 - Invalid argument 2671 * @throws { BusinessError } 14000011 - System inner fail 2672 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2673 * @since 10 2674 */ 2675 /** 2676 * Obtains the next object in the fetch result. 2677 * Before calling this method, you must use isAfterLast() to check whether the current position is the last row 2678 * in the fetch result. This method only works when the current position is not the last row. 2679 * 2680 * @param { AsyncCallback<T> } callback - Returns the next object 2681 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2682 * <br>2. Incorrect parameter types. 2683 * @throws { BusinessError } 13900020 - Invalid argument 2684 * @throws { BusinessError } 14000011 - System inner fail 2685 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2686 * @crossplatform 2687 * @since 12 2688 */ 2689 getNextObject(callback: AsyncCallback<T>): void; 2690 /** 2691 * Obtains the next object in the fetch result. 2692 * Before calling this method, you must use isAfterLast() to check whether the current position is the last row 2693 * in the fetch result. This method only works when the current position is not the last row. 2694 * 2695 * @returns { Promise<T> } Returns the next object 2696 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2697 * <br>2. Incorrect parameter types. 2698 * @throws { BusinessError } 13900020 - Invalid argument 2699 * @throws { BusinessError } 14000011 - System inner fail 2700 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2701 * @since 10 2702 */ 2703 /** 2704 * Obtains the next object in the fetch result. 2705 * Before calling this method, you must use isAfterLast() to check whether the current position is the last row 2706 * in the fetch result. This method only works when the current position is not the last row. 2707 * 2708 * @returns { Promise<T> } Returns the next object 2709 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2710 * <br>2. Incorrect parameter types. 2711 * @throws { BusinessError } 13900020 - Invalid argument 2712 * @throws { BusinessError } 14000011 - System inner fail 2713 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2714 * @crossplatform 2715 * @since 12 2716 */ 2717 getNextObject(): Promise<T>; 2718 /** 2719 * Obtains the last object in the fetch result 2720 * 2721 * @param { AsyncCallback<T> } callback - Returns the last object 2722 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2723 * <br>2. Incorrect parameter types. 2724 * @throws { BusinessError } 13900020 - Invalid argument 2725 * @throws { BusinessError } 14000011 - System inner fail 2726 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2727 * @since 10 2728 */ 2729 /** 2730 * Obtains the last object in the fetch result 2731 * 2732 * @param { AsyncCallback<T> } callback - Returns the last object 2733 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2734 * <br>2. Incorrect parameter types. 2735 * @throws { BusinessError } 13900020 - Invalid argument 2736 * @throws { BusinessError } 14000011 - System inner fail 2737 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2738 * @crossplatform 2739 * @since 12 2740 */ 2741 getLastObject(callback: AsyncCallback<T>): void; 2742 /** 2743 * Obtains the last object in the fetch result 2744 * 2745 * @returns { Promise<T> } Returns the last object 2746 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2747 * <br>2. Incorrect parameter types. 2748 * @throws { BusinessError } 13900020 - Invalid argument 2749 * @throws { BusinessError } 14000011 - System inner fail 2750 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2751 * @since 10 2752 */ 2753 /** 2754 * Obtains the last object in the fetch result 2755 * 2756 * @returns { Promise<T> } Returns the last object 2757 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2758 * <br>2. Incorrect parameter types. 2759 * @throws { BusinessError } 13900020 - Invalid argument 2760 * @throws { BusinessError } 14000011 - System inner fail 2761 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2762 * @crossplatform 2763 * @since 12 2764 */ 2765 getLastObject(): Promise<T>; 2766 /** 2767 * Obtains the object with the specified index in the fetch result. 2768 * 2769 * @param { number } index - Index of the object to obtain. 2770 * @param { AsyncCallback<T> } callback - Returns the object 2771 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2772 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 2773 * @throws { BusinessError } 13900020 - Invalid argument 2774 * @throws { BusinessError } 14000011 - System inner fail 2775 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2776 * @since 10 2777 */ 2778 /** 2779 * Obtains the object with the specified index in the fetch result. 2780 * 2781 * @param { number } index - Index of the object to obtain. 2782 * @param { AsyncCallback<T> } callback - Returns the object 2783 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2784 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 2785 * @throws { BusinessError } 13900020 - Invalid argument 2786 * @throws { BusinessError } 14000011 - System inner fail 2787 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2788 * @crossplatform 2789 * @since 12 2790 */ 2791 getObjectByPosition(index: number, callback: AsyncCallback<T>): void; 2792 /** 2793 * Obtains the object with the specified index in the fetch result. 2794 * 2795 * @param { number } index - Index of the asset to obtain. 2796 * @returns { Promise<T> } Returns the object 2797 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2798 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 2799 * @throws { BusinessError } 13900020 - Invalid argument 2800 * @throws { BusinessError } 14000011 - System inner fail 2801 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2802 * @since 10 2803 */ 2804 /** 2805 * Obtains the object with the specified index in the fetch result. 2806 * 2807 * @param { number } index - Index of the asset to obtain. 2808 * @returns { Promise<T> } Returns the object 2809 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2810 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 2811 * @throws { BusinessError } 13900020 - Invalid argument 2812 * @throws { BusinessError } 14000011 - System inner fail 2813 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2814 * @crossplatform 2815 * @since 12 2816 */ 2817 getObjectByPosition(index: number): Promise<T>; 2818 /** 2819 * Obtains all objects in the fetch result. 2820 * 2821 * @param { AsyncCallback<Array<T>> } callback - Returns all the objects 2822 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2823 * <br>2. Incorrect parameter types. 2824 * @throws { BusinessError } 13900020 - Invalid argument 2825 * @throws { BusinessError } 14000011 - System inner fail 2826 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2827 * @since 10 2828 */ 2829 /** 2830 * Obtains all objects in the fetch result. 2831 * 2832 * @param { AsyncCallback<Array<T>> } callback - Returns all the objects 2833 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2834 * <br>2. Incorrect parameter types. 2835 * @throws { BusinessError } 13900020 - Invalid argument 2836 * @throws { BusinessError } 14000011 - System inner fail 2837 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2838 * @crossplatform 2839 * @since 12 2840 */ 2841 getAllObjects(callback: AsyncCallback<Array<T>>): void; 2842 /** 2843 * Obtains all objects in the fetch result. 2844 * 2845 * @returns { Promise<Array<T>> } Returns all the objects 2846 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2847 * <br>2. Incorrect parameter types. 2848 * @throws { BusinessError } 13900020 - Invalid argument 2849 * @throws { BusinessError } 14000011 - System inner fail 2850 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2851 * @since 10 2852 */ 2853 /** 2854 * Obtains all objects in the fetch result. 2855 * 2856 * @returns { Promise<Array<T>> } Returns all the objects 2857 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2858 * <br>2. Incorrect parameter types. 2859 * @throws { BusinessError } 13900020 - Invalid argument 2860 * @throws { BusinessError } 14000011 - System inner fail 2861 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2862 * @crossplatform 2863 * @since 12 2864 */ 2865 getAllObjects(): Promise<Array<T>>; 2866 /** 2867 * Releases the fetch result. 2868 * 2869 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2870 * <br>2. Incorrect parameter types. 2871 * @throws { BusinessError } 13900020 - Invalid argument 2872 * @throws { BusinessError } 14000011 - System inner fail 2873 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2874 * @since 10 2875 */ 2876 /** 2877 * Releases the fetch result. 2878 * 2879 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2880 * <br>2. Incorrect parameter types. 2881 * @throws { BusinessError } 13900020 - Invalid argument 2882 * @throws { BusinessError } 14000011 - System inner fail 2883 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2884 * @crossplatform 2885 * @since 12 2886 */ 2887 close(): void; 2888 } 2889 2890 /** 2891 * Album type. 2892 * 2893 * @enum { number } AlbumType 2894 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2895 * @since 10 2896 */ 2897 /** 2898 * Album type. 2899 * 2900 * @enum { number } AlbumType 2901 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2902 * @crossplatform 2903 * @since 12 2904 */ 2905 enum AlbumType { 2906 /** 2907 * Album created by user. 2908 * 2909 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2910 * @since 10 2911 */ 2912 /** 2913 * Album created by user. 2914 * 2915 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2916 * @crossplatform 2917 * @since 12 2918 */ 2919 USER = 0, 2920 /** 2921 * Album created by system, which metadata cannot be modified. 2922 * 2923 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2924 * @since 10 2925 */ 2926 /** 2927 * Album created by system, which metadata cannot be modified. 2928 * 2929 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2930 * @crossplatform 2931 * @since 12 2932 */ 2933 SYSTEM = 1024, 2934 /** 2935 * Album created by smart abilities. 2936 * 2937 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2938 * @systemapi 2939 * @since 11 2940 */ 2941 SMART = 4096 2942 } 2943 2944 /** 2945 * Album subtype 2946 * 2947 * @enum { number } AlbumSubtype 2948 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2949 * @since 10 2950 */ 2951 /** 2952 * Album subtype 2953 * 2954 * @enum { number } AlbumSubtype 2955 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2956 * @crossplatform 2957 * @since 12 2958 */ 2959 enum AlbumSubtype { 2960 /** 2961 * Generic user-created albums. 2962 * 2963 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2964 * @since 10 2965 */ 2966 /** 2967 * Generic user-created albums. 2968 * 2969 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2970 * @crossplatform 2971 * @since 12 2972 */ 2973 USER_GENERIC = 1, 2974 /** 2975 * Favorite album, which assets are marked as favorite. 2976 * 2977 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2978 * @since 10 2979 */ 2980 /** 2981 * Favorite album, which assets are marked as favorite. 2982 * 2983 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2984 * @crossplatform 2985 * @since 12 2986 */ 2987 FAVORITE = 1025, 2988 /** 2989 * Video album, which contains all video assets. 2990 * 2991 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2992 * @since 10 2993 */ 2994 /** 2995 * Video album, which contains all video assets. 2996 * 2997 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 2998 * @crossplatform 2999 * @since 12 3000 */ 3001 VIDEO, 3002 /** 3003 * Hidden album, which assets are marked as hidden. 3004 * 3005 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3006 * @systemapi 3007 * @since 10 3008 */ 3009 HIDDEN, 3010 /** 3011 * Trash album, which assets are deleted. 3012 * 3013 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3014 * @systemapi 3015 * @since 10 3016 */ 3017 TRASH, 3018 /** 3019 * Screenshot album 3020 * 3021 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3022 * @systemapi 3023 * @since 10 3024 */ 3025 SCREENSHOT, 3026 /** 3027 * Camera album 3028 * 3029 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3030 * @systemapi 3031 * @since 10 3032 */ 3033 CAMERA, 3034 /** 3035 * Image album 3036 * 3037 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3038 * @systemapi 3039 * @since 11 3040 */ 3041 /** 3042 * Image album 3043 * 3044 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3045 * @since 12 3046 */ 3047 IMAGE = 1031, 3048 /** 3049 * Cloud Enhancement album 3050 * 3051 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3052 * @systemapi 3053 * @since 13 3054 */ 3055 CLOUD_ENHANCEMENT = 1032, 3056 /** 3057 * Source album 3058 * 3059 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3060 * @systemapi 3061 * @since 11 3062 */ 3063 SOURCE_GENERIC = 2049, 3064 /** 3065 * Classify album 3066 * 3067 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3068 * @systemapi 3069 * @since 11 3070 */ 3071 CLASSIFY = 4097, 3072 /** 3073 * Location album 3074 * 3075 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3076 * @systemapi 3077 * @since 11 3078 */ 3079 GEOGRAPHY_LOCATION = 4099, 3080 /** 3081 * City album 3082 * 3083 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3084 * @systemapi 3085 * @since 11 3086 */ 3087 GEOGRAPHY_CITY, 3088 /** 3089 * ShootingMode album 3090 * 3091 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3092 * @systemapi 3093 * @since 11 3094 */ 3095 SHOOTING_MODE, 3096 /** 3097 * Portrait album 3098 * 3099 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3100 * @systemapi 3101 * @since 11 3102 */ 3103 PORTRAIT, 3104 /** 3105 * Group photo album 3106 * 3107 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3108 * @systemapi 3109 * @since 13 3110 */ 3111 GROUP_PHOTO, 3112 /** 3113 * Highlight album 3114 * 3115 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3116 * @systemapi 3117 * @since 12 3118 */ 3119 HIGHLIGHT = 4104, 3120 /** 3121 * Highlight suggestions album 3122 * 3123 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3124 * @systemapi 3125 * @since 12 3126 */ 3127 HIGHLIGHT_SUGGESTIONS, 3128 /** 3129 * Any album 3130 * 3131 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3132 * @since 10 3133 */ 3134 /** 3135 * Any album 3136 * 3137 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3138 * @crossplatform 3139 * @since 12 3140 */ 3141 ANY = 2147483647 3142 } 3143 3144 /** 3145 * Request photo type. 3146 * 3147 * @enum { number } RequestPhotoType 3148 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3149 * @systemapi 3150 * @since 11 3151 */ 3152 enum RequestPhotoType { 3153 /** 3154 * Request all thumbnails: fast thumbnail and quality thumbnail 3155 * 3156 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3157 * @systemapi 3158 * @since 11 3159 */ 3160 REQUEST_ALL_THUMBNAILS = 0, 3161 /** 3162 * Only request fast thumbnail 3163 * 3164 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3165 * @systemapi 3166 * @since 11 3167 */ 3168 REQUEST_FAST_THUMBNAIL, 3169 /** 3170 * Only request quality thumbnail 3171 * 3172 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3173 * @systemapi 3174 * @since 11 3175 */ 3176 REQUEST_QUALITY_THUMBNAIL 3177 } 3178 3179 /** 3180 * Defines the abstract interface of albums. 3181 * 3182 * @interface AbsAlbum 3183 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3184 * @since 10 3185 */ 3186 /** 3187 * Defines the abstract interface of albums. 3188 * 3189 * @interface AbsAlbum 3190 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3191 * @crossplatform 3192 * @since 12 3193 */ 3194 interface AbsAlbum { 3195 /** 3196 * Album type 3197 * 3198 * @type { AlbumType } 3199 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3200 * @since 10 3201 */ 3202 /** 3203 * Album type 3204 * 3205 * @type { AlbumType } 3206 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3207 * @crossplatform 3208 * @since 12 3209 */ 3210 readonly albumType: AlbumType; 3211 /** 3212 * Album subtype 3213 * 3214 * @type { AlbumSubtype } 3215 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3216 * @since 10 3217 */ 3218 /** 3219 * Album subtype 3220 * 3221 * @type { AlbumSubtype } 3222 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3223 * @crossplatform 3224 * @since 12 3225 */ 3226 readonly albumSubtype: AlbumSubtype; 3227 /** 3228 * Album name. 3229 * 3230 * @type { string } 3231 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3232 * @since 10 3233 */ 3234 /** 3235 * Album name. 3236 * 3237 * @type { string } 3238 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3239 * @crossplatform 3240 * @since 12 3241 */ 3242 albumName: string; 3243 /** 3244 * Album uri. 3245 * 3246 * @type { string } 3247 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3248 * @since 10 3249 */ 3250 /** 3251 * Album uri. 3252 * 3253 * @type { string } 3254 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3255 * @crossplatform 3256 * @since 12 3257 */ 3258 readonly albumUri: string; 3259 /** 3260 * Number of assets in the album 3261 * 3262 * @type { number } 3263 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3264 * @since 10 3265 */ 3266 /** 3267 * Number of assets in the album 3268 * 3269 * @type { number } 3270 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3271 * @crossplatform 3272 * @since 12 3273 */ 3274 readonly count: number; 3275 /** 3276 * Cover uri for the album 3277 * 3278 * @type { string } 3279 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3280 * @since 10 3281 */ 3282 readonly coverUri: string; 3283 /** 3284 * Fetch assets in an album. 3285 * 3286 * @permission ohos.permission.READ_IMAGEVIDEO 3287 * @param { FetchOptions } options - Fetch options. 3288 * @param { AsyncCallback<FetchResult<PhotoAsset>> } callback - Returns the fetch result 3289 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3290 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3291 * @throws { BusinessError } 13900012 - Permission denied 3292 * @throws { BusinessError } 13900020 - Invalid argument 3293 * @throws { BusinessError } 14000011 - System inner fail 3294 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3295 * @since 10 3296 */ 3297 /** 3298 * Fetch assets in an album. 3299 * 3300 * @permission ohos.permission.READ_IMAGEVIDEO 3301 * @param { FetchOptions } options - Fetch options. 3302 * @param { AsyncCallback<FetchResult<PhotoAsset>> } callback - Returns the fetch result 3303 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3304 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3305 * @throws { BusinessError } 13900012 - Permission denied 3306 * @throws { BusinessError } 13900020 - Invalid argument 3307 * @throws { BusinessError } 14000011 - System inner fail 3308 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3309 * @crossplatform 3310 * @since 12 3311 */ 3312 getAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<PhotoAsset>>): void; 3313 /** 3314 * Fetch assets in an album. 3315 * 3316 * @permission ohos.permission.READ_IMAGEVIDEO 3317 * @param { FetchOptions } options - Fetch options. 3318 * @returns { Promise<FetchResult<PhotoAsset>> } Returns the fetch result 3319 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3320 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3321 * @throws { BusinessError } 13900012 - Permission denied 3322 * @throws { BusinessError } 13900020 - Invalid argument 3323 * @throws { BusinessError } 14000011 - System inner fail 3324 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3325 * @since 10 3326 */ 3327 /** 3328 * Fetch assets in an album. 3329 * 3330 * @permission ohos.permission.READ_IMAGEVIDEO 3331 * @param { FetchOptions } options - Fetch options. 3332 * @returns { Promise<FetchResult<PhotoAsset>> } Returns the fetch result 3333 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3334 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3335 * @throws { BusinessError } 13900012 - Permission denied 3336 * @throws { BusinessError } 13900020 - Invalid argument 3337 * @throws { BusinessError } 14000011 - System inner fail 3338 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3339 * @crossplatform 3340 * @since 12 3341 */ 3342 getAssets(options: FetchOptions): Promise<FetchResult<PhotoAsset>>; 3343 /** 3344 * Fetch shared photo assets in an album. 3345 * 3346 * @permission ohos.permission.ACCESS_MEDIALIB_THUMB_DB 3347 * @param { FetchOptions } options - Fetch options. 3348 * @returns { Array<SharedPhotoAsset> } Returns the shared photo assets 3349 * @throws { BusinessError } 201 - Permission denied 3350 * @throws { BusinessError } 202 - Called by non-system application 3351 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3352 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3353 * @throws { BusinessError } 14000011 - Internal system error 3354 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3355 * @systemapi 3356 * @since 13 3357 */ 3358 getSharedPhotoAssets(options: FetchOptions): Array<SharedPhotoAsset>; 3359 } 3360 3361 /** 3362 * Defines the album. 3363 * 3364 * @interface Album 3365 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3366 * @since 10 3367 */ 3368 /** 3369 * Defines the album. 3370 * 3371 * @interface Album 3372 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3373 * @crossplatform 3374 * @since 12 3375 */ 3376 interface Album extends AbsAlbum { 3377 /** 3378 * Number of image assets in the album 3379 * 3380 * @type { ?number } 3381 * @readonly 3382 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3383 * @since 11 3384 */ 3385 /** 3386 * Number of image assets in the album 3387 * 3388 * @type { ?number } 3389 * @readonly 3390 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3391 * @crossplatform 3392 * @since 12 3393 */ 3394 readonly imageCount?: number; 3395 /** 3396 * Number of video assets in the album 3397 * 3398 * @type { ?number } 3399 * @readonly 3400 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3401 * @since 11 3402 */ 3403 /** 3404 * Number of video assets in the album 3405 * 3406 * @type { ?number } 3407 * @readonly 3408 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3409 * @crossplatform 3410 * @since 12 3411 */ 3412 readonly videoCount?: number; 3413 /** 3414 * Modify metadata for the album 3415 * 3416 * @permission ohos.permission.WRITE_IMAGEVIDEO 3417 * @param { AsyncCallback<void> } callback - Returns void 3418 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3419 * <br>2. Incorrect parameter types. 3420 * @throws { BusinessError } 13900012 - Permission denied 3421 * @throws { BusinessError } 13900020 - Invalid argument 3422 * @throws { BusinessError } 14000011 - System inner fail 3423 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3424 * @since 10 3425 */ 3426 commitModify(callback: AsyncCallback<void>): void; 3427 /** 3428 * Modify metadata for the album 3429 * 3430 * @permission ohos.permission.WRITE_IMAGEVIDEO 3431 * @returns { Promise<void> } Returns void 3432 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3433 * <br>2. Incorrect parameter types. 3434 * @throws { BusinessError } 13900012 - Permission denied 3435 * @throws { BusinessError } 13900020 - Invalid argument 3436 * @throws { BusinessError } 14000011 - System inner fail 3437 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3438 * @since 10 3439 */ 3440 commitModify(): Promise<void>; 3441 /** 3442 * Add assets to the album. 3443 * 3444 * @permission ohos.permission.WRITE_IMAGEVIDEO 3445 * @param { Array<PhotoAsset> } assets - Assets to add 3446 * @param { AsyncCallback<void> } callback - Returns void 3447 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3448 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3449 * @throws { BusinessError } 13900012 - Permission denied 3450 * @throws { BusinessError } 13900020 - Invalid argument 3451 * @throws { BusinessError } 14000011 - System inner fail 3452 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3453 * @since 10 3454 * @deprecated since 11 3455 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#addAssets 3456 */ 3457 addAssets(assets: Array<PhotoAsset>, callback: AsyncCallback<void>): void; 3458 /** 3459 * Add assets to the album. 3460 * 3461 * @permission ohos.permission.WRITE_IMAGEVIDEO 3462 * @param { Array<PhotoAsset> } assets - Assets to add 3463 * @returns { Promise<void> } Returns void 3464 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3465 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3466 * @throws { BusinessError } 13900012 - Permission denied 3467 * @throws { BusinessError } 13900020 - Invalid argument 3468 * @throws { BusinessError } 14000011 - System inner fail 3469 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3470 * @since 10 3471 * @deprecated since 11 3472 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#addAssets 3473 */ 3474 addAssets(assets: Array<PhotoAsset>): Promise<void>; 3475 /** 3476 * Remove assets from the album. 3477 * 3478 * @permission ohos.permission.WRITE_IMAGEVIDEO 3479 * @param { Array<PhotoAsset> } assets - Assets to remove 3480 * @param { AsyncCallback<void> } callback - Returns void 3481 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3482 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3483 * @throws { BusinessError } 13900012 - Permission denied 3484 * @throws { BusinessError } 13900020 - Invalid argument 3485 * @throws { BusinessError } 14000011 - System inner fail 3486 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3487 * @since 10 3488 * @deprecated since 11 3489 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#removeAssets 3490 */ 3491 removeAssets(assets: Array<PhotoAsset>, callback: AsyncCallback<void>): void; 3492 /** 3493 * Remove assets from the album. 3494 * 3495 * @permission ohos.permission.WRITE_IMAGEVIDEO 3496 * @param { Array<PhotoAsset> } assets - Assets to remove 3497 * @returns { Promise<void> } Returns void 3498 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3499 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3500 * @throws { BusinessError } 13900012 - Permission denied 3501 * @throws { BusinessError } 13900020 - Invalid argument 3502 * @throws { BusinessError } 14000011 - System inner fail 3503 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3504 * @since 10 3505 * @deprecated since 11 3506 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#removeAssets 3507 */ 3508 removeAssets(assets: Array<PhotoAsset>): Promise<void>; 3509 /** 3510 * Recover assets from the trash album. 3511 * 3512 * @permission ohos.permission.WRITE_IMAGEVIDEO 3513 * @param { Array<PhotoAsset> } assets - Assets to recover 3514 * @param { AsyncCallback<void> } callback - Returns void 3515 * @throws { BusinessError } 202 - Called by non-system application. 3516 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3517 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3518 * @throws { BusinessError } 13900012 - Permission denied 3519 * @throws { BusinessError } 13900020 - Invalid argument 3520 * @throws { BusinessError } 14000011 - System inner fail 3521 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3522 * @systemapi 3523 * @since 10 3524 * @deprecated since 11 3525 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#recoverAssets 3526 */ 3527 recoverAssets(assets: Array<PhotoAsset>, callback: AsyncCallback<void>): void; 3528 /** 3529 * Recover assets from the trash album. 3530 * 3531 * @permission ohos.permission.WRITE_IMAGEVIDEO 3532 * @param { Array<PhotoAsset> } assets - Assets to recover 3533 * @returns { Promise<void> } Returns void 3534 * @throws { BusinessError } 202 - Called by non-system application. 3535 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3536 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3537 * @throws { BusinessError } 13900012 - Permission denied 3538 * @throws { BusinessError } 13900020 - Invalid argument 3539 * @throws { BusinessError } 14000011 - System inner fail 3540 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3541 * @systemapi 3542 * @since 10 3543 * @deprecated since 11 3544 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#recoverAssets 3545 */ 3546 recoverAssets(assets: Array<PhotoAsset>): Promise<void>; 3547 /** 3548 * Delete assets permanently from the trash album. 3549 * 3550 * @permission ohos.permission.WRITE_IMAGEVIDEO 3551 * @param { Array<PhotoAsset> } assets - Assets to delete 3552 * @param { AsyncCallback<void> } callback - Returns void 3553 * @throws { BusinessError } 202 - Called by non-system application. 3554 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3555 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3556 * @throws { BusinessError } 13900012 - Permission denied 3557 * @throws { BusinessError } 13900020 - Invalid argument 3558 * @throws { BusinessError } 14000011 - System inner fail 3559 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3560 * @systemapi 3561 * @since 10 3562 * @deprecated since 11 3563 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAssets 3564 */ 3565 deleteAssets(assets: Array<PhotoAsset>, callback: AsyncCallback<void>): void; 3566 /** 3567 * Delete assets permanently from the trash album. 3568 * 3569 * @permission ohos.permission.WRITE_IMAGEVIDEO 3570 * @param { Array<PhotoAsset> } assets - Assets to delete 3571 * @returns { Promise<void> } Returns void 3572 * @throws { BusinessError } 202 - Called by non-system application. 3573 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3574 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3575 * @throws { BusinessError } 13900012 - Permission denied 3576 * @throws { BusinessError } 13900020 - Invalid argument 3577 * @throws { BusinessError } 14000011 - System inner fail 3578 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3579 * @systemapi 3580 * @since 10 3581 * @deprecated since 11 3582 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAssets 3583 */ 3584 deleteAssets(assets: Array<PhotoAsset>): Promise<void>; 3585 /** 3586 * Set cover uri for this album. 3587 * 3588 * @permission ohos.permission.WRITE_IMAGEVIDEO 3589 * @param { string } uri - The asset uri to set 3590 * @param { AsyncCallback<void> } callback - Returns void 3591 * @throws { BusinessError } 202 - Called by non-system application. 3592 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3593 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3594 * @throws { BusinessError } 13900012 - Permission denied 3595 * @throws { BusinessError } 13900020 - Invalid argument 3596 * @throws { BusinessError } 14000011 - System inner fail 3597 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3598 * @systemapi 3599 * @since 10 3600 * @deprecated since 11 3601 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#setCoverUri 3602 */ 3603 setCoverUri(uri: string, callback: AsyncCallback<void>): void; 3604 /** 3605 * Set cover uri for this album. 3606 * 3607 * @permission ohos.permission.WRITE_IMAGEVIDEO 3608 * @param { string } uri - The asset uri to set 3609 * @returns { Promise<void> } Returns void 3610 * @throws { BusinessError } 202 - Called by non-system application. 3611 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3612 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3613 * @throws { BusinessError } 13900012 - Permission denied 3614 * @throws { BusinessError } 13900020 - Invalid argument 3615 * @throws { BusinessError } 14000011 - System inner fail 3616 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3617 * @systemapi 3618 * @since 10 3619 * @deprecated since 11 3620 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#setCoverUri 3621 */ 3622 setCoverUri(uri: string): Promise<void>; 3623 /** 3624 * Get the faceId of the portrait album or group photo album. 3625 * 3626 * @permission ohos.permission.READ_IMAGEVIDEO 3627 * @returns { Promise<string> } Returns tag_id if portrait album, Returns group_tag if group photo album, 3628 * <br>Returns empty if not found. 3629 * @throws { BusinessError } 201 - Permission denied 3630 * @throws { BusinessError } 202 - Called by non-system application 3631 * @throws { BusinessError } 14000011 - Internal system error 3632 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3633 * @systemapi 3634 * @since 13 3635 */ 3636 getFaceId(): Promise<string>; 3637 } 3638 3639 /** 3640 * Helper functions to access photos and albums. 3641 * 3642 * @interface PhotoAccessHelper 3643 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3644 * @since 10 3645 */ 3646 /** 3647 * Helper functions to access photos and albums. 3648 * 3649 * @interface PhotoAccessHelper 3650 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3651 * @atomicservice 3652 * @since 11 3653 */ 3654 /** 3655 * Helper functions to access photos and albums. 3656 * 3657 * @interface PhotoAccessHelper 3658 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3659 * @crossplatform 3660 * @atomicservice 3661 * @since 12 3662 */ 3663 interface PhotoAccessHelper { 3664 /** 3665 * Fetch photo assets 3666 * 3667 * @permission ohos.permission.READ_IMAGEVIDEO 3668 * @param { FetchOptions } options - Fetch options. 3669 * @param { AsyncCallback<FetchResult<PhotoAsset>> } callback - Returns the fetch result. 3670 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3671 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3672 * @throws { BusinessError } 13900012 - Permission denied 3673 * @throws { BusinessError } 13900020 - Invalid argument 3674 * @throws { BusinessError } 14000011 - System inner fail 3675 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3676 * @since 10 3677 */ 3678 /** 3679 * Fetch photo assets 3680 * 3681 * @permission ohos.permission.READ_IMAGEVIDEO 3682 * @param { FetchOptions } options - Fetch options. 3683 * @param { AsyncCallback<FetchResult<PhotoAsset>> } callback - Returns the fetch result. 3684 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3685 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3686 * @throws { BusinessError } 13900012 - Permission denied 3687 * @throws { BusinessError } 13900020 - Invalid argument 3688 * @throws { BusinessError } 14000011 - System inner fail 3689 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3690 * @crossplatform 3691 * @since 12 3692 */ 3693 getAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<PhotoAsset>>): void; 3694 /** 3695 * Fetch photo assets 3696 * 3697 * @permission ohos.permission.READ_IMAGEVIDEO 3698 * @param { FetchOptions } options - Retrieval options. 3699 * @returns { Promise<FetchResult<PhotoAsset>> } Returns the fetch result. 3700 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3701 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3702 * @throws { BusinessError } 13900012 - Permission denied 3703 * @throws { BusinessError } 13900020 - Invalid argument 3704 * @throws { BusinessError } 14000011 - System inner fail 3705 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3706 * @since 10 3707 */ 3708 /** 3709 * Fetch photo assets 3710 * 3711 * @permission ohos.permission.READ_IMAGEVIDEO 3712 * @param { FetchOptions } options - Retrieval options. 3713 * @returns { Promise<FetchResult<PhotoAsset>> } Returns the fetch result. 3714 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3715 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3716 * @throws { BusinessError } 13900012 - Permission denied 3717 * @throws { BusinessError } 13900020 - Invalid argument 3718 * @throws { BusinessError } 14000011 - System inner fail 3719 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3720 * @crossplatform 3721 * @since 12 3722 */ 3723 getAssets(options: FetchOptions): Promise<FetchResult<PhotoAsset>>; 3724 /** 3725 * Fetch a group of burst assets 3726 * 3727 * @permission ohos.permission.READ_IMAGEVIDEO 3728 * @param { string } burstKey - Burst asset uuid 3729 * @param { FetchOptions } options - Retrieval options. 3730 * @returns { Promise<FetchResult<PhotoAsset>> } Returns the fetch result. 3731 * @throws { BusinessError } 201 - Permission denied 3732 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3733 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3734 * @throws { BusinessError } 14000011 - Internal system error 3735 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3736 * @since 12 3737 */ 3738 getBurstAssets(burstKey: string, options: FetchOptions): Promise<FetchResult<PhotoAsset>>; 3739 /** 3740 * Create a photo asset 3741 * 3742 * @permission ohos.permission.WRITE_IMAGEVIDEO 3743 * @param { string } displayName - Asset name 3744 * @param { AsyncCallback<PhotoAsset> } callback - Returns the newly created asset 3745 * @throws { BusinessError } 202 - Called by non-system application. 3746 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3747 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3748 * @throws { BusinessError } 13900012 - Permission denied 3749 * @throws { BusinessError } 13900020 - Invalid argument 3750 * @throws { BusinessError } 14000001 - Invalid display name 3751 * @throws { BusinessError } 14000011 - System inner fail 3752 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3753 * @systemapi 3754 * @since 10 3755 */ 3756 createAsset(displayName: string, callback: AsyncCallback<PhotoAsset>): void; 3757 /** 3758 * Create a photo asset 3759 * 3760 * @permission ohos.permission.WRITE_IMAGEVIDEO 3761 * @param { string } displayName - Asset name 3762 * @returns { Promise<PhotoAsset> } Returns the newly created asset 3763 * @throws { BusinessError } 202 - Called by non-system application. 3764 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3765 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3766 * @throws { BusinessError } 13900012 - Permission denied 3767 * @throws { BusinessError } 13900020 - Invalid argument 3768 * @throws { BusinessError } 14000001 - Invalid display name 3769 * @throws { BusinessError } 14000011 - System inner fail 3770 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3771 * @systemapi 3772 * @since 10 3773 */ 3774 createAsset(displayName: string): Promise<PhotoAsset>; 3775 /** 3776 * Create a photo asset 3777 * 3778 * @permission ohos.permission.WRITE_IMAGEVIDEO 3779 * @param { string } displayName - Asset name 3780 * @param { PhotoCreateOptions } options - Create operation 3781 * @returns { Promise<PhotoAsset> } Returns the newly created asset 3782 * @throws { BusinessError } 202 - Called by non-system application. 3783 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3784 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3785 * @throws { BusinessError } 13900012 - Permission denied 3786 * @throws { BusinessError } 13900020 - Invalid argument 3787 * @throws { BusinessError } 14000001 - Invalid display name 3788 * @throws { BusinessError } 14000011 - System inner fail 3789 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3790 * @systemapi 3791 * @since 10 3792 */ 3793 createAsset(displayName: string, options: PhotoCreateOptions): Promise<PhotoAsset>; 3794 /** 3795 * Create a photo asset 3796 * 3797 * @permission ohos.permission.WRITE_IMAGEVIDEO 3798 * @param { string } displayName - Asset name 3799 * @param { PhotoCreateOptions } options - Photo create operation 3800 * @param { AsyncCallback<PhotoAsset> } callback - Returns the newly created asset 3801 * @throws { BusinessError } 202 - Called by non-system application. 3802 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3803 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3804 * @throws { BusinessError } 13900012 - Permission denied 3805 * @throws { BusinessError } 13900020 - Invalid argument 3806 * @throws { BusinessError } 14000001 - Invalid display name 3807 * @throws { BusinessError } 14000011 - System inner fail 3808 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3809 * @systemapi 3810 * @since 10 3811 */ 3812 createAsset(displayName: string, options: PhotoCreateOptions, callback: AsyncCallback<PhotoAsset>): void; 3813 /** 3814 * Create a photo asset: 3815 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3816 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3817 * 3818 * @permission ohos.permission.WRITE_IMAGEVIDEO 3819 * @param { PhotoType } photoType - Photo asset type 3820 * @param { string } extension - Asset extension 3821 * @param { CreateOptions } options - Asset create option 3822 * @param { AsyncCallback<string> } callback - Returns the uri of the newly created asset 3823 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3824 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3825 * @throws { BusinessError } 13900012 - Permission denied 3826 * @throws { BusinessError } 13900020 - Invalid argument 3827 * @throws { BusinessError } 14000011 - System inner fail 3828 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3829 * @since 10 3830 */ 3831 /** 3832 * Create a photo asset: 3833 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3834 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3835 * 3836 * @permission ohos.permission.WRITE_IMAGEVIDEO 3837 * @param { PhotoType } photoType - Photo asset type 3838 * @param { string } extension - Asset extension 3839 * @param { CreateOptions } options - Asset create option 3840 * @param { AsyncCallback<string> } callback - Returns the uri of the newly created asset 3841 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3842 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3843 * @throws { BusinessError } 13900012 - Permission denied 3844 * @throws { BusinessError } 13900020 - Invalid argument 3845 * @throws { BusinessError } 14000011 - System inner fail 3846 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3847 * @atomicservice 3848 * @since 11 3849 */ 3850 createAsset(photoType: PhotoType, extension: string, options: CreateOptions, callback: AsyncCallback<string>): void; 3851 /** 3852 * Create a photo asset: 3853 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3854 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3855 * 3856 * @permission ohos.permission.WRITE_IMAGEVIDEO 3857 * @param { PhotoType } photoType - Photo asset type 3858 * @param { string } extension - Asset extension 3859 * @param { AsyncCallback<string> } callback - Returns the uri of the newly created asset 3860 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3861 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3862 * @throws { BusinessError } 13900012 - Permission denied 3863 * @throws { BusinessError } 13900020 - Invalid argument 3864 * @throws { BusinessError } 14000011 - System inner fail 3865 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3866 * @since 10 3867 */ 3868 /** 3869 * Create a photo asset: 3870 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3871 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3872 * 3873 * @permission ohos.permission.WRITE_IMAGEVIDEO 3874 * @param { PhotoType } photoType - Photo asset type 3875 * @param { string } extension - Asset extension 3876 * @param { AsyncCallback<string> } callback - Returns the uri of the newly created asset 3877 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3878 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3879 * @throws { BusinessError } 13900012 - Permission denied 3880 * @throws { BusinessError } 13900020 - Invalid argument 3881 * @throws { BusinessError } 14000011 - System inner fail 3882 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3883 * @atomicservice 3884 * @since 11 3885 */ 3886 createAsset(photoType: PhotoType, extension: string, callback: AsyncCallback<string>): void; 3887 /** 3888 * Create a photo asset: 3889 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3890 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3891 * 3892 * @permission ohos.permission.WRITE_IMAGEVIDEO 3893 * @param { PhotoType } photoType - Photo asset type 3894 * @param { string } extension - Asset extension 3895 * @param { CreateOptions } [options] - Optional asset create option 3896 * @returns { Promise<string> } Returns the uri of the newly created asset 3897 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3898 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3899 * @throws { BusinessError } 13900012 - Permission denied 3900 * @throws { BusinessError } 13900020 - Invalid argument 3901 * @throws { BusinessError } 14000011 - System inner fail 3902 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3903 * @since 10 3904 */ 3905 /** 3906 * Create a photo asset: 3907 * 1. (Suggested)Integrate security component without WRITE_IMAGEVIDEO permission; 3908 * 2. Get WRITE_IMAGEVIDEO permission by ACL; 3909 * 3910 * @permission ohos.permission.WRITE_IMAGEVIDEO 3911 * @param { PhotoType } photoType - Photo asset type 3912 * @param { string } extension - Asset extension 3913 * @param { CreateOptions } [options] - Optional asset create option 3914 * @returns { Promise<string> } Returns the uri of the newly created asset 3915 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3916 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3917 * @throws { BusinessError } 13900012 - Permission denied 3918 * @throws { BusinessError } 13900020 - Invalid argument 3919 * @throws { BusinessError } 14000011 - System inner fail 3920 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3921 * @atomicservice 3922 * @since 11 3923 */ 3924 createAsset(photoType: PhotoType, extension: string, options?: CreateOptions): Promise<string>; 3925 /** 3926 * Create a generic user album. 3927 * 3928 * @permission ohos.permission.WRITE_IMAGEVIDEO 3929 * @param { string } name - Album name to be created. 3930 * @param { AsyncCallback<Album> } callback - Returns the instance of newly created Album 3931 * @throws { BusinessError } 202 - Called by non-system application. 3932 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3933 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3934 * @throws { BusinessError } 13900012 - Permission denied 3935 * @throws { BusinessError } 13900015 - File exists 3936 * @throws { BusinessError } 13900020 - Invalid argument 3937 * @throws { BusinessError } 14000011 - System inner fail 3938 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3939 * @systemapi 3940 * @since 10 3941 * @deprecated since 11 3942 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#createAlbumRequest 3943 */ 3944 createAlbum(name: string, callback: AsyncCallback<Album>): void; 3945 /** 3946 * Create a generic user album. 3947 * 3948 * @permission ohos.permission.WRITE_IMAGEVIDEO 3949 * @param { string } name - Album name to be created. 3950 * @returns { Promise<Album> } Returns the instance of newly created Album 3951 * @throws { BusinessError } 202 - Called by non-system application. 3952 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3953 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3954 * @throws { BusinessError } 13900012 - Permission denied 3955 * @throws { BusinessError } 13900015 - File exists 3956 * @throws { BusinessError } 13900020 - Invalid argument 3957 * @throws { BusinessError } 14000011 - System inner fail 3958 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3959 * @systemapi 3960 * @since 10 3961 * @deprecated since 11 3962 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#createAlbumRequest 3963 */ 3964 createAlbum(name: string): Promise<Album>; 3965 /** 3966 * Delete generic user-created albums. 3967 * 3968 * @permission ohos.permission.WRITE_IMAGEVIDEO 3969 * @param { Array<Album> } albums - Specify which albums to delete 3970 * @param { AsyncCallback<void> } callback - Returns void 3971 * @throws { BusinessError } 202 - Called by non-system application. 3972 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3973 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3974 * @throws { BusinessError } 13900012 - Permission denied 3975 * @throws { BusinessError } 13900020 - Invalid argument 3976 * @throws { BusinessError } 14000011 - System inner fail 3977 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3978 * @systemapi 3979 * @since 10 3980 * @deprecated since 11 3981 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAlbums 3982 */ 3983 deleteAlbums(albums: Array<Album>, callback: AsyncCallback<void>): void; 3984 /** 3985 * Delete generic user-created albums. 3986 * 3987 * @permission ohos.permission.WRITE_IMAGEVIDEO 3988 * @param { Array<Album> } albums - Specify which albums to delete 3989 * @returns { Promise<void> } Returns void 3990 * @throws { BusinessError } 202 - Called by non-system application. 3991 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3992 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 3993 * @throws { BusinessError } 13900012 - Permission denied 3994 * @throws { BusinessError } 13900020 - Invalid argument 3995 * @throws { BusinessError } 14000011 - System inner fail 3996 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3997 * @systemapi 3998 * @since 10 3999 * @deprecated since 11 4000 * @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAlbums 4001 */ 4002 deleteAlbums(albums: Array<Album>): Promise<void>; 4003 /** 4004 * Fetch albums. 4005 * 4006 * @permission ohos.permission.READ_IMAGEVIDEO 4007 * @param { AlbumType } type - Album type. 4008 * @param { AlbumSubtype } subtype - Album subtype. 4009 * @param { FetchOptions } options - options to fetch albums 4010 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns the fetch result 4011 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4012 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4013 * @throws { BusinessError } 13900012 - Permission denied 4014 * @throws { BusinessError } 13900020 - Invalid argument 4015 * @throws { BusinessError } 14000011 - System inner fail 4016 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4017 * @since 10 4018 */ 4019 /** 4020 * Fetch albums. 4021 * 4022 * @permission ohos.permission.READ_IMAGEVIDEO 4023 * @param { AlbumType } type - Album type. 4024 * @param { AlbumSubtype } subtype - Album subtype. 4025 * @param { FetchOptions } options - options to fetch albums 4026 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns the fetch result 4027 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4028 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4029 * @throws { BusinessError } 13900012 - Permission denied 4030 * @throws { BusinessError } 13900020 - Invalid argument 4031 * @throws { BusinessError } 14000011 - System inner fail 4032 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4033 * @crossplatform 4034 * @since 12 4035 */ 4036 getAlbums( 4037 type: AlbumType, 4038 subtype: AlbumSubtype, 4039 options: FetchOptions, 4040 callback: AsyncCallback<FetchResult<Album>> 4041 ): void; 4042 /** 4043 * Fetch albums. 4044 * 4045 * @permission ohos.permission.READ_IMAGEVIDEO 4046 * @param { AlbumType } type - Album type. 4047 * @param { AlbumSubtype } subtype - Album subtype. 4048 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns the fetch result 4049 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4050 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4051 * @throws { BusinessError } 13900012 - Permission denied 4052 * @throws { BusinessError } 13900020 - Invalid argument 4053 * @throws { BusinessError } 14000011 - System inner fail 4054 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4055 * @since 10 4056 */ 4057 /** 4058 * Fetch albums. 4059 * 4060 * @permission ohos.permission.READ_IMAGEVIDEO 4061 * @param { AlbumType } type - Album type. 4062 * @param { AlbumSubtype } subtype - Album subtype. 4063 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns the fetch result 4064 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4065 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4066 * @throws { BusinessError } 13900012 - Permission denied 4067 * @throws { BusinessError } 13900020 - Invalid argument 4068 * @throws { BusinessError } 14000011 - System inner fail 4069 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4070 * @crossplatform 4071 * @since 12 4072 */ 4073 getAlbums(type: AlbumType, subtype: AlbumSubtype, callback: AsyncCallback<FetchResult<Album>>): void; 4074 /** 4075 * Fetch albums. 4076 * 4077 * @permission ohos.permission.READ_IMAGEVIDEO 4078 * @param { AlbumType } type - Album type. 4079 * @param { AlbumSubtype } subtype - Album subtype. 4080 * @param { FetchOptions } [options] - options to fetch albums 4081 * @returns { Promise<FetchResult<Album>> } - Returns the fetch result 4082 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4083 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4084 * @throws { BusinessError } 13900012 - Permission denied 4085 * @throws { BusinessError } 13900020 - Invalid argument 4086 * @throws { BusinessError } 14000011 - System inner fail 4087 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4088 * @since 10 4089 */ 4090 /** 4091 * Fetch albums. 4092 * 4093 * @permission ohos.permission.READ_IMAGEVIDEO 4094 * @param { AlbumType } type - Album type. 4095 * @param { AlbumSubtype } subtype - Album subtype. 4096 * @param { FetchOptions } [options] - options to fetch albums 4097 * @returns { Promise<FetchResult<Album>> } - Returns the fetch result 4098 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4099 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4100 * @throws { BusinessError } 13900012 - Permission denied 4101 * @throws { BusinessError } 13900020 - Invalid argument 4102 * @throws { BusinessError } 14000011 - System inner fail 4103 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4104 * @crossplatform 4105 * @since 12 4106 */ 4107 getAlbums(type: AlbumType, subtype: AlbumSubtype, options?: FetchOptions): Promise<FetchResult<Album>>; 4108 /** 4109 * Fetch albums containing hidden assets. 4110 * 4111 * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS 4112 * @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets. 4113 * @param { FetchOptions } options - Options to fetch albums. 4114 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns fetchResult of albums containing hidden assets. 4115 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4116 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4117 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4118 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4119 * @throws { BusinessError } 14000011 - System inner fail. 4120 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4121 * @systemapi 4122 * @since 11 4123 */ 4124 getHiddenAlbums(mode: HiddenPhotosDisplayMode, options: FetchOptions, callback: AsyncCallback<FetchResult<Album>>): void; 4125 /** 4126 * Fetch albums containing hidden assets. 4127 * 4128 * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS 4129 * @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets. 4130 * @param { AsyncCallback<FetchResult<Album>> } callback - Returns fetchResult of albums containing hidden assets. 4131 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4132 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4133 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4134 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4135 * @throws { BusinessError } 14000011 - System inner fail. 4136 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4137 * @systemapi 4138 * @since 11 4139 */ 4140 getHiddenAlbums(mode: HiddenPhotosDisplayMode, callback: AsyncCallback<FetchResult<Album>>): void; 4141 /** 4142 * Fetch albums containing hidden assets. 4143 * 4144 * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS 4145 * @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets. 4146 * @param { FetchOptions } [options] - Options to fetch albums. 4147 * @returns { Promise<FetchResult<Album>> } Returns fetchResult of albums containing hidden assets. 4148 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4149 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4150 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4151 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4152 * @throws { BusinessError } 14000011 - System inner fail. 4153 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4154 * @systemapi 4155 * @since 11 4156 */ 4157 getHiddenAlbums(mode: HiddenPhotosDisplayMode, options?: FetchOptions): Promise<FetchResult<Album>>; 4158 /** 4159 * Delete assets 4160 * 4161 * @permission ohos.permission.WRITE_IMAGEVIDEO 4162 * @param { Array<string> } uriList - Uris of assets to delete 4163 * @param { AsyncCallback<void> } callback - No value returned 4164 * @throws { BusinessError } 202 - Called by non-system application. 4165 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4166 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4167 * @throws { BusinessError } 13900012 - Permission denied 4168 * @throws { BusinessError } 13900020 - Invalid argument 4169 * @throws { BusinessError } 14000002 - Invalid uri 4170 * @throws { BusinessError } 14000011 - System inner fail 4171 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4172 * @systemapi 4173 * @since 10 4174 * @deprecated since 11 4175 * @useinstead photoAccessHelper.MediaAssetChangeRequest#deleteAssets 4176 */ 4177 deleteAssets(uriList: Array<string>, callback: AsyncCallback<void>): void; 4178 /** 4179 * Delete assets 4180 * 4181 * @permission ohos.permission.WRITE_IMAGEVIDEO 4182 * @param { Array<string> } uriList - Uris of assets to delete 4183 * @returns { Promise<void> } - Returns void 4184 * @throws { BusinessError } 202 - Called by non-system application. 4185 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4186 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4187 * @throws { BusinessError } 13900012 - Permission denied 4188 * @throws { BusinessError } 13900020 - Invalid argument 4189 * @throws { BusinessError } 14000002 - Invalid uri 4190 * @throws { BusinessError } 14000011 - System inner fail 4191 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4192 * @systemapi 4193 * @since 10 4194 * @deprecated since 11 4195 * @useinstead photoAccessHelper.MediaAssetChangeRequest#deleteAssets 4196 */ 4197 deleteAssets(uriList: Array<string>): Promise<void>; 4198 /** 4199 * Register change notify for the specified uri. 4200 * 4201 * @param { string } uri - PhotoAsset's uri, album's uri or DefaultChangeUri 4202 * @param { boolean } forChildUris - Monitor the child uris. 4203 * @param { Callback<ChangeData> } callback - Returns the changed data 4204 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4205 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4206 * @throws { BusinessError } 13900012 - Permission denied 4207 * @throws { BusinessError } 13900020 - Invalid argument 4208 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4209 * @since 10 4210 */ 4211 registerChange(uri: string, forChildUris: boolean, callback: Callback<ChangeData>): void; 4212 /** 4213 * Get analysis progress of the asset. 4214 * 4215 * @permission ohos.permission.READ_IMAGEVIDEO 4216 * @param { AnalysisType } analysisType - Analysis type 4217 * @returns { Promise<string> } Returns analysis progress info into a json string 4218 * @throws { BusinessError } 201 - Permission denied 4219 * @throws { BusinessError } 202 - Called by non-system application 4220 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4221 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4222 * @throws { BusinessError } 14000011 - Internal system error 4223 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4224 * @systemapi 4225 * @since 12 4226 */ 4227 getDataAnalysisProgress(analysisType: AnalysisType): Promise<string>; 4228 /** 4229 * Unregister change notify for the specified uri. 4230 * 4231 * @param { string } uri - PhotoAsset's uri, album's uri or DefaultChangeUri 4232 * @param { Callback<ChangeData> } [callback] - The callback function to unregister. 4233 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4234 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4235 * @throws { BusinessError } 13900012 - Permission denied 4236 * @throws { BusinessError } 13900020 - Invalid argument 4237 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4238 * @since 10 4239 */ 4240 unRegisterChange(uri: string, callback?: Callback<ChangeData>): void; 4241 /** 4242 * Create a pop-up box to delete photos 4243 * 4244 * @permission ohos.permission.WRITE_IMAGEVIDEO 4245 * @param { Array<string> } uriList - List of the asset uris to be deleted 4246 * @param { AsyncCallback<void> } callback - Returns void 4247 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4248 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4249 * @throws { BusinessError } 13900012 - Permission denied 4250 * @throws { BusinessError } 13900020 - Invalid argument 4251 * @throws { BusinessError } 14000011 - System inner fail 4252 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4253 * @since 10 4254 * @deprecated since 11 4255 * @useinstead photoAccessHelper.MediaAssetChangeRequest#deleteAssets 4256 */ 4257 createDeleteRequest(uriList: Array<string>, callback: AsyncCallback<void>): void; 4258 /** 4259 * Create a pop-up box to delete photos 4260 * 4261 * @permission ohos.permission.WRITE_IMAGEVIDEO 4262 * @param { Array<string> } uriList - List of the asset uris to be deleted 4263 * @returns { Promise<void> } - Returns void 4264 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4265 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4266 * @throws { BusinessError } 13900012 - Permission denied 4267 * @throws { BusinessError } 13900020 - Invalid argument 4268 * @throws { BusinessError } 14000011 - System inner fail 4269 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4270 * @since 10 4271 * @deprecated since 11 4272 * @useinstead photoAccessHelper.MediaAssetChangeRequest#deleteAssets 4273 */ 4274 createDeleteRequest(uriList: Array<string>): Promise<void>; 4275 /** 4276 * Create a save dialog to save photos 4277 * 4278 * @param { Array<string> } srcFileUris - List of the file uris to be saved 4279 * @param { Array<PhotoCreationConfig> } photoCreationConfigs - List of the photo asset creation configs 4280 * @returns { Promise<Array<string>> } - Returns the media library file uri list to application which has been authorized 4281 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4282 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4283 * @throws { BusinessError } 14000011 - Internal system error 4284 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4285 * @atomicservice 4286 * @since 12 4287 */ 4288 showAssetsCreationDialog(srcFileUris: Array<string>, photoCreationConfigs: Array<PhotoCreationConfig>): Promise<Array<string>>; 4289 /** 4290 * Create assets and grant save permission to the app which called the save dialog. 4291 * 4292 * @permission ohos.permission.WRITE_IMAGEVIDEO 4293 * @param { string } bundleName - BundleName of the application which called the save dialog 4294 * @param { string } appName - AppName of the application which called the save dialog 4295 * @param { string } appId - AppId of the application which called the save dialog 4296 * @param { Array<PhotoCreationConfig> } photoCreationConfigs - List of the photo asset creation configs 4297 * @returns { Promise<Array<string>> } - Returns the media library file uri list to application which has been authorized 4298 * @throws { BusinessError } 201 - Permission denied 4299 * @throws { BusinessError } 202 - Called by non-system application 4300 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4301 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4302 * @throws { BusinessError } 14000011 - Internal system error 4303 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4304 * @systemapi 4305 * @since 12 4306 */ 4307 createAssetsForApp(bundleName: string, appName: string, appId: string, photoCreationConfigs: Array<PhotoCreationConfig>): Promise<Array<string>>; 4308 /** 4309 * Create asset and grant short term permission to the application. 4310 * 4311 * @permission ohos.permission.SHORT_TERM_WRITE_IMAGEVIDEO 4312 * @param { PhotoCreationConfig } photoCreationConfig - photo asset creation configs 4313 * @returns { Promise<string> } - Returns the media library file uri to application which has been authorized 4314 * @throws { BusinessError } 201 - Permission denied 4315 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4316 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4317 * @throws { BusinessError } 14000011 - Internal system error 4318 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4319 * @since 12 4320 */ 4321 createAssetWithShortTermPermission(photoCreationConfig: PhotoCreationConfig): Promise<string>; 4322 /** 4323 * Create assets and grant save permission with authorization mode to the app which called the save dialog. 4324 * 4325 * @permission ohos.permission.WRITE_IMAGEVIDEO 4326 * @param { string } bundleName - BundleName of the application which called the save dialog 4327 * @param { string } appName - AppName of the application which called the save dialog 4328 * @param { string } appId - AppId of the application which called the save dialog 4329 * @param { number } tokenId - TokenId of the application which called the save dialog 4330 * @param { AuthorizationMode } authorizationMode - Mode of authorization 4331 * @param { Array<PhotoCreationConfig> } photoCreationConfigs - List of the photo asset creation configs 4332 * @returns { Promise<Array<string>> } - Returns the media library file uri list to application which has been authorized 4333 * @throws { BusinessError } 201 - Permission denied 4334 * @throws { BusinessError } 202 - Called by non-system application 4335 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4336 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4337 * @throws { BusinessError } 14000011 - Internal system error 4338 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4339 * @systemapi 4340 * @since 12 4341 */ 4342 createAssetsForAppWithMode( 4343 bundleName: string, 4344 appName: string, 4345 appId: string, 4346 tokenId: number, 4347 authorizationMode: AuthorizationMode, 4348 photoCreationConfigs: Array<PhotoCreationConfig> 4349 ): Promise<Array<string>>; 4350 /** 4351 * Authorize the uri list. 4352 * 4353 * @param { Array<string> } srcFileUris - Unauthorized uri list 4354 * @returns { Promise<Array<string>> } - Returns the authorized uri list 4355 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4356 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4357 * @throws { BusinessError } 14000011 - Internal system error 4358 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4359 * @atomicservice 4360 * @since 14 4361 */ 4362 requestPhotoUrisReadPermission(srcFileUris: Array<string>): Promise<Array<string>>; 4363 /** 4364 * Get the index of the asset in the album 4365 * 4366 * @permission ohos.permission.READ_IMAGEVIDEO 4367 * @param { string } photoUri - The photo asset uri. 4368 * @param { string } albumUri - The album uri. 4369 * @param { FetchOptions } options - fetch options 4370 * @param { AsyncCallback<number> } callback - Returns the index of the asset in the album 4371 * @throws { BusinessError } 202 - Called by non-system application. 4372 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4373 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4374 * @throws { BusinessError } 13900012 - Permission denied 4375 * @throws { BusinessError } 13900020 - Invalid argument 4376 * @throws { BusinessError } 14000011 - System inner fail 4377 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4378 * @systemapi 4379 * @since 10 4380 */ 4381 getPhotoIndex(photoUri: string, albumUri: string, options: FetchOptions, callback: AsyncCallback<number>): void; 4382 /** 4383 * Get the index of the asset in the album 4384 * 4385 * @permission ohos.permission.READ_IMAGEVIDEO 4386 * @param { string } photoUri - The photo asset uri. 4387 * @param { string } albumUri - The album uri. 4388 * @param { FetchOptions } options - fetch options 4389 * @returns { Promise<number> } - Returns the index of the asset in the album 4390 * @throws { BusinessError } 202 - Called by non-system application. 4391 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4392 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4393 * @throws { BusinessError } 13900012 - Permission denied 4394 * @throws { BusinessError } 13900020 - Invalid argument 4395 * @throws { BusinessError } 14000011 - System inner fail 4396 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4397 * @systemapi 4398 * @since 10 4399 */ 4400 getPhotoIndex(photoUri: string, albumUri: string, options: FetchOptions): Promise<number>; 4401 /** 4402 * Release PhotoAccessHelper instance 4403 * 4404 * @param { AsyncCallback<void> } callback - Returns void 4405 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4406 * <br>2. Incorrect parameter types. 4407 * @throws { BusinessError } 13900020 - Invalid argument 4408 * @throws { BusinessError } 14000011 - System inner fail 4409 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4410 * @since 10 4411 */ 4412 release(callback: AsyncCallback<void>): void; 4413 /** 4414 * Release PhotoAccessHelper instance 4415 * 4416 * @returns { Promise<void> } Returns void 4417 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4418 * <br>2. Incorrect parameter types. 4419 * @throws { BusinessError } 13900020 - Invalid argument 4420 * @throws { BusinessError } 14000011 - System inner fail 4421 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4422 * @since 10 4423 */ 4424 release(): Promise<void>; 4425 /** 4426 * Saves form information 4427 * 4428 * @permission ohos.permission.WRITE_IMAGEVIDEO 4429 * @param { FormInfo } info - Information store with the form. 4430 * @param { AsyncCallback<void> } callback - No value returned. 4431 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4432 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4433 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4434 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4435 * @throws { BusinessError } 14000011 - System inner fail. 4436 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4437 * @systemapi 4438 * @since 11 4439 */ 4440 saveFormInfo(info: FormInfo, callback: AsyncCallback<void>): void; 4441 /** 4442 * Saves form information 4443 * 4444 * @permission ohos.permission.WRITE_IMAGEVIDEO 4445 * @param { FormInfo } info - Information store with the form. 4446 * @returns { Promise<void> } Return void. 4447 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4448 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4449 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4450 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4451 * @throws { BusinessError } 14000011 - System inner fail. 4452 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4453 * @systemapi 4454 * @since 11 4455 */ 4456 saveFormInfo(info: FormInfo): Promise<void>; 4457 /** 4458 * Removes form information 4459 * 4460 * @permission ohos.permission.WRITE_IMAGEVIDEO 4461 * @param { FormInfo } info - Information store with the form. 4462 * @param { AsyncCallback<void> } callback - No value returned. 4463 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4464 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4465 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4466 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4467 * @throws { BusinessError } 14000011 - System inner fail. 4468 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4469 * @systemapi 4470 * @since 11 4471 */ 4472 removeFormInfo(info: FormInfo, callback: AsyncCallback<void>): void; 4473 /** 4474 * Removes form information 4475 * 4476 * @permission ohos.permission.WRITE_IMAGEVIDEO 4477 * @param { FormInfo } info - Information store with the form. 4478 * @returns { Promise<void> } Return void. 4479 * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. 4480 * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. 4481 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4482 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4483 * @throws { BusinessError } 14000011 - System inner fail. 4484 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4485 * @systemapi 4486 * @since 11 4487 */ 4488 removeFormInfo(info: FormInfo): Promise<void>; 4489 /** 4490 * Apply the change request of asset or album. 4491 * 4492 * @permission ohos.permission.WRITE_IMAGEVIDEO 4493 * @param { MediaChangeRequest } mediaChangeRequest - The change request to be applied 4494 * @returns { Promise<void> } Returns void 4495 * @throws { BusinessError } 201 - Permission denied 4496 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4497 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4498 * @throws { BusinessError } 14000011 - System inner fail 4499 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4500 * @atomicservice 4501 * @since 11 4502 */ 4503 applyChanges(mediaChangeRequest: MediaChangeRequest): Promise<void>; 4504 /** 4505 * Get index construction progress. 4506 * 4507 * @permission ohos.permission.READ_IMAGEVIDEO 4508 * @returns { Promise<string> } Returns progress of the photo and video 4509 * @throws { BusinessError } 201 - Permission denied 4510 * @throws { BusinessError } 202 - Called by non-system application 4511 * @throws { BusinessError } 14000011 - Internal system error 4512 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4513 * @systemapi 4514 * @since 12 4515 */ 4516 getIndexConstructProgress(): Promise<string>; 4517 /** 4518 * Grant permission of assets to an APP. 4519 * 4520 * @permission ohos.permission.READ_IMAGEVIDEO 4521 * @param { string } appid - App Id 4522 * @param { Array<string> } uriList - List of asset uris whose permission will be granted to an App, 4523 * <br>the capacity of uriList is 1000. 4524 * @param { PhotoPermissionType } photoPermissionType - Permission type of accessing assets. 4525 * @param { HideSensitiveType } hideSensitiveType - Hide sensitive info type of accessing assets. 4526 * @returns { Promise<number> } Returns result of grant permission 4527 * @throws { BusinessError } 201 - Permission denied 4528 * @throws { BusinessError } 202 - Called by non-system application 4529 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4530 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4531 * @throws { BusinessError } 14000011 - Internal system error 4532 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4533 * @systemapi 4534 * @since 12 4535 */ 4536 grantPhotoUrisPermission( 4537 appid: string, 4538 uriList: Array<string>, 4539 photoPermissionType: PhotoPermissionType, 4540 hideSensitiveType: HideSensitiveType 4541 ): Promise<number>; 4542 /** 4543 * Grant permission of asset to an APP. 4544 * 4545 * @permission ohos.permission.READ_IMAGEVIDEO 4546 * @param { string } appid - App Id 4547 * @param { string } uri - Asset uri whose permission will be granted to an App. 4548 * @param { PhotoPermissionType } photoPermissionType - Permission type of accessing assets. 4549 * @param { HideSensitiveType } hideSensitiveType - Hide sensitive info type of accessing assets. 4550 * @returns { Promise<number> } Returns result of grant permission 4551 * @throws { BusinessError } 201 - Permission denied 4552 * @throws { BusinessError } 202 - Called by non-system application 4553 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4554 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4555 * @throws { BusinessError } 14000011 - Internal system error 4556 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4557 * @systemapi 4558 * @since 12 4559 */ 4560 grantPhotoUriPermission(appid: string, uri: string, photoPermissionType: PhotoPermissionType, hideSensitiveType: HideSensitiveType): Promise<number>; 4561 /** 4562 * Cancel permission of asset to an APP. 4563 * 4564 * @permission ohos.permission.READ_IMAGEVIDEO 4565 * @param { string } appid - App Id 4566 * @param { string } uri - Asset uri whose permission will be granted to an App. 4567 * @param { PhotoPermissionType } photoPermissionType - Permission type of accessing assets. 4568 * @returns { Promise<number> } Returns result of cancel permission 4569 * @throws { BusinessError } 201 - Permission denied 4570 * @throws { BusinessError } 202 - Called by non-system application 4571 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4572 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4573 * @throws { BusinessError } 14000011 - Internal system error 4574 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4575 * @systemapi 4576 * @since 12 4577 */ 4578 cancelPhotoUriPermission(appid: string, uri: string, photoPermissionType: PhotoPermissionType): Promise<number>; 4579 /** 4580 * Provides the capability of thumbnail generation according to specified rules. 4581 * 4582 * @permission ohos.permission.READ_IMAGEVIDEO 4583 * @param { dataSharePredicates.DataSharePredicates } predicate - Rule options for generating thumbnails. 4584 * @param { AsyncCallback<void> } callback - Returns void when the task is completed. 4585 * @returns { number } Create task id for generating thumbnails 4586 * @throws { BusinessError } 201 - Permission denied 4587 * @throws { BusinessError } 202 - Called by non-system application 4588 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4589 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4590 * @throws { BusinessError } 14000011 - Internal system error 4591 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4592 * @systemapi 4593 * @since 13 4594 */ 4595 startThumbnailCreationTask(predicate: dataSharePredicates.DataSharePredicates, callback: AsyncCallback<void>): number; 4596 /** 4597 * Provides the capability of stop generating thumbnails. 4598 * 4599 * @permission ohos.permission.READ_IMAGEVIDEO 4600 * @param { number } taskId - Stop generating thumbnail task id. 4601 * @throws { BusinessError } 201 - Permission denied 4602 * @throws { BusinessError } 202 - Called by non-system application 4603 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4604 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4605 * @throws { BusinessError } 14000011 - Internal system error 4606 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4607 * @systemapi 4608 * @since 13 4609 */ 4610 stopThumbnailCreationTask(taskId: number): void; 4611 /** 4612 * Fetch shared photo assets. 4613 * 4614 * @permission ohos.permission.ACCESS_MEDIALIB_THUMB_DB 4615 * @param { FetchOptions } options - Fetch options. 4616 * @returns { Array<SharedPhotoAsset> } Returns the shared photo assets 4617 * @throws { BusinessError } 201 - Permission denied 4618 * @throws { BusinessError } 202 - Called by non-system application 4619 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4620 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4621 * @throws { BusinessError } 14000011 - Internal system error 4622 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4623 * @systemapi 4624 * @since 13 4625 */ 4626 getSharedPhotoAssets(options: FetchOptions): Array<SharedPhotoAsset>; 4627 } 4628 4629 /** 4630 * Form information. 4631 * 4632 * @interface FormInfo 4633 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4634 * @systemapi 4635 * @since 11 4636 */ 4637 interface FormInfo { 4638 /** 4639 * Id of the form. 4640 * 4641 * @type { string } 4642 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4643 * @systemapi 4644 * @since 11 4645 */ 4646 formId: string; 4647 /** 4648 * URI of the photo or album. 4649 * 4650 * @type { string } 4651 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4652 * @systemapi 4653 * @since 11 4654 */ 4655 uri: string; 4656 } 4657 4658 /** 4659 * Enumeration types of data change. 4660 * 4661 * @enum { number } NotifyType 4662 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4663 * @since 10 4664 */ 4665 enum NotifyType { 4666 /** 4667 * Data(assets or albums) have been newly created 4668 * 4669 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4670 * @since 10 4671 */ 4672 NOTIFY_ADD, 4673 /** 4674 * Data(assets or albums) have been modified 4675 * 4676 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4677 * @since 10 4678 */ 4679 NOTIFY_UPDATE, 4680 /** 4681 * Data(assets or albums) have been removed 4682 * 4683 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4684 * @since 10 4685 */ 4686 NOTIFY_REMOVE, 4687 /** 4688 * Assets have been added to an album. 4689 * 4690 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4691 * @since 10 4692 */ 4693 NOTIFY_ALBUM_ADD_ASSET, 4694 /** 4695 * Assets have been removed from an album. 4696 * 4697 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4698 * @since 10 4699 */ 4700 NOTIFY_ALBUM_REMOVE_ASSET 4701 } 4702 4703 /** 4704 * Enumeration uris for registerChange. 4705 * 4706 * @enum { string } DefaultChangeUri 4707 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4708 * @since 10 4709 */ 4710 enum DefaultChangeUri { 4711 /** 4712 * Uri for default PhotoAsset, use with forDescendant{true}, will receive all PhotoAsset's change notifications 4713 * 4714 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4715 * @since 10 4716 */ 4717 DEFAULT_PHOTO_URI = 'file://media/Photo', 4718 /** 4719 * Uri for default Album, use with forDescendant{true}, will receive all Album's change notifications 4720 * 4721 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4722 * @since 10 4723 */ 4724 DEFAULT_ALBUM_URI = 'file://media/PhotoAlbum', 4725 /** 4726 * Uri for albums in hidden album view. 4727 * 4728 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4729 * @systemapi 4730 * @since 11 4731 */ 4732 DEFAULT_HIDDEN_ALBUM_URI = 'file://media/HiddenAlbum' 4733 } 4734 4735 /** 4736 * Defines the change data 4737 * 4738 * @interface ChangeData 4739 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4740 * @since 10 4741 */ 4742 interface ChangeData { 4743 /** 4744 * The NotifyType of ChangeData 4745 * 4746 * @type { NotifyType } 4747 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4748 * @since 10 4749 */ 4750 type: NotifyType; 4751 /** 4752 * The changed uris 4753 * 4754 * @type { Array<string> } 4755 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4756 * @since 10 4757 */ 4758 uris: Array<string>; 4759 /** 4760 * Change details of the asset uris to an album. 4761 * 4762 * @type { Array<string> } 4763 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4764 * @since 10 4765 */ 4766 extraUris: Array<string>; 4767 /** 4768 * sharedPhotoAssets of the same type 4769 * 4770 * @type { Array<SharedPhotoAsset> } 4771 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4772 * @systemapi 4773 * @since 14 4774 */ 4775 sharedPhotoAssets: Array<SharedPhotoAsset>; 4776 /** 4777 * sharedAlbumAssets of the same type 4778 * 4779 * @type { Array<SharedAlbumAsset> } 4780 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4781 * @systemapi 4782 * @since 14 4783 */ 4784 sharedAlbumAssets: Array<SharedAlbumAsset>; 4785 /** 4786 * sharedExtraPhotoAssets of the same type 4787 * 4788 * @type { Array<SharedPhotoAsset> } 4789 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4790 * @systemapi 4791 * @since 14 4792 */ 4793 sharedExtraPhotoAssets: Array<SharedPhotoAsset>; 4794 } 4795 4796 /** 4797 * PhotoViewMIMETypes represents the type of media resource that photo picker selects. 4798 * 4799 * @enum { string } PhotoViewMIMETypes 4800 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4801 * @since 10 4802 */ 4803 /** 4804 * PhotoViewMIMETypes represents the type of media resource that photo picker selects. 4805 * 4806 * @enum { string } PhotoViewMIMETypes 4807 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4808 * @atomicservice 4809 * @since 11 4810 */ 4811 /** 4812 * PhotoViewMIMETypes represents the type of media resource that photo picker selects. 4813 * 4814 * @enum { string } PhotoViewMIMETypes 4815 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4816 * @crossplatform 4817 * @atomicservice 4818 * @since 12 4819 */ 4820 export enum PhotoViewMIMETypes { 4821 /** 4822 * IMAGE_TYPE indicates that the selected media resources are images. 4823 * 4824 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4825 * @since 10 4826 */ 4827 /** 4828 * IMAGE_TYPE indicates that the selected media resources are images. 4829 * 4830 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4831 * @atomicservice 4832 * @since 11 4833 */ 4834 /** 4835 * IMAGE_TYPE indicates that the selected media resources are images. 4836 * 4837 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4838 * @crossplatform 4839 * @atomicservice 4840 * @since 12 4841 */ 4842 IMAGE_TYPE = 'image/*', 4843 /** 4844 * VIDEO_TYPE indicates that the selected media resources are videos. 4845 * 4846 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4847 * @since 10 4848 */ 4849 /** 4850 * VIDEO_TYPE indicates that the selected media resources are videos. 4851 * 4852 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4853 * @atomicservice 4854 * @since 11 4855 */ 4856 /** 4857 * VIDEO_TYPE indicates that the selected media resources are videos. 4858 * 4859 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4860 * @crossplatform 4861 * @atomicservice 4862 * @since 12 4863 */ 4864 VIDEO_TYPE = 'video/*', 4865 /** 4866 * IMAGE_VIDEO_TYPE indicates that the selected media resources are images and videos. 4867 * 4868 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4869 * @since 10 4870 */ 4871 /** 4872 * IMAGE_VIDEO_TYPE indicates that the selected media resources are images and videos. 4873 * 4874 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4875 * @atomicservice 4876 * @since 11 4877 */ 4878 /** 4879 * IMAGE_VIDEO_TYPE indicates that the selected media resources are images and videos. 4880 * 4881 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4882 * @crossplatform 4883 * @atomicservice 4884 * @since 12 4885 */ 4886 IMAGE_VIDEO_TYPE = '*/*', 4887 4888 /** 4889 * MOVING_PHOTO_IMAGE_TYPE indicates that the selected media resources are moving photos. 4890 * 4891 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4892 * @atomicservice 4893 * @since 12 4894 */ 4895 MOVING_PHOTO_IMAGE_TYPE = 'image/movingPhoto' 4896 } 4897 4898 /** 4899 * Class BaseSelectOptions, which is extracted from class PhotoSelectOptions 4900 * 4901 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4902 * @crossplatform 4903 * @atomicservice 4904 * @since 12 4905 */ 4906 class BaseSelectOptions { 4907 /** 4908 * The Type of the file in the picker window. 4909 * 4910 * @type { ?PhotoViewMIMETypes } 4911 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4912 * @since 10 4913 */ 4914 /** 4915 * The Type of the file in the picker window. 4916 * 4917 * @type { ?PhotoViewMIMETypes } 4918 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4919 * @atomicservice 4920 * @since 11 4921 */ 4922 /** 4923 * The Type of the file in the picker window. 4924 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 4925 * 4926 * @type { ?PhotoViewMIMETypes } 4927 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4928 * @crossplatform 4929 * @atomicservice 4930 * @since 12 4931 */ 4932 MIMEType?: PhotoViewMIMETypes; 4933 4934 /** 4935 * Maximum number of images for a single selection. 4936 * 4937 * @type { ?number } 4938 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4939 * @since 10 4940 */ 4941 /** 4942 * Maximum number of images for a single selection. 4943 * 4944 * @type { ?number } 4945 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4946 * @atomicservice 4947 * @since 11 4948 */ 4949 /** 4950 * Maximum number of images for a single selection. 4951 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 4952 * 4953 * @type { ?number } 4954 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4955 * @atomicservice 4956 * @since 12 4957 */ 4958 maxSelectNumber?: number; 4959 4960 /** 4961 * Support search. 4962 * 4963 * @type { ?boolean } 4964 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4965 * @atomicservice 4966 * @since 11 4967 */ 4968 /** 4969 * Support search. 4970 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 4971 * 4972 * @type { ?boolean } 4973 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4974 * @atomicservice 4975 * @since 12 4976 */ 4977 isSearchSupported?: boolean; 4978 4979 /** 4980 * Support taking photos. 4981 * 4982 * @type { ?boolean } 4983 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4984 * @atomicservice 4985 * @since 11 4986 */ 4987 /** 4988 * Support taking photos. 4989 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 4990 * 4991 * @type { ?boolean } 4992 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 4993 * @atomicservice 4994 * @since 12 4995 */ 4996 isPhotoTakingSupported?: boolean; 4997 4998 /** 4999 * The recommendation options when use recommendation photo function. 5000 * 5001 * @type { ?RecommendationOptions } 5002 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5003 * @atomicservice 5004 * @since 11 5005 */ 5006 /** 5007 * The recommendation options when use recommendation photo function. 5008 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 5009 * 5010 * @type { ?RecommendationOptions } 5011 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5012 * @atomicservice 5013 * @since 12 5014 */ 5015 recommendationOptions?: RecommendationOptions; 5016 5017 /** 5018 * The uri for the preselected files. 5019 * 5020 * @type { ?Array<string> } 5021 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5022 * @atomicservice 5023 * @since 11 5024 */ 5025 /** 5026 * The uri for the preselected files. 5027 * Move from class PhotoSelectOptions to it's base class BaseSelectOptions 5028 * 5029 * @type { ?Array<string> } 5030 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5031 * @atomicservice 5032 * @since 12 5033 */ 5034 preselectedUris?: Array<string>; 5035 5036 /** 5037 * Support preview in single selection mode or not 5038 * 5039 * @type { ?boolean } 5040 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5041 * @atomicservice 5042 * @since 12 5043 */ 5044 isPreviewForSingleSelectionSupported?: boolean; 5045 } 5046 5047 /** 5048 * PhotoSelectOptions Object 5049 * 5050 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5051 * @since 10 5052 */ 5053 /** 5054 * PhotoSelectOptions Object 5055 * 5056 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5057 * @atomicservice 5058 * @since 11 5059 */ 5060 /** 5061 * PhotoSelectOptions extends base class BaseSelectOptions 5062 * 5063 * @extends BaseSelectOptions 5064 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5065 * @crossplatform 5066 * @atomicservice 5067 * @since 12 5068 */ 5069 class PhotoSelectOptions extends BaseSelectOptions { 5070 /** 5071 * Support editing photos. 5072 * 5073 * @type { ?boolean } 5074 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5075 * @atomicservice 5076 * @since 11 5077 */ 5078 isEditSupported?: boolean; 5079 5080 /** 5081 * Support select original photo or not 5082 * 5083 * @type { ?boolean } 5084 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5085 * @atomicservice 5086 * @since 12 5087 */ 5088 isOriginalSupported?: boolean; 5089 5090 /** 5091 * SubWindow name 5092 * 5093 * @type { ?string } 5094 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5095 * @atomicservice 5096 * @since 12 5097 */ 5098 subWindowName?: string; 5099 5100 /** 5101 * Theme color 5102 * 5103 * @type { ?CustomColors } 5104 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5105 * @systemapi 5106 * @since 12 5107 */ 5108 themeColor?: CustomColors; 5109 5110 /** 5111 * Complete button text 5112 * 5113 * @type { ?CompleteButtonText } 5114 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5115 * @atomicservice 5116 * @since 14 5117 */ 5118 completeButtonText?: CompleteButtonText; 5119 } 5120 5121 /** 5122 * Options for recommend photos 5123 * 5124 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5125 * @atomicservice 5126 * @since 11 5127 */ 5128 class RecommendationOptions { 5129 /** 5130 * The recommendation photo type when select photo in photo picker. 5131 * 5132 * @type { ?RecommendationType } 5133 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5134 * @atomicservice 5135 * @since 11 5136 */ 5137 recommendationType?: RecommendationType; 5138 5139 /** 5140 * The textContextInfo to recommend images. 5141 * 5142 * @type { ?TextContextInfo } 5143 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5144 * @atomicservice 5145 * @since 12 5146 */ 5147 textContextInfo?: TextContextInfo; 5148 } 5149 5150 /** 5151 * Defines the text context info. 5152 * 5153 * @interface TextContextInfo 5154 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5155 * @atomicservice 5156 * @since 12 5157 */ 5158 interface TextContextInfo { 5159 /** 5160 * The Simplified Chinese(UTF-8) text within 250 to recommend images. 5161 * 5162 * @type { ?string } 5163 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5164 * @atomicservice 5165 * @since 12 5166 */ 5167 text?: string; 5168 } 5169 5170 /** 5171 * PhotoSelectResult Object 5172 * 5173 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5174 * @since 10 5175 */ 5176 /** 5177 * PhotoSelectResult Object 5178 * 5179 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5180 * @atomicservice 5181 * @since 11 5182 */ 5183 /** 5184 * PhotoSelectResult Object 5185 * 5186 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5187 * @crossplatform 5188 * @atomicservice 5189 * @since 12 5190 */ 5191 class PhotoSelectResult { 5192 /** 5193 * The uris for the selected files. 5194 * 5195 * @type { Array<string> } 5196 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5197 * @since 10 5198 */ 5199 /** 5200 * The uris for the selected files. 5201 * 5202 * @type { Array<string> } 5203 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5204 * @atomicservice 5205 * @since 11 5206 */ 5207 /** 5208 * The uris for the selected files. 5209 * 5210 * @type { Array<string> } 5211 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5212 * @crossplatform 5213 * @atomicservice 5214 * @since 12 5215 */ 5216 photoUris: Array<string>; 5217 5218 /** 5219 * Original option. 5220 * 5221 * @type { boolean } 5222 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5223 * @since 10 5224 */ 5225 /** 5226 * Original option. 5227 * 5228 * @type { boolean } 5229 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5230 * @atomicservice 5231 * @since 11 5232 */ 5233 /** 5234 * Original option. 5235 * 5236 * @type { boolean } 5237 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5238 * @crossplatform 5239 * @atomicservice 5240 * @since 12 5241 */ 5242 isOriginalPhoto: boolean; 5243 } 5244 5245 /** 5246 * PhotoViewPicker Object 5247 * 5248 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5249 * @since 10 5250 */ 5251 /** 5252 * PhotoViewPicker Object 5253 * 5254 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5255 * @atomicservice 5256 * @since 11 5257 */ 5258 /** 5259 * PhotoViewPicker Object 5260 * 5261 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5262 * @crossplatform 5263 * @atomicservice 5264 * @since 12 5265 */ 5266 class PhotoViewPicker { 5267 /** 5268 * Pull up the photo picker based on the selection mode. 5269 * 5270 * @param { PhotoSelectOptions } [option] - represents the options provided in select mode. 5271 * @returns { Promise<PhotoSelectResult> } Returns the uris for the selected files. 5272 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5273 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5274 * @throws { BusinessError } 13900042 - Unknown error 5275 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5276 * @since 10 5277 */ 5278 /** 5279 * Pull up the photo picker based on the selection mode. 5280 * 5281 * @param { PhotoSelectOptions } [option] - represents the options provided in select mode. 5282 * @returns { Promise<PhotoSelectResult> } Returns the uris for the selected files. 5283 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5284 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5285 * @throws { BusinessError } 13900042 - Unknown error 5286 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5287 * @atomicservice 5288 * @since 11 5289 */ 5290 /** 5291 * Pull up the photo picker based on the selection mode. 5292 * 5293 * @param { PhotoSelectOptions } [option] - represents the options provided in select mode. 5294 * @returns { Promise<PhotoSelectResult> } Returns the uris for the selected files. 5295 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5296 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5297 * @throws { BusinessError } 13900042 - Unknown error 5298 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5299 * @crossplatform 5300 * @atomicservice 5301 * @since 12 5302 */ 5303 select(option?: PhotoSelectOptions): Promise<PhotoSelectResult>; 5304 5305 /** 5306 * Pull up the photo picker based on the selection mode. 5307 * 5308 * @param { PhotoSelectOptions } option - represents the options provided in select mode. 5309 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5310 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5311 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5312 * @throws { BusinessError } 13900042 - Unknown error 5313 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5314 * @since 10 5315 */ 5316 /** 5317 * Pull up the photo picker based on the selection mode. 5318 * 5319 * @param { PhotoSelectOptions } option - represents the options provided in select mode. 5320 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5321 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5322 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5323 * @throws { BusinessError } 13900042 - Unknown error 5324 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5325 * @atomicservice 5326 * @since 11 5327 */ 5328 /** 5329 * Pull up the photo picker based on the selection mode. 5330 * 5331 * @param { PhotoSelectOptions } option - represents the options provided in select mode. 5332 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5333 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5334 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5335 * @throws { BusinessError } 13900042 - Unknown error 5336 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5337 * @crossplatform 5338 * @atomicservice 5339 * @since 12 5340 */ 5341 select(option: PhotoSelectOptions, callback: AsyncCallback<PhotoSelectResult>): void; 5342 5343 /** 5344 * Pull up the photo picker based on the selection mode. 5345 * 5346 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5347 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5348 * <br>2. Incorrect parameter types. 5349 * @throws { BusinessError } 13900042 - Unknown error 5350 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5351 * @since 10 5352 */ 5353 /** 5354 * Pull up the photo picker based on the selection mode. 5355 * 5356 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5357 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5358 * <br>2. Incorrect parameter types. 5359 * @throws { BusinessError } 13900042 - Unknown error 5360 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5361 * @atomicservice 5362 * @since 11 5363 */ 5364 /** 5365 * Pull up the photo picker based on the selection mode. 5366 * 5367 * @param { AsyncCallback<PhotoSelectResult> } callback - Returns the PhotoSelectResult by photo picker 5368 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5369 * <br>2. Incorrect parameter types. 5370 * @throws { BusinessError } 13900042 - Unknown error 5371 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5372 * @crossplatform 5373 * @atomicservice 5374 * @since 12 5375 */ 5376 select(callback: AsyncCallback<PhotoSelectResult>): void; 5377 } 5378 5379 /** 5380 * MediaAssetEditData Object 5381 * 5382 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5383 * @systemapi 5384 * @since 11 5385 */ 5386 class MediaAssetEditData { 5387 /** 5388 * The constructor to create a MediaAssetEditData instance. 5389 * 5390 * @param { string } compatibleFormat - Compatible format 5391 * @param { string } formatVersion - Format version 5392 * @throws { BusinessError } 202 - Called by non-system application 5393 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5394 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5395 * @throws { BusinessError } 14000011 - System inner fail 5396 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5397 * @systemapi 5398 * @since 11 5399 */ 5400 constructor(compatibleFormat: string, formatVersion: string); 5401 5402 /** 5403 * Compatible format 5404 * 5405 * @type { string } 5406 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5407 * @systemapi 5408 * @since 11 5409 */ 5410 compatibleFormat: string; 5411 5412 /** 5413 * Format version 5414 * 5415 * @type { string } 5416 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5417 * @systemapi 5418 * @since 11 5419 */ 5420 formatVersion: string; 5421 5422 /** 5423 * Edit data 5424 * 5425 * @type { string } 5426 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5427 * @systemapi 5428 * @since 11 5429 */ 5430 data: string; 5431 } 5432 5433 /** 5434 * Enumeration of resource type. 5435 * 5436 * @enum { number } ResourceType 5437 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5438 * @atomicservice 5439 * @since 11 5440 */ 5441 enum ResourceType { 5442 /** 5443 * Image resource 5444 * 5445 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5446 * @atomicservice 5447 * @since 11 5448 */ 5449 IMAGE_RESOURCE = 1, 5450 5451 /** 5452 * Video resource 5453 * 5454 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5455 * @atomicservice 5456 * @since 11 5457 */ 5458 VIDEO_RESOURCE = 2, 5459 5460 /** 5461 * Photo proxy 5462 * 5463 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5464 * @systemapi 5465 * @since 11 5466 */ 5467 PHOTO_PROXY = 3, 5468 5469 /** 5470 * Private moving photo resource 5471 * 5472 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5473 * @systemapi 5474 * @since 13 5475 */ 5476 PRIVATE_MOVING_PHOTO_RESOURCE = 4 5477 } 5478 5479 /** 5480 * The format in which the image is saved 5481 * 5482 * @enum { number } ImageFileType 5483 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5484 * @since 13 5485 */ 5486 enum ImageFileType { 5487 /** 5488 * Jpeg type 5489 * 5490 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5491 * @since 13 5492 */ 5493 JPEG = 1, 5494 5495 /** 5496 * Heif type 5497 * 5498 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5499 * @since 13 5500 */ 5501 HEIF = 2 5502 } 5503 5504 /** 5505 * Enumeration of moving photo effect mode. 5506 * 5507 * @enum { number } MovingPhotoEffectMode 5508 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5509 * @systemapi 5510 * @since 12 5511 */ 5512 enum MovingPhotoEffectMode { 5513 /** 5514 * Default 5515 * 5516 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5517 * @systemapi 5518 * @since 12 5519 */ 5520 DEFAULT = 0, 5521 5522 /** 5523 * Bounce play 5524 * 5525 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5526 * @systemapi 5527 * @since 12 5528 */ 5529 BOUNCE_PLAY = 1, 5530 5531 /** 5532 * Loop play 5533 * 5534 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5535 * @systemapi 5536 * @since 12 5537 */ 5538 LOOP_PLAY = 2, 5539 5540 /** 5541 * Long exposure 5542 * 5543 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5544 * @systemapi 5545 * @since 12 5546 */ 5547 LONG_EXPOSURE = 3, 5548 5549 /** 5550 * Multi exposure 5551 * 5552 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5553 * @systemapi 5554 * @since 12 5555 */ 5556 MULTI_EXPOSURE = 4, 5557 5558 /** 5559 * Cinema graph 5560 * 5561 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5562 * @systemapi 5563 * @since 13 5564 */ 5565 CINEMA_GRAPH = 5, 5566 5567 /** 5568 * Image only 5569 * 5570 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5571 * @systemapi 5572 * @since 13 5573 */ 5574 IMAGE_ONLY = 10 5575 } 5576 5577 /** 5578 * Enumeration of video enhancement type. 5579 * 5580 * @enum { number } VideoEnhancementType 5581 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5582 * @systemapi 5583 * @since 13 5584 */ 5585 enum VideoEnhancementType { 5586 /** 5587 * Quality enhancement local 5588 * 5589 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5590 * @systemapi 5591 * @since 13 5592 */ 5593 QUALITY_ENHANCEMENT_LOCAL = 0, 5594 5595 /** 5596 * Quality enhancement cloud 5597 * 5598 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5599 * @systemapi 5600 * @since 13 5601 */ 5602 QUALITY_ENHANCEMENT_CLOUD = 1, 5603 5604 /** 5605 * Quality enhancement local and cloud 5606 * 5607 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5608 * @systemapi 5609 * @since 13 5610 */ 5611 QUALITY_ENHANCEMENT_LOCAL_AND_CLOUD = 2 5612 } 5613 5614 /** 5615 * Defines the interface of media change request. 5616 * 5617 * @interface MediaChangeRequest 5618 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5619 * @atomicservice 5620 * @since 11 5621 */ 5622 interface MediaChangeRequest {} 5623 5624 /** 5625 * Defines the class of media asset change request. 5626 * 5627 * @implements MediaChangeRequest 5628 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5629 * @atomicservice 5630 * @since 11 5631 */ 5632 class MediaAssetChangeRequest implements MediaChangeRequest { 5633 /** 5634 * The constructor to create a MediaAssetChangeRequest instance. 5635 * 5636 * @param { PhotoAsset } asset - Specify which asset to change 5637 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5638 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5639 * @throws { BusinessError } 14000011 - System inner fail 5640 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5641 * @since 11 5642 */ 5643 /** 5644 * The constructor to create a MediaAssetChangeRequest instance. 5645 * 5646 * @param { PhotoAsset } asset - Specify which asset to change 5647 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5648 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5649 * @throws { BusinessError } 14000011 - System inner fail 5650 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5651 * @atomicservice 5652 * @since 12 5653 */ 5654 constructor(asset: PhotoAsset); 5655 5656 /** 5657 * Create image asset change request. 5658 * 5659 * @param { Context } context - Hap context information 5660 * @param { string } fileUri - File uri 5661 * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance 5662 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5663 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5664 * @throws { BusinessError } 13900002 - No such file 5665 * @throws { BusinessError } 14000011 - System inner fail 5666 * @static 5667 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5668 * @since 11 5669 */ 5670 /** 5671 * Create image asset change request. 5672 * 5673 * @param { Context } context - Hap context information 5674 * @param { string } fileUri - File uri 5675 * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance 5676 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5677 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5678 * @throws { BusinessError } 13900002 - No such file 5679 * @throws { BusinessError } 14000011 - System inner fail 5680 * @static 5681 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5682 * @atomicservice 5683 * @since 12 5684 */ 5685 static createImageAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; 5686 5687 /** 5688 * Create video asset change request. 5689 * 5690 * @param { Context } context - Hap context information 5691 * @param { string } fileUri - File uri 5692 * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance 5693 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5694 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5695 * @throws { BusinessError } 13900002 - No such file 5696 * @throws { BusinessError } 14000011 - System inner fail 5697 * @static 5698 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5699 * @since 11 5700 */ 5701 static createVideoAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; 5702 5703 /** 5704 * Create asset change request. 5705 * 5706 * @param { Context } context - Hap context information 5707 * @param { string } displayName - Asset name 5708 * @param { PhotoCreateOptions } [options] - Optional photo create option 5709 * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance 5710 * @throws { BusinessError } 202 - Called by non-system application 5711 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5712 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5713 * @throws { BusinessError } 14000001 - Invalid display name 5714 * @throws { BusinessError } 14000011 - System inner fail 5715 * @static 5716 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5717 * @systemapi 5718 * @since 11 5719 */ 5720 static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest; 5721 5722 /** 5723 * Create asset change request. 5724 * 5725 * @param { Context } context - Hap context information 5726 * @param { PhotoType } photoType - Photo asset type 5727 * @param { string } extension - Asset extension 5728 * @param { CreateOptions } [options] - Optional asset create option 5729 * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance 5730 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5731 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5732 * @throws { BusinessError } 14000011 - System inner fail 5733 * @static 5734 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5735 * @atomicservice 5736 * @since 11 5737 */ 5738 static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest; 5739 5740 /** 5741 * Delete assets. 5742 * 5743 * @permission ohos.permission.WRITE_IMAGEVIDEO 5744 * @param { Context } context - Hap context information 5745 * @param { Array<PhotoAsset> } assets - Assets to delete 5746 * @returns { Promise<void> } - Returns void 5747 * @throws { BusinessError } 201 - Permission denied 5748 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5749 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5750 * @throws { BusinessError } 14000011 - System inner fail 5751 * @static 5752 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5753 * @since 11 5754 */ 5755 static deleteAssets(context: Context, assets: Array<PhotoAsset>): Promise<void>; 5756 5757 /** 5758 * Delete assets. 5759 * 5760 * @permission ohos.permission.WRITE_IMAGEVIDEO 5761 * @param { Context } context - Hap context information 5762 * @param { Array<string> } uriList - Uris of assets to delete 5763 * @returns { Promise<void> } - Returns void 5764 * @throws { BusinessError } 201 - Permission denied 5765 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5766 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5767 * @throws { BusinessError } 14000002 - Invalid asset uri 5768 * @throws { BusinessError } 14000011 - System inner fail 5769 * @static 5770 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5771 * @since 11 5772 */ 5773 static deleteAssets(context: Context, uriList: Array<string>): Promise<void>; 5774 5775 /** 5776 * Get the asset. 5777 * 5778 * @returns { PhotoAsset } - Returns the asset 5779 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5780 * <br>2. Incorrect parameter types. 5781 * @throws { BusinessError } 14000011 - System inner fail 5782 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5783 * @since 11 5784 */ 5785 /** 5786 * Get the asset. 5787 * 5788 * @returns { PhotoAsset } - Returns the asset 5789 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5790 * <br>2. Incorrect parameter types. 5791 * @throws { BusinessError } 14000011 - System inner fail 5792 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5793 * @atomicservice 5794 * @since 12 5795 */ 5796 getAsset(): PhotoAsset; 5797 5798 /** 5799 * Set favorite state of the asset. 5800 * 5801 * @param { boolean } favoriteState - true: Put the asset into favorite album; false: Remove the asset from favorite album. 5802 * @throws { BusinessError } 202 - Called by non-system application 5803 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5804 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5805 * @throws { BusinessError } 14000011 - System inner fail 5806 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5807 * @systemapi 5808 * @since 11 5809 */ 5810 setFavorite(favoriteState: boolean): void; 5811 5812 /** 5813 * Set hidden state of the asset. 5814 * 5815 * @param { boolean } hiddenState - true: Put the asset into hidden album; false: Recover the asset from hidden album. 5816 * @throws { BusinessError } 202 - Called by non-system application 5817 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5818 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5819 * @throws { BusinessError } 14000011 - System inner fail 5820 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5821 * @systemapi 5822 * @since 11 5823 */ 5824 setHidden(hiddenState: boolean): void; 5825 5826 /** 5827 * Set user comment of the asset. 5828 * 5829 * @param { string } userComment - user comment info 5830 * @throws { BusinessError } 202 - Called by non-system application 5831 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5832 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5833 * @throws { BusinessError } 14000011 - System inner fail 5834 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5835 * @systemapi 5836 * @since 11 5837 */ 5838 setUserComment(userComment: string): void; 5839 5840 /** 5841 * Set location of the asset. 5842 * 5843 * @param { number } longitude - longitude value of the asset 5844 * @param { number } latitude - latitude value of the asset 5845 * @throws { BusinessError } 202 - Called by non-system application 5846 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5847 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5848 * @throws { BusinessError } 14000011 - System inner fail 5849 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5850 * @systemapi 5851 * @since 11 5852 */ 5853 setLocation(longitude: number, latitude: number): void; 5854 5855 /** 5856 * Set title of the asset. 5857 * 5858 * @param { string } title - the new title of the asset 5859 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5860 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5861 * @throws { BusinessError } 14000011 - System inner fail 5862 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5863 * @since 11 5864 */ 5865 /** 5866 * Set title of the asset. 5867 * 5868 * @param { string } title - the new title of the asset 5869 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5870 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5871 * @throws { BusinessError } 14000011 - System inner fail 5872 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5873 * @atomicservice 5874 * @since 12 5875 */ 5876 setTitle(title: string): void; 5877 5878 /** 5879 * Save edit data. 5880 * 5881 * @param { MediaAssetEditData } editData - edit data of the asset 5882 * @throws { BusinessError } 202 - Called by non-system application 5883 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5884 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5885 * @throws { BusinessError } 14000011 - System inner fail 5886 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5887 * @systemapi 5888 * @since 11 5889 */ 5890 setEditData(editData: MediaAssetEditData): void; 5891 5892 /** 5893 * Get write cache handler. 5894 * 5895 * @permission ohos.permission.WRITE_IMAGEVIDEO 5896 * @returns { Promise<number> } Returns the write cache handler 5897 * @throws { BusinessError } 201 - Permission denied 5898 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5899 * <br>2. Incorrect parameter types. 5900 * @throws { BusinessError } 14000011 - System inner fail 5901 * @throws { BusinessError } 14000016 - Operation Not Support 5902 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5903 * @since 11 5904 */ 5905 getWriteCacheHandler(): Promise<number>; 5906 5907 /** 5908 * Add resource of the asset using file uri. 5909 * 5910 * @param { ResourceType } type - Resource type 5911 * @param { string } fileUri - File uri 5912 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5913 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5914 * @throws { BusinessError } 13900002 - No such file 5915 * @throws { BusinessError } 14000011 - System inner fail 5916 * @throws { BusinessError } 14000016 - Operation Not Support 5917 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5918 * @atomicservice 5919 * @since 11 5920 */ 5921 addResource(type: ResourceType, fileUri: string): void; 5922 5923 /** 5924 * Add resource of the asset using ArrayBuffer. 5925 * 5926 * @param { ResourceType } type - Resource type 5927 * @param { ArrayBuffer } data - Data buffer to add 5928 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5929 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5930 * @throws { BusinessError } 14000011 - System inner fail 5931 * @throws { BusinessError } 14000016 - Operation Not Support 5932 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5933 * @atomicservice 5934 * @since 11 5935 */ 5936 addResource(type: ResourceType, data: ArrayBuffer): void; 5937 5938 /** 5939 * Add resource of the asset using PhotoProxy. 5940 * 5941 * @param { ResourceType } type - Resource type 5942 * @param { PhotoProxy } proxy - Photo proxy used to add resource 5943 * @throws { BusinessError } 202 - Called by non-system application 5944 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5945 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5946 * @throws { BusinessError } 14000011 - System inner fail 5947 * @throws { BusinessError } 14000016 - Operation Not Support 5948 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5949 * @systemapi 5950 * @since 11 5951 */ 5952 addResource(type: ResourceType, proxy: PhotoProxy): void; 5953 5954 /** 5955 * Set camera shot key. 5956 * 5957 * @param { string } cameraShotKey - Camera shot key of the asset 5958 * @throws { BusinessError } 202 - Called by non-system application 5959 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5960 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5961 * @throws { BusinessError } 14000011 - System inner fail 5962 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5963 * @systemapi 5964 * @since 12 5965 */ 5966 setCameraShotKey(cameraShotKey: string): void; 5967 5968 /** 5969 * Save the photo asset captured by camera. 5970 * 5971 * @throws { BusinessError } 14000011 - System inner fail 5972 * @throws { BusinessError } 14000016 - Operation Not Support 5973 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5974 * @since 12 5975 */ 5976 saveCameraPhoto(): void; 5977 5978 /** 5979 * Save the photo asset captured by camera with imageFileType. 5980 * 5981 * @param { ImageFileType } imageFileType - Image file type 5982 * @throws { BusinessError } 14000011 - System inner fail 5983 * @throws { BusinessError } 14000016 - Operation Not Support 5984 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5985 * @since 13 5986 */ 5987 saveCameraPhoto(imageFileType: ImageFileType): void; 5988 5989 /** 5990 * Discard the photo asset captured by camera. 5991 * 5992 * @throws { BusinessError } 14000011 - Internal system error 5993 * @throws { BusinessError } 14000016 - Operation Not Support 5994 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 5995 * @since 12 5996 */ 5997 discardCameraPhoto(): void; 5998 5999 /** 6000 * Set effect mode of moving photo. 6001 * 6002 * @param { MovingPhotoEffectMode } mode - the new effect mode of the moving photo 6003 * @throws { BusinessError } 202 - Called by non-system application 6004 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6005 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6006 * @throws { BusinessError } 14000011 - System inner fail 6007 * @throws { BusinessError } 14000016 - Operation Not Support 6008 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6009 * @systemapi 6010 * @since 12 6011 */ 6012 setEffectMode(mode: MovingPhotoEffectMode): void; 6013 6014 /** 6015 * Set orientation of the asset. 6016 * 6017 * @param { number } orientation - the new orientation of the asset 6018 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6019 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6020 * @throws { BusinessError } 14000011 - Internal system error 6021 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6022 * @since 15 6023 */ 6024 setOrientation(orientation: number): void; 6025 6026 /** 6027 * Set video enhancement attribute 6028 * 6029 * @param { VideoEnhancementType } videoEnhancementType - The type of video enhancement 6030 * @param { string } photoId - The photo id of video 6031 * @throws { BusinessError } 202 - Called by non-system application 6032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6033 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6034 * @throws { BusinessError } 14000011 - Internal system error 6035 * @throws { BusinessError } 14000016 - Operation Not Support 6036 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6037 * @systemapi 6038 * @since 13 6039 */ 6040 setVideoEnhancementAttr(videoEnhancementType: VideoEnhancementType, photoId: string): void; 6041 6042 /** 6043 * Set watermark type of the asset. 6044 * 6045 * @param { WatermarkType } watermarkType - the new watermark type of the asset 6046 * @throws { BusinessError } 202 - Called by non-system application 6047 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6048 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6049 * @throws { BusinessError } 14000011 - Internal system error 6050 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6051 * @systemapi 6052 * @since 14 6053 */ 6054 setSupportedWatermarkType(watermarkType: WatermarkType): void; 6055 } 6056 6057 /** 6058 * Defines the class of media assets change request. 6059 * 6060 * @implements MediaChangeRequest 6061 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6062 * @systemapi 6063 * @since 11 6064 */ 6065 class MediaAssetsChangeRequest implements MediaChangeRequest { 6066 /** 6067 * The constructor to create a MediaAssetsChangeRequest instance. 6068 * 6069 * @param { Array<PhotoAsset> } assets - Specify which assets to change 6070 * @throws { BusinessError } 202 - Called by non-system application 6071 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6072 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6073 * @throws { BusinessError } 14000011 - System inner fail 6074 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6075 * @systemapi 6076 * @since 11 6077 */ 6078 constructor(assets: Array<PhotoAsset>); 6079 6080 /** 6081 * Set favorite state of the assets. 6082 * 6083 * @param { boolean } favoriteState - true: Put the assets into favorite album; false: Remove the assets from favorite album. 6084 * @throws { BusinessError } 202 - Called by non-system application 6085 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6086 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6087 * @throws { BusinessError } 14000011 - System inner fail 6088 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6089 * @systemapi 6090 * @since 11 6091 */ 6092 setFavorite(favoriteState: boolean): void; 6093 6094 /** 6095 * Set hidden state of the assets. 6096 * 6097 * @param { boolean } hiddenState - true: Put the assets into hidden album; false: Recover the assets from hidden album. 6098 * @throws { BusinessError } 202 - Called by non-system application 6099 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6100 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6101 * @throws { BusinessError } 14000011 - System inner fail 6102 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6103 * @systemapi 6104 * @since 11 6105 */ 6106 setHidden(hiddenState: boolean): void; 6107 6108 /** 6109 * Set user comment of the assets. 6110 * 6111 * @param { string } userComment - user comment info 6112 * @throws { BusinessError } 202 - Called by non-system application 6113 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6114 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6115 * @throws { BusinessError } 14000011 - System inner fail 6116 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6117 * @systemapi 6118 * @since 11 6119 */ 6120 setUserComment(userComment: string): void; 6121 } 6122 6123 /** 6124 * Defines the class of media album change request. 6125 * 6126 * @implements MediaChangeRequest 6127 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6128 * @since 11 6129 */ 6130 class MediaAlbumChangeRequest implements MediaChangeRequest { 6131 /** 6132 * The constructor to create a MediaAlbumChangeRequest instance. 6133 * 6134 * @param { Album } album - Specify which album to change 6135 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6136 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6137 * @throws { BusinessError } 14000011 - System inner fail 6138 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6139 * @since 11 6140 */ 6141 constructor(album: Album); 6142 6143 /** 6144 * Create album change request. 6145 * 6146 * @param { Context } context - Hap context information 6147 * @param { string } name - Album name 6148 * @returns { MediaAlbumChangeRequest } - Returns a MediaAlbumChangeRequest instance 6149 * @throws { BusinessError } 202 - Called by non-system application 6150 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6151 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6152 * @throws { BusinessError } 14000011 - System inner fail 6153 * @static 6154 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6155 * @systemapi 6156 * @since 11 6157 */ 6158 static createAlbumRequest(context: Context, name: string): MediaAlbumChangeRequest; 6159 6160 /** 6161 * Delete albums. 6162 * 6163 * @permission ohos.permission.WRITE_IMAGEVIDEO 6164 * @param { Context } context - Hap context information 6165 * @param { Array<Album> } albums - Albums to delete 6166 * @returns { Promise<void> } - Returns void 6167 * @throws { BusinessError } 201 - Permission denied 6168 * @throws { BusinessError } 202 - Called by non-system application 6169 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6170 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6171 * @throws { BusinessError } 14000011 - System inner fail 6172 * @static 6173 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6174 * @systemapi 6175 * @since 11 6176 */ 6177 static deleteAlbums(context: Context, albums: Array<Album>): Promise<void>; 6178 6179 /** 6180 * Get the album. 6181 * 6182 * @returns { Album } - Returns the album 6183 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6184 * <br>2. Incorrect parameter types. 6185 * @throws { BusinessError } 14000011 - System inner fail 6186 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6187 * @since 11 6188 */ 6189 getAlbum(): Album; 6190 6191 /** 6192 * Set cover uri of the album. 6193 * 6194 * @param { string } coverUri - the asset uri to set 6195 * @throws { BusinessError } 202 - Called by non-system application 6196 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6197 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6198 * @throws { BusinessError } 14000011 - System inner fail 6199 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6200 * @systemapi 6201 * @since 11 6202 */ 6203 setCoverUri(coverUri: string): void; 6204 6205 /** 6206 * Set name of the album. 6207 * 6208 * @param { string } name - the new name to set 6209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6210 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6211 * @throws { BusinessError } 14000011 - System inner fail 6212 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6213 * @since 11 6214 */ 6215 setAlbumName(name: string): void; 6216 6217 /** 6218 * Add assets into the album. 6219 * 6220 * @param { Array<PhotoAsset> } assets - the assets to add 6221 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6222 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6223 * @throws { BusinessError } 14000011 - System inner fail 6224 * @throws { BusinessError } 14000016 - Operation Not Support 6225 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6226 * @since 11 6227 */ 6228 addAssets(assets: Array<PhotoAsset>): void; 6229 6230 /** 6231 * Remove assets from the album. 6232 * 6233 * @param { Array<PhotoAsset> } assets - the assets to be removed 6234 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6235 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6236 * @throws { BusinessError } 14000011 - System inner fail 6237 * @throws { BusinessError } 14000016 - Operation Not Support 6238 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6239 * @since 11 6240 */ 6241 removeAssets(assets: Array<PhotoAsset>): void; 6242 6243 /** 6244 * Move assets to the target album. 6245 * 6246 * @param { Array<PhotoAsset> } assets - the assets to move 6247 * @param { Album } targetAlbum - target album 6248 * @throws { BusinessError } 202 - Called by non-system application 6249 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6250 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6251 * @throws { BusinessError } 14000011 - System inner fail 6252 * @throws { BusinessError } 14000016 - Operation Not Support 6253 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6254 * @systemapi 6255 * @since 11 6256 */ 6257 moveAssets(assets: Array<PhotoAsset>, targetAlbum: Album): void; 6258 6259 /** 6260 * Recover assets from the trash album. 6261 * 6262 * @param { Array<PhotoAsset> } assets - the assets to recover 6263 * @throws { BusinessError } 202 - Called by non-system application 6264 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6265 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6266 * @throws { BusinessError } 14000011 - System inner fail 6267 * @throws { BusinessError } 14000016 - Operation Not Support 6268 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6269 * @systemapi 6270 * @since 11 6271 */ 6272 recoverAssets(assets: Array<PhotoAsset>): void; 6273 6274 /** 6275 * Delete assets permanently from the trash album. 6276 * 6277 * @param { Array<PhotoAsset> } assets - the assets to be deleted permanently 6278 * @throws { BusinessError } 202 - Called by non-system application 6279 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6280 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6281 * @throws { BusinessError } 14000011 - System inner fail 6282 * @throws { BusinessError } 14000016 - Operation Not Support 6283 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6284 * @systemapi 6285 * @since 11 6286 */ 6287 deleteAssets(assets: Array<PhotoAsset>): void; 6288 6289 /** 6290 * Set portrait album to me 6291 * 6292 * @throws { BusinessError } 202 - Called by non-system application 6293 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6294 * <br>2. Incorrect parameter types. 6295 * @throws { BusinessError } 14000011 - System inner fail 6296 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6297 * @systemapi 6298 * @since 11 6299 */ 6300 setIsMe(): void; 6301 6302 /** 6303 * Set display level of the portrait album 6304 * 6305 * @param { number } displayLevel - The level of display interface for portrait albums, such as homepage and more pages 6306 * @throws { BusinessError } 202 - Called by non-system application 6307 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6308 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6309 * @throws { BusinessError } 14000011 - System inner fail 6310 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6311 * @systemapi 6312 * @since 11 6313 */ 6314 setDisplayLevel(displayLevel: number): void; 6315 6316 /** 6317 * Remove assets from the smart album 6318 * 6319 * @param { Array<PhotoAsset> } assets - List of assets that need to be removed 6320 * @throws { BusinessError } 202 - Called by non-system application 6321 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6322 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6323 * @throws { BusinessError } 14000011 - System inner fail 6324 * @throws { BusinessError } 14000016 - Operation Not Support 6325 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6326 * @systemapi 6327 * @since 11 6328 */ 6329 dismissAssets(assets: Array<PhotoAsset>): void; 6330 6331 /** 6332 * Merge two portrait albums 6333 * 6334 * @param { Album } target - Albums that need to be merged 6335 * @throws { BusinessError } 202 - Called by non-system application 6336 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6337 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6338 * @throws { BusinessError } 14000011 - System inner fail 6339 * @throws { BusinessError } 14000016 - Operation Not Support 6340 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6341 * @systemapi 6342 * @since 11 6343 */ 6344 mergeAlbum(target: Album): void; 6345 6346 /** 6347 * Place the current album in front of the target album. 6348 * 6349 * @param { Album } album - Specify the target album to be placed before 6350 * @throws { BusinessError } 202 - Called by non-system application 6351 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6352 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6353 * @throws { BusinessError } 14000011 - System inner fail 6354 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6355 * @systemapi 6356 * @since 11 6357 */ 6358 placeBefore(album: Album): void; 6359 6360 /** 6361 * Dismiss group photo album. 6362 * 6363 * @throws { BusinessError } 202 - Called by non-system application 6364 * @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types. 6365 * @throws { BusinessError } 14000011 - System inner fail 6366 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6367 * @systemapi 6368 * @since 13 6369 */ 6370 dismiss(): void; 6371 } 6372 6373 /** 6374 * Defines the shared photo asset 6375 * 6376 * @interface SharedPhotoAsset 6377 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6378 * @systemapi 6379 * @since 13 6380 */ 6381 interface SharedPhotoAsset { 6382 /** 6383 * File id of photo asset 6384 * 6385 * @type { number } 6386 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6387 * @systemapi 6388 * @since 13 6389 */ 6390 fileId: number; 6391 /** 6392 * URI of photo asset 6393 * 6394 * @type { string } 6395 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6396 * @systemapi 6397 * @since 13 6398 */ 6399 uri: string; 6400 /** 6401 * Path data of photo asset 6402 * 6403 * @type { string } 6404 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6405 * @systemapi 6406 * @since 13 6407 */ 6408 data: string; 6409 /** 6410 * Media type of photo asset 6411 * 6412 * @type { PhotoType } 6413 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6414 * @systemapi 6415 * @since 13 6416 */ 6417 mediaType: PhotoType; 6418 /** 6419 * Display name of photo asset 6420 * 6421 * @type { string } 6422 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6423 * @systemapi 6424 * @since 13 6425 */ 6426 displayName: string; 6427 /** 6428 * Size of photo asset 6429 * 6430 * @type { number } 6431 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6432 * @systemapi 6433 * @since 13 6434 */ 6435 size: number; 6436 /** 6437 * Added date of photo asset 6438 * 6439 * @type { number } 6440 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6441 * @systemapi 6442 * @since 13 6443 */ 6444 dateAdded: number; 6445 /** 6446 * Modify date of photo asset 6447 * 6448 * @type { number } 6449 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6450 * @systemapi 6451 * @since 13 6452 */ 6453 dateModified: number; 6454 /** 6455 * Duration of video photo asset 6456 * 6457 * @type { number } 6458 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6459 * @systemapi 6460 * @since 13 6461 */ 6462 duration: number; 6463 /** 6464 * Width of photo asset 6465 * 6466 * @type { number } 6467 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6468 * @systemapi 6469 * @since 13 6470 */ 6471 width: number; 6472 /** 6473 * Height of photo asset 6474 * 6475 * @type { number } 6476 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6477 * @systemapi 6478 * @since 13 6479 */ 6480 height: number; 6481 /** 6482 * DateTaken of photo asset 6483 * 6484 * @type { number } 6485 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6486 * @systemapi 6487 * @since 13 6488 */ 6489 dateTaken: number; 6490 /** 6491 * Orientation of photo asset 6492 * 6493 * @type { number } 6494 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6495 * @systemapi 6496 * @since 13 6497 */ 6498 orientation: number; 6499 /** 6500 * Favorite state of photo asset 6501 * 6502 * @type { boolean } 6503 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6504 * @systemapi 6505 * @since 13 6506 */ 6507 isFavorite: boolean; 6508 /** 6509 * Title of photo asset 6510 * 6511 * @type { string } 6512 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6513 * @systemapi 6514 * @since 13 6515 */ 6516 title: string; 6517 /** 6518 * Position of photo asset 6519 * 6520 * @type { PositionType } 6521 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6522 * @systemapi 6523 * @since 13 6524 */ 6525 position: PositionType; 6526 /** 6527 * Trashed date of photo asset 6528 * 6529 * @type { number } 6530 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6531 * @systemapi 6532 * @since 13 6533 */ 6534 dateTrashed: number; 6535 /** 6536 * Hidden state of photo asset 6537 * 6538 * @type { boolean } 6539 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6540 * @systemapi 6541 * @since 13 6542 */ 6543 hidden: boolean; 6544 /** 6545 * User comment info of photo asset 6546 * 6547 * @type { string } 6548 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6549 * @systemapi 6550 * @since 13 6551 */ 6552 userComment: string; 6553 /** 6554 * Camera shot key of photo asset 6555 * 6556 * @type { string } 6557 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6558 * @systemapi 6559 * @since 13 6560 */ 6561 cameraShotKey: string; 6562 /** 6563 * The year of the file created 6564 * 6565 * @type { string } 6566 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6567 * @systemapi 6568 * @since 13 6569 */ 6570 dateYear: string; 6571 /** 6572 * The month of the file created 6573 * 6574 * @type { string } 6575 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6576 * @systemapi 6577 * @since 13 6578 */ 6579 dateMonth: string; 6580 /** 6581 * The day of the file created 6582 * 6583 * @type { string } 6584 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6585 * @systemapi 6586 * @since 13 6587 */ 6588 dateDay: string; 6589 /** 6590 * Pending state of the asset, true means asset is pending 6591 * 6592 * @type { boolean } 6593 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6594 * @systemapi 6595 * @since 13 6596 */ 6597 pending: boolean; 6598 /** 6599 * Added date of photo asset in milliseconds 6600 * 6601 * @type { number } 6602 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6603 * @systemapi 6604 * @since 13 6605 */ 6606 dateAddedMs: number; 6607 /** 6608 * Modified time of the asset in milliseconds 6609 * 6610 * @type { number } 6611 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6612 * @systemapi 6613 * @since 13 6614 */ 6615 dateModifiedMs: number; 6616 /** 6617 * Trashed time of the asset in milliseconds 6618 * 6619 * @type { number } 6620 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6621 * @systemapi 6622 * @since 13 6623 */ 6624 dateTrashedMs: number; 6625 /** 6626 * Subtype of photo asset 6627 * 6628 * @type { PhotoSubtype } 6629 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6630 * @systemapi 6631 * @since 13 6632 */ 6633 subtype: PhotoSubtype; 6634 /** 6635 * Effect mode of moving photo 6636 * 6637 * @type { MovingPhotoEffectMode } 6638 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6639 * @systemapi 6640 * @since 13 6641 */ 6642 movingPhotoEffectMode: MovingPhotoEffectMode; 6643 /** 6644 * Dynamic range type of the asset 6645 * 6646 * @type { DynamicRangeType } 6647 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6648 * @systemapi 6649 * @since 13 6650 */ 6651 dynamicRangeType: DynamicRangeType; 6652 /** 6653 * Ready state of thumbnail 6654 * 6655 * @type { boolean } 6656 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6657 * @systemapi 6658 * @since 13 6659 */ 6660 thumbnailReady: boolean; 6661 /** 6662 * Width and height information of lcd picture 6663 * 6664 * @type { string } 6665 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6666 * @systemapi 6667 * @since 13 6668 */ 6669 lcdSize: string; 6670 /** 6671 * Width and height information of thumbnail picture 6672 * 6673 * @type { string } 6674 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6675 * @systemapi 6676 * @since 13 6677 */ 6678 thmSize: string; 6679 /** 6680 * modified time of thumbnail status 6681 * 6682 * @type { number } 6683 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6684 * @systemapi 6685 * @since 14 6686 */ 6687 thumbnailModifiedMs?: number; 6688 /** 6689 * visibility of thumbnails 6690 * 6691 * @type { ThumbnailVisibility } 6692 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6693 * @systemapi 6694 * @since 14 6695 */ 6696 thumbnailVisible: ThumbnailVisibility; 6697 } 6698 6699 /** 6700 * Defines the shared album asset 6701 * 6702 * @interface SharedAlbumAsset 6703 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6704 * @systemapi 6705 * @since 14 6706 */ 6707 interface SharedAlbumAsset { 6708 /** 6709 * album id of album asset 6710 * 6711 * @type { number } 6712 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6713 * @systemapi 6714 * @since 14 6715 */ 6716 albumId: number; 6717 /** 6718 * type of album asset 6719 * 6720 * @type { AlbumType } 6721 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6722 * @systemapi 6723 * @since 14 6724 */ 6725 albumType: AlbumType; 6726 /** 6727 * subtype of album asset 6728 * 6729 * @type { AlbumSubtype } 6730 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6731 * @systemapi 6732 * @since 14 6733 */ 6734 albumSubType: AlbumSubtype; 6735 /** 6736 * album name 6737 * 6738 * @type { string } 6739 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6740 * @systemapi 6741 * @since 14 6742 */ 6743 albumName: string; 6744 /** 6745 * uri of album cover 6746 * 6747 * @type { string } 6748 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6749 * @systemapi 6750 * @since 14 6751 */ 6752 coverUri: string; 6753 /** 6754 * number of assets in this album 6755 * 6756 * @type { number } 6757 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6758 * @systemapi 6759 * @since 14 6760 */ 6761 count: number; 6762 /** 6763 * number of photo assets in this album 6764 * 6765 * @type { number } 6766 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6767 * @systemapi 6768 * @since 14 6769 */ 6770 imageCount: number; 6771 /** 6772 * number of video assets in this album 6773 * 6774 * @type { number } 6775 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6776 * @systemapi 6777 * @since 14 6778 */ 6779 videoCount: number; 6780 } 6781 6782 /** 6783 * Defines the moving photo. 6784 * 6785 * @interface MovingPhoto 6786 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6787 * @atomicservice 6788 * @since 12 6789 */ 6790 interface MovingPhoto { 6791 /** 6792 * Request the image and video content of the moving photo and write to destination uri. 6793 * 6794 * @permission ohos.permission.READ_IMAGEVIDEO 6795 * @param { string } imageFileUri - Destination uri of the image content to be written 6796 * @param { string } videoFileUri - Destination uri of the video content to be written 6797 * @returns { Promise<void> } Returns void 6798 * @throws { BusinessError } 201 - Permission denied 6799 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6800 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6801 * @throws { BusinessError } 14000011 - System inner fail 6802 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6803 * @atomicservice 6804 * @since 12 6805 */ 6806 requestContent(imageFileUri: string, videoFileUri: string): Promise<void>; 6807 6808 /** 6809 * Request content of the moving photo for the given resource type and write to destination uri. 6810 * 6811 * @permission ohos.permission.READ_IMAGEVIDEO 6812 * @param { ResourceType } resourceType - The resource type of the content to request 6813 * @param { string } fileUri - Destination uri of the content to be written 6814 * @returns { Promise<void> } Returns void 6815 * @throws { BusinessError } 201 - Permission denied 6816 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6817 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6818 * @throws { BusinessError } 14000011 - System inner fail 6819 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6820 * @atomicservice 6821 * @since 12 6822 */ 6823 requestContent(resourceType: ResourceType, fileUri: string): Promise<void>; 6824 6825 /** 6826 * Request content of the moving photo for the given resource type and return the array buffer. 6827 * 6828 * @permission ohos.permission.READ_IMAGEVIDEO 6829 * @param { ResourceType } resourceType - The resource type of the content to request 6830 * @returns { Promise<ArrayBuffer> } Returns array buffer of the content 6831 * @throws { BusinessError } 201 - Permission denied 6832 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6833 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6834 * @throws { BusinessError } 14000011 - System inner fail 6835 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6836 * @atomicservice 6837 * @since 12 6838 */ 6839 requestContent(resourceType: ResourceType): Promise<ArrayBuffer>; 6840 6841 /** 6842 * Get uri of the moving photo. 6843 * 6844 * @returns { string } Returns uri of the moving photo 6845 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6846 * <br>2. Incorrect parameter types. 6847 * @throws { BusinessError } 14000011 - System inner fail 6848 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6849 * @atomicservice 6850 * @since 12 6851 */ 6852 getUri(): string; 6853 } 6854 6855 /** 6856 * Highlight album info type 6857 * 6858 * @enum { number } HighlightAlbumInfoType 6859 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6860 * @systemapi 6861 * @since 12 6862 */ 6863 enum HighlightAlbumInfoType { 6864 /** 6865 * Highlight cover info 6866 * 6867 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6868 * @systemapi 6869 * @since 12 6870 */ 6871 COVER_INFO = 0, 6872 /** 6873 * Highlight play info 6874 * 6875 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6876 * @systemapi 6877 * @since 12 6878 */ 6879 PLAY_INFO 6880 } 6881 6882 /** 6883 * Highlight user action type 6884 * 6885 * @enum { number } HighlightUserActionType 6886 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6887 * @systemapi 6888 * @since 12 6889 */ 6890 enum HighlightUserActionType { 6891 /** 6892 * Highlight album inserted picture count 6893 * 6894 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6895 * @systemapi 6896 * @since 12 6897 */ 6898 INSERTED_PIC_COUNT = 0, 6899 /** 6900 * Highlight album removed picture count 6901 * 6902 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6903 * @systemapi 6904 * @since 12 6905 */ 6906 REMOVED_PIC_COUNT, 6907 /** 6908 * Highlight album shared screenshot count 6909 * 6910 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6911 * @systemapi 6912 * @since 12 6913 */ 6914 SHARED_SCREENSHOT_COUNT, 6915 /** 6916 * Highlight album shared cover count 6917 * 6918 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6919 * @systemapi 6920 * @since 12 6921 */ 6922 SHARED_COVER_COUNT, 6923 /** 6924 * Highlight album renamed count 6925 * 6926 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6927 * @systemapi 6928 * @since 12 6929 */ 6930 RENAMED_COUNT, 6931 /** 6932 * Highlight album changed cover count 6933 * 6934 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6935 * @systemapi 6936 * @since 12 6937 */ 6938 CHANGED_COVER_COUNT, 6939 /** 6940 * Highlight album render viewed times 6941 * 6942 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6943 * @systemapi 6944 * @since 12 6945 */ 6946 RENDER_VIEWED_TIMES = 100, 6947 /** 6948 * Highlight album render viewed duration 6949 * 6950 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6951 * @systemapi 6952 * @since 12 6953 */ 6954 RENDER_VIEWED_DURATION, 6955 /** 6956 * Highlight album art layout viewed times 6957 * 6958 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6959 * @systemapi 6960 * @since 12 6961 */ 6962 ART_LAYOUT_VIEWED_TIMES, 6963 /** 6964 * Highlight album art layout viewed duration 6965 * 6966 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6967 * @systemapi 6968 * @since 12 6969 */ 6970 ART_LAYOUT_VIEWED_DURATION 6971 } 6972 6973 /** 6974 * The type of thumbnail 6975 * 6976 * @enum { number } ThumbnailType 6977 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6978 * @systemapi 6979 * @since 13 6980 */ 6981 enum ThumbnailType { 6982 /** 6983 * LCD thumbnail 6984 * 6985 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6986 * @systemapi 6987 * @since 13 6988 */ 6989 LCD = 1, 6990 /** 6991 * THM thumbnail 6992 * 6993 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 6994 * @systemapi 6995 * @since 13 6996 */ 6997 THM = 2 6998 } 6999 7000 /** 7001 * Defines the class of highlight album. 7002 * 7003 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7004 * @systemapi 7005 * @since 12 7006 */ 7007 class HighlightAlbum { 7008 /** 7009 * The constructor to create a highlight instance. 7010 * 7011 * @param { Album } album - Analysis album 7012 * @throws { BusinessError } 202 - Called by non-system application 7013 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7014 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7015 * @throws { BusinessError } 14000011 - Internal system error 7016 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7017 * @systemapi 7018 * @since 12 7019 */ 7020 constructor(album: Album); 7021 7022 /** 7023 * Get highlight album info. 7024 * 7025 * @permission ohos.permission.READ_IMAGEVIDEO 7026 * @param { HighlightAlbumInfoType } type - Highlight album info type 7027 * @returns { Promise<string> } Returns highlight album info into a json string 7028 * @throws { BusinessError } 201 - Permission denied 7029 * @throws { BusinessError } 202 - Called by non-system application 7030 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7031 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7032 * @throws { BusinessError } 14000011 - Internal system error 7033 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7034 * @systemapi 7035 * @since 12 7036 */ 7037 getHighlightAlbumInfo(type: HighlightAlbumInfoType): Promise<string>; 7038 7039 /** 7040 * Get highlight resource array buffer. 7041 * 7042 * @permission ohos.permission.READ_IMAGEVIDEO 7043 * @param { string } resourceUri - highlight resource uri 7044 * @returns { Promise<ArrayBuffer> } Returns array buffer of the content 7045 * @throws { BusinessError } 201 - Permission denied 7046 * @throws { BusinessError } 202 - Called by non-system application 7047 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7048 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7049 * @throws { BusinessError } 14000011 - Internal system error 7050 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7051 * @systemapi 7052 * @since 12 7053 */ 7054 getHighlightResource(resourceUri: string): Promise<ArrayBuffer>; 7055 7056 /** 7057 * Set highlight user action data 7058 * 7059 * @permission ohos.permission.WRITE_IMAGEVIDEO 7060 * @param { HighlightUserActionType } type - Highlight user action type 7061 * @param { number } actionData - User action highlight album data 7062 * @returns { Promise<void> } Returns void 7063 * @throws { BusinessError } 201 - Permission denied 7064 * @throws { BusinessError } 202 - Called by non-system application 7065 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7066 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7067 * @throws { BusinessError } 14000011 - Internal system error 7068 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7069 * @systemapi 7070 * @since 12 7071 */ 7072 setHighlightUserActionData(type: HighlightUserActionType, actionData: number): Promise<void>; 7073 } 7074 7075 /** 7076 * Cloud enhancement task stage. 7077 * 7078 * @enum { number } CloudEnhancementTaskStage 7079 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7080 * @systemapi 7081 * @since 13 7082 */ 7083 enum CloudEnhancementTaskStage { 7084 /** 7085 * Cloud enhancement task exception stage. 7086 * 7087 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7088 * @systemapi 7089 * @since 13 7090 */ 7091 TASK_STAGE_EXCEPTION = -1, 7092 /** 7093 * Cloud enhancement task preparing stage. 7094 * 7095 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7096 * @systemapi 7097 * @since 13 7098 */ 7099 TASK_STAGE_PREPARING, 7100 /** 7101 * Cloud enhancement task uploading stage. 7102 * 7103 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7104 * @systemapi 7105 * @since 13 7106 */ 7107 TASK_STAGE_UPLOADING, 7108 /** 7109 * Cloud enhancement task executing stage. 7110 * 7111 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7112 * @systemapi 7113 * @since 13 7114 */ 7115 TASK_STAGE_EXECUTING, 7116 /** 7117 * Cloud enhancement task downloading stage. 7118 * 7119 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7120 * @systemapi 7121 * @since 13 7122 */ 7123 TASK_STAGE_DOWNLOADING, 7124 /** 7125 * Cloud enhancement task failed stage. 7126 * 7127 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7128 * @systemapi 7129 * @since 13 7130 */ 7131 TASK_STAGE_FAILED, 7132 /** 7133 * Cloud enhancement task completed stage. 7134 * 7135 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7136 * @systemapi 7137 * @since 13 7138 */ 7139 TASK_STAGE_COMPLETED 7140 } 7141 7142 /** 7143 * Task state of cloud enhancement. 7144 * 7145 * @interface CloudEnhancementTaskState 7146 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7147 * @systemapi 7148 * @since 13 7149 */ 7150 interface CloudEnhancementTaskState { 7151 /** 7152 * Indicates the cloud enhancement task stage. 7153 * 7154 * @type { CloudEnhancementTaskStage } 7155 * @readonly 7156 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7157 * @systemapi 7158 * @since 13 7159 */ 7160 readonly taskStage: CloudEnhancementTaskStage; 7161 /** 7162 * Indicates the transferred file size. 7163 * 7164 * @type { ?number } 7165 * @readonly 7166 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7167 * @systemapi 7168 * @since 13 7169 */ 7170 readonly transferredFileSize?: number; 7171 /** 7172 * Indicates the total file size. 7173 * 7174 * @type { ?number } 7175 * @readonly 7176 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7177 * @systemapi 7178 * @since 13 7179 */ 7180 readonly totalFileSize?: number; 7181 /** 7182 * Indicates the expected duration of cloud enhancement queue time. 7183 * 7184 * @type { ?number } 7185 * @readonly 7186 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7187 * @systemapi 7188 * @since 13 7189 */ 7190 readonly expectedDuration?: number; 7191 /** 7192 * Status code when failed in cloud enhancement. 7193 * 7194 * @type { ?number } 7195 * @readonly 7196 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7197 * @systemapi 7198 * @since 13 7199 */ 7200 readonly statusCode?: number; 7201 } 7202 7203 /** 7204 * Defines the class of cloud enhancement. 7205 * 7206 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7207 * @systemapi 7208 * @since 13 7209 */ 7210 class CloudEnhancement { 7211 /** 7212 * Get cloud enhancement instance. 7213 * 7214 * @param { Context } context - Hap context information 7215 * @returns { CloudEnhancement } Returns cloud enhancement instance 7216 * @throws { BusinessError } 202 - Called by non-system application 7217 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7218 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7219 * @throws { BusinessError } 14000011 - Internal system error 7220 * @static 7221 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7222 * @systemapi 7223 * @since 13 7224 */ 7225 static getCloudEnhancementInstance(context: Context): CloudEnhancement; 7226 7227 /** 7228 * Submit cloud enhancement tasks. 7229 * 7230 * @permission ohos.permission.WRITE_IMAGEVIDEO 7231 * @param { Array<PhotoAsset> } photoAssets - The photo assets requested 7232 * @param { boolean } hasCloudWatermark - true: Persistent cloud watermark; false: Not persistent cloud watermark. 7233 * @returns { Promise<void> } Returns void 7234 * @throws { BusinessError } 201 - Permission denied 7235 * @throws { BusinessError } 202 - Called by non-system application 7236 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7237 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7238 * @throws { BusinessError } 14000011 - Internal system error 7239 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7240 * @systemapi 7241 * @since 13 7242 */ 7243 submitCloudEnhancementTasks(photoAssets: Array<PhotoAsset>, hasCloudWatermark: boolean): Promise<void>; 7244 7245 /** 7246 * Prioritize cloud enhancement task. 7247 * 7248 * @permission ohos.permission.WRITE_IMAGEVIDEO 7249 * @param { PhotoAsset } photoAsset - The photo asset requested 7250 * @returns { Promise<void> } Returns void 7251 * @throws { BusinessError } 201 - Permission denied 7252 * @throws { BusinessError } 202 - Called by non-system application 7253 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7254 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7255 * @throws { BusinessError } 14000011 - Internal system error 7256 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7257 * @systemapi 7258 * @since 13 7259 */ 7260 prioritizeCloudEnhancementTask(photoAsset: PhotoAsset): Promise<void>; 7261 7262 /** 7263 * Cancel cloud enhancement tasks. 7264 * 7265 * @permission ohos.permission.WRITE_IMAGEVIDEO 7266 * @param { Array<PhotoAsset> } photoAssets - The photo assets requested 7267 * @returns { Promise<void> } Returns void 7268 * @throws { BusinessError } 201 - Permission denied 7269 * @throws { BusinessError } 202 - Called by non-system application 7270 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7271 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7272 * @throws { BusinessError } 14000011 - Internal system error 7273 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7274 * @systemapi 7275 * @since 13 7276 */ 7277 cancelCloudEnhancementTasks(photoAssets: Array<PhotoAsset>): Promise<void>; 7278 7279 /** 7280 * Cancel all cloud enhancement tasks. 7281 * 7282 * @permission ohos.permission.WRITE_IMAGEVIDEO 7283 * @returns { Promise<void> } Returns void 7284 * @throws { BusinessError } 201 - Permission denied 7285 * @throws { BusinessError } 202 - Called by non-system application 7286 * @throws { BusinessError } 14000011 - Internal system error 7287 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7288 * @systemapi 7289 * @since 13 7290 */ 7291 cancelAllCloudEnhancementTasks(): Promise<void>; 7292 7293 /** 7294 * Query cloud enhancement task state. 7295 * 7296 * @permission ohos.permission.READ_IMAGEVIDEO 7297 * @param { PhotoAsset } photoAsset - The photo asset requested 7298 * @returns { Promise<CloudEnhancementTaskState> } Returns cloud enhancement task state 7299 * @throws { BusinessError } 201 - Permission denied 7300 * @throws { BusinessError } 202 - Called by non-system application 7301 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7302 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7303 * @throws { BusinessError } 14000011 - Internal system error 7304 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7305 * @systemapi 7306 * @since 13 7307 */ 7308 queryCloudEnhancementTaskState(photoAsset: PhotoAsset): Promise<CloudEnhancementTaskState>; 7309 7310 /** 7311 * Sync cloud enhancement task status. 7312 * 7313 * @permission ohos.permission.READ_IMAGEVIDEO 7314 * @returns { Promise<void> } Returns void 7315 * @throws { BusinessError } 201 - Permission denied 7316 * @throws { BusinessError } 202 - Called by non-system application 7317 * @throws { BusinessError } 14000011 - Internal system error 7318 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7319 * @systemapi 7320 * @since 13 7321 */ 7322 syncCloudEnhancementTaskStatus(): Promise<void>; 7323 7324 /** 7325 * Get cloud enhancement pair. 7326 * 7327 * @permission ohos.permission.READ_IMAGEVIDEO 7328 * @param { PhotoAsset } asset - The asset requested 7329 * @returns { Promise<PhotoAsset> } Returns cloud-enhanced asset 7330 * @throws { BusinessError } 201 - Permission denied 7331 * @throws { BusinessError } 202 - Called by non-system application 7332 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7333 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7334 * @throws { BusinessError } 14000011 - Internal system error 7335 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7336 * @systemapi 7337 * @since 13 7338 */ 7339 getCloudEnhancementPair(asset: PhotoAsset): Promise<PhotoAsset>; 7340 } 7341 7342 /** 7343 * Cloud enhancement state. 7344 * 7345 * @enum { number } CloudEnhancementState 7346 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7347 * @systemapi 7348 * @since 13 7349 */ 7350 enum CloudEnhancementState { 7351 /** 7352 * Cloud enhancement unavailable state. 7353 * 7354 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7355 * @systemapi 7356 * @since 13 7357 */ 7358 UNAVAILABLE = 0, 7359 /** 7360 * Cloud enhancement available state. 7361 * 7362 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7363 * @systemapi 7364 * @since 13 7365 */ 7366 AVAILABLE, 7367 /** 7368 * Cloud enhancement executing state. 7369 * 7370 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7371 * @systemapi 7372 * @since 13 7373 */ 7374 EXECUTING, 7375 /** 7376 * Cloud enhancement completed state. 7377 * 7378 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7379 * @systemapi 7380 * @since 13 7381 */ 7382 COMPLETED 7383 } 7384 7385 /** 7386 * Cloud media asset task status. 7387 * 7388 * @enum { number } CloudMediaAssetTaskStatus 7389 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7390 * @systemapi 7391 * @since 14 7392 */ 7393 enum CloudMediaAssetTaskStatus { 7394 /** 7395 * Cloud media asset task status of downloading. 7396 * 7397 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7398 * @systemapi 7399 * @since 14 7400 */ 7401 DOWNLOADING = 0, 7402 /** 7403 * Cloud media asset task status of paused. 7404 * 7405 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7406 * @systemapi 7407 * @since 14 7408 */ 7409 PAUSED = 1, 7410 /** 7411 * Cloud media asset task status of idle. 7412 * 7413 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7414 * @systemapi 7415 * @since 14 7416 */ 7417 IDLE = 2 7418 } 7419 7420 /** 7421 * Cloud media task pause cause. 7422 * 7423 * @enum { number } CloudMediaTaskPauseCause 7424 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7425 * @systemapi 7426 * @since 14 7427 */ 7428 enum CloudMediaTaskPauseCause { 7429 /** 7430 * No pause. 7431 * 7432 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7433 * @systemapi 7434 * @since 14 7435 */ 7436 NO_PAUSE = 0, 7437 /** 7438 * Temperature limit. 7439 * 7440 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7441 * @systemapi 7442 * @since 14 7443 */ 7444 TEMPERATURE_LIMIT = 1, 7445 /** 7446 * Rom limit. 7447 * 7448 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7449 * @systemapi 7450 * @since 14 7451 */ 7452 ROM_LIMIT = 2, 7453 /** 7454 * Network flow limit. 7455 * 7456 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7457 * @systemapi 7458 * @since 14 7459 */ 7460 NETWORK_FLOW_LIMIT = 3, 7461 /** 7462 * Wifi unavailable. 7463 * 7464 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7465 * @systemapi 7466 * @since 14 7467 */ 7468 WIFI_UNAVAILABLE = 4, 7469 /** 7470 * Power limit. 7471 * 7472 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7473 * @systemapi 7474 * @since 14 7475 */ 7476 POWER_LIMIT = 5, 7477 /** 7478 * Background task unavailable. 7479 * 7480 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7481 * @systemapi 7482 * @since 14 7483 */ 7484 BACKGROUND_TASK_UNAVAILABLE = 6, 7485 /** 7486 * Frequent user requests. 7487 * 7488 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7489 * @systemapi 7490 * @since 14 7491 */ 7492 FREQUENT_USER_REQUESTS = 7, 7493 /** 7494 * cloud error. 7495 * 7496 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7497 * @systemapi 7498 * @since 14 7499 */ 7500 CLOUD_ERROR = 8, 7501 /** 7502 * User paused. 7503 * 7504 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7505 * @systemapi 7506 * @since 14 7507 */ 7508 USER_PAUSED = 9 7509 } 7510 7511 /** 7512 * Status of cloud media asset. 7513 * 7514 * @interface CloudMediaAssetStatus 7515 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7516 * @systemapi 7517 * @since 14 7518 */ 7519 interface CloudMediaAssetStatus { 7520 /** 7521 * Indicates the cloud media asset task status. 7522 * 7523 * @type { CloudMediaAssetTaskStatus } 7524 * @readonly 7525 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7526 * @systemapi 7527 * @since 14 7528 */ 7529 readonly taskStatus: CloudMediaAssetTaskStatus; 7530 /** 7531 * Indicates the downloading task info, including total count, total size, remain count and remain size. 7532 * 7533 * @type { string } 7534 * @readonly 7535 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7536 * @systemapi 7537 * @since 14 7538 */ 7539 readonly taskInfo: string; 7540 /** 7541 * Indicates the cloud media task pause status. 7542 * 7543 * @type { CloudMediaTaskPauseCause } 7544 * @readonly 7545 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7546 * @systemapi 7547 * @since 14 7548 */ 7549 readonly errorCode: CloudMediaTaskPauseCause; 7550 } 7551 7552 /** 7553 * Cloud media download type. 7554 * 7555 * @enum { number } CloudMediaDownloadType 7556 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7557 * @systemapi 7558 * @since 14 7559 */ 7560 enum CloudMediaDownloadType { 7561 /** 7562 * High-priority download policy, no background task required. 7563 * 7564 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7565 * @systemapi 7566 * @since 14 7567 */ 7568 DOWNLOAD_FORCE = 0, 7569 /** 7570 * Low-priority download policy, requiring background task. 7571 * 7572 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7573 * @systemapi 7574 * @since 14 7575 */ 7576 DOWNLOAD_GENTLE = 1 7577 } 7578 7579 /** 7580 * Cloud media retain type. 7581 * 7582 * @enum { number } CloudMediaRetainType 7583 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7584 * @systemapi 7585 * @since 14 7586 */ 7587 enum CloudMediaRetainType { 7588 /** 7589 * Delete native metadata and thumbnails of cloud-only media assets. 7590 * 7591 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7592 * @systemapi 7593 * @since 14 7594 */ 7595 RETAIN_FORCE = 0 7596 } 7597 7598 /** 7599 * Defines the class of cloud media asset manager. 7600 * 7601 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7602 * @systemapi 7603 * @since 14 7604 */ 7605 class CloudMediaAssetManager { 7606 /** 7607 * Get cloud media asset manager instance. 7608 * 7609 * @param { Context } context - Hap context information 7610 * @returns { CloudMediaAssetManager } Returns cloud media asset manager instance 7611 * @throws { BusinessError } 202 - Called by non-system application 7612 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7613 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7614 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7615 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7616 * @static 7617 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7618 * @systemapi 7619 * @since 14 7620 */ 7621 static getCloudMediaAssetManagerInstance(context: Context): CloudMediaAssetManager; 7622 7623 /** 7624 * Start or resume download cloud media. 7625 * 7626 * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER 7627 * @param { CloudMediaDownloadType } downloadType - cloud media download type. 7628 * @returns { Promise<void> } Returns void 7629 * @throws { BusinessError } 201 - Permission denied 7630 * @throws { BusinessError } 202 - Called by non-system application 7631 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7632 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7633 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7634 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7635 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7636 * @systemapi 7637 * @since 14 7638 */ 7639 startDownloadCloudMedia(downloadType: CloudMediaDownloadType): Promise<void>; 7640 7641 /** 7642 * Pause download cloud media. 7643 * 7644 * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER 7645 * @returns { Promise<void> } Returns void 7646 * @throws { BusinessError } 201 - Permission denied 7647 * @throws { BusinessError } 202 - Called by non-system application 7648 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7649 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7650 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7651 * @systemapi 7652 * @since 14 7653 */ 7654 pauseDownloadCloudMedia(): Promise<void>; 7655 7656 /** 7657 * Cancel download cloud media. 7658 * 7659 * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER 7660 * @returns { Promise<void> } Returns void 7661 * @throws { BusinessError } 201 - Permission denied 7662 * @throws { BusinessError } 202 - Called by non-system application 7663 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7664 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7665 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7666 * @systemapi 7667 * @since 14 7668 */ 7669 cancelDownloadCloudMedia(): Promise<void>; 7670 7671 /** 7672 * Retain cloud media asset. 7673 * 7674 * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER 7675 * @param { CloudMediaRetainType } retainType - cloud media retain type. 7676 * @returns { Promise<void> } Returns void 7677 * @throws { BusinessError } 201 - Permission denied 7678 * @throws { BusinessError } 202 - Called by non-system application 7679 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 7680 * <br>2. Incorrect parameter types; 3. Parameter verification failed. 7681 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7682 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7683 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7684 * @systemapi 7685 * @since 14 7686 */ 7687 retainCloudMediaAsset(retainType: CloudMediaRetainType): Promise<void>; 7688 7689 /** 7690 * Get cloud media asset status. 7691 * 7692 * @permission ohos.permission.READ_IMAGEVIDEO 7693 * @returns { Promise<CloudMediaAssetStatus> } Returns cloud media asset status 7694 * @throws { BusinessError } 201 - Permission denied 7695 * @throws { BusinessError } 202 - Called by non-system application 7696 * @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs. 7697 * <br>Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. 7698 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 7699 * @systemapi 7700 * @since 14 7701 */ 7702 getCloudMediaAssetStatus(): Promise<CloudMediaAssetStatus>; 7703 } 7704} 7705 7706export default photoAccessHelper; 7707