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 * Status callback, which is triggered when the animation starts to play. 538 * 539 * @param { function } event 540 * @returns { ImageAnimatorAttribute } 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @since 7 543 */ 544 /** 545 * Status callback, which is triggered when the animation starts to play. 546 * 547 * @param { function } event 548 * @returns { ImageAnimatorAttribute } 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @crossplatform 551 * @form 552 * @since 10 553 */ 554 /** 555 * Status callback, which is triggered when the animation starts to play. 556 * 557 * @param { function } event 558 * @returns { ImageAnimatorAttribute } 559 * @syscap SystemCapability.ArkUI.ArkUI.Full 560 * @crossplatform 561 * @form 562 * @atomicservice 563 * @since 11 564 */ 565 onStart(event: () => void): ImageAnimatorAttribute; 566 567 /** 568 * Status callback, which is triggered when the animation pauses. 569 * 570 * @param { function } event 571 * @returns { ImageAnimatorAttribute } 572 * @syscap SystemCapability.ArkUI.ArkUI.Full 573 * @since 7 574 */ 575 /** 576 * Status callback, which is triggered when the animation pauses. 577 * 578 * @param { function } event 579 * @returns { ImageAnimatorAttribute } 580 * @syscap SystemCapability.ArkUI.ArkUI.Full 581 * @crossplatform 582 * @form 583 * @since 10 584 */ 585 /** 586 * Status callback, which is triggered when the animation pauses. 587 * 588 * @param { function } event 589 * @returns { ImageAnimatorAttribute } 590 * @syscap SystemCapability.ArkUI.ArkUI.Full 591 * @crossplatform 592 * @form 593 * @atomicservice 594 * @since 11 595 */ 596 onPause(event: () => void): ImageAnimatorAttribute; 597 598 /** 599 * Status callback, triggered when the animation is replayed 600 * 601 * @param { function } event 602 * @returns { ImageAnimatorAttribute } 603 * @syscap SystemCapability.ArkUI.ArkUI.Full 604 * @since 7 605 */ 606 /** 607 * Status callback, triggered when the animation is replayed 608 * 609 * @param { function } event 610 * @returns { ImageAnimatorAttribute } 611 * @syscap SystemCapability.ArkUI.ArkUI.Full 612 * @crossplatform 613 * @since 10 614 */ 615 /** 616 * Status callback, triggered when the animation is replayed 617 * 618 * @param { function } event 619 * @returns { ImageAnimatorAttribute } 620 * @syscap SystemCapability.ArkUI.ArkUI.Full 621 * @crossplatform 622 * @atomicservice 623 * @since 11 624 */ 625 onRepeat(event: () => void): ImageAnimatorAttribute; 626 627 /** 628 * Status callback, which is triggered when the animation is canceled. 629 * 630 * @param { function } event 631 * @returns { ImageAnimatorAttribute } 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @since 7 634 */ 635 /** 636 * Status callback, which is triggered when the animation is canceled. 637 * 638 * @param { function } event 639 * @returns { ImageAnimatorAttribute } 640 * @syscap SystemCapability.ArkUI.ArkUI.Full 641 * @crossplatform 642 * @form 643 * @since 10 644 */ 645 /** 646 * Status callback, which is triggered when the animation is canceled. 647 * 648 * @param { function } event 649 * @returns { ImageAnimatorAttribute } 650 * @syscap SystemCapability.ArkUI.ArkUI.Full 651 * @crossplatform 652 * @form 653 * @atomicservice 654 * @since 11 655 */ 656 onCancel(event: () => void): ImageAnimatorAttribute; 657 658 /** 659 * Status callback, which is triggered when the animation playback is complete. 660 * 661 * @param { function } event 662 * @returns { ImageAnimatorAttribute } 663 * @syscap SystemCapability.ArkUI.ArkUI.Full 664 * @since 7 665 */ 666 /** 667 * Status callback, which is triggered when the animation playback is complete. 668 * 669 * @param { function } event 670 * @returns { ImageAnimatorAttribute } 671 * @syscap SystemCapability.ArkUI.ArkUI.Full 672 * @crossplatform 673 * @form 674 * @since 10 675 */ 676 /** 677 * Status callback, which is triggered when the animation playback is complete. 678 * 679 * @param { function } event 680 * @returns { ImageAnimatorAttribute } 681 * @syscap SystemCapability.ArkUI.ArkUI.Full 682 * @crossplatform 683 * @form 684 * @atomicservice 685 * @since 11 686 */ 687 onFinish(event: () => void): ImageAnimatorAttribute; 688} 689 690/** 691 * Defines ImageAnimator Component. 692 * 693 * @syscap SystemCapability.ArkUI.ArkUI.Full 694 * @since 7 695 */ 696/** 697 * Defines ImageAnimator Component. 698 * 699 * @syscap SystemCapability.ArkUI.ArkUI.Full 700 * @crossplatform 701 * @form 702 * @since 10 703 */ 704/** 705 * Defines ImageAnimator Component. 706 * 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @crossplatform 709 * @form 710 * @atomicservice 711 * @since 11 712 */ 713declare const ImageAnimator: ImageAnimatorInterface; 714 715/** 716 * Defines ImageAnimator Component instance. 717 * 718 * @syscap SystemCapability.ArkUI.ArkUI.Full 719 * @since 7 720 */ 721/** 722 * Defines ImageAnimator Component instance. 723 * 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @form 727 * @since 10 728 */ 729/** 730 * Defines ImageAnimator Component instance. 731 * 732 * @syscap SystemCapability.ArkUI.ArkUI.Full 733 * @crossplatform 734 * @form 735 * @atomicservice 736 * @since 11 737 */ 738declare const ImageAnimatorInstance: ImageAnimatorAttribute; 739