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