From 080cfdd4b754b2e05506586e2844255ca5d2c2b9 Mon Sep 17 00:00:00 2001 From: mabo26 Date: Sat, 5 Jul 2025 19:59:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0getRecentPhotoInfo?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mabo26 --- api/@ohos.file.photoAccessHelper.d.ts | 116 ++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index a5e1ab38e2..27cf63d18c 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -6236,6 +6236,122 @@ declare namespace photoAccessHelper { * @arkts 1.1&1.2 */ setPhotoAlbumOrder(orderStyle: number, albumOrders: Array): Promise; + + /** + * Get recwnt photo or video info by options + * + * @param { RecentPhotoOptions } options - options for recent photo + * @returns { Promise } - Returns the recent photo info + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 20 + */ + getRecentPhotoInfo(options: RecentPhotoOptions): Promise; + } + + /** + * RecentPhotoOptions Object + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + export class RecentPhotoOptions { + /** + * Support set period time + * + * @type { ?number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + period?: number; + + /** + * The type of the file in the recent photo window. + * + * @type { ?photoAccessHelper.PhotoViewMIMETypes } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + MIMEType?: photoAccessHelper.PhotoViewMIMETypes; + + /** + * PhotoSource + * + * @type { ?PhotoSource } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + photoSource?: PhotoSource; + } + + /** + * Recent photo info + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + export class RecentPhotoInfo { + /** + * The dateTaken of photos or videos + * + * @type { ?number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + dateTaken?: number; + + /** + * The identifier of photos or videos + * + * @type { ?string } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + identifier?: string; + } + + /** + * Enumeration of PhotoSource type + * + * @enum { number } PhotoSource + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + export enum PhotoSource { + /** + * all resource + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + ALL = 0, + + /** + * camera resource + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + CAMERA = 1, + + /** + * screenshot resource + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 12 + */ + SCREENSHOT = 2 } /** -- Gitee From aeda924bd9d9d4a7e5fde8d51bd3ce95ca721777 Mon Sep 17 00:00:00 2001 From: mabo26 Date: Sat, 5 Jul 2025 22:27:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0getRecentPhotoInfo?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mabo26 --- api/@ohos.file.photoAccessHelper.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 27cf63d18c..2897ea60d4 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -6240,13 +6240,13 @@ declare namespace photoAccessHelper { /** * Get recwnt photo or video info by options * - * @param { RecentPhotoOptions } options - options for recent photo + * @param { RecentPhotoOptions } [options] - options for recent photo * @returns { Promise } - Returns the recent photo info * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 20 */ - getRecentPhotoInfo(options: RecentPhotoOptions): Promise; + getRecentPhotoInfo(options?: RecentPhotoOptions): Promise; } /** @@ -6254,7 +6254,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ export class RecentPhotoOptions { /** @@ -6263,7 +6263,7 @@ declare namespace photoAccessHelper { * @type { ?number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ period?: number; @@ -6273,7 +6273,7 @@ declare namespace photoAccessHelper { * @type { ?photoAccessHelper.PhotoViewMIMETypes } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ MIMEType?: photoAccessHelper.PhotoViewMIMETypes; @@ -6283,7 +6283,7 @@ declare namespace photoAccessHelper { * @type { ?PhotoSource } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ photoSource?: PhotoSource; } @@ -6293,7 +6293,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 13 + * @since 20 */ export class RecentPhotoInfo { /** @@ -6302,7 +6302,7 @@ declare namespace photoAccessHelper { * @type { ?number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 13 + * @since 20 */ dateTaken?: number; @@ -6312,7 +6312,7 @@ declare namespace photoAccessHelper { * @type { ?string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 13 + * @since 20 */ identifier?: string; } @@ -6323,7 +6323,7 @@ declare namespace photoAccessHelper { * @enum { number } PhotoSource * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ export enum PhotoSource { /** @@ -6331,7 +6331,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ ALL = 0, @@ -6340,7 +6340,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ CAMERA = 1, @@ -6349,7 +6349,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice - * @since 12 + * @since 20 */ SCREENSHOT = 2 } -- Gitee From e3148dde9d208171ae1560db4779f95327672efb Mon Sep 17 00:00:00 2001 From: panlulu Date: Mon, 7 Jul 2025 11:31:18 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0getRecentPhotoInfo?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: panlulu --- api/@ohos.file.photoAccessHelper.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 2897ea60d4..6e169084f0 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -6238,7 +6238,7 @@ declare namespace photoAccessHelper { setPhotoAlbumOrder(orderStyle: number, albumOrders: Array): Promise; /** - * Get recwnt photo or video info by options + * Get recent photo or video info by options * * @param { RecentPhotoOptions } [options] - options for recent photo * @returns { Promise } - Returns the recent photo info -- Gitee