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 18 * @kit ArkUI 19 */ 20/*** if arkts 1.2 */ 21import { ImageAttribute } from './image'; 22import image from '../../@ohos.multimedia.image'; 23import { ResourceStr } from './units' 24import { DrawableDescriptor } from '../../@ohos.arkui.drawableDescriptor'; 25/*** endif */ 26/** 27 * Defines the resource which can use ASTC. 28 * 29 * @interface ASTCResource 30 * @syscap SystemCapability.ArkUI.ArkUI.Full 31 * @systemapi 32 * @since arkts {'1.1':'12','1.2':'20'} 33 * @arkts 1.1&1.2 34 */ 35interface ASTCResource { 36 /** 37 * Array of ASTC uri resources, indicating the range of ASTC data to be obtained. 38 * @type { Array<string> } 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @systemapi 41 * @since arkts {'1.1':'12','1.2':'20'} 42 * @arkts 1.1&1.2 43 */ 44 sources: Array<string>; 45 /** 46 * Column size, indicating the number of ASTC resources to splice per row. 47 * @type { number } 48 * @syscap SystemCapability.ArkUI.ArkUI.Full 49 * @systemapi 50 * @since arkts {'1.1':'12','1.2':'20'} 51 * @arkts 1.1&1.2 52 */ 53 column: number; 54} 55 56/** 57 * @interface MediaCachedImageInterface 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @systemapi 60 * @since arkts {'1.1':'12','1.2':'20'} 61 * @arkts 1.1&1.2 62 */ 63interface MediaCachedImageInterface { 64 /** 65 * Image resource to be obtained. 66 * 67 * @param { PixelMap | ResourceStr | DrawableDescriptor | ASTCResource } src 68 * @returns { MediaCachedImageAttribute } 69 * @syscap SystemCapability.ArkUI.ArkUI.Full 70 * @systemapi 71 * @since 12 72 */ 73 (src: PixelMap | ResourceStr | DrawableDescriptor | ASTCResource): MediaCachedImageAttribute; 74 /** 75 * Image resource to be obtained. 76 * 77 * @param { PixelMap | ResourceStr | DrawableDescriptor | ASTCResource } src 78 * @returns { MediaCachedImageAttribute } 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @systemapi 81 * @since 20 82 * @arkts 1.2 83 */ 84 (src: image.PixelMap | ResourceStr | DrawableDescriptor | ASTCResource): MediaCachedImageAttribute; 85} 86 87/** 88 * Attributes of MediaCachedImage inherited from ImageAttribute. 89 * 90 * @extends ImageAttribute 91 * @syscap SystemCapability.ArkUI.ArkUI.Full 92 * @systemapi 93 * @since arkts {'1.1':'12','1.2':'20'} 94 * @arkts 1.1&1.2 95 */ 96declare class MediaCachedImageAttribute extends ImageAttribute {} 97 98/** 99 * MediaCachedImage component. 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @systemapi 103 * @since 12 104 */ 105declare const MediaCachedImage: MediaCachedImageInterface; 106 107/** 108 * Instance of MediaCachedImage component. 109 * 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @systemapi 112 * @since 12 113 */ 114declare const MediaCachedImageInstance: MediaCachedImageAttribute; 115