• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 * Defines the ImageAnimator Interface.
18 *
19 * @interface ImageAnimatorInterface
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 7
22 */
23/**
24 * Defines the ImageAnimator Interface.
25 *
26 * @interface ImageAnimatorInterface
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @since 10
30 * @form
31 */
32interface ImageAnimatorInterface {
33  /**
34   * ImageAnimator is returned.
35   *
36   * @returns { ImageAnimatorAttribute }
37   * @syscap SystemCapability.ArkUI.ArkUI.Full
38   * @since 7
39   */
40  /**
41   * ImageAnimator is returned.
42   *
43   * @returns { ImageAnimatorAttribute }
44   * @syscap SystemCapability.ArkUI.ArkUI.Full
45   * @crossplatform
46   * @since 10
47   * @form
48   */
49  (): ImageAnimatorAttribute;
50}
51
52/**
53 * Defines the ImageFrameInfo Interface.
54 *
55 * @interface ImageFrameInfo
56 * @syscap SystemCapability.ArkUI.ArkUI.Full
57 * @since 7
58 */
59/**
60 * Defines the ImageFrameInfo Interface.
61 *
62 * @interface ImageFrameInfo
63 * @syscap SystemCapability.ArkUI.ArkUI.Full
64 * @crossplatform
65 * @since 10
66 * @form
67 */
68interface ImageFrameInfo {
69  /**
70   * Image path
71   *
72   * @type { string | Resource }
73   * @syscap SystemCapability.ArkUI.ArkUI.Full
74   * @since 7
75   */
76  /**
77   * Image path
78   *
79   * @type { string | Resource }
80   * @syscap SystemCapability.ArkUI.ArkUI.Full
81   * @since 9
82   */
83  /**
84   * Image path
85   *
86   * @type { string | Resource }
87   * @syscap SystemCapability.ArkUI.ArkUI.Full
88   * @crossplatform
89   * @since 10
90   * @form
91   */
92  src: string | Resource;
93  /**
94   * Image width
95   *
96   * @type { ?(number | string) }
97   * @syscap SystemCapability.ArkUI.ArkUI.Full
98   * @since 7
99   */
100  /**
101   * Image width
102   *
103   * @type { ?(number | string) }
104   * @syscap SystemCapability.ArkUI.ArkUI.Full
105   * @crossplatform
106   * @since 10
107   * @form
108   */
109  width?: number | string;
110  /**
111   * Image height
112   *
113   * @type { ?(number | string) }
114   * @syscap SystemCapability.ArkUI.ArkUI.Full
115   * @since 7
116   */
117  /**
118   * Image height
119   *
120   * @type { ?(number | string) }
121   * @syscap SystemCapability.ArkUI.ArkUI.Full
122   * @crossplatform
123   * @since 10
124   * @form
125   */
126  height?: number | string;
127  /**
128   * Vertical coordinate of the image relative to the upper left corner of the component
129   *
130   * @type { ?(number | string) }
131   * @syscap SystemCapability.ArkUI.ArkUI.Full
132   * @since 7
133   */
134  /**
135   * Vertical coordinate of the image relative to the upper left corner of the component
136   *
137   * @type { ?(number | string) }
138   * @syscap SystemCapability.ArkUI.ArkUI.Full
139   * @crossplatform
140   * @since 10
141   * @form
142   */
143  top?: number | string;
144  /**
145   * Horizontal coordinate of the image relative to the upper left corner of the component
146   *
147   * @type { ?(number | string) }
148   * @syscap SystemCapability.ArkUI.ArkUI.Full
149   * @since 7
150   */
151  /**
152   * Horizontal coordinate of the image relative to the upper left corner of the component
153   *
154   * @type { ?(number | string) }
155   * @syscap SystemCapability.ArkUI.ArkUI.Full
156   * @crossplatform
157   * @since 10
158   * @form
159   */
160  left?: number | string;
161  /**
162   * Playback duration of this image frame, in milliseconds.
163   *
164   * @type { ?number }
165   * @syscap SystemCapability.ArkUI.ArkUI.Full
166   * @since 7
167   */
168  /**
169   * Playback duration of this image frame, in milliseconds.
170   *
171   * @type { ?number }
172   * @syscap SystemCapability.ArkUI.ArkUI.Full
173   * @crossplatform
174   * @since 10
175   */
176  duration?: number;
177}
178
179/**
180 * inheritance CommonMethod
181 *
182 * @extends CommonMethod
183 * @syscap SystemCapability.ArkUI.ArkUI.Full
184 * @since 7
185 */
186/**
187 * inheritance CommonMethod
188 *
189 * @extends CommonMethod
190 * @syscap SystemCapability.ArkUI.ArkUI.Full
191 * @crossplatform
192 * @since 10
193 * @form
194 */
195declare class ImageAnimatorAttribute extends CommonMethod<ImageAnimatorAttribute> {
196  /**
197   * list images
198   *
199   * @param { Array<ImageFrameInfo> } value
200   * @returns { ImageAnimatorAttribute }
201   * @syscap SystemCapability.ArkUI.ArkUI.Full
202   * @since 7
203   */
204  /**
205   * list images
206   *
207   * @param { Array<ImageFrameInfo> } value
208   * @returns { ImageAnimatorAttribute }
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @crossplatform
211   * @since 10
212   * @form
213   */
214  images(value: Array<ImageFrameInfo>): ImageAnimatorAttribute;
215
216  /**
217   * The default value is the initial state, which is used to control the playback status.
218   *
219   * @param { AnimationStatus } value
220   * @returns { ImageAnimatorAttribute }
221   * @syscap SystemCapability.ArkUI.ArkUI.Full
222   * @since 7
223   */
224  /**
225   * The default value is the initial state, which is used to control the playback status.
226   *
227   * @param { AnimationStatus } value
228   * @returns { ImageAnimatorAttribute }
229   * @syscap SystemCapability.ArkUI.ArkUI.Full
230   * @crossplatform
231   * @since 10
232   * @form
233   */
234  state(value: AnimationStatus): ImageAnimatorAttribute;
235
236  /**
237   * The unit is millisecond.
238   *
239   * @param { number } value
240   * @returns { ImageAnimatorAttribute }
241   * @syscap SystemCapability.ArkUI.ArkUI.Full
242   * @since 7
243   */
244  /**
245   * The unit is millisecond.
246   *
247   * @param { number } value
248   * @returns { ImageAnimatorAttribute }
249   * @syscap SystemCapability.ArkUI.ArkUI.Full
250   * @crossplatform
251   * @since 10
252   * @form
253   */
254  duration(value: number): ImageAnimatorAttribute;
255
256  /**
257   * Set the playback sequence.
258   *
259   * @param { boolean } value
260   * @returns { ImageAnimatorAttribute }
261   * @syscap SystemCapability.ArkUI.ArkUI.Full
262   * @since 7
263   */
264  /**
265   * Set the playback sequence.
266   *
267   * @param { boolean } value
268   * @returns { ImageAnimatorAttribute }
269   * @syscap SystemCapability.ArkUI.ArkUI.Full
270   * @crossplatform
271   * @since 10
272   * @form
273   */
274  reverse(value: boolean): ImageAnimatorAttribute;
275
276  /**
277   * Sets whether the image size is fixed to the component size.
278   *
279   * @param { boolean } value
280   * @returns { ImageAnimatorAttribute }
281   * @syscap SystemCapability.ArkUI.ArkUI.Full
282   * @since 7
283   */
284  /**
285   * Sets whether the image size is fixed to the component size.
286   *
287   * @param { boolean } value
288   * @returns { ImageAnimatorAttribute }
289   * @syscap SystemCapability.ArkUI.ArkUI.Full
290   * @crossplatform
291   * @since 10
292   * @form
293   */
294  fixedSize(value: boolean): ImageAnimatorAttribute;
295
296  /**
297   * Indicates whether to enable pre-decoding.
298   *
299   * @param { number } value
300   * @returns { ImageAnimatorAttribute }
301   * @syscap SystemCapability.ArkUI.ArkUI.Full
302   * @since 7
303   * @deprecated since 9
304   */
305  preDecode(value: number): ImageAnimatorAttribute;
306
307  /**
308   * Sets the state before and after the animation starts
309   *
310   * @param { FillMode } value
311   * @returns { ImageAnimatorAttribute }
312   * @syscap SystemCapability.ArkUI.ArkUI.Full
313   * @since 7
314   */
315  /**
316   * Sets the state before and after the animation starts
317   *
318   * @param { FillMode } value
319   * @returns { ImageAnimatorAttribute }
320   * @syscap SystemCapability.ArkUI.ArkUI.Full
321   * @crossplatform
322   * @since 10
323   * @form
324   */
325  fillMode(value: FillMode): ImageAnimatorAttribute;
326
327  /**
328   * Played once by default
329   *
330   * @param { number } value
331   * @returns { ImageAnimatorAttribute }
332   * @syscap SystemCapability.ArkUI.ArkUI.Full
333   * @since 7
334   */
335  /**
336   * Played once by default
337   *
338   * @param { number } value
339   * @returns { ImageAnimatorAttribute }
340   * @syscap SystemCapability.ArkUI.ArkUI.Full
341   * @crossplatform
342   * @since 10
343   */
344  iterations(value: number): ImageAnimatorAttribute;
345
346  /**
347   * Status callback, which is triggered when the animation starts to play.
348   *
349   * @param { function } event
350   * @returns { ImageAnimatorAttribute }
351   * @syscap SystemCapability.ArkUI.ArkUI.Full
352   * @since 7
353   */
354  /**
355   * Status callback, which is triggered when the animation starts to play.
356   *
357   * @param { function } event
358   * @returns { ImageAnimatorAttribute }
359   * @syscap SystemCapability.ArkUI.ArkUI.Full
360   * @crossplatform
361   * @since 10
362   * @form
363   */
364  onStart(event: () => void): ImageAnimatorAttribute;
365
366  /**
367   * Status callback, which is triggered when the animation pauses.
368   *
369   * @param { function } event
370   * @returns { ImageAnimatorAttribute }
371   * @syscap SystemCapability.ArkUI.ArkUI.Full
372   * @since 7
373   */
374  /**
375   * Status callback, which is triggered when the animation pauses.
376   *
377   * @param { function } event
378   * @returns { ImageAnimatorAttribute }
379   * @syscap SystemCapability.ArkUI.ArkUI.Full
380   * @crossplatform
381   * @since 10
382   * @form
383   */
384  onPause(event: () => void): ImageAnimatorAttribute;
385
386  /**
387   * Status callback, triggered when the animation is replayed
388   *
389   * @param { function } event
390   * @returns { ImageAnimatorAttribute }
391   * @syscap SystemCapability.ArkUI.ArkUI.Full
392   * @since 7
393   */
394  /**
395   * Status callback, triggered when the animation is replayed
396   *
397   * @param { function } event
398   * @returns { ImageAnimatorAttribute }
399   * @syscap SystemCapability.ArkUI.ArkUI.Full
400   * @crossplatform
401   * @since 10
402   */
403  onRepeat(event: () => void): ImageAnimatorAttribute;
404
405  /**
406   * Status callback, which is triggered when the animation is canceled.
407   *
408   * @param { function } event
409   * @returns { ImageAnimatorAttribute }
410   * @syscap SystemCapability.ArkUI.ArkUI.Full
411   * @since 7
412   */
413  /**
414   * Status callback, which is triggered when the animation is canceled.
415   *
416   * @param { function } event
417   * @returns { ImageAnimatorAttribute }
418   * @syscap SystemCapability.ArkUI.ArkUI.Full
419   * @crossplatform
420   * @since 10
421   * @form
422   */
423  onCancel(event: () => void): ImageAnimatorAttribute;
424
425  /**
426   * Status callback, which is triggered when the animation playback is complete.
427   *
428   * @param { function } event
429   * @returns { ImageAnimatorAttribute }
430   * @syscap SystemCapability.ArkUI.ArkUI.Full
431   * @since 7
432   */
433  /**
434   * Status callback, which is triggered when the animation playback is complete.
435   *
436   * @param { function } event
437   * @returns { ImageAnimatorAttribute }
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @crossplatform
440   * @since 10
441   * @form
442   */
443  onFinish(event: () => void): ImageAnimatorAttribute;
444}
445
446/**
447 * Defines ImageAnimator Component.
448 *
449 * @syscap SystemCapability.ArkUI.ArkUI.Full
450 * @since 7
451 */
452/**
453 * Defines ImageAnimator Component.
454 *
455 * @syscap SystemCapability.ArkUI.ArkUI.Full
456 * @crossplatform
457 * @since 10
458 * @form
459 */
460declare const ImageAnimator: ImageAnimatorInterface;
461
462/**
463 * Defines ImageAnimator Component instance.
464 *
465 * @syscap SystemCapability.ArkUI.ArkUI.Full
466 * @since 7
467 */
468/**
469 * Defines ImageAnimator Component instance.
470 *
471 * @syscap SystemCapability.ArkUI.ArkUI.Full
472 * @crossplatform
473 * @since 10
474 * @form
475 */
476declare const ImageAnimatorInstance: ImageAnimatorAttribute;
477