From a01b19b99bb9e7cf10586bca275d809f150109a1 Mon Sep 17 00:00:00 2001 From: hdwang Date: Tue, 26 Aug 2025 09:06:47 +0000 Subject: [PATCH 1/7] =?UTF-8?q?null/undefined=E9=9D=99=E6=80=81=E5=8C=96?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=98=BE=E7=A4=BA=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 84 +++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 9c482d200e..b60f520519 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -77,7 +77,7 @@ 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 + * @returns { PhotoAccessHelper | null | undefined } 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 @@ -87,7 +87,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - function getPhotoAccessHelper(context: Context): PhotoAccessHelper; + function getPhotoAccessHelper(context: Context): PhotoAccessHelper | null | undefined; /** * Obtains a PhotoAccessHelper instance for accessing and modifying media files in the album. @@ -95,7 +95,7 @@ declare namespace photoAccessHelper { * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Context } context - Hap context information * @param { int } userId - Target userId - * @returns { PhotoAccessHelper } Instance of PhotoAccessHelper + * @returns { PhotoAccessHelper | null } Instance of PhotoAccessHelper * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 202 - Called by non-system application * @throws { BusinessError } 13900020 - Invalid argument @@ -105,7 +105,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'19','1.2':'20'} * @arkts 1.1&1.2 */ - function getPhotoAccessHelper(context: Context, userId: int): PhotoAccessHelper; + function getPhotoAccessHelper(context: Context, userId: int): PhotoAccessHelper | null; /** * Enumerates the types of av file format. @@ -1045,13 +1045,13 @@ declare namespace photoAccessHelper { /** * Indicates required media asset data is prepared * - * @param { T } data - the returned data of media asset - * @param { Map } [map] - additional information for the data + * @param { T | undefined } 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; + onDataPrepared: (data: T | undefined, map?: Map) => void; } /** @@ -1066,14 +1066,14 @@ declare namespace photoAccessHelper { /** * 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 + * @param { T | undefined } data - the returned data of picture + * @param { image.ImageSource | null } 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; + onDataPrepared: (data: T | undefined, imageSource: image.ImageSource | null, map?: Map) => void; } /** @@ -1470,7 +1470,7 @@ declare namespace photoAccessHelper { * 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 + * @returns { MemberType | null } 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 @@ -1481,7 +1481,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - get(member: string): MemberType; + get(member: string): MemberType | null; /** * Sets a PhotoAsset member parameter. * @@ -2146,7 +2146,7 @@ declare namespace photoAccessHelper { * * @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. + * @returns { string | null } 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; @@ -2157,14 +2157,14 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - requestPhoto(callback: AsyncCallback): string; + 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. * * @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. + * @returns { string | null } 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; @@ -2175,7 +2175,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string; + requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string | null; /** * Cancels a task for obtaining media thumbnails. * @@ -8210,7 +8210,7 @@ declare namespace photoAccessHelper { * * @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 } - Returns a MediaAssetChangeRequest instance + * @returns { MediaAssetChangeRequest | null } - 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. @@ -8221,14 +8221,14 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - static createImageAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; + 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 | null } - 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. @@ -8238,15 +8238,15 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - static createVideoAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest; + static createVideoAssetRequest(context: Context, fileUri: string): MediaAssetChangeRequest | null; /** * 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 } - Returns a MediaAssetChangeRequest instance + * @param { ?PhotoCreateOptions } [options] - Options for creating an image or video asset. + * @returns { MediaAssetChangeRequest | null | undefined } - Returns a MediaAssetChangeRequest 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. @@ -8258,7 +8258,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest; + static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest | null | undefined; /** * Create an asset change request based on the file type and filename extension. @@ -8266,8 +8266,8 @@ declare namespace photoAccessHelper { * @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 } - Returns a MediaAssetChangeRequest instance + * @param { ?CreateOptions } [options] - Options for creating the image or video asset, for example, {title: 'testPhoto'}. + * @returns { MediaAssetChangeRequest | null | undefined } - 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 } 14000011 - System inner fail @@ -8277,7 +8277,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest; + static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest | null | undefined; /** * Deletes media assets. This API uses a promise to return the result. The deleted assets are moved to the trash. @@ -8319,7 +8319,7 @@ declare namespace photoAccessHelper { /** * Get the asset. * - * @returns { PhotoAsset } - Returns the asset + * @returns { PhotoAsset | null } - Returns the asset * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail @@ -8329,7 +8329,7 @@ declare namespace photoAccessHelper { /** * Obtains the asset in this asset change request. * - * @returns { PhotoAsset } - Returns the asset + * @returns { PhotoAsset | null } - Returns the asset * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail @@ -8338,7 +8338,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - getAsset(): PhotoAsset; + getAsset(): PhotoAsset | null; /** * Set favorite state of the asset. @@ -8772,7 +8772,7 @@ declare namespace photoAccessHelper { * * @param { Context } context - Context of the ability instance. * @param { string } name - Name of the album. - * @returns { MediaAlbumChangeRequest } - Returns a MediaAlbumChangeRequest instance + * @returns { MediaAlbumChangeRequest | null } - Returns a MediaAlbumChangeRequest 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. @@ -8783,7 +8783,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - static createAlbumRequest(context: Context, name: string): MediaAlbumChangeRequest; + static createAlbumRequest(context: Context, name: string): MediaAlbumChangeRequest | null; /** * Deletes albums. This API uses a promise to return the result. @@ -8827,7 +8827,7 @@ declare namespace photoAccessHelper { /** * Obtains the album in the current album change request. * - * @returns { Album } - Returns the album + * @returns { Album | null } - Returns the album * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail @@ -8835,7 +8835,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - getAlbum(): Album; + getAlbum(): Album | null; /** * Sets the album cover. @@ -9612,7 +9612,7 @@ declare namespace photoAccessHelper { /** * Obtains the URI of this moving photo. * - * @returns { string } Returns uri of the moving photo + * @returns { string | null } Returns uri of the moving photo * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail @@ -9621,7 +9621,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - getUri(): string; + getUri(): string | null; /** * Check if the video of the moving photo is ready. @@ -10166,7 +10166,7 @@ declare namespace photoAccessHelper { * Obtains a cloud enhancement instance. * * @param { Context } context - Context of the ability instance. - * @returns { CloudEnhancement } Returns cloud enhancement instance + * @returns { CloudEnhancement | undefined } Returns cloud enhancement 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. @@ -10177,7 +10177,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'13','1.2':'20'} * @arkts 1.1&1.2 */ - static getCloudEnhancementInstance(context: Context): CloudEnhancement; + static getCloudEnhancementInstance(context: Context): CloudEnhancement | undefined; /** * Submits cloud enhancement tasks. @@ -10628,7 +10628,7 @@ declare namespace photoAccessHelper { * Obtains a CloudMediaAssetManager instance. * * @param { Context } context - Obtains a CloudMediaAssetManager instance. - * @returns { CloudMediaAssetManager } Returns cloud media asset manager instance + * @returns { CloudMediaAssetManager | null | undefined } Returns cloud media asset manager 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. @@ -10640,7 +10640,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'14','1.2':'20'} * @arkts 1.1&1.2 */ - static getCloudMediaAssetManagerInstance(context: Context): CloudMediaAssetManager; + static getCloudMediaAssetManagerInstance(context: Context): CloudMediaAssetManager | null | undefined; /** * Starts or resumes a task to download cloud media assets. @@ -10785,7 +10785,7 @@ declare namespace photoAccessHelper { * Get media asset custom record manager instance. * * @param { Context } context - Context of the ability instance. - * @returns { PhotoAssetCustomRecordManager } Returns media asset custom record manager instance + * @returns { PhotoAssetCustomRecordManager | null | undefined } Returns media asset custom record manager instance * @throws { BusinessError } 202 - Called by non-system application * @throws { BusinessError } 23800107 - Context is invalid * @static @@ -10793,7 +10793,7 @@ declare namespace photoAccessHelper { * @systemapi * @since 20 */ - static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager; + static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager | null | undefined; /** * A maximum of 200 custom records can be created at once. * -- Gitee From ffc32a4a8362d4164314f49f6c8ed2579be9a5b3 Mon Sep 17 00:00:00 2001 From: hdwang Date: Wed, 27 Aug 2025 10:35:10 +0000 Subject: [PATCH 2/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 743 ++++++++++++++++++-------- 1 file changed, 523 insertions(+), 220 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index b60f520519..f998e9350f 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -77,17 +77,30 @@ 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 | null | undefined } Instance of PhotoAccessHelper + * @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 + * @since 12 */ - function getPhotoAccessHelper(context: Context): PhotoAccessHelper | null | undefined; + 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. @@ -95,15 +108,33 @@ declare namespace photoAccessHelper { * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Context } context - Hap context information * @param { int } userId - Target userId - * @returns { PhotoAccessHelper | null } Instance of PhotoAccessHelper + * @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 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; @@ -1045,13 +1076,22 @@ declare namespace photoAccessHelper { /** * Indicates required media asset data is prepared * - * @param { T | undefined } data - the returned data of media asset - * @param { ?Map } [map] - additional information for the data + * @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 | undefined, map?: Map) => void; + 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; } /** @@ -1066,14 +1106,23 @@ declare namespace photoAccessHelper { /** * Indicates required media asset data quickly is prepared * - * @param { T | undefined } data - the returned data of picture - * @param { image.ImageSource | null } imageSource - the returned data of imageSource - * @param { ?Map } map - additional information for the data + * @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 + * @since 13 */ - onDataPrepared: (data: T | undefined, imageSource: image.ImageSource | null, map?: Map) => void; + 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; } /** @@ -1338,6 +1387,36 @@ declare namespace photoAccessHelper { */ type MemberType = int | long | double | string | boolean; + /** + * Indicates required media asset data is prepared + * + * @typef { 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 + * + * @typef { 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. * @@ -1470,7 +1549,7 @@ declare namespace photoAccessHelper { * Obtains a PhotoAsset member parameter. * * @param { string } member - Photo asset member. for example : get(PhotoKeys.SIZE) - * @returns { MemberType | null } Returns the value of the specified photo asset member + * @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 @@ -1481,7 +1560,7 @@ declare namespace photoAccessHelper { * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - get(member: string): MemberType | null; + get(member: string): MemberType; /** * Sets a PhotoAsset member parameter. * @@ -2146,7 +2225,7 @@ declare namespace photoAccessHelper { * * @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. + * @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; @@ -2154,9 +2233,28 @@ 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. @@ -2164,7 +2262,7 @@ 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. - * @returns { string | null } Returns request photo task id. + * @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; @@ -2172,8 +2270,28 @@ 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; /** @@ -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. * @@ -8210,7 +8328,7 @@ declare namespace photoAccessHelper { * * @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 + * @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. @@ -8218,8 +8336,28 @@ 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; @@ -8228,15 +8366,33 @@ declare namespace photoAccessHelper { * * @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 + * @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 } 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; @@ -8245,8 +8401,8 @@ declare namespace photoAccessHelper { * * @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 | undefined } - Returns a MediaAssetChangeRequest instance + * @param { PhotoCreateOptions } [options] - Options for creating an image or video asset. + * @returns { MediaAssetChangeRequest } - Returns a MediaAssetChangeRequest 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. @@ -8255,10 +8411,31 @@ 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 | undefined; + static createAssetRequest(context: Context, displayName: string, options?: PhotoCreateOptions): MediaAssetChangeRequest | null; /** * Create an asset change request based on the file type and filename extension. @@ -8266,18 +8443,39 @@ declare namespace photoAccessHelper { * @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 | undefined } - Returns a MediaAssetChangeRequest instance + * @param { CreateOptions } [options] - Options for creating the image or video asset, for example, {title: 'testPhoto'}. + * @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 } 14000011 - System inner fail * @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 + * @atomicservice + * @since 20 + * @arkts 1.2 */ - static createAssetRequest(context: Context, photoType: PhotoType, extension: string, options?: CreateOptions): MediaAssetChangeRequest | null | undefined; + 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. @@ -8319,7 +8517,7 @@ declare namespace photoAccessHelper { /** * Get the asset. * - * @returns { PhotoAsset | null } - Returns the asset + * @returns { PhotoAsset } - Returns the asset * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 14000011 - System inner fail @@ -8329,17 +8527,30 @@ declare namespace photoAccessHelper { /** * Obtains the asset in this asset change request. * - * @returns { PhotoAsset | null } - Returns the asset + * @returns { PhotoAsset } - Returns the asset * @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 * @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 + * @atomicservice + * @since 20 + * @arkts 1.2 */ getAsset(): PhotoAsset | null; + /** * Set favorite state of the asset. * @@ -8772,7 +8983,7 @@ declare namespace photoAccessHelper { * * @param { Context } context - Context of the ability instance. * @param { string } name - Name of the album. - * @returns { MediaAlbumChangeRequest | null } - Returns a MediaAlbumChangeRequest instance + * @returns { MediaAlbumChangeRequest } - Returns a MediaAlbumChangeRequest 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. @@ -8780,8 +8991,27 @@ 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; @@ -8827,13 +9057,24 @@ declare namespace photoAccessHelper { /** * Obtains the album in the current album change request. * - * @returns { Album | null } - Returns the album + * @returns { Album } - Returns the album * @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 - * @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 arkts 20 + * @arkts 1.2 */ getAlbum(): Album | null; @@ -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. @@ -9612,14 +9853,26 @@ declare namespace photoAccessHelper { /** * Obtains the URI of this moving photo. * - * @returns { string | null } Returns uri of the moving photo + * @returns { string } Returns uri of the moving photo * @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 * @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 + * @atomicservice + * @since 20 + * @arkts 1.2 */ getUri(): string | null; @@ -9811,7 +10064,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. * @@ -10166,7 +10419,7 @@ declare namespace photoAccessHelper { * Obtains a cloud enhancement instance. * * @param { Context } context - Context of the ability instance. - * @returns { CloudEnhancement | undefined } Returns cloud enhancement instance + * @returns { CloudEnhancement } Returns cloud enhancement 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. @@ -10174,10 +10427,27 @@ 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 | undefined; + 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. @@ -10628,7 +10898,7 @@ declare namespace photoAccessHelper { * Obtains a CloudMediaAssetManager instance. * * @param { Context } context - Obtains a CloudMediaAssetManager instance. - * @returns { CloudMediaAssetManager | null | undefined } Returns cloud media asset manager instance + * @returns { CloudMediaAssetManager } Returns cloud media asset manager 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. @@ -10637,10 +10907,28 @@ 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 | null | undefined; + 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. @@ -10785,15 +11073,30 @@ declare namespace photoAccessHelper { * Get media asset custom record manager instance. * * @param { Context } context - Context of the ability instance. - * @returns { PhotoAssetCustomRecordManager | null | undefined } Returns media asset custom record manager instance + * @returns { PhotoAssetCustomRecordManager } Returns media asset custom record manager instance + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 23800107 - Context is invalid + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @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 | undefined; + static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager | null; /** * A maximum of 200 custom records can be created at once. * -- Gitee From 4bbfedb64bc0cd72a39afb4ba46989f51a3f42c5 Mon Sep 17 00:00:00 2001 From: hdwang Date: Wed, 27 Aug 2025 11:20:10 +0000 Subject: [PATCH 3/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index f998e9350f..913a1ef56d 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -1134,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. @@ -1390,10 +1390,10 @@ declare namespace photoAccessHelper { /** * Indicates required media asset data is prepared * - * @typef { function } OnDataPreparedFunc + * @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 + * @param { Map }[map] - addition information for the data * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 20 * @arkts 1.2 @@ -1404,11 +1404,11 @@ declare namespace photoAccessHelper { /** * Indicates required media asset data quickly is prepared * - * @typef { function } OnQuickDataPreparedFunc + * @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 + * @param { Map }[map] - addition information for the data * if data of imageSource is valid,return null * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 20 @@ -8273,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. @@ -8385,8 +8385,7 @@ declare namespace photoAccessHelper { * 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 @@ -8461,7 +8460,8 @@ declare namespace photoAccessHelper { * @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'}. + * @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; @@ -8537,17 +8537,17 @@ declare namespace photoAccessHelper { */ 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 - * @atomicservice - * @since 20 - * @arkts 1.2 - */ + /** + * 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 + * @atomicservice + * @since 20 + * @arkts 1.2 + */ getAsset(): PhotoAsset | null; @@ -9071,9 +9071,9 @@ declare namespace photoAccessHelper { * * @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. + * Possible causes: 1. Database corrupted. 2. The file system is abnormal. 3. The IPC request timed out. * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @since arkts 20 + * @since 20 * @arkts 1.2 */ getAlbum(): Album | null; @@ -9868,7 +9868,7 @@ declare namespace photoAccessHelper { * * @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. + * Possible causes: 1. Database corrupted. 2. The file system is abnormal. 3. The IPC request timed out. * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 20 -- Gitee From 8985568a07af6bcdf3b149477326a3d8aa4bea47 Mon Sep 17 00:00:00 2001 From: hdwang Date: Wed, 27 Aug 2025 11:41:41 +0000 Subject: [PATCH 4/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 913a1ef56d..d6c9c92401 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -1405,9 +1405,9 @@ declare namespace photoAccessHelper { * Indicates required media asset data quickly is prepared * * @typedef { function } OnQuickDataPreparedFunc - * @param { T | undefined } data - the returned data of media asset. + * @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 { 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 @@ -2293,7 +2293,7 @@ declare namespace photoAccessHelper { * @since 20 * @arkts 1.2 */ - requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string | null; + requestPhoto(options?: RequestPhotoOptions, callback: AsyncCallback): string | null; /** * Cancels a task for obtaining media thumbnails. * @@ -8385,9 +8385,11 @@ declare namespace photoAccessHelper { * 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. + * 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 @@ -8470,7 +8472,6 @@ declare namespace photoAccessHelper { *
Possible causes: 1. Database corrupted. 2. The file system is abnormal. 3. The IPC request timed out. * @static * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core - * @atomicservice * @since 20 * @arkts 1.2 */ @@ -8544,7 +8545,6 @@ declare namespace photoAccessHelper { * @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 - * @atomicservice * @since 20 * @arkts 1.2 */ @@ -9870,7 +9870,6 @@ declare namespace photoAccessHelper { * @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 - * @atomicservice * @since 20 * @arkts 1.2 */ -- Gitee From 7d198391284aec81cfd7608e9231554a95944a84 Mon Sep 17 00:00:00 2001 From: hdwang Date: Wed, 27 Aug 2025 11:53:42 +0000 Subject: [PATCH 5/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index d6c9c92401..df3f825d58 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -1405,9 +1405,9 @@ declare namespace photoAccessHelper { * Indicates required media asset data quickly is prepared * * @typedef { function } OnQuickDataPreparedFunc - * @param { T | undefined } [data] - the returned data of media asset. + * @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 { 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 @@ -2293,7 +2293,8 @@ declare namespace photoAccessHelper { * @since 20 * @arkts 1.2 */ - requestPhoto(options?: RequestPhotoOptions, callback: AsyncCallback): string | null; + //! codecheck这里有问题(设置option命名要求是可选参数 电子流里变更不一致) + requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string | null; /** * Cancels a task for obtaining media thumbnails. * -- Gitee From 0eebcaf8f0195c7452c6181a8559b2749540200b Mon Sep 17 00:00:00 2001 From: hdwang Date: Thu, 28 Aug 2025 03:28:25 +0000 Subject: [PATCH 6/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index df3f825d58..b77b3d5455 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -2293,7 +2293,6 @@ declare namespace photoAccessHelper { * @since 20 * @arkts 1.2 */ - //! codecheck这里有问题(设置option命名要求是可选参数 电子流里变更不一致) requestPhoto(options: RequestPhotoOptions, callback: AsyncCallback): string | null; /** * Cancels a task for obtaining media thumbnails. -- Gitee From 0e20e724578acde6f886ac33099277e6d7dce5be Mon Sep 17 00:00:00 2001 From: hdwang Date: Thu, 28 Aug 2025 04:13:29 +0000 Subject: [PATCH 7/7] =?UTF-8?q?null/undefined=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hdwang --- api/@ohos.file.photoAccessHelper.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index b77b3d5455..9a3c2aec17 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -1405,10 +1405,10 @@ declare namespace photoAccessHelper { * Indicates required media asset data quickly is prepared * * @typedef { function } OnQuickDataPreparedFunc - * @param { T | undefined } data - the returned data of media asset. + * @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 + * @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 -- Gitee