diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 9c482d200e4db25b39e2182373db0cf206cd99db..9a3c2aec170800b25e69a170c7ef2af5a0828e28 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -84,11 +84,24 @@ declare namespace photoAccessHelper { * @StageModelOnly * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function getPhotoAccessHelper(context: Context): PhotoAccessHelper; + /** + * Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album. + * + * @param { Context } context - Context of the ability instance. + * @returns { PhotoAccessHelper | null } Instance of PhotoAccessHelper.if the operation fails,returns null. + * @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 20 + * @arkts 1.2 + */ + function getPhotoAccessHelper(context: Context): PhotoAccessHelper | null; + /** * Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album. * @@ -102,11 +115,29 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi * @StageModelOnly - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ function getPhotoAccessHelper(context: Context, userId: int): PhotoAccessHelper; + /** + * Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Context } context - Context of the ability instance. + * @param { int } userId - Target userId + * @returns { PhotoAccessHelper | null } Instance of PhotoAccessHelper + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 23800151 - Scene parameters validate failed,possible causes: + * 1.userId is invalid. + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @StageModelOnly + * @since 20 + * @arkts 1.2 + */ + function getPhotoAccessHelper(context: Context, userId: int): PhotoAccessHelper | null; + /** * Enumerates the types of av file format. * @@ -1048,10 +1079,19 @@ declare namespace photoAccessHelper { * @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 + * @since 12 */ onDataPrepared(data: T, map?: Map): void; + + /** + * Indicates required media asset data is prepared + * + * @type { OnDataPreparedFunc } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + onDataPrepared: OnDataPreparedFunc; } /** @@ -1070,10 +1110,19 @@ declare namespace photoAccessHelper { * @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 + * @since 13 */ onDataPrepared(data: T, imageSource: image.ImageSource, map: Map): void; + + /** + * Indicates required media asset data quickly is prepared + * + * @type { OnQuickDataPreparedFunc } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + onDataPrepared: OnQuickDataPreparedFunc; } /** @@ -1085,7 +1134,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - interface PhotoProxy {} + interface PhotoProxy { } /** * A media asset manager class, used for manipulating the read and write operations of media assets. @@ -1338,6 +1387,36 @@ declare namespace photoAccessHelper { */ type MemberType = int | long | double | string | boolean; + /** + * Indicates required media asset data is prepared + * + * @typedef { function } OnDataPreparedFunc + * @param { T | undefined } data - the returned data of media asset. + * if data of media asset is invalid,return undefined + * @param { Map }[map] - addition information for the data + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + + type OnDataPreparedFunc = (data: T | undefined, map?: Map) => void; + + /** + * Indicates required media asset data quickly is prepared + * + * @typedef { function } OnQuickDataPreparedFunc + * @param { T | undefined } [data] - the returned data of media asset. + * if data of media asset is valid,return undefined + * @param { image.ImageSource | null } [imageSource] - the returned data is imageSource. + * @param { Map } map - addition information for the data + * if data of imageSource is valid,return null + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + + type OnQuickDataPreparedFunc = (data: T | undefined, imageSource: image.ImageSource | null, map: Map) => void; + /** * Provides APIs for encapsulating file asset attributes. * @@ -2154,10 +2233,29 @@ declare namespace photoAccessHelper { * @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 + * @since 11 */ requestPhoto(callback: AsyncCallback): string; + /** + * Obtains the quick thumbnails 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 |null } Returns request photo task id.if the operation fails,return null. + * @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 } 23800301 - 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 20 + * @arkts 1.2 + */ + requestPhoto(callback: AsyncCallback): string | null; /** * Obtains the thumbnails of an asset based on the specified options. This API uses an asynchronous callback to return the result. * @@ -2172,10 +2270,30 @@ declare namespace photoAccessHelper { * @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 + * @since 11 */ requestPhoto(options: RequestPhotoOptions, 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 | null } Returns request photo task id.if the operation fails,returns null. + * @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 } 23800301 - 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 20 + * @arkts 1.2 + */ + requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string | null; /** * Cancels a task for obtaining media thumbnails. * @@ -3017,7 +3135,7 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @crossplatform * @since 12 - */ + */ /** * Defines the options for fetching media files. * @@ -5463,7 +5581,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - getDataAnalysisProgress(analysisType: AnalysisType): Promise; + getDataAnalysisProgress(analysisType: AnalysisType): Promise; /** * Unregisters listening for the specified URI. Multiple callbacks can be registered for a URI for listening. * You can use this API to unregister the listening of the specified callbacks or all callbacks. @@ -6443,7 +6561,7 @@ declare namespace photoAccessHelper { * @since 20 */ thumbnailChangeStatus: ThumbnailChangeStatus; - + /** * The version of the photo asset info used to determine the order of notification changes. * @@ -7189,14 +7307,14 @@ declare namespace photoAccessHelper { BETWEEN = 6, } - /** - * Enumeration type of single selection mode - * - * @enum { number } SingleSelectionMode - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 18 - */ + /** + * Enumeration type of single selection mode + * + * @enum { number } SingleSelectionMode + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 18 + */ export enum SingleSelectionMode { /** * browser mode @@ -7440,37 +7558,37 @@ declare namespace photoAccessHelper { * @atomicservice * @since 19 */ - class FileSizeFilter { - /** - * Specifing filter operator. - * - * @type { FilterOperator } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - filterOperator: FilterOperator; - - /** - * Specifing the size of files to be filtered. - * - * @type { number } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - fileSize: number; - - /** - * Specifing the upper limit of file size to be filtered. - * - * @type { ?number } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - extraFileSize?: number; - } + class FileSizeFilter { + /** + * Specifing filter operator. + * + * @type { FilterOperator } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + filterOperator: FilterOperator; + + /** + * Specifing the size of files to be filtered. + * + * @type { number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + fileSize: number; + + /** + * Specifing the upper limit of file size to be filtered. + * + * @type { ?number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + extraFileSize?: number; + } /** * Media file video duration filtering configuration. @@ -7480,35 +7598,35 @@ declare namespace photoAccessHelper { * @since 19 */ class VideoDurationFilter { - /** - * Specifing filter operator. - * - * @type { FilterOperator } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - filterOperator: FilterOperator; - - /** - * Specifing the video duration of files to be filtered. - * - * @type { number } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - videoDuration: number; - - /** - * Specifing the upper limit of video duration to be filtered. - * - * @type { ?number } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 19 - */ - extraVideoDuration?: number; + /** + * Specifing filter operator. + * + * @type { FilterOperator } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + filterOperator: FilterOperator; + + /** + * Specifing the video duration of files to be filtered. + * + * @type { number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + videoDuration: number; + + /** + * Specifing the upper limit of video duration to be filtered. + * + * @type { ?number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 19 + */ + extraVideoDuration?: number; } /** @@ -8023,7 +8141,7 @@ declare namespace photoAccessHelper { */ HEIF = 2 } - + /** * Enumeration of moving photo effect mode. * @@ -8155,7 +8273,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - interface MediaChangeRequest {} + interface MediaChangeRequest { } /** * Defines the class of media asset change request. @@ -8218,28 +8336,67 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static createImageAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; + /** + * Creates an image asset change request. + * + * @param { Context } context - Context of the ability instance. + * @param { string } fileUri - Data source of the image asset, + * which is specified by a URI in the application sandbox directory. + * @returns { MediaAssetChangeRequest | null } - Returns a MediaAssetChangeRequest instance + * if the operation fails,returns null. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 23800101 - The file corresponding to the URI is not in the app sandbox. + * @throws { BusinessError } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + * + */ + static createImageAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest | null; + /** * Creates a video asset change request. * * @param { Context } context - Context of the ability instance. * @param { string } fileUri - Data source of the video asset, which is specified by a URI in the application sandbox directory. - * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance + * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest instance. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 13900002 - The file corresponding to the URI is not in the app sandbox. * @throws { BusinessError } 14000011 - System inner fail * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static createVideoAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; + /** + * Creates a video asset change request. + * + * @param { Context } context - Context of the ability instance. + * @param { string } fileUri - Data source of the video asset, + * which is specified by a URI in the application sandbox directory. + * @returns { MediaAssetChangeRequest | null } - Returns a MediaAssetChangeRequest instance. + * if the operation fails,returns null. + * * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 23800101 - The file corresponding to the URI is not in the app sandbox. + * @throws { BusinessError } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + static createVideoAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest | null; + /** * Creates an asset change request with the specified file name. * @@ -8255,11 +8412,32 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest; + /** + * Creates an asset change request with the specified file name. + * + * @param { Context } context - Context of the ability instance. + * @param { string } displayName - File name of the image or video to create. + * @param { PhotoCreateOptions } [options] - Options for creating an image or video asset. + * @returns { MediaAssetChangeRequest | null } - Returns a MediaAssetChangeRequest instance. + * if the operation fails,returns null. + * @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 } 23800102 - The format or length of the display name dose not meet the specifications. + * @throws { BusinessError } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest | null; + /** * Create an asset change request based on the file type and filename extension. * @@ -8274,11 +8452,32 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest; + /** + * Create an asset change request based on the file type and filename extension. + * + * @param { Context } context - Context of the ability instance. + * @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 { MediaAssetChangeRequest | null } - Returns a MediaAssetChangeRequest instance, + * if the operation fails,returns null. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 20 + * @arkts 1.2 + */ + static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest | null; + + /** * Deletes media assets. This API uses a promise to return the result. The deleted assets are moved to the trash. * @@ -8335,11 +8534,23 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getAsset(): PhotoAsset; + /** + * Obtains the asset in this asset change request. + * + * @returns { PhotoAsset | null } - Returns the asset.if the operation fails,returns null. + * @throws { BusinessError } 23800301 - 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 20 + * @arkts 1.2 + */ + getAsset(): PhotoAsset | null; + + /** * Set favorite state of the asset. * @@ -8780,11 +8991,30 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static createAlbumRequest(context: Context, name: string): MediaAlbumChangeRequest; + /** + * Creates a MediaAlbumChangeRequest instance. + * + * @param { Context } context - Context of the ability instance. + * @param { string } name - Name of the album. + * @returns { MediaAlbumChangeRequest | null } - Returns a MediaAlbumChangeRequest instance. + * if the operation fails,returns null. + * @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 } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + static createAlbumRequest(context: Context, name: string): MediaAlbumChangeRequest | null; + /** * Deletes albums. This API uses a promise to return the result. * @@ -8832,11 +9062,22 @@ declare namespace photoAccessHelper { *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getAlbum(): Album; + /** + * Obtains the album in the current album change request. + * + * @returns { Album | null } - Returns the album,if the operation fails,returns null. + * @throws { BusinessError } 23800301 - 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 20 + * @arkts 1.2 + */ + getAlbum(): Album | null; + /** * Sets the album cover. * @@ -9463,88 +9704,88 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'14','1.2':'20'} * @arkts 1.1&1.2 */ - interface SharedAlbumAsset { - /** - * album id of album asset - * - * @type { int } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - albumId: int; - /** - * type of album asset - * - * @type { AlbumType } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - albumType: AlbumType; - /** - * subtype of album asset - * - * @type { AlbumSubtype } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - albumSubType: AlbumSubtype; - /** - * album name - * - * @type { string } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - albumName: string; - /** - * uri of album cover - * - * @type { string } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - coverUri: string; - /** - * number of assets in this album - * - * @type { int } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - count: int; - /** - * number of photo assets in this album - * - * @type { int } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - imageCount: int; - /** - * number of video assets in this album - * - * @type { int } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - videoCount: int; - } + interface SharedAlbumAsset { + /** + * album id of album asset + * + * @type { int } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + albumId: int; + /** + * type of album asset + * + * @type { AlbumType } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + albumType: AlbumType; + /** + * subtype of album asset + * + * @type { AlbumSubtype } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + albumSubType: AlbumSubtype; + /** + * album name + * + * @type { string } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + albumName: string; + /** + * uri of album cover + * + * @type { string } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + coverUri: string; + /** + * number of assets in this album + * + * @type { int } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + count: int; + /** + * number of photo assets in this album + * + * @type { int } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + imageCount: int; + /** + * number of video assets in this album + * + * @type { int } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 + */ + videoCount: int; + } /** * Provides APIs for managing a moving photo instance. @@ -9618,11 +9859,22 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getUri(): string; + /** + * Obtains the URI of this moving photo. + * + * @returns { string | null } Returns uri of the moving photo,if the operation fails,returns null. + * @throws { BusinessError } 23800301 - 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 20 + * @arkts 1.2 + */ + getUri(): string | null; + /** * Check if the video of the moving photo is ready. * @@ -9811,7 +10063,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - class MediaAnalysisAlbumChangeRequest extends MediaAlbumChangeRequest { + class MediaAnalysisAlbumChangeRequest extends MediaAlbumChangeRequest { /** * The constructor to create a MediaAnalysisAlbumChangeRequest instance. * @@ -10174,11 +10426,28 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ static getCloudEnhancementInstance(context: Context): CloudEnhancement; + /** + * Obtains a cloud enhancement instance. + * + * @param { Context } context - Context of the ability instance. + * @returns { CloudEnhancement | null } Returns cloud enhancement instance,if the operation fails,returns null. + * @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 } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + static getCloudEnhancementInstance(context: Context): CloudEnhancement | null; + /** * Submits cloud enhancement tasks. * @@ -10637,11 +10906,29 @@ declare namespace photoAccessHelper { * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ static getCloudMediaAssetManagerInstance(context: Context): CloudMediaAssetManager; + /** + * Obtains a CloudMediaAssetManager instance. + * + * @param { Context } context - Obtains a CloudMediaAssetManager instance. + * @returns { CloudMediaAssetManager | null } Returns cloud media asset manager instance, + * if the operation fails,returns null. + * @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 } 23800301 - 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. + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + static getCloudMediaAssetManagerInstance(context: Context): CloudMediaAssetManager | null; + /** * Starts or resumes a task to download cloud media assets. * @@ -10794,6 +11081,21 @@ declare namespace photoAccessHelper { * @since 20 */ static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager; + /** + * Get media asset custom record manager instance. + * + * @param { Context } context - Context of the ability instance. + * @returns { PhotoAssetCustomRecordManager | null } Returns media asset custom record manager instance + * if the operation fails,returns null. + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 23800107 - Context is invalid + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager | null; /** * A maximum of 200 custom records can be created at once. *