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 * Provides methods for switching components. 23 * 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @since 7 26 */ 27/** 28 * Provides methods for switching components. 29 * 30 * @syscap SystemCapability.ArkUI.ArkUI.Full 31 * @crossplatform 32 * @form 33 * @since 10 34 */ 35/** 36 * Provides methods for switching components. 37 * 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @crossplatform 40 * @form 41 * @atomicservice 42 * @since 11 43 */ 44declare class SwiperController { 45 /** 46 * constructor. 47 * 48 * @syscap SystemCapability.ArkUI.ArkUI.Full 49 * @since 7 50 */ 51 /** 52 * constructor. 53 * 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @crossplatform 56 * @form 57 * @since 10 58 */ 59 /** 60 * constructor. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @form 65 * @atomicservice 66 * @since 11 67 */ 68 constructor(); 69 70 /** 71 * Called when the next child component is displayed. 72 * 73 * @syscap SystemCapability.ArkUI.ArkUI.Full 74 * @since 7 75 */ 76 /** 77 * Called when the next child component is displayed. 78 * 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @crossplatform 81 * @form 82 * @since 10 83 */ 84 /** 85 * Called when the next child component is displayed. 86 * 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @form 90 * @atomicservice 91 * @since 11 92 */ 93 showNext(); 94 95 /** 96 * Called when the previous subcomponent is displayed. 97 * 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @since 7 100 */ 101 /** 102 * Called when the previous subcomponent is displayed. 103 * 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @crossplatform 106 * @form 107 * @since 10 108 */ 109 /** 110 * Called when the previous subcomponent is displayed. 111 * 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @form 115 * @atomicservice 116 * @since 11 117 */ 118 showPrevious(); 119 120 /** 121 * Controlling Swiper to change to the specified subcomponent. 122 * 123 * @param { number } index - the index of item to be redirected. 124 * @param { boolean } useAnimation - If true, swipe to index item with animation. If false, swipe to index item without animation. 125 * The default value is false. 126 * @syscap SystemCapability.ArkUI.ArkUI.Full 127 * @crossplatform 128 * @form 129 * @atomicservice 130 * @since 12 131 */ 132 changeIndex(index: number, useAnimation?: boolean); 133 134 /** 135 * Controlling Swiper to change to the specified subcomponent. 136 * 137 * @param { number } index - the index of item to be redirected. 138 * @param { SwiperAnimationMode | boolean } [animationMode] - animation mode for changeIndex, 139 * true is equivalent to SwiperAnimationMode.DEFAULT_ANIMATION, false is equivalent to SwiperAnimationMode.NO_ANIMATION 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @crossplatform 142 * @form 143 * @atomicservice 144 * @since 15 145 */ 146 changeIndex(index: number, animationMode?: SwiperAnimationMode | boolean); 147 148 /** 149 * Called when need to stop the swiper animation. 150 * 151 * @param { function } callback 152 * @syscap SystemCapability.ArkUI.ArkUI.Full 153 * @since 7 154 */ 155 /** 156 * Called when need to stop the swiper animation. 157 * 158 * @param { function } callback 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @crossplatform 161 * @form 162 * @since 10 163 */ 164 /** 165 * Called when need to stop the swiper animation. 166 * 167 * @param { function } callback 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @form 171 * @atomicservice 172 * @since 11 173 */ 174 finishAnimation(callback?: () => void); 175} 176 177/** 178 * Defines the indicator class. 179 * 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @form 183 * @since 10 184 */ 185/** 186 * Defines the indicator class. 187 * 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @crossplatform 190 * @form 191 * @atomicservice 192 * @since 11 193 */ 194declare class Indicator<T> { 195 /** 196 * Set the indicator to the left. 197 * 198 * @param { Length } value - the indicator to the left. 199 * @returns { T } 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @crossplatform 202 * @form 203 * @since 10 204 */ 205 /** 206 * Set the indicator to the left. 207 * 208 * @param { Length } value - the indicator to the left. 209 * @returns { T } 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @crossplatform 212 * @form 213 * @atomicservice 214 * @since 11 215 */ 216 left(value: Length): T; 217 218 /** 219 * Set the indicator to the top. 220 * 221 * @param { Length } value - the indicator to the top. 222 * @returns { T } 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @form 226 * @since 10 227 */ 228 /** 229 * Set the indicator to the top. 230 * 231 * @param { Length } value - the indicator to the top. 232 * @returns { T } 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @crossplatform 235 * @form 236 * @atomicservice 237 * @since 11 238 */ 239 top(value: Length): T; 240 241 /** 242 * Set the indicator to the right. 243 * 244 * @param { Length } value - the indicator to the right. 245 * @returns { T } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @form 249 * @since 10 250 */ 251 /** 252 * Set the indicator to the right. 253 * 254 * @param { Length } value - the indicator to the right. 255 * @returns { T } 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @form 259 * @atomicservice 260 * @since 11 261 */ 262 right(value: Length): T; 263 264 /** 265 * Set the indicator to the bottom. 266 * 267 * @param { Length } value - the indicator to the bottom. 268 * @returns { T } 269 * @syscap SystemCapability.ArkUI.ArkUI.Full 270 * @crossplatform 271 * @form 272 * @since 10 273 */ 274 /** 275 * Set the indicator to the bottom. 276 * 277 * @param { Length } value - the indicator to the bottom. 278 * @returns { T } 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @crossplatform 281 * @form 282 * @atomicservice 283 * @since 11 284 */ 285 bottom(value: Length): T; 286 287 /** 288 * Set the indicator to the left in LTR 289 * Set the indicator to the right in RTL 290 * 291 * @param { LengthMetrics } value - the indicator to the right in LTR, indicator to the left in RTL 292 * @returns { T } 293 * @syscap SystemCapability.ArkUI.ArkUI.Full 294 * @crossplatform 295 * @form 296 * @atomicservice 297 * @since 12 298 */ 299 start(value: LengthMetrics): T; 300 301 /** 302 * Set the indicator to the left in RTL 303 * Set the indicator to the right in LTR 304 * 305 * @param { LengthMetrics } value - the indicator to the left in RTL, Set the indicator to the right in LTR 306 * @returns { T } 307 * @syscap SystemCapability.ArkUI.ArkUI.Full 308 * @crossplatform 309 * @form 310 * @atomicservice 311 * @since 12 312 */ 313 end(value: LengthMetrics): T; 314 315 /** 316 * DotIndicator class object. 317 * 318 * @returns { DotIndicator } 319 * @static 320 * @syscap SystemCapability.ArkUI.ArkUI.Full 321 * @crossplatform 322 * @form 323 * @since 10 324 */ 325 /** 326 * DotIndicator class object. 327 * 328 * @returns { DotIndicator } 329 * @static 330 * @syscap SystemCapability.ArkUI.ArkUI.Full 331 * @crossplatform 332 * @form 333 * @atomicservice 334 * @since 11 335 */ 336 static dot(): DotIndicator; 337 338 /** 339 * DigitIndicator class object. 340 * 341 * @returns { DigitIndicator } 342 * @static 343 * @syscap SystemCapability.ArkUI.ArkUI.Full 344 * @crossplatform 345 * @form 346 * @since 10 347 */ 348 /** 349 * DigitIndicator class object. 350 * 351 * @returns { DigitIndicator } 352 * @static 353 * @syscap SystemCapability.ArkUI.ArkUI.Full 354 * @crossplatform 355 * @form 356 * @atomicservice 357 * @since 11 358 */ 359 static digit(): DigitIndicator; 360} 361 362/** 363 * Define DotIndicator, the indicator type is dot. 364 * 365 * @extends Indicator<DotIndicator> 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @form 369 * @since 10 370 */ 371/** 372 * Define DotIndicator, the indicator type is dot. 373 * 374 * @extends Indicator<DotIndicator> 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @crossplatform 377 * @form 378 * @atomicservice 379 * @since 11 380 */ 381declare class DotIndicator extends Indicator<DotIndicator> { 382 /** 383 * Constructor. 384 * 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @crossplatform 387 * @form 388 * @since 10 389 */ 390 /** 391 * Constructor. 392 * 393 * @syscap SystemCapability.ArkUI.ArkUI.Full 394 * @crossplatform 395 * @form 396 * @atomicservice 397 * @since 11 398 */ 399 constructor(); 400 401 /** 402 * Set the indicator item width. 403 * 404 * @param { Length } value - the indicator item width. 405 * @returns { DotIndicator } 406 * @syscap SystemCapability.ArkUI.ArkUI.Full 407 * @crossplatform 408 * @form 409 * @since 10 410 */ 411 /** 412 * Set the indicator item width. 413 * 414 * @param { Length } value - the indicator item width. 415 * @returns { DotIndicator } 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @form 419 * @atomicservice 420 * @since 11 421 */ 422 itemWidth(value: Length): DotIndicator; 423 424 /** 425 * Set the indicator item height. 426 * 427 * @param { Length } value - the indicator item height. 428 * @returns { DotIndicator } 429 * @syscap SystemCapability.ArkUI.ArkUI.Full 430 * @crossplatform 431 * @form 432 * @since 10 433 */ 434 /** 435 * Set the indicator item height. 436 * 437 * @param { Length } value - the indicator item height. 438 * @returns { DotIndicator } 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @crossplatform 441 * @form 442 * @atomicservice 443 * @since 11 444 */ 445 itemHeight(value: Length): DotIndicator; 446 447 /** 448 * Set the indicator item width when selected. 449 * 450 * @param { Length } value - the indicator item width when selected. 451 * @returns { DotIndicator } 452 * @syscap SystemCapability.ArkUI.ArkUI.Full 453 * @crossplatform 454 * @form 455 * @since 10 456 */ 457 /** 458 * Set the indicator item width when selected. 459 * 460 * @param { Length } value - the indicator item width when selected. 461 * @returns { DotIndicator } 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @crossplatform 464 * @form 465 * @atomicservice 466 * @since 11 467 */ 468 selectedItemWidth(value: Length): DotIndicator; 469 470 /** 471 * Set the indicator item height when selected. 472 * 473 * @param { Length } value - the indicator item height when selected. 474 * @returns { DotIndicator } 475 * @syscap SystemCapability.ArkUI.ArkUI.Full 476 * @crossplatform 477 * @form 478 * @since 10 479 */ 480 /** 481 * Set the indicator item height when selected. 482 * 483 * @param { Length } value - the indicator item height when selected. 484 * @returns { DotIndicator } 485 * @syscap SystemCapability.ArkUI.ArkUI.Full 486 * @crossplatform 487 * @form 488 * @atomicservice 489 * @since 11 490 */ 491 selectedItemHeight(value: Length): DotIndicator; 492 493 /** 494 * Setting indicator style mask. 495 * 496 * @param { boolean } value - the indicator item mask. 497 * @returns { DotIndicator } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @form 501 * @since 10 502 */ 503 /** 504 * Setting indicator style mask. 505 * 506 * @param { boolean } value - the indicator item mask. 507 * @returns { DotIndicator } 508 * @syscap SystemCapability.ArkUI.ArkUI.Full 509 * @crossplatform 510 * @form 511 * @atomicservice 512 * @since 11 513 */ 514 mask(value: boolean): DotIndicator; 515 516 /** 517 * Set the indicator color. 518 * 519 * @param { ResourceColor } value - the indicator item color. 520 * @returns { DotIndicator } 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @crossplatform 523 * @form 524 * @since 10 525 */ 526 /** 527 * Set the indicator color. 528 * 529 * @param { ResourceColor } value - the indicator item color. 530 * @returns { DotIndicator } 531 * @syscap SystemCapability.ArkUI.ArkUI.Full 532 * @crossplatform 533 * @form 534 * @atomicservice 535 * @since 11 536 */ 537 color(value: ResourceColor): DotIndicator; 538 539 /** 540 * Set the navigation point color. 541 * 542 * @param { ResourceColor } value - the indicator item when selected. 543 * @returns { DotIndicator } 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @crossplatform 546 * @form 547 * @since 10 548 */ 549 /** 550 * Set the navigation point color. 551 * 552 * @param { ResourceColor } value - the indicator item when selected. 553 * @returns { DotIndicator } 554 * @syscap SystemCapability.ArkUI.ArkUI.Full 555 * @crossplatform 556 * @form 557 * @atomicservice 558 * @since 11 559 */ 560 selectedColor(value: ResourceColor): DotIndicator; 561 562 /** 563 * Set the Indicator maxDisplayCount when selected. 564 * 565 * @param { number } maxDisplayCount - the indicator item maxDisplayCount when selected. 566 * @returns { DotIndicator } return the DotIndicator 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @crossplatform 569 * @atomicservice 570 * @since 12 571 */ 572 maxDisplayCount(maxDisplayCount: number): DotIndicator; 573} 574 575/** 576 * Set Swiper column count adaptation. 577 * 578 * @typedef { object } SwiperAutoFill 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @form 581 * @since 10 582 */ 583/** 584 * Set Swiper column count adaptation. 585 * 586 * @typedef { object } SwiperAutoFill 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @form 589 * @atomicservice 590 * @since 11 591 */ 592declare type SwiperAutoFill = { 593 /** 594 * Set minSize size. 595 * 596 * @syscap SystemCapability.ArkUI.ArkUI.Full 597 * @since 10 598 * @form 599 */ 600 /** 601 * Set minSize size. 602 * 603 * @syscap SystemCapability.ArkUI.ArkUI.Full 604 * @atomicservice 605 * @since 11 606 * @form 607 */ 608 minSize: VP; 609}; 610 611/** 612 * Define DigitIndicator, the indicator type is digit. 613 * 614 * @extends Indicator<DigitIndicator> 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @crossplatform 617 * @form 618 * @since 10 619 */ 620/** 621 * Define DigitIndicator, the indicator type is digit. 622 * 623 * @extends Indicator<DigitIndicator> 624 * @syscap SystemCapability.ArkUI.ArkUI.Full 625 * @crossplatform 626 * @form 627 * @atomicservice 628 * @since 11 629 */ 630declare class DigitIndicator extends Indicator<DigitIndicator> { 631 /** 632 * Constructor. 633 * 634 * @syscap SystemCapability.ArkUI.ArkUI.Full 635 * @crossplatform 636 * @form 637 * @since 10 638 */ 639 /** 640 * Constructor. 641 * 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @form 645 * @atomicservice 646 * @since 11 647 */ 648 constructor(); 649 650 /** 651 * Set font color of the digital indicator. 652 * 653 * @param { ResourceColor } value - the indicator font color. 654 * @returns { DigitIndicator } 655 * @syscap SystemCapability.ArkUI.ArkUI.Full 656 * @crossplatform 657 * @form 658 * @since 10 659 */ 660 /** 661 * Set font color of the digital indicator. 662 * 663 * @param { ResourceColor } value - the indicator font color. 664 * @returns { DigitIndicator } 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @crossplatform 667 * @form 668 * @atomicservice 669 * @since 11 670 */ 671 fontColor(value: ResourceColor): DigitIndicator; 672 673 /** 674 * Set font color of the digital indicator when selected. 675 * 676 * @param { ResourceColor } value - the indicator font color when selected. 677 * @returns { DigitIndicator } 678 * @syscap SystemCapability.ArkUI.ArkUI.Full 679 * @crossplatform 680 * @form 681 * @since 10 682 */ 683 /** 684 * Set font color of the digital indicator when selected. 685 * 686 * @param { ResourceColor } value - the indicator font color when selected. 687 * @returns { DigitIndicator } 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @crossplatform 690 * @form 691 * @atomicservice 692 * @since 11 693 */ 694 selectedFontColor(value: ResourceColor): DigitIndicator; 695 696 /** 697 * Set the digital indicator font (just support font size and weight). 698 * 699 * @param { Font } value - the indicator font size and weight. 700 * @returns { DigitIndicator } 701 * @syscap SystemCapability.ArkUI.ArkUI.Full 702 * @crossplatform 703 * @form 704 * @since 10 705 */ 706 /** 707 * Set the digital indicator font (just support font size and weight). 708 * 709 * @param { Font } value - the indicator font size and weight. 710 * @returns { DigitIndicator } 711 * @syscap SystemCapability.ArkUI.ArkUI.Full 712 * @crossplatform 713 * @form 714 * @atomicservice 715 * @since 11 716 */ 717 digitFont(value: Font): DigitIndicator; 718 719 /** 720 * Set the digital indicator font (just support font size and weight). 721 * 722 * @param { Font } value - the indicator font size and weight when selected. 723 * @returns { DigitIndicator } 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @form 727 * @since 10 728 */ 729 /** 730 * Set the digital indicator font (just support font size and weight). 731 * 732 * @param { Font } value - the indicator font size and weight when selected. 733 * @returns { DigitIndicator } 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @form 737 * @atomicservice 738 * @since 11 739 */ 740 selectedDigitFont(value: Font): DigitIndicator; 741} 742 743/** 744 * Arrow object. 745 * 746 * @interface ArrowStyle 747 * @syscap SystemCapability.ArkUI.ArkUI.Full 748 * @since 10 749 */ 750/** 751 * Arrow object. 752 * 753 * @interface ArrowStyle 754 * @syscap SystemCapability.ArkUI.ArkUI.Full 755 * @crossplatform 756 * @atomicservice 757 * @since 11 758 */ 759declare interface ArrowStyle { 760 /** 761 * Is show the arrow background or not. 762 * 763 * @type { ?boolean } 764 * @default false 765 * @syscap SystemCapability.ArkUI.ArkUI.Full 766 * @since 10 767 */ 768 /** 769 * Is show the arrow background or not. 770 * 771 * @type { ?boolean } 772 * @default false 773 * @syscap SystemCapability.ArkUI.ArkUI.Full 774 * @crossplatform 775 * @atomicservice 776 * @since 11 777 */ 778 showBackground?: boolean; 779 780 /** 781 * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. 782 * The arrow is displayed on side of the indicator, if the value is false. 783 * 784 * @type { ?boolean } 785 * @default false 786 * @syscap SystemCapability.ArkUI.ArkUI.Full 787 * @since 10 788 */ 789 /** 790 * When the indicator show, set the arrow position is side of the indicator or in the middle of content area. 791 * The arrow is displayed on side of the indicator, if the value is false. 792 * 793 * @type { ?boolean } 794 * @default false 795 * @syscap SystemCapability.ArkUI.ArkUI.Full 796 * @crossplatform 797 * @atomicservice 798 * @since 11 799 */ 800 isSidebarMiddle?: boolean; 801 802 /** 803 * The arrow background size. 804 * The size of the arrow is three-quarters of the background size, when the background is displayed. 805 * 806 * @type { ?Length } 807 * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp 808 * @syscap SystemCapability.ArkUI.ArkUI.Full 809 * @since 10 810 */ 811 /** 812 * The arrow background size. 813 * The size of the arrow is three-quarters of the background size, when the background is displayed. 814 * 815 * @type { ?Length } 816 * @default When isSidebarMiddle is false, the default value is 24vp, Otherwise,the default value is 32vp 817 * @syscap SystemCapability.ArkUI.ArkUI.Full 818 * @crossplatform 819 * @atomicservice 820 * @since 11 821 */ 822 backgroundSize?: Length; 823 824 /** 825 * The arrow background background color. 826 * 827 * @type { ?ResourceColor } 828 * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise,the default value is #19182431 829 * @syscap SystemCapability.ArkUI.ArkUI.Full 830 * @since 10 831 */ 832 /** 833 * The arrow background background color. 834 * 835 * @type { ?ResourceColor } 836 * @default When isSidebarMiddle is false, the default value is #00000000, Otherwise, the default value is #19182431 837 * @syscap SystemCapability.ArkUI.ArkUI.Full 838 * @crossplatform 839 * @atomicservice 840 * @since 11 841 */ 842 backgroundColor?: ResourceColor; 843 844 /** 845 * The arrow size. 846 * The arrow size can be set, when the background is not displayed. 847 * The size of the arrow is three-quarters of the background size, when the background is displayed. 848 * 849 * @type { ?Length } 850 * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp 851 * @syscap SystemCapability.ArkUI.ArkUI.Full 852 * @since 10 853 */ 854 /** 855 * The arrow size. 856 * The arrow size can be set, when the background is not displayed. 857 * The size of the arrow is three-quarters of the background size, when the background is displayed. 858 * 859 * @type { ?Length } 860 * @default When isSidebarMiddle is false, the default value is 18vp, Otherwise, the default value is 24vp 861 * @syscap SystemCapability.ArkUI.ArkUI.Full 862 * @crossplatform 863 * @atomicservice 864 * @since 11 865 */ 866 arrowSize?: Length; 867 868 /** 869 * The arrow color. 870 * 871 * @type { ?ResourceColor } 872 * @default #182431 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @since 10 875 */ 876 /** 877 * The arrow color. 878 * 879 * @type { ?ResourceColor } 880 * @default #182431 881 * @syscap SystemCapability.ArkUI.ArkUI.Full 882 * @crossplatform 883 * @atomicservice 884 * @since 11 885 */ 886 arrowColor?: ResourceColor; 887} 888 889/** 890 * Declare the size of the swiper on the spindle. 891 * 892 * @enum { number } 893 * @syscap SystemCapability.ArkUI.ArkUI.Full 894 * @since 7 895 */ 896/** 897 * Declare the size of the swiper on the spindle. 898 * 899 * @enum { number } 900 * @syscap SystemCapability.ArkUI.ArkUI.Full 901 * @crossplatform 902 * @form 903 * @since 10 904 */ 905/** 906 * Declare the size of the swiper on the spindle. 907 * 908 * @enum { number } 909 * @syscap SystemCapability.ArkUI.ArkUI.Full 910 * @crossplatform 911 * @form 912 * @atomicservice 913 * @since 11 914 */ 915declare enum SwiperDisplayMode { 916 /** 917 * Carousel map extension. 918 * 919 * @syscap SystemCapability.ArkUI.ArkUI.Full 920 * @form 921 * @since 7 922 * @deprecated since 10 923 * @useinstead SwiperDisplayMode#STRETCH 924 */ 925 Stretch, 926 927 /** 928 * The rotation chart is self linear. 929 * 930 * @syscap SystemCapability.ArkUI.ArkUI.Full 931 * @form 932 * @since 7 933 * @deprecated since 10 934 * @useinstead SwiperDisplayMode#AUTO_LINEAR 935 */ 936 AutoLinear, 937 938 /** 939 * Carousel map extension. 940 * 941 * @syscap SystemCapability.ArkUI.ArkUI.Full 942 * @crossplatform 943 * @form 944 * @since 10 945 */ 946 /** 947 * Carousel map extension. 948 * 949 * @syscap SystemCapability.ArkUI.ArkUI.Full 950 * @crossplatform 951 * @form 952 * @atomicservice 953 * @since 11 954 */ 955 STRETCH, 956 957 /** 958 * The rotation chart is self linear. 959 * 960 * @syscap SystemCapability.ArkUI.ArkUI.Full 961 * @crossplatform 962 * @form 963 * @since 10 964 */ 965 /** 966 * The rotation chart is self linear. 967 * 968 * @syscap SystemCapability.ArkUI.ArkUI.Full 969 * @crossplatform 970 * @form 971 * @atomicservice 972 * @since 11 973 * @deprecated since 12 974 * @useinstead Scroller#scrollTo 975 */ 976 AUTO_LINEAR, 977} 978 979/** 980 * Provides an interface for sliding containers. 981 * 982 * @interface SwiperInterface 983 * @syscap SystemCapability.ArkUI.ArkUI.Full 984 * @since 7 985 */ 986/** 987 * Provides an interface for sliding containers. 988 * 989 * @interface SwiperInterface 990 * @syscap SystemCapability.ArkUI.ArkUI.Full 991 * @crossplatform 992 * @form 993 * @since 10 994 */ 995/** 996 * Provides an interface for sliding containers. 997 * 998 * @interface SwiperInterface 999 * @syscap SystemCapability.ArkUI.ArkUI.Full 1000 * @crossplatform 1001 * @form 1002 * @atomicservice 1003 * @since 11 1004 */ 1005interface SwiperInterface { 1006 /** 1007 * Called when a sliding container is set. 1008 * 1009 * @param { SwiperController } controller 1010 * @returns { SwiperAttribute } 1011 * @syscap SystemCapability.ArkUI.ArkUI.Full 1012 * @since 7 1013 */ 1014 /** 1015 * Called when a sliding container is set. 1016 * 1017 * @param { SwiperController } controller 1018 * @returns { SwiperAttribute } 1019 * @syscap SystemCapability.ArkUI.ArkUI.Full 1020 * @crossplatform 1021 * @form 1022 * @since 10 1023 */ 1024 /** 1025 * Called when a sliding container is set. 1026 * 1027 * @param { SwiperController } controller 1028 * @returns { SwiperAttribute } 1029 * @syscap SystemCapability.ArkUI.ArkUI.Full 1030 * @crossplatform 1031 * @form 1032 * @atomicservice 1033 * @since 11 1034 */ 1035 (controller?: SwiperController): SwiperAttribute; 1036} 1037 1038/** 1039 * Setting indicator style navigation. 1040 * 1041 * @interface IndicatorStyle 1042 * @syscap SystemCapability.ArkUI.ArkUI.Full 1043 * @since 8 1044 * @deprecated since 10 1045 */ 1046declare interface IndicatorStyle { 1047 /** 1048 * Set the indicator to the left. 1049 * 1050 * @type { ?Length } 1051 * @syscap SystemCapability.ArkUI.ArkUI.Full 1052 * @since 8 1053 * @deprecated since 10 1054 */ 1055 left?: Length; 1056 1057 /** 1058 * Set the indicator to the top. 1059 * 1060 * @type { ?Length } 1061 * @syscap SystemCapability.ArkUI.ArkUI.Full 1062 * @since 8 1063 * @deprecated since 10 1064 */ 1065 top?: Length; 1066 1067 /** 1068 * Set the indicator to the right. 1069 * 1070 * @type { ?Length } 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @since 8 1073 * @deprecated since 10 1074 */ 1075 right?: Length; 1076 1077 /** 1078 * Set the indicator to the bottom. 1079 * 1080 * @type { ?Length } 1081 * @syscap SystemCapability.ArkUI.ArkUI.Full 1082 * @since 8 1083 * @deprecated since 10 1084 */ 1085 bottom?: Length; 1086 1087 /** 1088 * Set the indicator size. 1089 * 1090 * @type { ?Length } 1091 * @syscap SystemCapability.ArkUI.ArkUI.Full 1092 * @since 8 1093 * @deprecated since 10 1094 */ 1095 size?: Length; 1096 1097 /** 1098 * Setting indicator style mask. 1099 * 1100 * @type { ?boolean } 1101 * @syscap SystemCapability.ArkUI.ArkUI.Full 1102 * @since 8 1103 * @deprecated since 10 1104 */ 1105 mask?: boolean; 1106 1107 /** 1108 * Set the indicator color. 1109 * 1110 * @type { ?ResourceColor } 1111 * @syscap SystemCapability.ArkUI.ArkUI.Full 1112 * @since 8 1113 * @deprecated since 10 1114 */ 1115 color?: ResourceColor; 1116 1117 /** 1118 * Set the navigation point color. 1119 * 1120 * @type { ?ResourceColor } 1121 * @syscap SystemCapability.ArkUI.ArkUI.Full 1122 * @since 8 1123 * @deprecated since 10 1124 */ 1125 selectedColor?: ResourceColor; 1126} 1127 1128/** 1129 * Provides an interface for swiper animation. 1130 * 1131 * @interface SwiperAnimationEvent 1132 * @syscap SystemCapability.ArkUI.ArkUI.Full 1133 * @crossplatform 1134 * @since 10 1135 */ 1136/** 1137 * Provides an interface for swiper animation. 1138 * 1139 * @interface SwiperAnimationEvent 1140 * @syscap SystemCapability.ArkUI.ArkUI.Full 1141 * @crossplatform 1142 * @atomicservice 1143 * @since 11 1144 */ 1145declare interface SwiperAnimationEvent { 1146 /** 1147 * Offset of the current page to the start position of the swiper main axis. The unit is vp. 1148 * 1149 * @type { number } 1150 * @default 0.0 vp 1151 * @syscap SystemCapability.ArkUI.ArkUI.Full 1152 * @since 10 1153 */ 1154 /** 1155 * Offset of the current page to the start position of the swiper main axis. The unit is vp. 1156 * 1157 * @type { number } 1158 * @default 0.0 vp 1159 * @syscap SystemCapability.ArkUI.ArkUI.Full 1160 * @crossplatform 1161 * @atomicservice 1162 * @since 11 1163 */ 1164 currentOffset: number; 1165 1166 /** 1167 * Offset of the target page to the start position of the swiper main axis. The unit is vp. 1168 * 1169 * @type { number } 1170 * @default 0.0 vp 1171 * @syscap SystemCapability.ArkUI.ArkUI.Full 1172 * @since 10 1173 */ 1174 /** 1175 * Offset of the target page to the start position of the swiper main axis. The unit is vp. 1176 * 1177 * @type { number } 1178 * @default 0.0 vp 1179 * @syscap SystemCapability.ArkUI.ArkUI.Full 1180 * @crossplatform 1181 * @atomicservice 1182 * @since 11 1183 */ 1184 targetOffset: number; 1185 1186 /** 1187 * Start speed of the page-turning animation. The unit is vp/s. 1188 * 1189 * @type { number } 1190 * @default 0.0 vp/s 1191 * @syscap SystemCapability.ArkUI.ArkUI.Full 1192 * @since 10 1193 */ 1194 /** 1195 * Start speed of the page-turning animation. The unit is vp/s. 1196 * 1197 * @type { number } 1198 * @default 0.0 vp/s 1199 * @syscap SystemCapability.ArkUI.ArkUI.Full 1200 * @crossplatform 1201 * @atomicservice 1202 * @since 11 1203 */ 1204 velocity: number; 1205} 1206 1207/** 1208 * Swiper nested scroll nested mode 1209 1210 * @enum { number } SwiperNestedScrollMode 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @atomicservice 1213 * @since 11 1214 */ 1215declare enum SwiperNestedScrollMode { 1216 /** 1217 * Only Self response scrolling. 1218 * 1219 * @syscap SystemCapability.ArkUI.ArkUI.Full 1220 * @atomicservice 1221 * @since 11 1222 */ 1223 SELF_ONLY = 0, 1224 1225 /** 1226 * Self priority response scrolling. 1227 * 1228 * @syscap SystemCapability.ArkUI.ArkUI.Full 1229 * @atomicservice 1230 * @since 11 1231 */ 1232 SELF_FIRST = 1, 1233} 1234 1235/** 1236 * Declare the animation mode of SwiperController's changeIndex method. 1237 * 1238 * @enum { number } 1239 * @syscap SystemCapability.ArkUI.ArkUI.Full 1240 * @crossplatform 1241 * @form 1242 * @atomicservice 1243 * @since 15 1244 */ 1245declare enum SwiperAnimationMode { 1246 /** 1247 * Jump to target index without animation. 1248 * 1249 * @syscap SystemCapability.ArkUI.ArkUI.Full 1250 * @crossplatform 1251 * @form 1252 * @atomicservice 1253 * @since 15 1254 */ 1255 NO_ANIMATION = 0, 1256 1257 /** 1258 * Scroll to target index with animation. 1259 * 1260 * @syscap SystemCapability.ArkUI.ArkUI.Full 1261 * @crossplatform 1262 * @form 1263 * @atomicservice 1264 * @since 15 1265 */ 1266 DEFAULT_ANIMATION = 1, 1267 1268 /** 1269 * Jump to some index near the target index without animation, 1270 * then scroll to target index with animation. 1271 * 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @form 1275 * @atomicservice 1276 * @since 15 1277 */ 1278 FAST_ANIMATION = 2, 1279} 1280 1281/** 1282 * Defines the swiper attribute functions. 1283 * 1284 * @extends CommonMethod<SwiperAttribute> 1285 * @syscap SystemCapability.ArkUI.ArkUI.Full 1286 * @since 7 1287 */ 1288/** 1289 * Defines the swiper attribute functions. 1290 * 1291 * @extends CommonMethod<SwiperAttribute> 1292 * @syscap SystemCapability.ArkUI.ArkUI.Full 1293 * @crossplatform 1294 * @form 1295 * @since 10 1296 */ 1297/** 1298 * Defines the swiper attribute functions. 1299 * 1300 * @extends CommonMethod<SwiperAttribute> 1301 * @syscap SystemCapability.ArkUI.ArkUI.Full 1302 * @crossplatform 1303 * @form 1304 * @atomicservice 1305 * @since 11 1306 */ 1307declare class SwiperAttribute extends CommonMethod<SwiperAttribute> { 1308 /** 1309 * Called when the index value of the displayed subcomponent is set in the container. 1310 * 1311 * @param { number } value 1312 * @returns { SwiperAttribute } 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @since 7 1315 */ 1316 /** 1317 * Called when the index value of the displayed subcomponent is set in the container. 1318 * 1319 * @param { number } value 1320 * @returns { SwiperAttribute } 1321 * @syscap SystemCapability.ArkUI.ArkUI.Full 1322 * @crossplatform 1323 * @form 1324 * @since 10 1325 */ 1326 /** 1327 * Called when the index value of the displayed subcomponent is set in the container. 1328 * 1329 * @param { number } value 1330 * @returns { SwiperAttribute } 1331 * @syscap SystemCapability.ArkUI.ArkUI.Full 1332 * @crossplatform 1333 * @form 1334 * @atomicservice 1335 * @since 11 1336 */ 1337 index(value: number): SwiperAttribute; 1338 1339 /** 1340 * Called when setting whether the subcomponent plays automatically. 1341 * 1342 * @param { boolean } value 1343 * @returns { SwiperAttribute } 1344 * @syscap SystemCapability.ArkUI.ArkUI.Full 1345 * @since 7 1346 */ 1347 /** 1348 * Called when setting whether the subcomponent plays automatically. 1349 * 1350 * @param { boolean } value 1351 * @returns { SwiperAttribute } 1352 * @syscap SystemCapability.ArkUI.ArkUI.Full 1353 * @crossplatform 1354 * @form 1355 * @since 10 1356 */ 1357 /** 1358 * Called when setting whether the subcomponent plays automatically. 1359 * 1360 * @param { boolean } value 1361 * @returns { SwiperAttribute } 1362 * @syscap SystemCapability.ArkUI.ArkUI.Full 1363 * @crossplatform 1364 * @form 1365 * @atomicservice 1366 * @since 11 1367 */ 1368 autoPlay(value: boolean): SwiperAttribute; 1369 1370 /** 1371 * Called when the time interval for automatic playback is set. 1372 * 1373 * @param { number } value 1374 * @returns { SwiperAttribute } 1375 * @syscap SystemCapability.ArkUI.ArkUI.Full 1376 * @since 7 1377 */ 1378 /** 1379 * Called when the time interval for automatic playback is set. 1380 * 1381 * @param { number } value 1382 * @returns { SwiperAttribute } 1383 * @syscap SystemCapability.ArkUI.ArkUI.Full 1384 * @crossplatform 1385 * @form 1386 * @since 10 1387 */ 1388 /** 1389 * Called when the time interval for automatic playback is set. 1390 * 1391 * @param { number } value 1392 * @returns { SwiperAttribute } 1393 * @syscap SystemCapability.ArkUI.ArkUI.Full 1394 * @crossplatform 1395 * @form 1396 * @atomicservice 1397 * @since 11 1398 */ 1399 interval(value: number): SwiperAttribute; 1400 1401 /** 1402 * Called when you set whether the navigation point indicator is enabled. 1403 * 1404 * @param { boolean } value - show indicator of the swiper indicator. 1405 * @returns { SwiperAttribute } 1406 * @syscap SystemCapability.ArkUI.ArkUI.Full 1407 * @since 7 1408 */ 1409 /** 1410 * Set indicator is enabled, or set type style. 1411 * 1412 * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. 1413 * @returns { SwiperAttribute } 1414 * @syscap SystemCapability.ArkUI.ArkUI.Full 1415 * @crossplatform 1416 * @form 1417 * @since 10 1418 */ 1419 /** 1420 * Set indicator is enabled, or set type style. 1421 * 1422 * @param { DotIndicator | DigitIndicator | boolean } value - the style value or show indicator of the swiper indicator. 1423 * @returns { SwiperAttribute } 1424 * @syscap SystemCapability.ArkUI.ArkUI.Full 1425 * @crossplatform 1426 * @form 1427 * @atomicservice 1428 * @since 11 1429 */ 1430 indicator(value: DotIndicator | DigitIndicator | boolean): SwiperAttribute; 1431 1432 /** 1433 * Use indicator component controller. 1434 * 1435 * @param { IndicatorComponentController | DotIndicator | DigitIndicator | boolean } indicator - 1436 * the style value or show indicator of the swiper indicator. 1437 * @returns { SwiperAttribute } 1438 * @syscap SystemCapability.ArkUI.ArkUI.Full 1439 * @crossplatform 1440 * @form 1441 * @atomicservice 1442 * @since 15 1443 */ 1444 indicator(indicator: IndicatorComponentController | DotIndicator | DigitIndicator | boolean): SwiperAttribute; 1445 1446 /** 1447 * Set arrow is enabled, or set the arrow style. 1448 * 1449 * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. 1450 * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. 1451 * @returns { SwiperAttribute } return the component attribute. 1452 * @syscap SystemCapability.ArkUI.ArkUI.Full 1453 * @since 10 1454 */ 1455 /** 1456 * Set arrow is enabled, or set the arrow style. 1457 * 1458 * @param { ArrowStyle | boolean } value - arrow is displayed or set the arrow style. 1459 * @param { boolean } isHoverShow - arrow is display when mouse hover in indicator hotspot. 1460 * @returns { SwiperAttribute } return the component attribute. 1461 * @syscap SystemCapability.ArkUI.ArkUI.Full 1462 * @crossplatform 1463 * @atomicservice 1464 * @since 11 1465 */ 1466 displayArrow(value: ArrowStyle | boolean, isHoverShow?: boolean): SwiperAttribute; 1467 1468 /** 1469 * Called when setting whether to turn on cyclic sliding. 1470 * 1471 * @param { boolean } value 1472 * @returns { SwiperAttribute } 1473 * @syscap SystemCapability.ArkUI.ArkUI.Full 1474 * @since 7 1475 */ 1476 /** 1477 * Called when setting whether to turn on cyclic sliding. 1478 * 1479 * @param { boolean } value 1480 * @returns { SwiperAttribute } 1481 * @syscap SystemCapability.ArkUI.ArkUI.Full 1482 * @crossplatform 1483 * @form 1484 * @since 10 1485 */ 1486 /** 1487 * Called when setting whether to turn on cyclic sliding. 1488 * 1489 * @param { boolean } value 1490 * @returns { SwiperAttribute } 1491 * @syscap SystemCapability.ArkUI.ArkUI.Full 1492 * @crossplatform 1493 * @form 1494 * @atomicservice 1495 * @since 11 1496 */ 1497 loop(value: boolean): SwiperAttribute; 1498 1499 /** 1500 * Called when the animation duration of the switch is set. 1501 * 1502 * @param { number } value 1503 * @returns { SwiperAttribute } 1504 * @syscap SystemCapability.ArkUI.ArkUI.Full 1505 * @since 7 1506 */ 1507 /** 1508 * Called when the animation duration of the switch is set. 1509 * 1510 * @param { number } value 1511 * @returns { SwiperAttribute } 1512 * @syscap SystemCapability.ArkUI.ArkUI.Full 1513 * @crossplatform 1514 * @since 10 1515 */ 1516 /** 1517 * Called when the animation duration of the switch is set. 1518 * 1519 * @param { number } value 1520 * @returns { SwiperAttribute } 1521 * @syscap SystemCapability.ArkUI.ArkUI.Full 1522 * @crossplatform 1523 * @atomicservice 1524 * @since 11 1525 */ 1526 duration(value: number): SwiperAttribute; 1527 1528 /** 1529 * Called when setting whether to slide vertically. 1530 * 1531 * @param { boolean } value 1532 * @returns { SwiperAttribute } 1533 * @syscap SystemCapability.ArkUI.ArkUI.Full 1534 * @since 7 1535 */ 1536 /** 1537 * Called when setting whether to slide vertically. 1538 * 1539 * @param { boolean } value 1540 * @returns { SwiperAttribute } 1541 * @syscap SystemCapability.ArkUI.ArkUI.Full 1542 * @crossplatform 1543 * @form 1544 * @since 10 1545 */ 1546 /** 1547 * Called when setting whether to slide vertically. 1548 * 1549 * @param { boolean } value 1550 * @returns { SwiperAttribute } 1551 * @syscap SystemCapability.ArkUI.ArkUI.Full 1552 * @crossplatform 1553 * @form 1554 * @atomicservice 1555 * @since 11 1556 */ 1557 vertical(value: boolean): SwiperAttribute; 1558 1559 /** 1560 * Sets the space between child components. 1561 * 1562 * @param { number | string } value 1563 * @returns { SwiperAttribute } 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @since 7 1566 */ 1567 /** 1568 * Sets the space between child components. 1569 * 1570 * @param { number | string } value 1571 * @returns { SwiperAttribute } 1572 * @syscap SystemCapability.ArkUI.ArkUI.Full 1573 * @crossplatform 1574 * @form 1575 * @since 10 1576 */ 1577 /** 1578 * Sets the space between child components. 1579 * 1580 * @param { number | string } value 1581 * @returns { SwiperAttribute } 1582 * @syscap SystemCapability.ArkUI.ArkUI.Full 1583 * @crossplatform 1584 * @form 1585 * @atomicservice 1586 * @since 11 1587 */ 1588 itemSpace(value: number | string): SwiperAttribute; 1589 1590 /** 1591 * Called when setting the size of the swiper container on the spindle. 1592 * 1593 * @param { SwiperDisplayMode } value 1594 * @returns { SwiperAttribute } 1595 * @syscap SystemCapability.ArkUI.ArkUI.Full 1596 * @since 7 1597 */ 1598 /** 1599 * Called when setting the size of the swiper container on the spindle. 1600 * 1601 * @param { SwiperDisplayMode } value 1602 * @returns { SwiperAttribute } 1603 * @syscap SystemCapability.ArkUI.ArkUI.Full 1604 * @crossplatform 1605 * @form 1606 * @since 10 1607 */ 1608 /** 1609 * Called when setting the size of the swiper container on the spindle. 1610 * 1611 * @param { SwiperDisplayMode } value 1612 * @returns { SwiperAttribute } 1613 * @syscap SystemCapability.ArkUI.ArkUI.Full 1614 * @crossplatform 1615 * @form 1616 * @atomicservice 1617 * @since 11 1618 */ 1619 displayMode(value: SwiperDisplayMode): SwiperAttribute; 1620 1621 /** 1622 * Sets the number of child components to be preloaded(cached). 1623 * 1624 * @param { number } value 1625 * @returns { SwiperAttribute } 1626 * @syscap SystemCapability.ArkUI.ArkUI.Full 1627 * @since 8 1628 */ 1629 /** 1630 * Sets the number of child components to be preloaded(cached). 1631 * 1632 * @param { number } value 1633 * @returns { SwiperAttribute } 1634 * @syscap SystemCapability.ArkUI.ArkUI.Full 1635 * @crossplatform 1636 * @form 1637 * @since 10 1638 */ 1639 /** 1640 * Sets the number of child components to be preloaded(cached). 1641 * 1642 * @param { number } value 1643 * @returns { SwiperAttribute } 1644 * @syscap SystemCapability.ArkUI.ArkUI.Full 1645 * @crossplatform 1646 * @form 1647 * @atomicservice 1648 * @since 11 1649 */ 1650 cachedCount(value: number): SwiperAttribute; 1651 1652 /** 1653 * Sets the number of child components to be preloaded(cached). 1654 * 1655 * @param { number } count - Number of child components to be preloaded (cached). 1656 * @param { boolean } isShown - whether to show the nodes in the cache. 1657 * @returns { SwiperAttribute } the attribute of the swiper. 1658 * @syscap SystemCapability.ArkUI.ArkUI.Full 1659 * @crossplatform 1660 * @form 1661 * @atomicservice 1662 * @since 15 1663 */ 1664 cachedCount(count: number, isShown: boolean): SwiperAttribute; 1665 1666 /** 1667 * Sets the number of elements to display per page. 1668 * 1669 * @param { number | string } value 1670 * @returns { SwiperAttribute } 1671 * @syscap SystemCapability.ArkUI.ArkUI.Full 1672 * @since 8 1673 */ 1674 /** 1675 * Sets the number of elements to display per page. 1676 * 1677 * @param { number | string | SwiperAutoFill } value 1678 * @returns { SwiperAttribute } 1679 * @syscap SystemCapability.ArkUI.ArkUI.Full 1680 * @crossplatform 1681 * @form 1682 * @since 10 1683 */ 1684 /** 1685 * Sets the number of elements to display per page. 1686 * 1687 * If swipeByGroup is set to true: 1688 * 1、All sub-items are grouped from index 0. 1689 * 2、The number of sub-items in each group is the value of displayCount. 1690 * 3、If the number of sub-items in the last group is less than displayCount, placeholder items are added to supplement the number of last group. 1691 * 4、Placeholder items do not display any content and are only used as placeholders. 1692 * 5、When turning pages, turn pages by group. 1693 * 1694 * @param { number | string | SwiperAutoFill } value 1695 * @param { boolean } [swipeByGroup] - if swipe by group. 1696 * @returns { SwiperAttribute } 1697 * @syscap SystemCapability.ArkUI.ArkUI.Full 1698 * @crossplatform 1699 * @form 1700 * @atomicservice 1701 * @since 11 1702 */ 1703 displayCount(value: number | string | SwiperAutoFill, swipeByGroup?: boolean): SwiperAttribute; 1704 1705 /** 1706 * Invoked when setting the sliding effect 1707 * 1708 * @param { EdgeEffect } value 1709 * @returns { SwiperAttribute } 1710 * @syscap SystemCapability.ArkUI.ArkUI.Full 1711 * @since 8 1712 */ 1713 /** 1714 * Invoked when setting the sliding effect 1715 * 1716 * @param { EdgeEffect } value 1717 * @returns { SwiperAttribute } 1718 * @syscap SystemCapability.ArkUI.ArkUI.Full 1719 * @crossplatform 1720 * @form 1721 * @since 10 1722 */ 1723 /** 1724 * Invoked when setting the sliding effect 1725 * 1726 * @param { EdgeEffect } value 1727 * @returns { SwiperAttribute } 1728 * @syscap SystemCapability.ArkUI.ArkUI.Full 1729 * @crossplatform 1730 * @form 1731 * @atomicservice 1732 * @since 11 1733 */ 1734 effectMode(value: EdgeEffect): SwiperAttribute; 1735 1736 /** 1737 * Sets whether to disable the swipe feature 1738 * 1739 * @param { boolean } value 1740 * @returns { SwiperAttribute } 1741 * @syscap SystemCapability.ArkUI.ArkUI.Full 1742 * @since 8 1743 */ 1744 /** 1745 * Sets whether to disable the swipe feature 1746 * 1747 * @param { boolean } value 1748 * @returns { SwiperAttribute } 1749 * @syscap SystemCapability.ArkUI.ArkUI.Full 1750 * @crossplatform 1751 * @form 1752 * @since 10 1753 */ 1754 /** 1755 * Sets whether to disable the swipe feature 1756 * 1757 * @param { boolean } value 1758 * @returns { SwiperAttribute } 1759 * @syscap SystemCapability.ArkUI.ArkUI.Full 1760 * @crossplatform 1761 * @form 1762 * @atomicservice 1763 * @since 11 1764 */ 1765 disableSwipe(value: boolean): SwiperAttribute; 1766 1767 /** 1768 * Sets the animation curve 1769 * 1770 * @param { Curve | string } value 1771 * @returns { SwiperAttribute } 1772 * @syscap SystemCapability.ArkUI.ArkUI.Full 1773 * @since 8 1774 */ 1775 /** 1776 * Sets the animation curve 1777 * Curve is an enumeration type for common curves 1778 * ICurve is a curve object 1779 * 1780 * @param { Curve | string | ICurve } value 1781 * @returns { SwiperAttribute } 1782 * @syscap SystemCapability.ArkUI.ArkUI.Full 1783 * @crossplatform 1784 * @form 1785 * @since 10 1786 */ 1787 /** 1788 * Sets the animation curve 1789 * Curve is an enumeration type for common curves 1790 * ICurve is a curve object 1791 * 1792 * @param { Curve | string | ICurve } value 1793 * @returns { SwiperAttribute } 1794 * @syscap SystemCapability.ArkUI.ArkUI.Full 1795 * @crossplatform 1796 * @form 1797 * @atomicservice 1798 * @since 11 1799 */ 1800 curve(value: Curve | string | ICurve): SwiperAttribute; 1801 1802 /** 1803 * Called when the index value changes. 1804 * 1805 * @param { function } event 1806 * @returns { SwiperAttribute } 1807 * @syscap SystemCapability.ArkUI.ArkUI.Full 1808 * @since 7 1809 */ 1810 /** 1811 * Called when the index value changes. 1812 * 1813 * @param { function } event 1814 * @returns { SwiperAttribute } 1815 * @syscap SystemCapability.ArkUI.ArkUI.Full 1816 * @crossplatform 1817 * @form 1818 * @since 10 1819 */ 1820 /** 1821 * Called when the index value changes. 1822 * 1823 * @param { function } event 1824 * @returns { SwiperAttribute } 1825 * @syscap SystemCapability.ArkUI.ArkUI.Full 1826 * @crossplatform 1827 * @form 1828 * @atomicservice 1829 * @since 11 1830 */ 1831 onChange(event: (index: number) => void): SwiperAttribute; 1832 1833 /** 1834 * Setting indicator style navigation. 1835 * 1836 * @param { IndicatorStyle } value 1837 * @returns { SwiperAttribute } 1838 * @syscap SystemCapability.ArkUI.ArkUI.Full 1839 * @since 8 1840 * @deprecated since 10 1841 */ 1842 indicatorStyle(value?: IndicatorStyle): SwiperAttribute; 1843 1844 /** 1845 * The previous margin which can be used to expose a small portion of the previous item. 1846 * 1847 * @param { Length } value - The length of previous margin. 1848 * @returns { SwiperAttribute } The attribute of the swiper. 1849 * @syscap SystemCapability.ArkUI.ArkUI.Full 1850 * @since 10 1851 */ 1852 /** 1853 * The previous margin which can be used to expose a small portion of the previous item. 1854 * 1855 * @param { Length } value - The length of previous margin. 1856 * @returns { SwiperAttribute } The attribute of the swiper. 1857 * @syscap SystemCapability.ArkUI.ArkUI.Full 1858 * @crossplatform 1859 * @atomicservice 1860 * @since 11 1861 */ 1862 /** 1863 * The previous margin which can be used to expose a small portion of the previous item. 1864 * When the previous item is empty, do not display blank space. 1865 * 1866 * @param { Length } value - The length of previous margin. 1867 * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the previous margin on the first page in non-loop scenarios. 1868 * @returns { SwiperAttribute } The attribute of the swiper. 1869 * @syscap SystemCapability.ArkUI.ArkUI.Full 1870 * @crossplatform 1871 * @atomicservice 1872 * @since 12 1873 */ 1874 prevMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; 1875 1876 /** 1877 * The next margin which can be used to expose a small portion of the latter item. 1878 * 1879 * @param { Length } value - The length of next margin. 1880 * @returns { SwiperAttribute } The attribute of the swiper. 1881 * @syscap SystemCapability.ArkUI.ArkUI.Full 1882 * @since 10 1883 */ 1884 /** 1885 * The next margin which can be used to expose a small portion of the latter item. 1886 * 1887 * @param { Length } value - The length of next margin. 1888 * @returns { SwiperAttribute } The attribute of the swiper. 1889 * @syscap SystemCapability.ArkUI.ArkUI.Full 1890 * @crossplatform 1891 * @atomicservice 1892 * @since 11 1893 */ 1894 /** 1895 * The next margin which can be used to expose a small portion of the latter item. 1896 * When the next item is empty, do not display blank space. 1897 * 1898 * @param { Length } value - The length of next margin. 1899 * @param { boolean } [ignoreBlank] - Whether to hide(ignore) the next margin on the last page in non-loop scenarios. 1900 * @returns { SwiperAttribute } The attribute of the swiper. 1901 * @syscap SystemCapability.ArkUI.ArkUI.Full 1902 * @crossplatform 1903 * @atomicservice 1904 * @since 12 1905 */ 1906 nextMargin(value: Length, ignoreBlank?: boolean): SwiperAttribute; 1907 1908 /** 1909 * Called when the swiper animation start. 1910 * 1911 * @param { function } event - the index value of the swiper page that when animation start. 1912 * @returns { SwiperAttribute } 1913 * @syscap SystemCapability.ArkUI.ArkUI.Full 1914 * @since 9 1915 */ 1916 /** 1917 * Called when the swiper animation start. 1918 * 1919 * @param { function } event 1920 * "index": the index value of the swiper page that when animation start. 1921 * "targetIndex": the target index value of the swiper page that when animation start. 1922 * "extraInfo": the extra callback info. 1923 * @returns { SwiperAttribute } 1924 * @syscap SystemCapability.ArkUI.ArkUI.Full 1925 * @crossplatform 1926 * @form 1927 * @since 10 1928 */ 1929 /** 1930 * Called when the swiper animation start. 1931 * 1932 * @param { function } event 1933 * "index": the index value of the swiper page that when animation start. 1934 * "targetIndex": the target index value of the swiper page that when animation start. 1935 * "extraInfo": the extra callback info. 1936 * @returns { SwiperAttribute } 1937 * @syscap SystemCapability.ArkUI.ArkUI.Full 1938 * @crossplatform 1939 * @form 1940 * @atomicservice 1941 * @since 11 1942 */ 1943 onAnimationStart(event: (index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => void): SwiperAttribute; 1944 1945 /** 1946 * Called when the swiper animation end. 1947 * 1948 * @param { function } event - the index value of the swiper page that when animation end. 1949 * @returns { SwiperAttribute } 1950 * @syscap SystemCapability.ArkUI.ArkUI.Full 1951 * @since 9 1952 */ 1953 /** 1954 * Called when the swiper animation end. 1955 * 1956 * @param { function } event 1957 * "index": the index value of the swiper page that when animation end. 1958 * "extraInfo": the extra callback info. 1959 * @returns { SwiperAttribute } 1960 * @syscap SystemCapability.ArkUI.ArkUI.Full 1961 * @crossplatform 1962 * @form 1963 * @since 10 1964 */ 1965 /** 1966 * Called when the swiper animation end. 1967 * 1968 * @param { function } event 1969 * "index": the index value of the swiper page that when animation end. 1970 * "extraInfo": the extra callback info. 1971 * @returns { SwiperAttribute } 1972 * @syscap SystemCapability.ArkUI.ArkUI.Full 1973 * @crossplatform 1974 * @form 1975 * @atomicservice 1976 * @since 11 1977 */ 1978 onAnimationEnd(event: (index: number, extraInfo: SwiperAnimationEvent) => void): SwiperAttribute; 1979 1980 /** 1981 * Called when the swiper swipe with the gesture. 1982 * 1983 * @param { function } event 1984 * "index": the index value of the swiper page before gesture swipe. 1985 * "extraInfo": the extra callback info. 1986 * @returns { SwiperAttribute } 1987 * @syscap SystemCapability.ArkUI.ArkUI.Full 1988 * @crossplatform 1989 * @since 10 1990 */ 1991 /** 1992 * Called when the swiper swipe with the gesture. 1993 * 1994 * @param { function } event 1995 * "index": the index value of the swiper page before gesture swipe. 1996 * "extraInfo": the extra callback info. 1997 * @returns { SwiperAttribute } 1998 * @syscap SystemCapability.ArkUI.ArkUI.Full 1999 * @crossplatform 2000 * @atomicservice 2001 * @since 11 2002 */ 2003 onGestureSwipe(event: (index: number, extraInfo: SwiperAnimationEvent) => void): SwiperAttribute; 2004 2005 /** 2006 * Called to setting the nested scroll mode. 2007 * 2008 * @param { SwiperNestedScrollMode } value - mode for nested scrolling. 2009 * @returns { SwiperAttribute } the attribute of the swiper. 2010 * @syscap SystemCapability.ArkUI.ArkUI.Full 2011 * @crossplatform 2012 * @atomicservice 2013 * @since 11 2014 */ 2015 nestedScroll(value: SwiperNestedScrollMode): SwiperAttribute; 2016 2017 /** 2018 * Custom swiper content transition animation. 2019 * 2020 * @param { SwiperContentAnimatedTransition } transition - custom content transition animation. 2021 * @returns { SwiperAttribute } the attribute of the swiper. 2022 * @syscap SystemCapability.ArkUI.ArkUI.Full 2023 * @crossplatform 2024 * @atomicservice 2025 * @since 12 2026 */ 2027 customContentTransition(transition: SwiperContentAnimatedTransition): SwiperAttribute; 2028 2029 /** 2030 * Called when the swiper content did scroll. 2031 * 2032 * @param { ContentDidScrollCallback } handler - callback of scroll, 2033 * selectedIndex is the index value of the swiper content selected before animation start. 2034 * index is the index value of the swiper content. 2035 * position is the moving ratio of the swiper content from the start position of the swiper main axis. 2036 * mainAxisLength is the swiper main axis length for calculating position. 2037 * @returns { SwiperAttribute } the attribute of the swiper. 2038 * @syscap SystemCapability.ArkUI.ArkUI.Full 2039 * @crossplatform 2040 * @atomicservice 2041 * @since 12 2042 */ 2043 onContentDidScroll(handler: ContentDidScrollCallback): SwiperAttribute; 2044 2045 /** 2046 * Setting whether the indicator is interactive. 2047 * 2048 * @param { boolean } value - Whether the indicator is interactive. 2049 * @returns { SwiperAttribute } 2050 * @syscap SystemCapability.ArkUI.ArkUI.Full 2051 * @crossplatform 2052 * @atomicservice 2053 * @since 12 2054 */ 2055 indicatorInteractive(value: boolean): SwiperAttribute; 2056 2057 /** 2058 * Setting page flip mode on mouse wheel event. 2059 * 2060 * @param { Optional<PageFlipMode> } mode - page flip mode on mouse wheel event. The default value is PageFlipMode.CONTINUOUS. 2061 * @returns { SwiperAttribute } 2062 * @syscap SystemCapability.ArkUI.ArkUI.Full 2063 * @crossplatform 2064 * @form 2065 * @atomicservice 2066 * @since 15 2067 */ 2068 pageFlipMode(mode: Optional<PageFlipMode>): SwiperAttribute; 2069 2070 /** 2071 * Called when the swiper content will scroll. 2072 * 2073 * @param { ContentWillScrollCallback } handler - callback of will scroll. 2074 * @returns { SwiperAttribute } the attribute of the swiper. 2075 * @syscap SystemCapability.ArkUI.ArkUI.Full 2076 * @crossplatform 2077 * @form 2078 * @atomicservice 2079 * @since 15 2080 */ 2081 onContentWillScroll(handler: ContentWillScrollCallback): SwiperAttribute; 2082} 2083 2084/** 2085 * Defines the swiper content animated transition options. 2086 * 2087 * @interface SwiperContentAnimatedTransition 2088 * @syscap SystemCapability.ArkUI.ArkUI.Full 2089 * @crossplatform 2090 * @atomicservice 2091 * @since 12 2092 */ 2093declare interface SwiperContentAnimatedTransition { 2094 /** 2095 * Defines the timeout of custom content transition animation after the page is moved out of the swiper. The unit is ms. 2096 * If SwiperContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. 2097 * 2098 * @type { ?number } 2099 * @default 0 ms 2100 * @syscap SystemCapability.ArkUI.ArkUI.Full 2101 * @crossplatform 2102 * @atomicservice 2103 * @since 12 2104 */ 2105 timeout?: number; 2106 2107 /** 2108 * Called when custom content transition animation start. 2109 * 2110 * @type { Callback<SwiperContentTransitionProxy> } 2111 * @syscap SystemCapability.ArkUI.ArkUI.Full 2112 * @crossplatform 2113 * @atomicservice 2114 * @since 12 2115 */ 2116 transition: Callback<SwiperContentTransitionProxy>; 2117} 2118 2119/** 2120 * The proxy of SwiperContentAnimatedTransition. 2121 * 2122 * @interface SwiperContentTransitionProxy 2123 * @syscap SystemCapability.ArkUI.ArkUI.Full 2124 * @crossplatform 2125 * @atomicservice 2126 * @since 12 2127 */ 2128declare interface SwiperContentTransitionProxy { 2129 /** 2130 * the index value of the swiper content selected before animation start. 2131 * 2132 * @type { number } 2133 * @syscap SystemCapability.ArkUI.ArkUI.Full 2134 * @crossplatform 2135 * @atomicservice 2136 * @since 12 2137 */ 2138 selectedIndex: number; 2139 2140 /** 2141 * The index value of the swiper content. 2142 * 2143 * @type { number } 2144 * @syscap SystemCapability.ArkUI.ArkUI.Full 2145 * @crossplatform 2146 * @atomicservice 2147 * @since 12 2148 */ 2149 index: number; 2150 2151 /** 2152 * the moving ratio of the swiper content from the start position of the swiper main axis. 2153 * 2154 * @type { number } 2155 * @syscap SystemCapability.ArkUI.ArkUI.Full 2156 * @crossplatform 2157 * @atomicservice 2158 * @since 12 2159 */ 2160 position: number; 2161 2162 /** 2163 * the swiper main axis length for calculating position. 2164 * 2165 * @type { number } 2166 * @syscap SystemCapability.ArkUI.ArkUI.Full 2167 * @crossplatform 2168 * @atomicservice 2169 * @since 12 2170 */ 2171 mainAxisLength: number; 2172 2173 /** 2174 * Notifies Swiper page the custom content transition animation is complete. 2175 * 2176 * @syscap SystemCapability.ArkUI.ArkUI.Full 2177 * @crossplatform 2178 * @atomicservice 2179 * @since 12 2180 */ 2181 finishTransition(): void; 2182} 2183 2184/** 2185 * The result of swiper ContentWillScrollCallback. 2186 * 2187 * @interface SwiperContentWillScrollResult 2188 * @syscap SystemCapability.ArkUI.ArkUI.Full 2189 * @crossplatform 2190 * @form 2191 * @atomicservice 2192 * @since 15 2193 */ 2194declare interface SwiperContentWillScrollResult { 2195 /** 2196 * the index value of the current child page. 2197 * 2198 * @type { number } 2199 * @syscap SystemCapability.ArkUI.ArkUI.Full 2200 * @crossplatform 2201 * @form 2202 * @atomicservice 2203 * @since 15 2204 */ 2205 currentIndex: number; 2206 2207 /** 2208 * the index value of the child page that will display. 2209 * 2210 * @type { number } 2211 * @syscap SystemCapability.ArkUI.ArkUI.Full 2212 * @crossplatform 2213 * @form 2214 * @atomicservice 2215 * @since 15 2216 */ 2217 comingIndex: number; 2218 2219 /** 2220 * the sliding offset of each frame. Positive numbers indicating slide backward(e.g. from index=1 to index=0), 2221 * negative numbers indicating slide forward(e.g. from index=0 to index=1). 2222 * 2223 * @type { number } 2224 * @syscap SystemCapability.ArkUI.ArkUI.Full 2225 * @crossplatform 2226 * @form 2227 * @atomicservice 2228 * @since 15 2229 */ 2230 offset: number; 2231} 2232 2233/** 2234 * The callback of onContentDidScroll. 2235 * 2236 * @typedef { Function } ContentDidScrollCallback 2237 * @param { number } selectedIndex - the index value of the swiper content selected before animation start. 2238 * @param { number } index - the index value of the swiper content. 2239 * @param { number } position - the moving ratio of the swiper content from the start position of the swiper main axis. 2240 * @param { number } mainAxisLength - the swiper main axis length for calculating position. 2241 * @syscap SystemCapability.ArkUI.ArkUI.Full 2242 * @crossplatform 2243 * @atomicservice 2244 * @since 12 2245 */ 2246declare type ContentDidScrollCallback = (selectedIndex: number, index: number, position: number, mainAxisLength: number) => void; 2247 2248/** 2249 * The callback of onContentWillScroll. 2250 * 2251 * @typedef { function } ContentWillScrollCallback 2252 * @param { SwiperContentWillScrollResult } result - the result of swiper ContentWillScrollCallback. 2253 * @returns { boolean } whether to allow scroll, true indicating can scroll and false indicating can not scroll. 2254 * @syscap SystemCapability.ArkUI.ArkUI.Full 2255 * @crossplatform 2256 * @form 2257 * @atomicservice 2258 * @since 15 2259 */ 2260declare type ContentWillScrollCallback = (result: SwiperContentWillScrollResult) => boolean; 2261 2262/** 2263 * Defines Swiper Component. 2264 * 2265 * @syscap SystemCapability.ArkUI.ArkUI.Full 2266 * @since 7 2267 */ 2268/** 2269 * Defines Swiper Component. 2270 * 2271 * @syscap SystemCapability.ArkUI.ArkUI.Full 2272 * @crossplatform 2273 * @form 2274 * @since 10 2275 */ 2276/** 2277 * Defines Swiper Component. 2278 * 2279 * @syscap SystemCapability.ArkUI.ArkUI.Full 2280 * @crossplatform 2281 * @form 2282 * @atomicservice 2283 * @since 11 2284 */ 2285declare const Swiper: SwiperInterface; 2286 2287/** 2288 * Defines Swiper Component instance. 2289 * 2290 * @syscap SystemCapability.ArkUI.ArkUI.Full 2291 * @since 7 2292 */ 2293/** 2294 * Defines Swiper Component instance. 2295 * 2296 * @syscap SystemCapability.ArkUI.ArkUI.Full 2297 * @crossplatform 2298 * @form 2299 * @since 10 2300 */ 2301/** 2302 * Defines Swiper Component instance. 2303 * 2304 * @syscap SystemCapability.ArkUI.ArkUI.Full 2305 * @crossplatform 2306 * @form 2307 * @atomicservice 2308 * @since 11 2309 */ 2310declare const SwiperInstance: SwiperAttribute; 2311