1/* 2 * Copyright (c) 2023-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 21import image from './@ohos.multimedia.image'; 22 23/** 24 * Use the DrawableDescriptor class to get drawable image. 25 * 26 * @syscap SystemCapability.ArkUI.ArkUI.Full 27 * @since 10 28 */ 29/** 30 * Use the DrawableDescriptor class to get drawable image. 31 * 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @atomicservice 34 * @since 11 35 */ 36/** 37 * Use the DrawableDescriptor class to get drawable image. 38 * 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @crossplatform 41 * @atomicservice 42 * @since arkts {'1.1':'12','1.2':'20'} 43 * @arkts 1.1&1.2 44 */ 45export declare class DrawableDescriptor { 46 /** 47 * Creates a new DrawableDescriptor. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @systemapi Hide this for inner system use. 51 * @since arkts {'1.1':'10','1.2':'20'} 52 * @arkts 1.1&1.2 53 */ 54 constructor(); 55 56 /** 57 * Get pixelMap of drawable image. 58 * 59 * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @since 10 62 */ 63 /** 64 * Get pixelMap of drawable image. 65 * 66 * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @atomicservice 69 * @since 11 70 */ 71 /** 72 * Get pixelMap of drawable image. 73 * 74 * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @atomicservice 78 * @since arkts {'1.1':'12','1.2':'20'} 79 * @arkts 1.1&1.2 80 */ 81 getPixelMap(): image.PixelMap; 82} 83 84/** 85 * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 86 * 87 * @extends DrawableDescriptor 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @since 10 90 */ 91/** 92 * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 93 * 94 * @extends DrawableDescriptor 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @atomicservice 97 * @since 11 98 */ 99/** 100 * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 101 * 102 * @extends DrawableDescriptor 103 * @syscap SystemCapability.ArkUI.ArkUI.Full 104 * @crossplatform 105 * @atomicservice 106 * @since arkts {'1.1':'12','1.2':'20'} 107 * @arkts 1.1&1.2 108 */ 109export declare class LayeredDrawableDescriptor extends DrawableDescriptor { 110 /** 111 * Creates a new LayeredDrawableDescriptor. 112 * 113 * @param { DrawableDescriptor } [foreground] - Indicates the foreground option to create LayeredDrawableDescriptor. 114 * @param { DrawableDescriptor } [background] - Indicates the background option to create LayeredDrawableDescriptor. 115 * @param { DrawableDescriptor } [mask] - Indicates the mask option to create LayeredDrawableDescriptor. 116 * @syscap SystemCapability.ArkUI.ArkUI.Full 117 * @atomicservice 118 * @since arkts {'1.1':'12','1.2':'20'} 119 * @arkts 1.1&1.2 120 */ 121 constructor( 122 foreground?: DrawableDescriptor, 123 background?: DrawableDescriptor, 124 mask?: DrawableDescriptor 125 ); 126 127 /** 128 * Get DrawableDescriptor for the foreground. 129 * 130 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @since 10 133 */ 134 /** 135 * Get DrawableDescriptor for the foreground. 136 * 137 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @atomicservice 140 * @since 11 141 */ 142 /** 143 * Get DrawableDescriptor for the foreground. 144 * 145 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @atomicservice 149 * @since arkts {'1.1':'12','1.2':'20'} 150 * @arkts 1.1&1.2 151 */ 152 getForeground(): DrawableDescriptor; 153 154 /** 155 * Get DrawableDescriptor for the background. 156 * 157 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @since 10 160 */ 161 /** 162 * Get DrawableDescriptor for the background. 163 * 164 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @atomicservice 167 * @since 11 168 */ 169 /** 170 * Get DrawableDescriptor for the background. 171 * 172 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 173 * @syscap SystemCapability.ArkUI.ArkUI.Full 174 * @crossplatform 175 * @atomicservice 176 * @since 12 177 */ 178 /** 179 * Get DrawableDescriptor for the background. 180 * 181 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 182 * @syscap SystemCapability.ArkUI.ArkUI.Full 183 * @crossplatform 184 * @atomicservice 185 * @since arkts {'1.1':'12','1.2':'20'} 186 * @arkts 1.1&1.2 187 */ 188 getBackground(): DrawableDescriptor; 189 190 /** 191 * Get DrawableDescriptor for the mask. 192 * 193 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @since 10 196 */ 197 /** 198 * Get DrawableDescriptor for the mask. 199 * 200 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @atomicservice 203 * @since 11 204 */ 205 /** 206 * Get DrawableDescriptor for the mask. 207 * 208 * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 209 * @syscap SystemCapability.ArkUI.ArkUI.Full 210 * @crossplatform 211 * @atomicservice 212 * @since arkts {'1.1':'12','1.2':'20'} 213 * @arkts 1.1&1.2 214 */ 215 getMask(): DrawableDescriptor; 216 217 /** 218 * Get the clip path info of the adaptive icon mask. 219 * 220 * @returns { string } Return the clip path info of mask. 221 * @syscap SystemCapability.ArkUI.ArkUI.Full 222 * @since 10 223 */ 224 /** 225 * Get the clip path info of the adaptive icon mask. 226 * 227 * @returns { string } Return the clip path info of mask. 228 * @syscap SystemCapability.ArkUI.ArkUI.Full 229 * @atomicservice 230 * @since 11 231 */ 232 /** 233 * Get the clip path info of the adaptive icon mask. 234 * 235 * @returns { string } Return the clip path info of mask. 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @atomicservice 239 * @since arkts {'1.1':'12','1.2':'20'} 240 * @arkts 1.1&1.2 241 */ 242 static getMaskClipPath(): string; 243} 244 245/** 246 * Use the PixelMapDrawableDescriptor class to get the resource of pixelmap or resource descriptor information. 247 * 248 * @extends DrawableDescriptor 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @atomicservice 251 * @since arkts {'1.1':'12','1.2':'20'} 252 * @arkts 1.1&1.2 253 */ 254export declare class PixelMapDrawableDescriptor extends DrawableDescriptor { 255 /** 256 * Creates a new PixelMapDrawableDescriptor. 257 * @param { image.PixelMap } src - Indicates the resource to create PixelMapDrawableDescriptor. 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @atomicservice 260 * @since arkts {'1.1':'12','1.2':'20'} 261 * @arkts 1.1&1.2 262 */ 263 constructor(src?: image.PixelMap); 264} 265 266/** 267 * Animation control options 268 * 269 * @interface AnimationOptions 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @atomicservice 273 * @since arkts {'1.1':'12','1.2':'20'} 274 * @arkts 1.1&1.2 275 */ 276export declare interface AnimationOptions { 277 /** 278 * The duration of animation playback once. 279 * 280 * @type { ?number } 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @crossplatform 283 * @atomicservice 284 * @since arkts {'1.1':'12','1.2':'20'} 285 * @arkts 1.1&1.2 286 */ 287 duration?: number; 288 /** 289 * Animation playback times. 290 * 291 * @type { ?number } 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @atomicservice 295 * @since arkts {'1.1':'12','1.2':'20'} 296 * @arkts 1.1&1.2 297 */ 298 iterations?: number; 299} 300 301/** 302 * Define the data structure for PixelMap animations. 303 * 304 * @extends DrawableDescriptor 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @crossplatform 307 * @atomicservice 308 * @since arkts {'1.1':'12','1.2':'20'} 309 * @arkts 1.1&1.2 310 */ 311export declare class AnimatedDrawableDescriptor extends DrawableDescriptor { 312 /** 313 * Creates a new AnimatedDrawableDescriptor. 314 * 315 * @param { Array<image.PixelMap> } pixelMaps - PixelMap List. 316 * @param { AnimationOptions } [options] - Animation control options. 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @crossplatform 319 * @atomicservice 320 * @since arkts {'1.1':'12','1.2':'20'} 321 * @arkts 1.1&1.2 322 */ 323 constructor(pixelMaps: Array<image.PixelMap>, options?: AnimationOptions); 324} 325