/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file Helper functions to access image and video assets
* @kit MediaLibraryKit
*/
import type { AsyncCallback, Callback } from './@ohos.base';
import type Context from './application/Context';
import type image from './@ohos.multimedia.image';
import type dataSharePredicates from './@ohos.data.dataSharePredicates';
import type { CustomColors } from './@ohos.arkui.theme';
/**
* Helper functions to access image and video assets
*
* @namespace photoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Helper functions to access image and video assets
*
* @namespace photoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Helper functions to access image and video assets
*
* @namespace photoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
declare namespace photoAccessHelper {
/**
* Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album.
*
* @param { Context } context - Context of the ability instance.
* @returns { PhotoAccessHelper } Instance of PhotoAccessHelper
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @StageModelOnly
* @since 10
*/
/**
* Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album.
*
* @param { Context } context - Context of the ability instance.
* @returns { PhotoAccessHelper } Instance of PhotoAccessHelper
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @StageModelOnly
* @atomicservice
* @since 11
*/
/**
* Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album.
*
* @param { Context } context - Context of the ability instance.
* @returns { PhotoAccessHelper } Instance of PhotoAccessHelper
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @StageModelOnly
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
function getPhotoAccessHelper(context: Context): PhotoAccessHelper;
/**
* Returns an instance of PhotoAccessHelper
*
* @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param { Context } context - Hap context information
* @param { number } userId - Target userId
* @returns { PhotoAccessHelper } Instance of PhotoAccessHelper
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 13900020 - Invalid argument
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @StageModelOnly
* @since 19
*/
function getPhotoAccessHelper(context: Context, userId: number): PhotoAccessHelper;
/**
* Enumerates the types of av file format.
*
* @enum { string } SupportedImageFormat
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
enum SupportedImageFormat {
/**
* jpg format
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
AVFILE_FORMAT_JPG = 'jpg',
}
/**
* Enumerates media file types.
*
* @enum { number } PhotoType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Enumerates media file types.
*
* @enum { number } PhotoType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Enumerates media file types.
*
* @enum { number } PhotoType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum PhotoType {
/**
* Image asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Image asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Image asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
IMAGE = 1,
/**
* Video asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Video asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Video asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
VIDEO = 2
}
/**
* Enumerates the PhotoAsset types.
*
* @enum { number } PhotoSubtype
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Enumerates the PhotoAsset types.
*
* @enum { number } PhotoSubtype
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum PhotoSubtype {
/**
* Default Photo Type
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Default Photo Type
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
DEFAULT = 0,
/**
* Screenshot Photo Type
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
SCREENSHOT = 1,
/**
* Moving Photo Type
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
MOVING_PHOTO = 3,
/**
* Burst Photo Type
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
BURST = 4,
}
/**
* Enumerates the formats for displaying media assets.
*
* @enum { number } DynamicRangeType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum DynamicRangeType {
/**
* Standard dynamic range (SDR).
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
SDR = 0,
/**
* High dynamic range (HDR).
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HDR = 1
}
/**
* Ability to access thumbnail
*
* @enum { number } ThumbnailVisibility
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 14
*/
enum ThumbnailVisibility {
/**
* Unable to access thumbnail
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 14
*/
INVISIBLE = 0,
/**
* able to access thumbnail
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 14
*/
VISIBLE = 1
}
/**
* Enumerates the file locations.
*
* @enum { number } Photo asset position, such as local device or cloud
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Enumerates the file locations.
*
* @enum { number } Photo asset position, such as local device or cloud
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'16','1.2':'20'}
* @arkts 1.1&1.2
*/
enum PositionType {
/**
* Asset exists only in local device
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Asset exists only in local device
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'16','1.2':'20'}
* @arkts 1.1&1.2
*/
LOCAL = 1,
/**
* Stored only on a local device.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Stored only on the cloud.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'16','1.2':'20'}
* @arkts 1.1&1.2
*/
CLOUD = 2,
/**
* Stored both on a local device and cloud.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 16
*/
LOCAL_AND_CLOUD = 3
}
/**
* Analysis type
*
* @enum { number } AnalysisType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum AnalysisType {
/**
* Analysis of aesthetics score
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_AESTHETICS_SCORE = 0,
/**
* Analysis of label
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_LABEL,
/**
* Analysis of ocr
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_OCR,
/**
* Analysis of face
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_FACE,
/**
* Analysis of object
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_OBJECT,
/**
* Analysis of recommendation
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_RECOMMENDATION,
/**
* Analysis of segmentation
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_SEGMENTATION,
/**
* Analysis of composition
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_COMPOSITION,
/**
* Analysis of saliency
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_SALIENCY,
/**
* Analysis of photo detail address info
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_DETAIL_ADDRESS,
/**
* Analysis of human face tag
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_HUMAN_FACE_TAG,
/**
* Analysis of head position
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_HEAD_POSITION,
/**
* Analysis of bone pose
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_BONE_POSE,
/**
* Analysis of video label
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_VIDEO_LABEL,
/**
* Analysis of highlight
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_HIGHLIGHT,
/**
* Analysis of multi crop
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANALYSIS_MULTI_CROP,
/**
* Analysis of search index
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
ANALYSIS_SEARCH_INDEX = 16
}
/**
* Enumerates the types of recommended images.
*
* @enum { number } RecommendationType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum RecommendationType {
/**
* QR_OR_BAR_CODE indicates that QR code or barcode photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
QR_OR_BAR_CODE = 1,
/**
* QR_CODE indicates that QR code photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
QR_CODE = 2,
/**
* BAR_CODE indicates that barcode photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
BAR_CODE = 3,
/**
* ID_CARD indicates that QR code or barcode photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ID_CARD = 4,
/**
* PROFILE_PICTURE indicates that profile picture photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
PROFILE_PICTURE = 5,
/**
* PASSPORT indicates that passport photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
PASSPORT = 6,
/**
* BANK_CARD indicates that bank card photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
BANK_CARD = 7,
/**
* DRIVER_LICENSE indicates that driver license photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
DRIVER_LICENSE = 8,
/**
* DRIVING_LICENSE indicates that driving license photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
DRIVING_LICENSE = 9,
/**
* FEATURED_SINGLE_PORTRAIT indicates that featured single portrait photos can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
FEATURED_SINGLE_PORTRAIT = 10,
/**
* COLOR_STYLE_PHOTO indicates that color style photo can be recommended
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
COLOR_STYLE_PHOTO = 12
}
/**
* Enumerates the asset delivery modes.
*
* @enum { number } DeliveryMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum DeliveryMode {
/**
* Fast mode.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
FAST_MODE = 0,
/**
* High-quality mode.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
HIGH_QUALITY_MODE = 1,
/**
* Balance mode.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
BALANCE_MODE = 2
}
/**
* Enumerates the video transcoding mode.
*
* @enum { number } CompatibleMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
enum CompatibleMode {
/**
* Maintains the original video format.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
ORIGINAL_FORMAT_MODE = 0,
/**
* Converts the HDR content to SDR format.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
COMPATIBLE_FORMAT_MODE = 1
}
/**
* Data handler used to notify the progress of required media asset data
*
* @interface MediaAssetProgressHandler
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
interface MediaAssetProgressHandler {
/**
* Indicates the progress of required media asset data
*
* @param { number } progress - Progress in percentage. Value range: 0 to 100
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
onProgress(progress: number): void;
}
/**
* Enumerates the types of the file to read.
*
* @enum { number } SourceMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum SourceMode {
/**
* Original file.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ORIGINAL_MODE = 0,
/**
* Edited file.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
EDITED_MODE = 1
}
/**
* Enumeration type of permissions for accessing asset uri.
*
* @enum { number } PhotoPermissionType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum PhotoPermissionType {
/**
* Temporary read permission.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
TEMPORARY_READ_IMAGEVIDEO = 0,
/**
* Persistent read permission.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
PERSISTENT_READ_IMAGEVIDEO = 1
}
/**
* Enumerates the types of media resource information to be hidden from an application.
*
* @enum { number } HideSensitiveType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum HideSensitiveType {
/**
* Geographical location and shooting parameters.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HIDE_LOCATION_AND_SHOOTING_PARAM = 0,
/**
* Geographical location information.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HIDE_LOCATION_ONLY = 1,
/**
* Shooting parameters.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HIDE_SHOOTING_PARAM_ONLY = 2,
/**
* Do not hide any information.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
NO_HIDE_SENSITIVE_TYPE = 3
}
/**
* Enumerates the authorization modes.
*
* @enum { number } AuthorizationMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum AuthorizationMode {
/**
* Temporary authorization.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
SHORT_TIME_AUTHORIZATION = 0
}
/**
* Enumerates the watermark editable flags.
*
* @enum { number } WatermarkType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
enum WatermarkType {
/**
* Watermarks are not editable.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
DEFAULT = 0,
/**
* Brand and common watermarks are editable.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
BRAND_COMMON = 1,
/**
* Common watermarks are editable.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
COMMON = 2,
/**
* Brand watermarks are editable.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
BRAND = 3,
}
/**
* Enum: complete button text
*
* @enum { number } CompleteButtonText
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
enum CompleteButtonText {
/**
* Complete button text: done
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
TEXT_DONE = 0,
/**
* Complete button text: send
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
TEXT_SEND = 1,
/**
* Complete button text: add
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'14','1.2':'20'}
* @arkts 1.1&1.2
*/
TEXT_ADD = 2,
}
/**
* Options to request media asset
*
* @interface RequestOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
interface RequestOptions {
/**
* Indicates the delivery mode
*
* @type { DeliveryMode }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
deliveryMode: DeliveryMode;
/**
* Indicates the source mode
*
* @type { ?SourceMode }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
sourceMode?: SourceMode;
/**
* Indicates the compatible mode
*
* @type { ?CompatibleMode }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
compatibleMode?: CompatibleMode;
/**
* data handler used to notify the progress of required media asset data
*
* @type { ?MediaAssetProgressHandler }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'15','1.2':'20'}
* @arkts 1.1&1.2
*/
mediaAssetProgressHandler?: MediaAssetProgressHandler;
}
/**
* Media asset handler, which can be used to customize the media asset processing logic in onDataPrepared.
*
* @interface MediaAssetDataHandler
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
interface MediaAssetDataHandler {
/**
* Indicates required media asset data is prepared
*
* @param { T } data - the returned data of media asset
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
/**
* Indicates required media asset data is prepared
*
* @param { T } data - the returned data of media asset
* @param { Map } [map] - additional information for the data
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
onDataPrepared(data: T, map?: Map): void;
}
/**
* Data handler when quick request image is finished
*
* @typedef QuickImageDataHandler
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
interface QuickImageDataHandler {
/**
* Indicates required media asset data quickly is prepared
*
* @param { T } data - the returned data of picture
* @param { image.ImageSource } imageSource - the returned data of imageSource
* @param { Map } map - additional information for the data
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
onDataPrepared(data: T, imageSource: image.ImageSource, map: Map): void;
}
/**
* Photo proxy object, which is used by the camera application to write image data.
*
* @interface PhotoProxy
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
interface PhotoProxy {}
/**
* A media asset manager class, used for manipulating the read and write operations of media assets.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
/**
* A media asset manager class, used for manipulating the read and write operations of media assets.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 14
*/
class MediaAssetManager {
/**
* Request image
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the image.
* @param { MediaAssetDataHandler } dataHandler - Media asset handler, which invokes a callback to return the image when the requested image is ready.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
static requestImage(
context: Context,
asset: PhotoAsset,
requestOptions: RequestOptions,
dataHandler: MediaAssetDataHandler
): Promise;
/**
* Requests an image quickly.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the image.
* @param { QuickImageDataHandler } dataHandler - Media asset handler, which invokes a callback to return the image when the requested image is ready.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 13
*/
static quickRequestImage(
context: Context,
asset: PhotoAsset,
requestOptions: RequestOptions,
dataHandler: QuickImageDataHandler
): Promise;
/**
* Requests image data.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the image.
* @param { MediaAssetDataHandler } dataHandler - Media asset handler, which invokes a callback to return the image when the requested image is ready.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
static requestImageData(
context: Context,
asset: PhotoAsset,
requestOptions: RequestOptions,
dataHandler: MediaAssetDataHandler
): Promise;
/**
* Requests a moving photo object, which can be used to request the asset data of the moving photo.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the image.
* @param { MediaAssetDataHandler } dataHandler - Media asset handler, which invokes a callback to return the image when the requested image is ready.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Requests a moving photo object, which can be used to request the asset data of the moving photo.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the image.
* @param { MediaAssetDataHandler } dataHandler - Media asset handler, which invokes a callback to return the image when the requested image is ready.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 18
*/
static requestMovingPhoto(
context: Context,
asset: PhotoAsset,
requestOptions: RequestOptions,
dataHandler: MediaAssetDataHandler
): Promise;
/**
* Cancels a request for the asset, the callback of which has not been triggered yet.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { string } requestId - ID of the request to cancel. It is a valid request ID returned by requestImage.
* @returns { Promise } Returns void
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
static cancelRequest(context: Context, requestId: string): Promise;
/**
* Request video file
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the video asset.
* @param { string } fileUri - the destination file uri to save the video data
* @param { MediaAssetDataHandler } dataHandler - Media asset handler. When the requested video is written to the specified directory, a callback is triggered.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Request video file
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { Context } context - Context of the ability instance.
* @param { PhotoAsset } asset - Image to request.
* @param { RequestOptions } requestOptions - Options for requesting the video asset.
* @param { string } fileUri - the destination file uri to save the video data
* @param { MediaAssetDataHandler } dataHandler - Media asset handler. When the requested video is written to the specified directory, a callback is triggered.
* @returns { Promise } Returns request id
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 14000011 - System inner fail
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 15
*/
static requestVideoFile(
context: Context,
asset: PhotoAsset,
requestOptions: RequestOptions,
fileUri: string,
dataHandler: MediaAssetDataHandler
): Promise;
/**
* Load moving photo
*
* @param { Context } context - AbilityContext or UIExtensionContext instance.
* @param { string } imageFileUri - image file uri of the moving photo to be loaded
* @param { string } videoFileUri - video file uri of the moving photo to be loaded
* @returns { Promise } Returns moving photo
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Load moving photo
*
* @param { Context } context - AbilityContext or UIExtensionContext instance.
* @param { string } imageFileUri - image file uri of the moving photo to be loaded
* @param { string } videoFileUri - video file uri of the moving photo to be loaded
* @returns { Promise } Returns moving photo
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @static
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 14
*/
static loadMovingPhoto(
context: Context,
imageFileUri: string,
videoFileUri: string
): Promise;
}
/**
* Indicates the type of photo asset member.
*
* @typedef { number | string | boolean } MemberType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Indicates the type of photo asset member.
*
* @typedef { number | string | boolean } MemberType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
type MemberType = number | string | boolean;
/**
* Provides APIs for encapsulating file asset attributes.
*
* @interface PhotoAsset
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Provides APIs for encapsulating file asset attributes.
*
* @interface PhotoAsset
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Provides APIs for encapsulating file asset attributes.
*
* @interface PhotoAsset
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
interface PhotoAsset {
/**
* uri of the asset.
*
* @type { string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* uri of the asset.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly uri: string;
/**
* Photo type, image or video
*
* @type { PhotoType }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Photo type, image or video
*
* @type { PhotoType }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Photo type, image or video
*
* @type { PhotoType }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly photoType: PhotoType;
/**
* Display name (with a file name extension) of the asset.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Display name (with a file name extension) of the asset.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Display name (with a file name extension) of the asset.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly displayName: string;
/**
* Obtains a PhotoAsset member parameter.
*
* @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE)
* @returns { MemberType } Returns the value of the specified photo asset member
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000014 - The provided member must be a property name of PhotoKey.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains a PhotoAsset member parameter.
*
* @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE)
* @returns { MemberType } Returns the value of the specified photo asset member
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000014 - The provided member must be a property name of PhotoKey.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains a PhotoAsset member parameter.
*
* @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE)
* @returns { MemberType } Returns the value of the specified photo asset member
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000014 - The provided member must be a property name of PhotoKey.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
get(member: string): MemberType;
/**
* Sets a PhotoAsset member parameter.
*
* @param { string } member - Photo asset member
* @param { string } value - The new value of the member.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000014 - The provided member must be a property name of PhotoKey.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
* @example : set(PhotoKeys.TITLE, "newTitle"), call commitModify after set
*/
set(member: string, value: string): void;
/**
* Commits the modification on the file metadata to the database. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Commits the modification on the file metadata to the database. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
commitModify(callback: AsyncCallback): void;
/**
* Commits the modification on the file metadata to the database. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Commits the modification on the file metadata to the database. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
commitModify(): Promise;
/**
* Open the asset
*
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.WRITE_IMAGEVIDEO
* @param { string } mode - Mode for open, for example: rw, r, w.
* @param { AsyncCallback } callback - Callback return the fd of the asset.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#open
*/
open(mode: string, callback: AsyncCallback): void;
/**
* Open the asset
*
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.WRITE_IMAGEVIDEO
* @param { string } mode - Mode for open, for example: rw, r, w.
* @returns { Promise } Returns the fd
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#open
*/
open(mode: string): Promise;
/**
* Opens this file in read-only mode. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the file descriptor (FD) of the file opened.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#open
*/
getReadOnlyFd(callback: AsyncCallback): void;
/**
* Opens this file in read-only mode. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns the read only fd
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#open
*/
getReadOnlyFd(): Promise;
/**
* Closes a file. This API uses an asynchronous callback to return the result.
*
* @param { number } fd - FD of the file to close.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#close
*/
close(fd: number, callback: AsyncCallback): void;
/**
* Closes a file. This API uses a promise to return the result.
*
* @param { number } fd - FD of the file to close.
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead ohos.file.fs/fileIo#close
*/
close(fd: number): Promise;
/**
* Obtains the thumbnail of this file. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the PixelMap of the thumbnail.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
getThumbnail(callback: AsyncCallback): void;
/**
* Obtains the file thumbnail of the given size. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { image.Size } size - Size of the thumbnail.
* @param { AsyncCallback } callback - Callback used to return the PixelMap of the thumbnail.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
getThumbnail(size: image.Size, callback: AsyncCallback): void;
/**
* Obtains the file thumbnail of the given size. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { image.Size } [size] - Size of the thumbnail.
* @returns { Promise } Returns the thumbnail's pixelMap.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
getThumbnail(size?: image.Size): Promise;
/**
* Obtains the ArrayBuffer of a file thumbnail by specifying its type. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { ThumbnailType } type - Type of the thumbnail.
* @returns { Promise } Returns the thumbnail's ArrayBuffer.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs.
*
Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
getThumbnailData(type: ThumbnailType): Promise;
/**
* Favorites or unfavorites this file. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } favoriteState - Operation to perform. The value true means to favorite the file asset, and false means the opposite.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setFavorite
*/
setFavorite(favoriteState: boolean, callback: AsyncCallback): void;
/**
* Favorites or unfavorites this file asset. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } favoriteState - Operation to perform. The value true means to favorite the file asset, and false means the opposite.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setFavorite
*/
setFavorite(favoriteState: boolean): Promise;
/**
* Sets this file to hidden state. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } hiddenState - Whether to set a file to hidden state. The value true means to hide the file; the value false means the opposite.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setHidden
*/
setHidden(hiddenState: boolean, callback: AsyncCallback): void;
/**
* Sets this file asset to hidden state. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } hiddenState - Whether to set a file to hidden state. The value true means to hide the file; the value false means the opposite.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setHidden
*/
setHidden(hiddenState: boolean): Promise;
/**
* Sets user comment information of an image or video. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } userComment - User comment information to set.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setUserComment
*/
setUserComment(userComment: string, callback: AsyncCallback): void;
/**
* Sets user comment information of an image or video. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } userComment - User comment information to set.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAssetChangeRequest#setUserComment
*/
setUserComment(userComment: string): Promise;
/**
* Obtains the exchangeable image file format (EXIF) data from a JPG image. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the EXIF data, in JSON strings.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
getExif(callback: AsyncCallback): void;
/**
* Obtains analysis data. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AnalysisType } analysisType - Smart analysis type.
* @returns { Promise } Returns analysis info into a json string
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
getAnalysisData(analysisType: AnalysisType): Promise;
/**
* Obtains the exchangeable image file format (EXIF) data from a JPG image. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns exif info into a json string
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
getExif(): Promise;
/**
* Sets the pending state for this image or video asset. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } pendingState - Whether to set the file to pending state. The value true means to set the file to pending state, and the value false means to remove the pending state.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
setPending(pendingState: boolean, callback: AsyncCallback): void;
/**
* Sets the pending state for this image or video asset. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { boolean } pendingState - Whether to set the file to pending state. The value true means to set the file to pending state, and the value false means to remove the pending state.
* @returns { Promise } Returns void
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
setPending(pendingState: boolean): Promise;
/**
* Checks whether this image or video asset is edited. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the result. The value true means that the image or video asset is edited, and false means the opposite. The default value is false.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
isEdited(callback: AsyncCallback): void;
/**
* Checks whether this image or video asset is edited. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns whether the asset has been edited.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
isEdited(): Promise;
/**
* Obtains the edit data of this image or video asset. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the edit data obtained.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestEditData(callback: AsyncCallback): void;
/**
* Obtains the edit data of this image or video asset. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns asset edit data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestEditData(): Promise;
/**
* Obtains the edited data of this asset. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns media asset edit data
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
getEditData(): Promise;
/**
* Clone asset.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } title - The title of asset.
* @returns { Promise } Returns asset
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error. It is recommended to retry and check the logs.
*
Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 14
*/
clone(title: string): Promise;
/**
* Copy a picture in the same album and convert it to a specified format.
* The album here refers to the album created by user or application album.
* The API supports media types include normal picture, moving(only picture part), and burst photo, but video is not include.
* The API supports image format include heif and heic.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } title - The new image title.
* @param { SupportedImageFormat } imageFormat - The target image format.
* @returns { Promise } Returns the new PhotoAsset.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 23800151 - Scene parameters validate failed, possible causes:
* 1. The original file does not exist locally in PhotoAsset;
* 2. The original file format is not within the supported range;
* 3. The original file is a temporary file or is being edited;
* 4. The title is the same with an image in the same album;
* 5. PhotoAsset is a photo in the trash or a hidden photo;
* 6. The title does not meet the parameter specifications.
* @throws { BusinessError } 23800301 - Internal system error. It is recommended to retry and check the
* kogs. Possible causes:
* 1. Database corrupted. 2. The file system is abnormal. 3. The IPC request timed out.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
convertImageFormat(title: string, imageFormat: SupportedImageFormat): Promise;
/**
* Opens the source file to obtain the FD. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback used to return the FD.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestSource(callback: AsyncCallback): void;
/**
* Opens the source file to obtain the FD. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns opened source asset fd.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestSource(): Promise;
/**
* Commits the edited image or video asset. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } editData - New data to commit.
* @param { string } uri - URI of the committed image or video in the application sandbox.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
commitEditedAsset(editData: string, uri: string, callback: AsyncCallback): void;
/**
* Commits the edited image or video asset. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } editData - New data to commit.
* @param { string } uri - URI of the committed image or video in the application sandbox.
* @returns { Promise } Returns void.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
commitEditedAsset(editData: string, uri: string): Promise;
/**
* Reverts to the state of the file before being edited. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
revertToOriginal(callback: AsyncCallback): void;
/**
* Reverts to the state of the file before being edited. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @returns { Promise } Returns void.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
revertToOriginal(): Promise;
/**
* Obtains the quick thumbnail and quality thumbnail of this asset. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AsyncCallback } callback - Callback invoked twice to return the quick and quality thumbnails obtained.
* @returns { string } Returns request photo task id.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestPhoto(callback: AsyncCallback): string;
/**
* Obtains the thumbnails of an asset based on the specified options. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { RequestPhotoOptions } options - Options for obtaining the asset thumbnail.
* @param { AsyncCallback } callback - Callback used to return the thumbnails obtained. The callback may be invoked more than once, depending on options.
* @returns { string } Returns request photo task id.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string;
/**
* Cancels a task for obtaining media thumbnails.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { string } requestId - ID of the task to cancel.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
cancelPhotoRequest(requestId: string): void;
/**
* Obtains the thumbnail of the specified type for the key frame. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { number } beginFrameTimeMs - Time of the start frame, in ms. The value 0 indicates the cover frame.
* @param { ThumbnailType } type - Type of the thumbnail.
* @returns { Promise } Returns the thumbnail's pixelMap.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
getKeyFrameThumbnail(beginFrameTimeMs: number, type: ThumbnailType): Promise;
}
/**
* Enumeration of photo asset members
*
* @enum { string } PhotoKeys
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Enumeration of photo asset members
*
* @enum { string } PhotoKeys
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Enumeration of photo asset members
*
* @enum { string } PhotoKeys
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
enum PhotoKeys {
/**
* Asset uri, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Asset uri, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Asset uri, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
URI = 'uri',
/**
* Photo type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Photo type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Photo type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
PHOTO_TYPE = 'media_type',
/**
* Asset name, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Asset name, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Asset name, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DISPLAY_NAME = 'display_name',
/**
* Size of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Size of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Size of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
SIZE = 'size',
/**
* Creation date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Creation date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Creation date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_ADDED = 'date_added',
/**
* Modified date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Modified date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Modified date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
DATE_MODIFIED = 'date_modified',
/**
* Duration of video files, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Duration of video files, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Duration of video files, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DURATION = 'duration',
/**
* Width of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Width of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Width of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
WIDTH = 'width',
/**
* Height of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Height of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Height of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
HEIGHT = 'height',
/**
* Date taken of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Date taken of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Date taken of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_TAKEN = 'date_taken',
/**
* Orientation of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Orientation of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Orientation of the image asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
ORIENTATION = 'orientation',
/**
* Favorite state of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Favorite state of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Favorite state of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
FAVORITE = 'is_favorite',
/**
* Title of the asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Title of the asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Title of the asset
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
TITLE = 'title',
/**
* Asset position, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
*/
/**
* Asset position, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 16
*/
/**
* Asset position, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
POSITION = 'position',
/**
* Trashed date of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_TRASHED = 'date_trashed',
/**
* Hidden state of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
HIDDEN = 'hidden',
/**
* User comment info
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
USER_COMMENT = 'user_comment',
/**
* Camera shot key
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
CAMERA_SHOT_KEY = 'camera_shot_key',
/**
* The year of the file created, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_YEAR = 'date_year',
/**
* The month of the file created, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_MONTH = 'date_month',
/**
* The day of the file created, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_DAY = 'date_day',
/**
* Pending state of the asset, true means asset is pending, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
PENDING = 'pending',
/**
* Creation time of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Creation time of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_ADDED_MS = 'date_added_ms',
/**
* Modified time of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Modified time of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_MODIFIED_MS = 'date_modified_ms',
/**
* Trashed time of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_TRASHED_MS = 'date_trashed_ms',
/**
* Photo subtype of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Photo subtype of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
PHOTO_SUBTYPE = 'subtype',
/**
* Effect mode of moving photo, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
MOVING_PHOTO_EFFECT_MODE = 'moving_photo_effect_mode',
/**
* Dynamic range type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Dynamic range type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DYNAMIC_RANGE_TYPE = 'dynamic_range_type',
/**
* Cover position of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Cover position of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
COVER_POSITION = 'cover_position',
/**
* Unique uuid of the burst photos, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Unique uuid of the burst photos, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
BURST_KEY = 'burst_key',
/**
* Thumbnail of photo asset has been ready, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
THUMBNAIL_READY = 'thumbnail_ready',
/**
* Width and height information of lcd picture, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Width and height information of lcd picture, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
LCD_SIZE = 'lcd_size',
/**
* Width and height information of thumbnail picture, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Width and height information of thumbnail picture, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
THM_SIZE = 'thm_size',
/**
* Detail time of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 13
*/
/**
* Detail time of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DETAIL_TIME = 'detail_time',
/**
* Date taken of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 13
*/
/**
* Date taken of the asset in milliseconds, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_TAKEN_MS = 'date_taken_ms',
/**
* Cloud enhancement status of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
CE_AVAILABLE = 'ce_available',
/**
* watermark type of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 14
*/
SUPPORTED_WATERMARK_TYPE = 'supported_watermark_type',
/**
* visibility of thumbnails
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 14
*/
THUMBNAIL_VISIBLE = 'thumbnail_visible',
/**
* Whether the photo supports auto cloud enhancement task, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
IS_CE_AUTO = 'is_auto',
/**
* Owner album id of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
OWNER_ALBUM_ID = 'owner_album_id',
/**
* Recentshow state of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
IS_RECENT_SHOW = 'is_recent_show',
/**
* Suffix of the asset, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 18
*/
MEDIA_SUFFIX = 'media_suffix',
/**
* total size of assets, read only
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 19
*/
SUM_SIZE = 'sum(size)',
/**
* orientation in exif
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
EXIF_ROTATE = 'exif_rotate'
}
/**
* Enumerates the key album attributes.
*
* @enum { string } AlbumKeys
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Enumerates the key album attributes.
*
* @enum { string } AlbumKeys
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum AlbumKeys {
/**
* URI of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* URI of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* URI of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
URI = 'uri',
/**
* Name of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Name of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ALBUM_NAME = 'album_name',
/**
* Virtual path of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
ALBUM_LPATH = 'lpath',
/**
* Bundle name of the album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
BUNDLE_NAME = 'bundle_name',
/**
* Timestamp when the album was modified, in milliseconds.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'18','1.2':'20'}
* @arkts 1.1&1.2
*/
DATE_MODIFIED = 'date_modified',
/**
* album cover uri source
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
COVER_URI_SOURCE = 'cover_uri_source'
}
/**
* Enumerates the display modes of hidden files in the system.
*
* @enum { number } HiddenPhotosDisplayMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum HiddenPhotosDisplayMode {
/**
* Display all hidden files in the system.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ASSETS_MODE,
/**
* Display hidden files by album (display all albums that contain hidden files in the system, excluding the preset hidden album and the albums in the trash).
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
ALBUMS_MODE
}
/**
* Defines the options for fetching media files.
*
* @interface FetchOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Defines the options for fetching media files.
*
* @interface FetchOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Defines the options for fetching media files.
*
* @interface FetchOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
interface FetchOptions {
/**
* Indicates the members to query.
*
* @type { Array }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Indicates the members to query.
*
* @type { Array }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Indicates the members to query.
*
* @type { Array }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
fetchColumns: Array;
/**
* Predicates that specify the fetch criteria.
*
* @type { dataSharePredicates.DataSharePredicates }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Predicates that specify the fetch criteria.
*
* @type { dataSharePredicates.DataSharePredicates }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Predicates that specify the fetch criteria.
*
* @type { dataSharePredicates.DataSharePredicates }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
predicates: dataSharePredicates.DataSharePredicates;
}
/**
* Options for creating an image or video asset.
*
* @interface PhotoCreateOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
interface PhotoCreateOptions {
/**
* Specify subtype of the asset to create
*
* @type { ?PhotoSubtype }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
subtype?: PhotoSubtype;
/**
* Camera shot key
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
cameraShotKey?: string;
/**
* User id
*
* @type { ?number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 19
*/
userId?: number;
}
/**
* Config to create photo asset
*
* @interface PhotoCreationConfig
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
interface PhotoCreationConfig {
/**
* Title of the asset
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
title?: string;
/**
* Extension of the asset
*
* @type { string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
fileNameExtension: string;
/**
* Specify photo type of the asset to create, include image or video
*
* @type { PhotoType }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
photoType: PhotoType;
/**
* Specify photo subtype of the asset to create, include default or moving_photo
*
* @type { ?PhotoSubtype }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
subtype?: PhotoSubtype;
}
/**
* Options for creating an image or video asset.
*
* @interface CreateOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Options for creating an image or video asset.
*
* @interface CreateOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
interface CreateOptions {
/**
* Title of the asset
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Title of the asset
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
title?: string;
/**
* Specify subtype of the asset to create
*
* @type { ?PhotoSubtype }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
subtype?: PhotoSubtype;
}
/**
* Defines the options for obtaining the thumbnail of an image or video.
*
* @interface RequestPhotoOptions
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
interface RequestPhotoOptions {
/**
* Size of the thumbnail to obtain.
*
* @type { ?image.Size }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
size?: image.Size;
/**
* Operation to perform.
*
* @type { ?RequestPhotoType }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
requestPhotoType?: RequestPhotoType;
}
/**
* Defines the application information provided to create assets on behalf of the application.
*
* @interface PhotoCreationSource
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
interface PhotoCreationSource {
/**
* Bundle name of the target application
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
bundleName?: string;
/**
* Name of the target application
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
appName?: string;
/**
* ID of the target application
*
* @type { ?string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
appId?: string;
/**
* Token ID of the target application
*
* @type { ?number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
tokenId?: number;
}
/**
* Provides APIs to manage the file retrieval result.
*
* @interface FetchResult
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Provides APIs to manage the file retrieval result.
*
* @interface FetchResult
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Provides APIs to manage the file retrieval result.
*
* @interface FetchResult
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
interface FetchResult {
/**
* Obtains the total number of files in the result set.
*
* @returns { number } Total number of objects.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the total number of files in the result set.
*
* @returns { number } Total number of objects.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the total number of objects in the fetch result.
*
* @returns { number } Total number of objects.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getCount(): number;
/**
* Checks whether the cursor is in the last row of the result set.
* You need to check whether the object is the last one before calling getNextObject.
*
* @returns { boolean } Whether the object is the last one in the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Checks whether the cursor is in the last row of the result set.
* You need to check whether the object is the last one before calling getNextObject.
*
* @returns { boolean } Whether the object is the last one in the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Checks whether the result set points to the last row.
* You need to check whether the object is the last one before calling getNextObject.
*
* @returns { boolean } Whether the object is the last one in the fetch result.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
*/
isAfterLast(): boolean;
/**
* Obtains the first file asset in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback } callback - Callback used to return the first file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the first file asset in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback } callback - Callback used to return the first file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the first object in the fetch result.
*
* @param { AsyncCallback } callback - Callback used to return the first file asset obtained.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getFirstObject(callback: AsyncCallback): void;
/**
* Obtains the first file asset in the result set. This API uses a promise to return the result.
*
* @returns { Promise } Returns the first object in the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the first file asset in the result set. This API uses a promise to return the result.
*
* @returns { Promise } Returns the first object in the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the first object in the fetch result.
*
* @returns { Promise } Returns the first object in the fetch result.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getFirstObject(): Promise;
/**
* Obtains the next file asset in the result set. This API uses an asynchronous callback to return the result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
*
* @param { AsyncCallback } callback - Callback used to return the next file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the next file asset in the result set. This API uses an asynchronous callback to return the result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
*
* @param { AsyncCallback } callback - Callback used to return the next file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the next object in the fetch result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
* in the fetch result. This method only works when the current position is not the last row.
*
* @param { AsyncCallback } callback - Callback used to return the next file asset obtained.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getNextObject(callback: AsyncCallback): void;
/**
* Obtains the next file asset in the result set. This API uses a promise to return the result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
*
* @returns { Promise } Returns the next object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the next file asset in the result set. This API uses a promise to return the result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
*
* @returns { Promise } Returns the next object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the next object in the fetch result.
* Before using this API, you must use isAfterLast() to check whether the current position is the end of the result set.
* in the fetch result. This method only works when the current position is not the last row.
*
* @returns { Promise } Returns the next object
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getNextObject(): Promise;
/**
* Obtains the last file asset in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback } callback - Callback used to return the last file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the last file asset in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback } callback - Callback used to return the last file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the last object asset in the fetch result.
*
* @param { AsyncCallback } callback - Callback used to return the last file asset obtained.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
*/
getLastObject(callback: AsyncCallback): void;
/**
* Obtains the last file asset in the result set. This API uses a promise to return the result.
*
* @returns { Promise } Returns the last object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains the last file asset in the result set. This API uses a promise to return the result.
*
* @returns { Promise } Returns the last object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the last object asset in the fetch result.
*
* @returns { Promise } Returns the last object
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
*/
getLastObject(): Promise;
/**
* Obtains a file asset with the specified index in the result set. This API uses an asynchronous callback to return the result.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @param { AsyncCallback } callback - Callback used to return the file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains a file asset with the specified index in the result set. This API uses an asynchronous callback to return the result.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @param { AsyncCallback } callback - Callback used to return the file asset obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the object with the specified index in the result set.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @param { AsyncCallback } callback - Callback used to return the file asset obtained.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getObjectByPosition(index: number, callback: AsyncCallback): void;
/**
* Obtains a file asset with the specified index in the result set. This API uses a promise to return the result.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @returns { Promise } Returns the object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains a file asset with the specified index in the result set. This API uses a promise to return the result.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @returns { Promise } Returns the object
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains the object with the specified index in the result set.
*
* @param { number } index - Index of the file asset to obtain. The value starts from 0.
* @returns { Promise } Returns the object
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getObjectByPosition(index: number): Promise;
/**
* Obtains all the file assets in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback> } callback - Callback used to return an array of all file assets in the result set.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains all the file assets in the result set. This API uses an asynchronous callback to return the result.
*
* @param { AsyncCallback> } callback - Callback used to return an array of all file assets in the result set.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains all objects in the fetch result.
*
* @param { AsyncCallback> } callback - Callback used to return an array of all file assets in the result set.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getAllObjects(callback: AsyncCallback>): void;
/**
* Obtains all the file assets in the result set. This API uses a promise to return the result.
*
* @returns { Promise> } Returns all the objects
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains all the file assets in the result set. This API uses a promise to return the result.
*
* @returns { Promise> } Returns all the objects
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Obtains all objects in the fetch result.
*
* @returns { Promise> } Returns all the objects
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getAllObjects(): Promise>;
/**
* Closes this FetchResult instance to invalidate it. After this instance is released, the APIs in this instance cannot be invoked.
*
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Closes this FetchResult instance to invalidate it. After this instance is released, the APIs in this instance cannot be invoked.
*
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Release the fetch result.
*
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
close(): void;
}
/**
* Enumerates the album types.
*
* @enum { number } AlbumType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Enumerates the album types.
*
* @enum { number } AlbumType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum AlbumType {
/**
* User album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* User album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
USER = 0,
/**
* System album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* System album.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
SYSTEM = 1024,
/**
* Album created by app.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
SOURCE = 2048,
/**
* Album created by smart abilities.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
SMART = 4096
}
/**
* Enumerate the album subtypes.
*
* @enum { number } AlbumSubtype
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Enumerate the album subtypes.
*
* @enum { number } AlbumSubtype
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
enum AlbumSubtype {
/**
* Generic user-created albums.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Generic user-created albums.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
USER_GENERIC = 1,
/**
* Favorite album, which assets are marked as favorite.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Favorite album, which assets are marked as favorite.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
FAVORITE = 1025,
/**
* Video album, which contains all video assets.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Video album, which contains all video assets.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
VIDEO,
/**
* Hidden album, which assets are marked as hidden.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
HIDDEN,
/**
* Trash album, which assets are deleted.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
TRASH,
/**
* Screenshot album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
SCREENSHOT,
/**
* Camera album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
CAMERA,
/**
* Image album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
/**
* Image album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
IMAGE = 1031,
/**
* Cloud Enhancement album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
CLOUD_ENHANCEMENT = 1032,
/**
* Source album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
SOURCE_GENERIC = 2049,
/**
* Classify album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
CLASSIFY = 4097,
/**
* Location album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
GEOGRAPHY_LOCATION = 4099,
/**
* City album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
GEOGRAPHY_CITY,
/**
* ShootingMode album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
SHOOTING_MODE,
/**
* Portrait album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
PORTRAIT,
/**
* Group photo album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
GROUP_PHOTO,
/**
* Highlight album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HIGHLIGHT = 4104,
/**
* Highlight suggestions album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
HIGHLIGHT_SUGGESTIONS,
/**
* Any album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Any album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
ANY = 2147483647
}
/**
* Enumerates the types of the operation for obtaining image or video thumbnails.
*
* @enum { number } RequestPhotoType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
enum RequestPhotoType {
/**
* Obtain both the quick thumbnail and the quality thumbnail.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
REQUEST_ALL_THUMBNAILS = 0,
/**
* Obtain only the quick thumbnail.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
REQUEST_FAST_THUMBNAIL,
/**
* Obtain only the quality thumbnail.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
REQUEST_QUALITY_THUMBNAIL
}
/**
* Enumerates source types of cover uri.
*
* @enum { number } CoverUriSource
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
enum CoverUriSource {
/**
* Default album cover.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
DEFAULT_COVER = 0,
/**
* Manually set cover uri.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
MANUAL_COVER = 1
}
/**
* Defines the abstract interface of albums.
*
* @interface AbsAlbum
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Defines the abstract interface of albums.
*
* @interface AbsAlbum
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
interface AbsAlbum {
/**
* Album type
*
* @type { AlbumType }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Album type
*
* @type { AlbumType }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly albumType: AlbumType;
/**
* Album subtype
*
* @type { AlbumSubtype }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Album subtype
*
* @type { AlbumSubtype }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly albumSubtype: AlbumSubtype;
/**
* Album name.
*
* @type { string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Album name.
*
* @type { string }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
albumName: string;
/**
* Album uri.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Album uri.
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly albumUri: string;
/**
* Number of assets in the album
*
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Number of assets in the album
*
* @type { number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly count: number;
/**
* Cover uri for the album
*
* @type { string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly coverUri: string;
/**
* Lpath for the album, one album has a virtual path
*
* @type { ?string }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
readonly lpath?: string;
/**
* Album cover uri source
*
* @type { ?CoverUriSource }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
* @arkts 1.1&1.2
*/
readonly coverUriSource?: CoverUriSource;
/**
* Obtains image and video assets. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @param { AsyncCallback> } callback - Callback used to return the image and video assets obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains image and video assets. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @param { AsyncCallback> } callback - Callback used to return the image and video assets obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
getAssets(options: FetchOptions, callback: AsyncCallback>): void;
/**
* Fetch assets in an album.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Fetch options.
* @returns { Promise> } Returns the fetch result
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Fetch assets in an album.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Fetch options.
* @returns { Promise> } Returns the fetch result
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Fetch assets in an album.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Fetch options.
* @returns { Promise> } Returns the fetch result
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getAssets(options: FetchOptions): Promise>;
/**
* Fetch shared photo assets in an album.
*
* @permission ohos.permission.ACCESS_MEDIALIB_THUMB_DB
* @param { FetchOptions } options - Fetch options.
* @returns { Array } Returns the shared photo assets
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 13
*/
getSharedPhotoAssets(options: FetchOptions): Array;
}
/**
* Enumeration change types of data change.
*
* @enum { number } NotifyChangeType
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 20
*/
enum NotifyChangeType {
/**
* Data(assets or albums) have been newly created.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 20
*/
NOTIFY_CHANGE_ADD = 0,
/**
* Data(assets or albums) have been modified.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 20
*/
NOTIFY_CHANGE_UPDATE = 1,
/**
* Data(assets or albums) have been removed.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 20
*/
NOTIFY_CHANGE_REMOVE = 2,
}
/**
* Defines the album.
*
* @extends AbsAlbum
* @interface Album
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Defines the album.
*
* @extends AbsAlbum
* @interface Album
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
interface Album extends AbsAlbum {
/**
* Number of image assets in the album
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
/**
* Number of image assets in the album
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly imageCount?: number;
/**
* Number of video assets in the album
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
/**
* Number of video assets in the album
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
readonly videoCount?: number;
/**
* Album dateAdded
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
readonly dateAdded?: number;
/**
* Album dateModified
*
* @type { ?number }
* @readonly
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 18
*/
readonly dateModified?: number;
/**
* Modify metadata for the album
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { AsyncCallback } callback - Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
commitModify(callback: AsyncCallback): void;
/**
* Modify metadata for the album
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
commitModify(): Promise;
/**
* Adds image and video assets to an album. Before the operation, ensure that the image and video assets to add and the album exist.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image and video assets to add.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#addAssets
*/
addAssets(assets: Array, callback: AsyncCallback): void;
/**
* Adds image and video assets to an album. Before the operation, ensure that the image and video assets to add and the album exist.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image and video assets to add.
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#addAssets
*/
addAssets(assets: Array): Promise;
/**
* Removes image and video assets from an album. The album and file resources must exist.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image and video assets to remove.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#removeAssets
*/
removeAssets(assets: Array, callback: AsyncCallback): void;
/**
* Removes image and video assets from an album. The album and file resources must exist.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image and video assets to remove.
* @returns { Promise } Returns void
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#removeAssets
*/
removeAssets(assets: Array): Promise;
/**
* Recovers image or video assets from the trash. Before the operation, ensure that the image or video assets exist in the trash.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image or video assets to recover.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#recoverAssets
*/
recoverAssets(assets: Array, callback: AsyncCallback): void;
/**
* Recovers image or video assets from the trash. Before the operation, ensure that the image or video assets exist in the trash.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image or video assets to recover.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#recoverAssets
*/
recoverAssets(assets: Array): Promise;
/**
* Deletes image or video assets from the trash. Before the operation, ensure that the image or video assets exist in the trash.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image or video assets to delete.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAssets
*/
deleteAssets(assets: Array, callback: AsyncCallback): void;
/**
* Deletes image or video assets from the trash. Before the operation, ensure that the image or video assets exist in the trash.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } assets - Array of the image or video assets to delete.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAssets
*/
deleteAssets(assets: Array): Promise;
/**
* Sets the album cover. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } uri - URI of the file to be set as the album cover.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#setCoverUri
*/
setCoverUri(uri: string, callback: AsyncCallback): void;
/**
* Sets the album cover. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } uri - URI of the file to be set as the album cover.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#setCoverUri
*/
setCoverUri(uri: string): Promise;
/**
* Obtains the face identifier on the cover of a portrait album or group photo album.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @returns { Promise } Returns tag_id if portrait album, Returns group_tag if group photo album,
*
Returns empty if not found.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 202 - Called by non-system application
* @throws { BusinessError } 14000011 - Internal system error
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'13','1.2':'20'}
* @arkts 1.1&1.2
*/
getFaceId(): Promise;
}
/**
* Defines the album order.
*
* @interface AlbumOrder
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
interface AlbumOrder {
/**
* The album id of album asset
*
* @type { number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
albumId: number;
/**
* The album order of album asset
*
* @type { number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
albumOrder: number;
/**
* The order section of album asset
*
* @type { number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
orderSection: number;
/**
* The order type of album asset
*
* @type { number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
orderType: number;
/**
* The order status of album asset
*
* @type { number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 20
*/
orderStatus: number;
}
/**
* Helper functions to access photos and albums.
*
* @interface PhotoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Helper functions to access photos and albums.
*
* @interface PhotoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 11
*/
/**
* Helper functions to access photos and albums.
*
* @interface PhotoAccessHelper
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
interface PhotoAccessHelper {
/**
* Obtains image and video assets. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @param { AsyncCallback> } callback - Callback used to return the image and video assets obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains image and video assets. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @param { AsyncCallback> } callback - Callback used to return the image and video assets obtained.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
getAssets(options: FetchOptions, callback: AsyncCallback>): void;
/**
* Obtains image and video assets. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @returns { Promise> } Returns the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains image and video assets. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @returns { Promise> } Returns the fetch result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since 12
*/
/**
* Fetch photo assets
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { FetchOptions } options - Options for fetching the image and video assets.
* @returns { Promise> } Returns the fetch result.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.1&1.2
*/
getAssets(options: FetchOptions): Promise>;
/**
* Obtains burst assets. This API uses a promise to return the result.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { string } burstKey - UUID of a set of burst photos (BURST_KEY of PhotoKeys). The value is a string of 36 characters.
* @param { FetchOptions } options - Options for fetching the burst photos.
* @returns { Promise> } Returns the fetch result.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 14000011 - Internal system error
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 12
*/
/**
* Fetch a group of burst assets
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { string } burstKey - UUID of a set of burst photos (BURST_KEY of PhotoKeys). The value is a string of 36 characters.
* @param { FetchOptions } options - Options for fetching the burst photos.
* @returns { Promise> } Returns the fetch result.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 14000011 - Internal system error
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'20','1.2':'20'}
* @arkts 1.1&1.2
*/
getBurstAssets(burstKey: string, options: FetchOptions): Promise>;
/**
* Creates an image or video asset with the specified file name. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } displayName - File name of the image or video to create.
* @param { AsyncCallback } callback - File name of the image or video to create.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(displayName: string, callback: AsyncCallback): void;
/**
* Creates an image or video asset with the specified file name. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } displayName - File name of the image or video to create.
* @returns { Promise } Returns the newly created asset
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(displayName: string): Promise;
/**
* Creates an image or video asset with the specified file name and options. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } displayName - File name of the image or video to create.
* @param { PhotoCreateOptions } options - Options for creating an image or video asset.
* @returns { Promise } Returns the newly created asset
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(displayName: string, options: PhotoCreateOptions): Promise;
/**
* Creates an image or video asset with the specified file name and options.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } displayName - File name of the image or video to create.
* @param { PhotoCreateOptions } options - Options for creating an image or video asset.
* @param { AsyncCallback } callback - Callback used to return the image or video created.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000001 - Invalid display name
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since arkts {'1.1':'10','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(displayName: string, options: PhotoCreateOptions, callback: AsyncCallback): void;
/**
* Creates an image or video asset with the specified file type, file name extension, and options.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { CreateOptions } options - Options for creating the image or video asset, for example, {title: 'testPhoto'}.
* @param { AsyncCallback } callback - Callback used to return the URI of the created image or video asset.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Creates an image or video asset with the specified file type, file name extension, and options.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { CreateOptions } options - Options for creating the image or video asset, for example, {title: 'testPhoto'}.
* @param { AsyncCallback } callback - Callback used to return the URI of the created image or video asset.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(photoType: PhotoType, extension: string, options: CreateOptions, callback: AsyncCallback): void;
/**
* Creates an image or video asset with the specified file type and file name extension.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { AsyncCallback } callback - Callback used to return the URI of the created image or video asset.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Creates an image or video asset with the specified file type and file name extension.
* This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { AsyncCallback } callback - Callback used to return the URI of the created image or video asset.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(photoType: PhotoType, extension: string, callback: AsyncCallback): void;
/**
* Creates an image or video asset with the specified file type, file name extension, and options.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { CreateOptions } [options] - Options for creating the image or video asset, for example, {title: 'testPhoto'}.
* @returns { Promise } Returns the uri of the newly created asset
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Creates an image or video asset with the specified file type, file name extension, and options.
* This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO.
* @param { string } extension - File name extension, for example, 'jpg'.
* @param { CreateOptions } [options] - Options for creating the image or video asset, for example, {title: 'testPhoto'}.
* @returns { Promise } Returns the uri of the newly created asset
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since arkts {'1.1':'11','1.2':'20'}
* @arkts 1.1&1.2
*/
createAsset(photoType: PhotoType, extension: string, options?: CreateOptions): Promise;
/**
* Creates an album. This API uses an asynchronous callback to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } name - Name of the album to create.
* @param { AsyncCallback } callback - Callback used to return the created album instance.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900015 - The file name already exists.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#createAlbumRequest
*/
createAlbum(name: string, callback: AsyncCallback): void;
/**
* Creates an album. This API uses a promise to return the result.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { string } name - Name of the album to create.
* @returns { Promise } Returns the instance of newly created Album
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900015 - The file name already exists.
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#createAlbumRequest
*/
createAlbum(name: string): Promise;
/**
* Deletes albums. This API uses an asynchronous callback to return the result.
* Ensure that the albums to be deleted exist. Only user albums can be deleted.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } albums - Albums to delete.
* @param { AsyncCallback } callback - Callback that returns no value.
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAlbums
*/
deleteAlbums(albums: Array, callback: AsyncCallback): void;
/**
* Deletes albums. This API uses a promise to return the result.
* Ensure that the albums to be deleted exist. Only user albums can be deleted.
*
* @permission ohos.permission.WRITE_IMAGEVIDEO
* @param { Array } albums - Albums to delete.
* @returns { Promise } Returns void
* @throws { BusinessError } 202 - Called by non-system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 10
* @deprecated since 11
* @useinstead photoAccessHelper.MediaAlbumChangeRequest#deleteAlbums
*/
deleteAlbums(albums: Array): Promise;
/**
* Obtains albums based on the specified options and album type. This API uses an asynchronous callback to return the result.
* Before the operation, ensure that the albums to obtain exist.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AlbumType } type - Type of the album.
* @param { AlbumSubtype } subtype - Subtype of the album.
* @param { FetchOptions } options - Options for fetching the albums.
* @param { AsyncCallback> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 13900012 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
/**
* Obtains albums based on the specified options and album type. This API uses an asynchronous callback to return the result.
* Before the operation, ensure that the albums to obtain exist.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AlbumType } type - Type of the album.
* @param { AlbumSubtype } subtype - Subtype of the album.
* @param { FetchOptions } options - Options for fetching the albums.
* @param { AsyncCallback> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameter types; 3. Parameter verification failed.
* @throws { BusinessError } 201 - Permission denied
* @throws { BusinessError } 13900020 - Invalid argument
* @throws { BusinessError } 14000011 - System inner fail
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @crossplatform
* @since arkts {'1.1':'12','1.2':'20'}
* @arkts 1.1&1.2
*/
getAlbums(
type: AlbumType,
subtype: AlbumSubtype,
options: FetchOptions,
callback: AsyncCallback>
): void;
/**
* Obtains albums by type. This API uses an asynchronous callback to return the result.
* Before the operation, ensure that the albums to obtain exist.
*
* @permission ohos.permission.READ_IMAGEVIDEO
* @param { AlbumType } type - Type of the album.
* @param { AlbumSubtype } subtype - Subtype of the album.
* @param { AsyncCallback> } callback - Callback used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*