1/* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file A component which supports applications to select album 18 * @kit MediaLibraryKit 19 */ 20 21import { PickerColorMode } from '@ohos.file.PhotoPickerComponent'; 22import photoAccessHelper from '@ohos.file.photoAccessHelper'; 23 24/** 25 * AlbumPickerComponent: can select a certain album and display the images in that album through PhotoPickerComponent 26 * 27 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 28 * @atomicservice 29 * @since 12 30 */ 31@Component 32export declare struct AlbumPickerComponent { 33 /** 34 * AlbumPickerOptions 35 * 36 * @type { ?AlbumPickerOptions } 37 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 38 * @atomicservice 39 * @since 12 40 */ 41 albumPickerOptions?: AlbumPickerOptions; 42 43 /** 44 * Callback when select an album, will return album uri 45 * 46 * @type { ?function } 47 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 48 * @atomicservice 49 * @since 12 50 */ 51 onAlbumClick?: (albumInfo: AlbumInfo) => boolean; 52 53 /** 54 * Callback when click the empty area of the album component 55 * 56 * @type { ?function } 57 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 58 * @atomicservice 59 * @since 13 60 */ 61 onEmptyAreaClick?: EmptyAreaClickCallback; 62} 63 64/** 65 * The callback of onEmptyAreaClick event 66 * 67 * @typedef { function } EmptyAreaClickCallback 68 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 69 * @atomicservice 70 * @since 13 71 */ 72export type EmptyAreaClickCallback = () => void 73 74/** 75 * AlbumPickerOptions Object 76 * 77 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 78 * @atomicservice 79 * @since 12 80 */ 81export declare class AlbumPickerOptions { 82 /** 83 * AlbumPickerComponent theme color 84 * 85 * @type { ?PickerColorMode } 86 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 87 * @atomicservice 88 * @since 12 89 */ 90 themeColorMode?: PickerColorMode; 91 92 /** 93 * The type of the content displayed in the album 94 * 95 * @type { ?photoAccessHelper.PhotoViewMIMETypes } 96 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 97 * @atomicservice 98 * @since 13 99 */ 100 filterType?: photoAccessHelper.PhotoViewMIMETypes; 101} 102 103 104/** 105 * AlbumInfo: include album uri 106 * 107 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 108 * @atomicservice 109 * @since 12 110 */ 111export declare class AlbumInfo { 112 /** 113 * Album uri 114 * 115 * @type { ?string } 116 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 117 * @atomicservice 118 * @since 12 119 */ 120 uri?: string; 121 122 /** 123 * Album name 124 * 125 * @type { ?string } 126 * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 127 * @atomicservice 128 * @since 12 129 */ 130 albumName?: string; 131}