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