picker微信生态需求新增接口

Signed-off-by: zhouwenjun1031 <zhouwenjun6@huawei.com>
This commit is contained in:
zhouwenjun1031 2024-09-19 22:05:23 +08:00
parent 6db75c379b
commit 64898d50d6
2 changed files with 94 additions and 0 deletions

View File

@ -19,6 +19,7 @@
*/
import { PickerColorMode } from '@ohos.file.PhotoPickerComponent';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
/**
* AlbumPickerComponent: can select a certain album and display the images in that album through PhotoPickerComponent
@ -48,8 +49,28 @@ export declare struct AlbumPickerComponent {
* @since 12
*/
onAlbumClick?: (albumInfo: AlbumInfo) => boolean;
/**
* Callback when click the empty area of the album component
*
* @type { ?function }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
onEmptyAreaClick?: EmptyAreaClickCallback;
}
/**
* The callback of onEmptyAreaClick event
*
* @typedef { function } EmptyAreaClickCallback
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
export type EmptyAreaClickCallback = () => void
/**
* AlbumPickerOptions Object
*
@ -67,6 +88,16 @@ export declare class AlbumPickerOptions {
* @since 12
*/
themeColorMode?: PickerColorMode;
/**
* The type of the content displayed in the album
*
* @type { ?photoAccessHelper.PhotoViewMIMETypes }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
filterType?: photoAccessHelper.PhotoViewMIMETypes;
}

View File

@ -110,6 +110,36 @@ export declare struct PhotoPickerComponent {
*/
onPhotoBrowserChanged?: (browserItemInfo: BaseItemInfo) => boolean;
/**
* Callback when selected items are deleted
*
* @type { ?function }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
onSelectedItemsDeleted?: ItemsDeletedCallback;
/**
* Callback when exceed max selected
*
* @type { ?function }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
onExceedMaxSelected?: ExceedMaxSelectedCallback;
/**
* Callback when the current album is deleted
*
* @type { ?function }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
onCurrentAlbumDeleted?: CurrentAlbumDeletedCallback
/**
* PickerController
*
@ -131,6 +161,39 @@ export declare struct PhotoPickerComponent {
build(): void;
}
/**
* The callback of onSelectedItemsDeleted event
*
* @typedef { function } ItemsDeletedCallback
* @param { Array<ItemInfo> }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
export type ItemsDeletedCallback = (itemInfos: Array<ItemInfo>) => void;
/**
* The callback of onExceedMaxSelected event
*
* @typedef { function } ItemsDeletedCallback
* @param { MaxCountType }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
export type ExceedMaxSelectedCallback = (maxCountType: MaxCountType) => void;
/**
* The callback of onCurrentAlbumDeleted event
*
* @typedef { function } CurrentAlbumDeletedCallback
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 13
*/
export type CurrentAlbumDeletedCallback = () => void;
/**
* The class for PickerController
*