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