From 6a386a79f349e0577e241c1f3baae253d998f71d Mon Sep 17 00:00:00 2001 From: yaozihao Date: Wed, 18 Jun 2025 20:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E9=BB=84=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yaozihao --- api/@ohos.file.photoAccessHelper.d.ts | 721 ++++-------------- ...@ohos.file.sendablePhotoAccessHelper.d.ets | 12 +- 2 files changed, 147 insertions(+), 586 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index b942401453..df02c91836 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -996,7 +996,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1020,7 +1021,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1044,7 +1046,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1068,7 +1071,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1085,7 +1089,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1128,7 +1133,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1146,7 +1152,8 @@ declare namespace photoAccessHelper { * @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. + * @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; @@ -1278,16 +1285,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Photo type, image or video - * - * @type { PhotoType } - * @readonly - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ readonly photoType: PhotoType; /** * Display name (with a file name extension) of the asset. @@ -1306,16 +1303,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Display name (with a file name extension) of the asset. - * - * @type { string } - * @readonly - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ readonly displayName: string; /** * Obtains a PhotoAsset member parameter. @@ -1342,20 +1329,6 @@ declare namespace photoAccessHelper { * @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 20 - */ get(member: string): MemberType; /** * Sets a PhotoAsset member parameter. @@ -1752,7 +1725,8 @@ declare namespace photoAccessHelper { * 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 { 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. @@ -1768,7 +1742,8 @@ declare namespace photoAccessHelper { * 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. + * @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. @@ -1784,7 +1759,9 @@ declare namespace photoAccessHelper { * 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. + * @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; @@ -1985,7 +1962,8 @@ declare namespace photoAccessHelper { * * @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. + * @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. @@ -2046,14 +2024,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Enumeration of photo asset members - * - * @enum { string } PhotoKeys - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ enum PhotoKeys { /** * Asset uri, read only @@ -2082,14 +2052,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Photo type of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ PHOTO_TYPE = 'media_type', /** * Asset name, read only @@ -2104,14 +2066,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Asset name, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ DISPLAY_NAME = 'display_name', /** * Size of the asset, read only @@ -2126,14 +2080,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Size of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ SIZE = 'size', /** * Creation date of the asset, read only @@ -2148,14 +2094,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Creation date of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ DATE_ADDED = 'date_added', /** * Modified date of the asset, read only @@ -2184,14 +2122,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Duration of video files, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ DURATION = 'duration', /** * Width of the image asset, read only @@ -2206,14 +2136,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Width of the image asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ WIDTH = 'width', /** * Height of the image asset, read only @@ -2228,14 +2150,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Height of the image asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ HEIGHT = 'height', /** * Date taken of the asset, read only @@ -2249,15 +2163,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @crossplatform * @since 12 - */ - /** - * Date taken of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ DATE_TAKEN = 'date_taken', /** @@ -2273,14 +2178,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Orientation of the image asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ ORIENTATION = 'orientation', /** * Favorite state of the asset, read only @@ -2295,14 +2192,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Favorite state of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ FAVORITE = 'is_favorite', /** * Title of the asset @@ -2317,14 +2206,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Title of the asset - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ TITLE = 'title', /** * Asset position, read only @@ -2339,13 +2220,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 16 */ - /** - * Asset position, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ POSITION = 'position', /** * Trashed date of the asset, read only @@ -2417,13 +2291,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * Creation time of the asset in milliseconds, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ DATE_ADDED_MS = 'date_added_ms', /** * Modified time of the asset in milliseconds, read only @@ -2431,13 +2298,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * Modified time of the asset in milliseconds, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ DATE_MODIFIED_MS = 'date_modified_ms', /** * Trashed time of the asset in milliseconds, read only @@ -2453,13 +2313,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * Photo subtype of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ PHOTO_SUBTYPE = 'subtype', /** * Effect mode of moving photo, read only @@ -2469,46 +2322,25 @@ declare namespace photoAccessHelper { * @since 12 */ 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 20 - */ - 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 20 - */ COVER_POSITION = 'cover_position', /** - * Unique uuid of the burst photos, read only + * Dynamic range type of the asset, read only * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ + DYNAMIC_RANGE_TYPE = 'dynamic_range_type', /** * Unique uuid of the burst photos, read only * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 + * @since 12 */ BURST_KEY = 'burst_key', /** @@ -2525,13 +2357,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * Width and height information of lcd picture, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ LCD_SIZE = 'lcd_size', /** * Width and height information of thumbnail picture, read only @@ -2539,13 +2364,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * Width and height information of thumbnail picture, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ THM_SIZE = 'thm_size', /** * Detail time of the asset, read only @@ -2553,13 +2371,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 13 */ - /** - * Detail time of the asset, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ DETAIL_TIME = 'detail_time', /** * Date taken of the asset in milliseconds, read only @@ -2567,13 +2378,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 13 */ - /** - * Date taken of the asset in milliseconds, read only - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ DATE_TAKEN_MS = 'date_taken_ms', /** * Cloud enhancement status of the asset, read only @@ -2669,13 +2473,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * URI of the album. - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 20 - */ URI = 'uri', /** * Name of the album. @@ -2714,14 +2511,6 @@ declare namespace photoAccessHelper { * @systemapi * @since 18 */ - /** - * Timestamp when the album was modified, in milliseconds. - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @systemapi - * @atomicservice - * @since 20 - */ DATE_MODIFIED = 'date_modified', } @@ -2743,7 +2532,8 @@ declare namespace photoAccessHelper { */ 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). + * 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 @@ -2766,15 +2556,6 @@ declare namespace photoAccessHelper { * @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 20 */ interface FetchOptions { /** @@ -2792,15 +2573,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Indicates the members to query. - * - * @type { Array } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ fetchColumns: Array; /** * Predicates that specify the fetch criteria. @@ -2817,15 +2589,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Predicates that specify the fetch criteria. - * - * @type { dataSharePredicates.DataSharePredicates } - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ predicates: dataSharePredicates.DataSharePredicates; } @@ -3051,15 +2814,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * Provides APIs to manage the file retrieval result. - * - * @interface FetchResult - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ interface FetchResult { /** * Obtains the total number of files in the result set. @@ -3084,19 +2838,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getCount(): number; /** * Checks whether the cursor is in the last row of the result set. @@ -3123,20 +2864,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ isAfterLast(): boolean; /** * Obtains the first file asset in the result set. This API uses an asynchronous callback to return the result. @@ -3158,34 +2885,10 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @since 12 - */ - /** - * 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 - * @atomicservice - * @since 20 - */ - 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 + * @crossplatform + * @since 12 */ + getFirstObject(callback: AsyncCallback): void; /** * Obtains the first file asset in the result set. This API uses a promise to return the result. * @@ -3195,8 +2898,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 13900020 - Invalid argument * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @since 12 + * @since 10 */ /** * Obtains the first file asset in the result set. This API uses a promise to return the result. @@ -3208,8 +2910,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @crossplatform - * @atomicservice - * @since 20 + * @since 12 */ getFirstObject(): Promise; /** @@ -3237,20 +2938,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getNextObject(callback: AsyncCallback): void; /** * Obtains the next file asset in the result set. This API uses a promise to return the result. @@ -3277,20 +2964,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getNextObject(): Promise; /** * Obtains the last file asset in the result set. This API uses an asynchronous callback to return the result. @@ -3315,19 +2988,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @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. @@ -3352,19 +3012,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @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. @@ -3391,20 +3038,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ 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. @@ -3431,20 +3064,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getObjectByPosition(index: number): Promise; /** * Obtains all the file assets in the result set. This API uses an asynchronous callback to return the result. @@ -3469,19 +3088,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getAllObjects(callback: AsyncCallback>): void; /** * Obtains all the file assets in the result set. This API uses a promise to return the result. @@ -3506,19 +3112,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ getAllObjects(): Promise>; /** * Closes this FetchResult instance to invalidate it. After this instance is released, the APIs in this instance cannot be invoked. @@ -3541,18 +3134,6 @@ declare namespace photoAccessHelper { * @crossplatform * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ close(): void; } @@ -4035,22 +3616,6 @@ declare namespace photoAccessHelper { * @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 } 13900012 - Permission denied - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 14000011 - System inner fail - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @crossplatform - * @atomicservice - * @since 20 - */ getAssets(options: FetchOptions): Promise>; /** * Fetch shared photo assets in an album. @@ -4477,21 +4042,6 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - /** - * 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 - * @atomicservice - * @since 20 - */ 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. @@ -5157,7 +4707,8 @@ declare namespace photoAccessHelper { * * @permission ohos.permission.READ_IMAGEVIDEO * @param { string } photoUri - URI of the media asset whose index is to be obtained. - * @param { string } albumUri - Album URI, which can be an empty string. If it is an empty string, all the media assets in the Gallery are obtained by default. + * @param { string } albumUri - Album URI, which can be an empty string. + *
If it is an empty string, all the media assets in the Gallery are obtained by default. * @param { FetchOptions } options - Fetch options. Only one search condition or sorting mode must be set in predicates. *
If no value is set or multiple search criteria or sorting modes are set, the API cannot be called successfully. * @returns { Promise } - Returns the index of the asset in the album @@ -5357,7 +4908,12 @@ declare namespace photoAccessHelper { * @systemapi * @since 19 */ - grantPhotoUrisPermission(tokenId: number, uriList: Array, photoPermissionType: PhotoPermissionType, hideSensitiveType: HideSensitiveType): Promise; + grantPhotoUrisPermission( + tokenId: number, + uriList: Array, + photoPermissionType: PhotoPermissionType, + hideSensitiveType: HideSensitiveType + ): Promise; /** * Grants an application the permission to access a URI. This API uses a promise to return the result. * @@ -5506,7 +5062,8 @@ declare namespace photoAccessHelper { * @systemapi * @since 18 */ - createAssetsForAppWithAlbum(source: PhotoCreationSource, albumUri: string, isAuthorized: boolean, photoCreationConfigs: Array): Promise>; + createAssetsForAppWithAlbum(source: PhotoCreationSource, albumUri: string, isAuthorized: boolean, + photoCreationConfigs: Array): Promise>; } /** @@ -5808,6 +5365,41 @@ declare namespace photoAccessHelper { MOVING_PHOTO_IMAGE_TYPE = 'image/movingPhoto' } + /** + * Enumeration type of single selection mode + * + * @enum { number } SingleSelectionMode + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 18 + */ + export enum SingleSelectionMode { + /** + * browser mode + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 18 + */ + BROWSER_MODE = 0, + /** + * select directly mode + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 18 + */ + SELECT_MODE = 1, + /** + * browser and select mode + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 18 + */ + BROWSER_AND_SELECT_MODE = 2 + } + /** * Enumeration type of filter operator. * @@ -5875,41 +5467,6 @@ declare namespace photoAccessHelper { BETWEEN = 6, } - /** - * Enumeration type of single selection mode - * - * @enum { number } SingleSelectionMode - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 18 - */ - export enum SingleSelectionMode { - /** - * browser mode - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 18 - */ - BROWSER_MODE = 0, - /** - * select directly mode - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 18 - */ - SELECT_MODE = 1, - /** - * browser and select mode - * - * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice - * @since 18 - */ - BROWSER_AND_SELECT_MODE = 2 - } - /** * Class BaseSelectOptions, which is extracted from class PhotoSelectOptions * @@ -6125,37 +5682,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. @@ -6165,35 +5722,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; } /** @@ -7940,7 +7497,7 @@ declare namespace photoAccessHelper { subtype: PhotoSubtype; /** * Effect mode of moving photo - * + * * @type { MovingPhotoEffectMode } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi diff --git a/api/@ohos.file.sendablePhotoAccessHelper.d.ets b/api/@ohos.file.sendablePhotoAccessHelper.d.ets index bf2dbc140f..36a1a5eb32 100644 --- a/api/@ohos.file.sendablePhotoAccessHelper.d.ets +++ b/api/@ohos.file.sendablePhotoAccessHelper.d.ets @@ -336,7 +336,8 @@ declare namespace sendablePhotoAccessHelper { /** * Sets a PhotoAsset member parameter. * - * @param { string } member - Name of the parameter to set, for example, PhotoKeys.TITLE. The value contains 1 to 255 characters. + * @param { string } member - Name of the parameter to set, for example, PhotoKeys.TITLE. + * The value contains 1 to 255 characters. * @param { string } value - Value to set. Only the value of PhotoKeys. TITLE can be changed. * The title must meet the following requirements: * - It does not contain a file name extension. @@ -455,7 +456,8 @@ declare namespace sendablePhotoAccessHelper { getFirstObject(): Promise; /** * Obtains the next 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. + * 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 } 14000011 - Internal system error @@ -1234,8 +1236,10 @@ declare namespace sendablePhotoAccessHelper { createAsset(displayName: string, options: photoAccessHelper.PhotoCreateOptions): Promise; /** * 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. If the caller does not have the ohos.permission.WRITE_IMAGEVIDEO permission, - * you can create a media asset by using a security component. For details, see Creating a Media Asset Using a Security Component. + * This API uses a promise to return the result. + * If the caller does not have the ohos.permission.WRITE_IMAGEVIDEO permission, + * you can create a media asset by using a security component. + * For details, see Creating a Media Asset Using a Security Component. * * @permission ohos.permission.WRITE_IMAGEVIDEO * @param { PhotoType } photoType - Type of the file to create, which can be IMAGE or VIDEO. -- Gitee