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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Defines the ImageAnimator Interface. 23 * 24 * @interface ImageAnimatorInterface 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Defines the ImageAnimator Interface. 30 * 31 * @interface ImageAnimatorInterface 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @form 35 * @since 10 36 */ 37/** 38 * Defines the ImageAnimator Interface. 39 * 40 * @interface ImageAnimatorInterface 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @form 44 * @atomicservice 45 * @since 11 46 */ 47interface ImageAnimatorInterface { 48 /** 49 * ImageAnimator is returned. 50 * 51 * @returns { ImageAnimatorAttribute } 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @since 7 54 */ 55 /** 56 * ImageAnimator is returned. 57 * 58 * @returns { ImageAnimatorAttribute } 59 * @syscap SystemCapability.ArkUI.ArkUI.Full 60 * @crossplatform 61 * @form 62 * @since 10 63 */ 64 /** 65 * ImageAnimator is returned. 66 * 67 * @returns { ImageAnimatorAttribute } 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @form 71 * @atomicservice 72 * @since 11 73 */ 74 (): ImageAnimatorAttribute; 75} 76 77/** 78 * Defines the ImageFrameInfo Interface. 79 * 80 * @interface ImageFrameInfo 81 * @syscap SystemCapability.ArkUI.ArkUI.Full 82 * @since 7 83 */ 84/** 85 * Defines the ImageFrameInfo Interface. 86 * 87 * @interface ImageFrameInfo 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @crossplatform 90 * @form 91 * @since 10 92 */ 93/** 94 * Defines the ImageFrameInfo Interface. 95 * 96 * @interface ImageFrameInfo 97 * @syscap SystemCapability.ArkUI.ArkUI.Full 98 * @crossplatform 99 * @form 100 * @atomicservice 101 * @since 11 102 */ 103interface ImageFrameInfo { 104 /** 105 * Image path 106 * 107 * @type { string } 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @since 7 110 */ 111 /** 112 * Image path 113 * 114 * @type { string | Resource } 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @since 9 117 */ 118 /** 119 * Image path 120 * 121 * @type { string | Resource } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @crossplatform 124 * @form 125 * @since 10 126 */ 127 /** 128 * Image path 129 * 130 * @type { string | Resource } 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @crossplatform 133 * @form 134 * @atomicservice 135 * @since 11 136 */ 137 /** 138 * Image path 139 * 140 * @type { string | Resource | PixelMap } 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @crossplatform 143 * @form 144 * @atomicservice 145 * @since 12 146 */ 147 src: string | Resource | PixelMap; 148 /** 149 * Image width 150 * 151 * @type { ?(number | string) } 152 * @syscap SystemCapability.ArkUI.ArkUI.Full 153 * @since 7 154 */ 155 /** 156 * Image width 157 * 158 * @type { ?(number | string) } 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @crossplatform 161 * @form 162 * @since 10 163 */ 164 /** 165 * Image width 166 * 167 * @type { ?(number | string) } 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @form 171 * @atomicservice 172 * @since 11 173 */ 174 width?: number | string; 175 /** 176 * Image height 177 * 178 * @type { ?(number | string) } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @since 7 181 */ 182 /** 183 * Image height 184 * 185 * @type { ?(number | string) } 186 * @syscap SystemCapability.ArkUI.ArkUI.Full 187 * @crossplatform 188 * @form 189 * @since 10 190 */ 191 /** 192 * Image height 193 * 194 * @type { ?(number | string) } 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @form 198 * @atomicservice 199 * @since 11 200 */ 201 height?: number | string; 202 /** 203 * Vertical coordinate of the image relative to the upper left corner of the component 204 * 205 * @type { ?(number | string) } 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @since 7 208 */ 209 /** 210 * Vertical coordinate of the image relative to the upper left corner of the component 211 * 212 * @type { ?(number | string) } 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @crossplatform 215 * @form 216 * @since 10 217 */ 218 /** 219 * Vertical coordinate of the image relative to the upper left corner of the component 220 * 221 * @type { ?(number | string) } 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @form 225 * @atomicservice 226 * @since 11 227 */ 228 top?: number | string; 229 /** 230 * Horizontal coordinate of the image relative to the upper left corner of the component 231 * 232 * @type { ?(number | string) } 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @since 7 235 */ 236 /** 237 * Horizontal coordinate of the image relative to the upper left corner of the component 238 * 239 * @type { ?(number | string) } 240 * @syscap SystemCapability.ArkUI.ArkUI.Full 241 * @crossplatform 242 * @form 243 * @since 10 244 */ 245 /** 246 * Horizontal coordinate of the image relative to the upper left corner of the component 247 * 248 * @type { ?(number | string) } 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @form 252 * @atomicservice 253 * @since 11 254 */ 255 left?: number | string; 256 /** 257 * Playback duration of this image frame, in milliseconds. 258 * 259 * @type { ?number } 260 * @syscap SystemCapability.ArkUI.ArkUI.Full 261 * @since 7 262 */ 263 /** 264 * Playback duration of this image frame, in milliseconds. 265 * 266 * @type { ?number } 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @since 10 270 */ 271 /** 272 * Playback duration of this image frame, in milliseconds. 273 * 274 * @type { ?number } 275 * @syscap SystemCapability.ArkUI.ArkUI.Full 276 * @crossplatform 277 * @atomicservice 278 * @since 11 279 */ 280 duration?: number; 281} 282 283/** 284 * inheritance CommonMethod 285 * 286 * @extends CommonMethod<ImageAnimatorAttribute> 287 * @syscap SystemCapability.ArkUI.ArkUI.Full 288 * @since 7 289 */ 290/** 291 * inheritance CommonMethod 292 * 293 * @extends CommonMethod<ImageAnimatorAttribute> 294 * @syscap SystemCapability.ArkUI.ArkUI.Full 295 * @crossplatform 296 * @form 297 * @since 10 298 */ 299/** 300 * inheritance CommonMethod 301 * 302 * @extends CommonMethod<ImageAnimatorAttribute> 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @form 306 * @atomicservice 307 * @since 11 308 */ 309declare class ImageAnimatorAttribute extends CommonMethod<ImageAnimatorAttribute> { 310 /** 311 * list images 312 * 313 * @param { Array<ImageFrameInfo> } value 314 * @returns { ImageAnimatorAttribute } 315 * @syscap SystemCapability.ArkUI.ArkUI.Full 316 * @since 7 317 */ 318 /** 319 * list images 320 * 321 * @param { Array<ImageFrameInfo> } value 322 * @returns { ImageAnimatorAttribute } 323 * @syscap SystemCapability.ArkUI.ArkUI.Full 324 * @crossplatform 325 * @form 326 * @since 10 327 */ 328 /** 329 * list images 330 * 331 * @param { Array<ImageFrameInfo> } value 332 * @returns { ImageAnimatorAttribute } 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @crossplatform 335 * @form 336 * @atomicservice 337 * @since 11 338 */ 339 images(value: Array<ImageFrameInfo>): ImageAnimatorAttribute; 340 341 /** 342 * The default value is the initial state, which is used to control the playback status. 343 * 344 * @param { AnimationStatus } value 345 * @returns { ImageAnimatorAttribute } 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @since 7 348 */ 349 /** 350 * The default value is the initial state, which is used to control the playback status. 351 * 352 * @param { AnimationStatus } value 353 * @returns { ImageAnimatorAttribute } 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @crossplatform 356 * @form 357 * @since 10 358 */ 359 /** 360 * The default value is the initial state, which is used to control the playback status. 361 * 362 * @param { AnimationStatus } value 363 * @returns { ImageAnimatorAttribute } 364 * @syscap SystemCapability.ArkUI.ArkUI.Full 365 * @crossplatform 366 * @form 367 * @atomicservice 368 * @since 11 369 */ 370 state(value: AnimationStatus): ImageAnimatorAttribute; 371 372 /** 373 * The unit is millisecond. 374 * 375 * @param { number } value 376 * @returns { ImageAnimatorAttribute } 377 * @syscap SystemCapability.ArkUI.ArkUI.Full 378 * @since 7 379 */ 380 /** 381 * The unit is millisecond. 382 * 383 * @param { number } value 384 * @returns { ImageAnimatorAttribute } 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @crossplatform 387 * @form 388 * @since 10 389 */ 390 /** 391 * The unit is millisecond. 392 * 393 * @param { number } value 394 * @returns { ImageAnimatorAttribute } 395 * @syscap SystemCapability.ArkUI.ArkUI.Full 396 * @crossplatform 397 * @form 398 * @atomicservice 399 * @since 11 400 */ 401 duration(value: number): ImageAnimatorAttribute; 402 403 /** 404 * Set the playback sequence. 405 * 406 * @param { boolean } value 407 * @returns { ImageAnimatorAttribute } 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @since 7 410 */ 411 /** 412 * Set the playback sequence. 413 * 414 * @param { boolean } value 415 * @returns { ImageAnimatorAttribute } 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @form 419 * @since 10 420 */ 421 /** 422 * Set the playback sequence. 423 * 424 * @param { boolean } value 425 * @returns { ImageAnimatorAttribute } 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @crossplatform 428 * @form 429 * @atomicservice 430 * @since 11 431 */ 432 reverse(value: boolean): ImageAnimatorAttribute; 433 434 /** 435 * Sets whether the image size is fixed to the component size. 436 * 437 * @param { boolean } value 438 * @returns { ImageAnimatorAttribute } 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @since 7 441 */ 442 /** 443 * Sets whether the image size is fixed to the component size. 444 * 445 * @param { boolean } value 446 * @returns { ImageAnimatorAttribute } 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @crossplatform 449 * @form 450 * @since 10 451 */ 452 /** 453 * Sets whether the image size is fixed to the component size. 454 * 455 * @param { boolean } value 456 * @returns { ImageAnimatorAttribute } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @crossplatform 459 * @form 460 * @atomicservice 461 * @since 11 462 */ 463 fixedSize(value: boolean): ImageAnimatorAttribute; 464 465 /** 466 * Indicates whether to enable pre-decoding. 467 * 468 * @param { number } value 469 * @returns { ImageAnimatorAttribute } 470 * @syscap SystemCapability.ArkUI.ArkUI.Full 471 * @since 7 472 * @deprecated since 9 473 */ 474 preDecode(value: number): ImageAnimatorAttribute; 475 476 /** 477 * Sets the state before and after the animation starts 478 * 479 * @param { FillMode } value 480 * @returns { ImageAnimatorAttribute } 481 * @syscap SystemCapability.ArkUI.ArkUI.Full 482 * @since 7 483 */ 484 /** 485 * Sets the state before and after the animation starts 486 * 487 * @param { FillMode } value 488 * @returns { ImageAnimatorAttribute } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @form 492 * @since 10 493 */ 494 /** 495 * Sets the state before and after the animation starts 496 * 497 * @param { FillMode } value 498 * @returns { ImageAnimatorAttribute } 499 * @syscap SystemCapability.ArkUI.ArkUI.Full 500 * @crossplatform 501 * @form 502 * @atomicservice 503 * @since 11 504 */ 505 fillMode(value: FillMode): ImageAnimatorAttribute; 506 507 /** 508 * Played once by default 509 * 510 * @param { number } value 511 * @returns { ImageAnimatorAttribute } 512 * @syscap SystemCapability.ArkUI.ArkUI.Full 513 * @since 7 514 */ 515 /** 516 * Played once by default 517 * 518 * @param { number } value 519 * @returns { ImageAnimatorAttribute } 520 * @syscap SystemCapability.ArkUI.ArkUI.Full 521 * @crossplatform 522 * @since 10 523 */ 524 /** 525 * Played once by default 526 * 527 * @param { number } value 528 * @returns { ImageAnimatorAttribute } 529 * @syscap SystemCapability.ArkUI.ArkUI.Full 530 * @crossplatform 531 * @atomicservice 532 * @since 11 533 */ 534 iterations(value: number): ImageAnimatorAttribute; 535 536 /** 537 * Determines whether to use the system onVisibleAreaChange callback to control pause and play. 538 * 539 * @param { boolean } monitorInvisibleArea 540 * @returns { ImageAnimatorAttribute } 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @crossplatform 543 * @atomicservice 544 * @since 17 545 */ 546 monitorInvisibleArea(monitorInvisibleArea: boolean) : ImageAnimatorAttribute; 547 548 /** 549 * Status callback, which is triggered when the animation starts to play. 550 * 551 * @param { function } event 552 * @returns { ImageAnimatorAttribute } 553 * @syscap SystemCapability.ArkUI.ArkUI.Full 554 * @since 7 555 */ 556 /** 557 * Status callback, which is triggered when the animation starts to play. 558 * 559 * @param { function } event 560 * @returns { ImageAnimatorAttribute } 561 * @syscap SystemCapability.ArkUI.ArkUI.Full 562 * @crossplatform 563 * @form 564 * @since 10 565 */ 566 /** 567 * Status callback, which is triggered when the animation starts to play. 568 * 569 * @param { function } event 570 * @returns { ImageAnimatorAttribute } 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @crossplatform 573 * @form 574 * @atomicservice 575 * @since 11 576 */ 577 onStart(event: () => void): ImageAnimatorAttribute; 578 579 /** 580 * Status callback, which is triggered when the animation pauses. 581 * 582 * @param { function } event 583 * @returns { ImageAnimatorAttribute } 584 * @syscap SystemCapability.ArkUI.ArkUI.Full 585 * @since 7 586 */ 587 /** 588 * Status callback, which is triggered when the animation pauses. 589 * 590 * @param { function } event 591 * @returns { ImageAnimatorAttribute } 592 * @syscap SystemCapability.ArkUI.ArkUI.Full 593 * @crossplatform 594 * @form 595 * @since 10 596 */ 597 /** 598 * Status callback, which is triggered when the animation pauses. 599 * 600 * @param { function } event 601 * @returns { ImageAnimatorAttribute } 602 * @syscap SystemCapability.ArkUI.ArkUI.Full 603 * @crossplatform 604 * @form 605 * @atomicservice 606 * @since 11 607 */ 608 onPause(event: () => void): ImageAnimatorAttribute; 609 610 /** 611 * Status callback, triggered when the animation is replayed 612 * 613 * @param { function } event 614 * @returns { ImageAnimatorAttribute } 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @since 7 617 */ 618 /** 619 * Status callback, triggered when the animation is replayed 620 * 621 * @param { function } event 622 * @returns { ImageAnimatorAttribute } 623 * @syscap SystemCapability.ArkUI.ArkUI.Full 624 * @crossplatform 625 * @since 10 626 */ 627 /** 628 * Status callback, triggered when the animation is replayed 629 * 630 * @param { function } event 631 * @returns { ImageAnimatorAttribute } 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @crossplatform 634 * @atomicservice 635 * @since 11 636 */ 637 onRepeat(event: () => void): ImageAnimatorAttribute; 638 639 /** 640 * Status callback, which is triggered when the animation is canceled. 641 * 642 * @param { function } event 643 * @returns { ImageAnimatorAttribute } 644 * @syscap SystemCapability.ArkUI.ArkUI.Full 645 * @since 7 646 */ 647 /** 648 * Status callback, which is triggered when the animation is canceled. 649 * 650 * @param { function } event 651 * @returns { ImageAnimatorAttribute } 652 * @syscap SystemCapability.ArkUI.ArkUI.Full 653 * @crossplatform 654 * @form 655 * @since 10 656 */ 657 /** 658 * Status callback, which is triggered when the animation is canceled. 659 * 660 * @param { function } event 661 * @returns { ImageAnimatorAttribute } 662 * @syscap SystemCapability.ArkUI.ArkUI.Full 663 * @crossplatform 664 * @form 665 * @atomicservice 666 * @since 11 667 */ 668 onCancel(event: () => void): ImageAnimatorAttribute; 669 670 /** 671 * Status callback, which is triggered when the animation playback is complete. 672 * 673 * @param { function } event 674 * @returns { ImageAnimatorAttribute } 675 * @syscap SystemCapability.ArkUI.ArkUI.Full 676 * @since 7 677 */ 678 /** 679 * Status callback, which is triggered when the animation playback is complete. 680 * 681 * @param { function } event 682 * @returns { ImageAnimatorAttribute } 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @crossplatform 685 * @form 686 * @since 10 687 */ 688 /** 689 * Status callback, which is triggered when the animation playback is complete. 690 * 691 * @param { function } event 692 * @returns { ImageAnimatorAttribute } 693 * @syscap SystemCapability.ArkUI.ArkUI.Full 694 * @crossplatform 695 * @form 696 * @atomicservice 697 * @since 11 698 */ 699 onFinish(event: () => void): ImageAnimatorAttribute; 700} 701 702/** 703 * Defines ImageAnimator Component. 704 * 705 * @syscap SystemCapability.ArkUI.ArkUI.Full 706 * @since 7 707 */ 708/** 709 * Defines ImageAnimator Component. 710 * 711 * @syscap SystemCapability.ArkUI.ArkUI.Full 712 * @crossplatform 713 * @form 714 * @since 10 715 */ 716/** 717 * Defines ImageAnimator Component. 718 * 719 * @syscap SystemCapability.ArkUI.ArkUI.Full 720 * @crossplatform 721 * @form 722 * @atomicservice 723 * @since 11 724 */ 725declare const ImageAnimator: ImageAnimatorInterface; 726 727/** 728 * Defines ImageAnimator Component instance. 729 * 730 * @syscap SystemCapability.ArkUI.ArkUI.Full 731 * @since 7 732 */ 733/** 734 * Defines ImageAnimator Component instance. 735 * 736 * @syscap SystemCapability.ArkUI.ArkUI.Full 737 * @crossplatform 738 * @form 739 * @since 10 740 */ 741/** 742 * Defines ImageAnimator Component instance. 743 * 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @form 747 * @atomicservice 748 * @since 11 749 */ 750declare const ImageAnimatorInstance: ImageAnimatorAttribute; 751