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 * Content scroll direction. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Content scroll direction. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * Content scroll direction. 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare enum ScrollDirection { 46 /** 47 * Vertical scrolling is supported. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @since 7 51 */ 52 /** 53 * Vertical scrolling is supported. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * Vertical scrolling is supported. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since 11 66 */ 67 Vertical, 68 69 /** 70 * Horizontal scrolling is supported. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75 /** 76 * Horizontal scrolling is supported. 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82 /** 83 * Horizontal scrolling is supported. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since 11 89 */ 90 Horizontal, 91 92 /** 93 * Free scrolling is supported. 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 7 97 * @deprecated since 9 98 */ 99 Free, 100 101 /** 102 * Non-scrollable. 103 * 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @since 7 106 */ 107 /** 108 * Non-scrollable. 109 * 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @crossplatform 112 * @since 10 113 */ 114 /** 115 * Non-scrollable. 116 * 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @atomicservice 120 * @since 11 121 */ 122 None, 123} 124 125/** 126 * ScrollAlign. 127 * 128 * @enum { number } ScrollAlign 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @crossplatform 131 * @since 10 132 */ 133/** 134 * ScrollAlign. 135 * 136 * @enum { number } ScrollAlign 137 * @syscap SystemCapability.ArkUI.ArkUI.Full 138 * @crossplatform 139 * @atomicservice 140 * @since 11 141 */ 142declare enum ScrollAlign { 143 /** 144 * Start position alignment. 145 * 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @since 10 149 */ 150 /** 151 * Start position alignment. 152 * 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @crossplatform 155 * @atomicservice 156 * @since 11 157 */ 158 START, 159 160 /** 161 * Center alignment. 162 * 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @crossplatform 165 * @since 10 166 */ 167 /** 168 * Center alignment. 169 * 170 * @syscap SystemCapability.ArkUI.ArkUI.Full 171 * @crossplatform 172 * @atomicservice 173 * @since 11 174 */ 175 CENTER, 176 177 /** 178 * End position alignment. 179 * 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @since 10 183 */ 184 /** 185 * End position alignment. 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @crossplatform 189 * @atomicservice 190 * @since 11 191 */ 192 END, 193 194 /** 195 * Scroll the minimum distance to fully display the specified item. 196 * 197 * @syscap SystemCapability.ArkUI.ArkUI.Full 198 * @crossplatform 199 * @since 10 200 */ 201 /** 202 * Scroll the minimum distance to fully display the specified item. 203 * 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @crossplatform 206 * @atomicservice 207 * @since 11 208 */ 209 AUTO, 210} 211 212/** 213 * OffsetResult info. 214 * 215 * @interface OffsetResult 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @crossplatform 218 * @atomicservice 219 * @since 11 220 */ 221declare interface OffsetResult { 222 /** 223 * The X-axis offset. 224 * 225 * @type { number } 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @crossplatform 228 * @atomicservice 229 * @since 11 230 */ 231 xOffset: number; 232 233 /** 234 * The y-axis offset. 235 * 236 * @type { number } 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @crossplatform 239 * @atomicservice 240 * @since 11 241 */ 242 yOffset: number; 243} 244 245/** 246 * Define scroll edge options 247 * 248 * @interface ScrollEdgeOptions 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @atomicservice 252 * @since 12 253 */ 254declare interface ScrollEdgeOptions { 255 /** 256 * The fasten speed of scrolling to the edge, unit is vp/s. 257 * 258 * @type { ?number } 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @crossplatform 261 * @atomicservice 262 * @since 12 263 */ 264 velocity?: number; 265} 266 267/** 268 * Define scrollToIndex options 269 * 270 * @interface ScrollToIndexOptions 271 * @syscap SystemCapability.ArkUI.ArkUI.Full 272 * @crossplatform 273 * @atomicservice 274 * @since 12 275 */ 276declare interface ScrollToIndexOptions { 277 /** 278 * The extra offset of scrolling to the index, unit is vp. 279 * 280 * @type { ?LengthMetrics } 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @crossplatform 283 * @atomicservice 284 * @since 12 285 */ 286 extraOffset?: LengthMetrics; 287} 288 289/** 290 * Provides custom animation parameters. 291 * 292 * @interface ScrollAnimationOptions 293 * @syscap SystemCapability.ArkUI.ArkUI.Full 294 * @crossplatform 295 * @atomicservice 296 * @since 12 297 */ 298declare interface ScrollAnimationOptions { 299 /** 300 * Set the duration of the animation. 301 * 302 * @type { ?number } 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @atomicservice 306 * @since 12 307 */ 308 duration?: number; 309 310 /** 311 * Set the curve of the animation. 312 * 313 * @type { ?(Curve | ICurve) } 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @atomicservice 317 * @since 12 318 */ 319 curve?: Curve | ICurve; 320 321 /** 322 * Set whether the animation can over the boundary. 323 * 324 * @type { ?boolean } 325 * @default false 326 * @syscap SystemCapability.ArkUI.ArkUI.Full 327 * @crossplatform 328 * @atomicservice 329 * @since 12 330 */ 331 canOverScroll?: boolean; 332} 333 334/** 335 * OffsetOptions info. 336 * 337 * @interface OffsetOptions 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @atomicservice 341 * @since 12 342 */ 343declare interface OffsetOptions { 344 /** 345 * The X-axis offset. 346 * 347 * @type { ?Dimension } 348 * @syscap SystemCapability.ArkUI.ArkUI.Full 349 * @crossplatform 350 * @atomicservice 351 * @since 12 352 */ 353 xOffset?: Dimension; 354 355 /** 356 * The y-axis offset. 357 * 358 * @type { ?Dimension } 359 * @syscap SystemCapability.ArkUI.ArkUI.Full 360 * @crossplatform 361 * @atomicservice 362 * @since 12 363 */ 364 yOffset?: Dimension; 365} 366 367/** 368 * Scroller 369 * 370 * @syscap SystemCapability.ArkUI.ArkUI.Full 371 * @since 7 372 */ 373/** 374 * Scroller 375 * 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @crossplatform 378 * @since 10 379 */ 380/** 381 * Scroller 382 * 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @crossplatform 385 * @atomicservice 386 * @since 11 387 */ 388declare class Scroller { 389 /** 390 * constructor. 391 * 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @since 7 394 */ 395 /** 396 * constructor. 397 * 398 * @syscap SystemCapability.ArkUI.ArkUI.Full 399 * @crossplatform 400 * @since 10 401 */ 402 /** 403 * constructor. 404 * 405 * @syscap SystemCapability.ArkUI.ArkUI.Full 406 * @crossplatform 407 * @atomicservice 408 * @since 11 409 */ 410 constructor(); 411 412 /** 413 * Called when the setting slides to the specified position. 414 * 415 * @param { object } value 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @since 7 418 */ 419 /** 420 * Called when the setting slides to the specified position. 421 * 422 * @param { object } value 423 * @syscap SystemCapability.ArkUI.ArkUI.Full 424 * @crossplatform 425 * @since 10 426 */ 427 /** 428 * Called when the setting slides to the specified position. 429 * 430 * @param { object } value 431 * @syscap SystemCapability.ArkUI.ArkUI.Full 432 * @crossplatform 433 * @atomicservice 434 * @since 11 435 */ 436 /** 437 * Called when the setting slides to the specified position. 438 * Anonymous Object Rectification. 439 * 440 * @param { ScrollOptions } options - scroll options 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @crossplatform 443 * @atomicservice 444 * @since 18 445 */ 446 scrollTo(options: ScrollOptions); 447 448 /** 449 * Called when scrolling to the edge of the container. 450 * 451 * @param { Edge } value 452 * @syscap SystemCapability.ArkUI.ArkUI.Full 453 * @since 7 454 */ 455 /** 456 * Called when scrolling to the edge of the container. 457 * 458 * @param { Edge } value 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @crossplatform 461 * @since 10 462 */ 463 /** 464 * Called when scrolling to the edge of the container. 465 * 466 * @param { Edge } value 467 * @syscap SystemCapability.ArkUI.ArkUI.Full 468 * @crossplatform 469 * @atomicservice 470 * @since 11 471 */ 472 /** 473 * Called when scrolling to the edge of the container. 474 * 475 * @param { Edge } value - Edge type of the container. 476 * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @atomicservice 480 * @since 12 481 */ 482 scrollEdge(value: Edge, options?: ScrollEdgeOptions); 483 484 485 /** 486 * Fling the scroll view. 487 * 488 * @param { number } velocity - initial velocity of fling, in vp/s. 489 * @throws { BusinessError } 401 - Parameter error. Possible causes: 490 * <br> 1. Mandatory parameters are left unspecified. 491 * <br> 2. Incorrect parameters types. 492 * <br> 3. Parameter verification failed. 493 * @throws { BusinessError } 100004 - Controller not bound to component. 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @crossplatform 496 * @atomicservice 497 * @since 12 498 */ 499 fling(velocity: number): void; 500 501 /** 502 * Called when page turning mode is set. 503 * 504 * @param { object } value 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @since 9 507 */ 508 /** 509 * Called when page turning mode is set. 510 * 511 * @param { object } value 512 * @syscap SystemCapability.ArkUI.ArkUI.Full 513 * @crossplatform 514 * @since 10 515 */ 516 /** 517 * Called when page turning mode is set. 518 * 519 * @param { object } value 520 * @syscap SystemCapability.ArkUI.ArkUI.Full 521 * @crossplatform 522 * @atomicservice 523 * @since 11 524 */ 525 /** 526 * Called when page turning mode is set. 527 * 528 * @param { ScrollPageOptions } value 529 * @syscap SystemCapability.ArkUI.ArkUI.Full 530 * @crossplatform 531 * @atomicservice 532 * @since 14 533 */ 534 scrollPage(value: ScrollPageOptions); 535 536 /** 537 * Called when page turning mode is set. 538 * 539 * @param { object } value 540 * @syscap SystemCapability.ArkUI.ArkUI.Full 541 * @since 7 542 * @deprecated since 9 543 */ 544 scrollPage(value: { next: boolean; direction?: Axis }); 545 546 /** 547 * Called when viewing the scroll offset. 548 * 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @since 7 551 */ 552 /** 553 * Called when viewing the scroll offset. 554 * 555 * @syscap SystemCapability.ArkUI.ArkUI.Full 556 * @crossplatform 557 * @since 10 558 */ 559 /** 560 * Called when viewing the scroll offset. 561 * 562 * @returns { OffsetResult } Returns the current scrolling offset. If the scroller not bound to a component, the return value is void. 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @crossplatform 565 * @atomicservice 566 * @since 11 567 */ 568 currentOffset() : OffsetResult; 569 570 /** 571 * Called when sliding to the specified index. 572 * 573 * @param { number } value 574 * @param { boolean } smooth 575 * @param { ScrollAlign } align 576 * @syscap SystemCapability.ArkUI.ArkUI.Full 577 * @since 7 578 */ 579 /** 580 * Called when sliding to the specified index. 581 * 582 * @param { number } value - Index to jump to. 583 * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. 584 * @param { ScrollAlign } align - Sets the alignment mode of a specified index. 585 * @syscap SystemCapability.ArkUI.ArkUI.Full 586 * @crossplatform 587 * @since 10 588 */ 589 /** 590 * Called when sliding to the specified index. 591 * 592 * @param { number } value - Index to jump to. 593 * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. 594 * @param { ScrollAlign } align - Sets the alignment mode of a specified index. 595 * @syscap SystemCapability.ArkUI.ArkUI.Full 596 * @crossplatform 597 * @atomicservice 598 * @since 11 599 */ 600 /** 601 * Scroll to the specified index. 602 * 603 * @param { number } value - Index to jump to. 604 * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. 605 * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. 606 * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. 607 * @syscap SystemCapability.ArkUI.ArkUI.Full 608 * @crossplatform 609 * @atomicservice 610 * @since 12 611 */ 612 scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions); 613 614 /** 615 * Called when the setting slides by offset. 616 * 617 * @param { Length } dx 618 * @param { Length } dy 619 * @syscap SystemCapability.ArkUI.ArkUI.Full 620 * @since 9 621 */ 622 /** 623 * Called when the setting slides by offset. 624 * 625 * @param { Length } dx 626 * @param { Length } dy 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @since 10 630 */ 631 /** 632 * Called when the setting slides by offset. 633 * 634 * @param { Length } dx 635 * @param { Length } dy 636 * @syscap SystemCapability.ArkUI.ArkUI.Full 637 * @crossplatform 638 * @atomicservice 639 * @since 11 640 */ 641 scrollBy(dx: Length, dy: Length); 642 643 /** 644 * Indicates whether the component scrolls to the end position. 645 * 646 * @returns { boolean } Returns whether the component scrolls to the end position. 647 * @syscap SystemCapability.ArkUI.ArkUI.Full 648 * @crossplatform 649 * @since 10 650 */ 651 /** 652 * Indicates whether the component scrolls to the end position. 653 * 654 * @returns { boolean } Returns whether the component scrolls to the end position. 655 * @syscap SystemCapability.ArkUI.ArkUI.Full 656 * @crossplatform 657 * @atomicservice 658 * @since 11 659 */ 660 isAtEnd(): boolean; 661 662 /** 663 * Get child item size and position. 664 * 665 * @param { number } index - Index of the item. 666 * @returns { RectResult } Returns the size and position. 667 * @throws { BusinessError } 401 - Parameter error. Possible causes: 668 * <br> 1. Mandatory parameters are left unspecified. 669 * <br> 2. Incorrect parameters types. 670 * <br> 3. Parameter verification failed. 671 * @throws { BusinessError } 100004 - Controller not bound to component. 672 * @syscap SystemCapability.ArkUI.ArkUI.Full 673 * @crossplatform 674 * @since 11 675 */ 676 /** 677 * Get child item size and position. 678 * 679 * @param { number } index - Index of the item. 680 * @returns { RectResult } Returns the size and position. 681 * @throws { BusinessError } 401 - Parameter error. Possible causes: 682 * <br> 1. Mandatory parameters are left unspecified. 683 * <br> 2. Incorrect parameters types. 684 * <br> 3. Parameter verification failed. 685 * @throws { BusinessError } 100004 - Controller not bound to component. 686 * @syscap SystemCapability.ArkUI.ArkUI.Full 687 * @crossplatform 688 * @atomicservice 689 * @since 12 690 */ 691 getItemRect(index: number): RectResult; 692 693 /** 694 * Get item index by position. 695 * 696 * @param { number } x - X coordinate relative to the upper left corner of the current component's original area, in vp. 697 * @param { number } y - Y coordinate relative to the upper left corner of the current component's original area, in vp. 698 * @returns { number } Index of the item. 699 * @throws { BusinessError } 401 - Parameter error. Possible causes: 700 * <br> 1. Mandatory parameters are left unspecified. 701 * <br> 2. Incorrect parameters types. 702 * <br> 3. Parameter verification failed. 703 * @throws { BusinessError } 100004 - The controller not bound to component. 704 * @syscap SystemCapability.ArkUI.ArkUI.Full 705 * @crossplatform 706 * @atomicservice 707 * @since 14 708 */ 709 getItemIndex(x: number, y: number): number; 710} 711 712/** 713 * Define scroll page options 714 * @interface ScrollPageOptions 715 * @syscap SystemCapability.ArkUI.ArkUI.Full 716 * @atomicservice 717 * @since 14 718 */ 719declare interface ScrollPageOptions { 720 /** 721 * Control whether to scroll to the next page or the previous page. 722 * 723 * @type { boolean } 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @atomicservice 727 * @since 14 728 */ 729 next: boolean; 730 731 /** 732 * Set whether the scrollPage have animate. 733 * 734 * @type { ?boolean } 735 * @default false 736 * @syscap SystemCapability.ArkUI.ArkUI.Full 737 * @crossplatform 738 * @atomicservice 739 * @since 14 740 */ 741 animation?: boolean; 742} 743 744/** 745 * Define scroll options. 746 * 747 * @interface ScrollOptions 748 * @syscap SystemCapability.ArkUI.ArkUI.Full 749 * @crossplatform 750 * @atomicservice 751 * @since 18 752 */ 753declare interface ScrollOptions { 754 /** 755 * The X-axis offset. 756 * 757 * @type { number | string } 758 * @syscap SystemCapability.ArkUI.ArkUI.Full 759 * @crossplatform 760 * @since 10 761 */ 762 /** 763 * The X-axis offset. 764 * 765 * @type { number | string } 766 * @syscap SystemCapability.ArkUI.ArkUI.Full 767 * @crossplatform 768 * @atomicservice 769 * @since 11 770 */ 771 /** 772 * The X-axis offset. 773 * Anonymous Object Rectification. 774 * 775 * @type { number | string } 776 * @syscap SystemCapability.ArkUI.ArkUI.Full 777 * @crossplatform 778 * @atomicservice 779 * @since 18 780 */ 781 xOffset: number | string; 782 783 /** 784 * The Y-axis offset. 785 * 786 * @type { number | string } 787 * @syscap SystemCapability.ArkUI.ArkUI.Full 788 * @crossplatform 789 * @since 10 790 */ 791 /** 792 * The Y-axis offset. 793 * 794 * @type { number | string } 795 * @syscap SystemCapability.ArkUI.ArkUI.Full 796 * @crossplatform 797 * @atomicservice 798 * @since 11 799 */ 800 /** 801 * The Y-axis offset. 802 * Anonymous Object Rectification. 803 * 804 * @type { number | string } 805 * @syscap SystemCapability.ArkUI.ArkUI.Full 806 * @crossplatform 807 * @atomicservice 808 * @since 18 809 */ 810 yOffset: number | string; 811 812 /** 813 * Descriptive animation. 814 * 815 * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters 816 * and the boolean type enables default spring animation. 817 * @syscap SystemCapability.ArkUI.ArkUI.Full 818 * @crossplatform 819 * @since 10 820 */ 821 /** 822 * Descriptive animation. 823 * 824 * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters 825 * and the boolean type enables default spring animation. 826 * @syscap SystemCapability.ArkUI.ArkUI.Full 827 * @crossplatform 828 * @atomicservice 829 * @since 11 830 */ 831 /** 832 * Descriptive animation. 833 * 834 * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters 835 * and the boolean type enables default spring animation. 836 * @syscap SystemCapability.ArkUI.ArkUI.Full 837 * @crossplatform 838 * @atomicservice 839 * @since 12 840 */ 841 /** 842 * Descriptive animation. 843 * Anonymous Object Rectification. 844 * 845 * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters 846 * and the boolean type enables default spring animation. 847 * @syscap SystemCapability.ArkUI.ArkUI.Full 848 * @crossplatform 849 * @atomicservice 850 * @since 18 851 */ 852 animation?: ScrollAnimationOptions | boolean; 853} 854 855/** 856 * Define scroll snap options 857 * 858 * @interface ScrollSnapOptions 859 * @syscap SystemCapability.ArkUI.ArkUI.Full 860 * @since 10 861 */ 862/** 863 * Define scroll snap options 864 * 865 * @interface ScrollSnapOptions 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @atomicservice 868 * @since 11 869 */ 870declare interface ScrollSnapOptions { 871 /** 872 * Set scroll snap alignment. 873 * 874 * @type { ScrollSnapAlign } 875 * @syscap SystemCapability.ArkUI.ArkUI.Full 876 * @since 10 877 */ 878 /** 879 * Set scroll snap alignment. 880 * 881 * @type { ScrollSnapAlign } 882 * @syscap SystemCapability.ArkUI.ArkUI.Full 883 * @atomicservice 884 * @since 11 885 */ 886 snapAlign: ScrollSnapAlign; 887 888 /** 889 * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer 890 * multiple of snapPositions. When the type of snapPositions is Array<number>, Scroll content is paginated based 891 * on the array of snapPositions. 892 * 893 * @type { ?(Dimension | Array<Dimension>) } 894 * @default 100% 895 * @syscap SystemCapability.ArkUI.ArkUI.Full 896 * @since 10 897 */ 898 /** 899 * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer 900 * multiple of snapPositions. When the type of snapPositions is Array<number>, Scroll content is paginated based 901 * on the array of snapPositions. 902 * 903 * @type { ?(Dimension | Array<Dimension>) } 904 * @default 100% 905 * @syscap SystemCapability.ArkUI.ArkUI.Full 906 * @atomicservice 907 * @since 11 908 */ 909 snapPagination?: Dimension | Array<Dimension>; 910 911 /** 912 * Set whether the beginning of the Scroll content counts an a snap. 913 * 914 * @type { ?boolean } 915 * @default true 916 * @syscap SystemCapability.ArkUI.ArkUI.Full 917 * @since 10 918 */ 919 /** 920 * Set whether the beginning of the Scroll content counts an a snap. 921 * 922 * @type { ?boolean } 923 * @default true 924 * @syscap SystemCapability.ArkUI.ArkUI.Full 925 * @atomicservice 926 * @since 11 927 */ 928 enableSnapToStart?: boolean; 929 930 /** 931 * Set whether the end of the Scroll content counts an a snap. 932 * 933 * @type { ?boolean } 934 * @default true 935 * @syscap SystemCapability.ArkUI.ArkUI.Full 936 * @since 10 937 */ 938 /** 939 * Set whether the end of the Scroll content counts an a snap. 940 * 941 * @type { ?boolean } 942 * @default true 943 * @syscap SystemCapability.ArkUI.ArkUI.Full 944 * @atomicservice 945 * @since 11 946 */ 947 enableSnapToEnd?: boolean; 948} 949 950/** 951 * Provides interfaces for scrollable containers. 952 * 953 * @interface ScrollInterface 954 * @syscap SystemCapability.ArkUI.ArkUI.Full 955 * @since 7 956 */ 957/** 958 * Provides interfaces for scrollable containers. 959 * 960 * @interface ScrollInterface 961 * @syscap SystemCapability.ArkUI.ArkUI.Full 962 * @crossplatform 963 * @since 10 964 */ 965/** 966 * Provides interfaces for scrollable containers. 967 * 968 * @interface ScrollInterface 969 * @syscap SystemCapability.ArkUI.ArkUI.Full 970 * @crossplatform 971 * @atomicservice 972 * @since 11 973 */ 974interface ScrollInterface { 975 /** 976 * Called when a scrollable container is set. 977 * 978 * @param { Scroller } scroller 979 * @returns { ScrollAttribute } 980 * @syscap SystemCapability.ArkUI.ArkUI.Full 981 * @since 7 982 */ 983 /** 984 * Called when a scrollable container is set. 985 * 986 * @param { Scroller } scroller 987 * @returns { ScrollAttribute } 988 * @syscap SystemCapability.ArkUI.ArkUI.Full 989 * @crossplatform 990 * @since 10 991 */ 992 /** 993 * Called when a scrollable container is set. 994 * 995 * @param { Scroller } scroller 996 * @returns { ScrollAttribute } 997 * @syscap SystemCapability.ArkUI.ArkUI.Full 998 * @crossplatform 999 * @atomicservice 1000 * @since 11 1001 */ 1002 (scroller?: Scroller): ScrollAttribute; 1003} 1004 1005/** 1006 * Defines a Scroll onScrollEdge callback. 1007 * 1008 * @typedef { function } OnScrollEdgeCallback 1009 * @param { Edge } side - the edge position scrolled to 1010 * @syscap SystemCapability.ArkUI.ArkUI.Full 1011 * @crossplatform 1012 * @atomicservice 1013 * @since 18 1014 */ 1015declare type OnScrollEdgeCallback = (side: Edge) => void; 1016 1017/** 1018 * The data returned by the event handler when onScrollFrameBegin. 1019 * 1020 * @interface OnScrollFrameBeginHandlerResult 1021 * @syscap SystemCapability.ArkUI.ArkUI.Full 1022 * @crossplatform 1023 * @atomicservice 1024 * @since 18 1025 */ 1026interface OnScrollFrameBeginHandlerResult { 1027 /** 1028 * Actual sliding amount, unit vp. 1029 * 1030 * @type { number } 1031 * @syscap SystemCapability.ArkUI.ArkUI.Full 1032 * @since 9 1033 */ 1034 /** 1035 * Actual sliding amount, unit vp. 1036 * 1037 * @type { number } 1038 * @syscap SystemCapability.ArkUI.ArkUI.Full 1039 * @crossplatform 1040 * @since 10 1041 */ 1042 /** 1043 * Actual sliding amount, unit vp. 1044 * 1045 * @type { number } 1046 * @syscap SystemCapability.ArkUI.ArkUI.Full 1047 * @crossplatform 1048 * @atomicservice 1049 * @since 11 1050 */ 1051 /** 1052 * Actual sliding amount, unit vp. 1053 * Anonymous Object Rectification. 1054 * 1055 * @type { number } 1056 * @syscap SystemCapability.ArkUI.ArkUI.Full 1057 * @crossplatform 1058 * @atomicservice 1059 * @since 18 1060 */ 1061 offsetRemain: number; 1062} 1063 1064/** 1065 * Defines a Scroll onScrollFrameBegin callback. 1066 * 1067 * @typedef { function } OnScrollFrameBeginCallback 1068 * @param { number } offset - The upcoming sliding amount, unit vp 1069 * @param { ScrollState } state - current sliding status 1070 * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @crossplatform 1073 * @atomicservice 1074 * @since 18 1075 */ 1076declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; 1077 1078/** 1079 * Defines the scroll attribute functions. 1080 * 1081 * @extends CommonMethod<ScrollAttribute> 1082 * @syscap SystemCapability.ArkUI.ArkUI.Full 1083 * @since 7 1084 */ 1085/** 1086 * Defines the scroll attribute functions. 1087 * 1088 * @extends CommonMethod<ScrollAttribute> 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @since 10 1092 */ 1093/** 1094 * Defines the scroll attribute functions. 1095 * 1096 * @extends ScrollableCommonMethod<ScrollAttribute> 1097 * @syscap SystemCapability.ArkUI.ArkUI.Full 1098 * @crossplatform 1099 * @atomicservice 1100 * @since 11 1101 */ 1102declare class ScrollAttribute extends ScrollableCommonMethod<ScrollAttribute> { 1103 /** 1104 * Called when the scroll method is slid. 1105 * 1106 * @param { ScrollDirection } value 1107 * @returns { ScrollAttribute } 1108 * @syscap SystemCapability.ArkUI.ArkUI.Full 1109 * @since 7 1110 */ 1111 /** 1112 * Called when the scroll method is slid. 1113 * 1114 * @param { ScrollDirection } value 1115 * @returns { ScrollAttribute } 1116 * @syscap SystemCapability.ArkUI.ArkUI.Full 1117 * @crossplatform 1118 * @since 10 1119 */ 1120 /** 1121 * Called when the scroll method is slid. 1122 * 1123 * @param { ScrollDirection } value 1124 * @returns { ScrollAttribute } 1125 * @syscap SystemCapability.ArkUI.ArkUI.Full 1126 * @crossplatform 1127 * @atomicservice 1128 * @since 11 1129 */ 1130 scrollable(value: ScrollDirection): ScrollAttribute; 1131 1132 /** 1133 * Called when the setting slides to the specified position. 1134 * 1135 * @param { function } event 1136 * @returns { ScrollAttribute } 1137 * @syscap SystemCapability.ArkUI.ArkUI.Full 1138 * @since 7 1139 */ 1140 /** 1141 * Called when the setting slides to the specified position. 1142 * 1143 * @param { function } event 1144 * @returns { ScrollAttribute } 1145 * @syscap SystemCapability.ArkUI.ArkUI.Full 1146 * @crossplatform 1147 * @since 10 1148 */ 1149 /** 1150 * Called when the setting slides to the specified position. 1151 * 1152 * @param { function } event 1153 * @returns { ScrollAttribute } 1154 * @syscap SystemCapability.ArkUI.ArkUI.Full 1155 * @crossplatform 1156 * @atomicservice 1157 * @since 11 1158 * @deprecated since 12 1159 * @useinstead scroll/Scroll#onWillScroll 1160 * 1161 */ 1162 onScroll(event: (xOffset: number, yOffset: number) => void): ScrollAttribute; 1163 1164 /** 1165 * Called when the Scroll will scroll. 1166 * 1167 * @param { ScrollOnWillScrollCallback } handler - callback of Scroll 1168 * @returns { ScrollAttribute } 1169 * @syscap SystemCapability.ArkUI.ArkUI.Full 1170 * @crossplatform 1171 * @atomicservice 1172 * @since 12 1173 */ 1174 onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute; 1175 1176 /** 1177 * Called when the Scroll did scroll. 1178 * 1179 * @param { ScrollOnScrollCallback } handler - callback of Scroll, 1180 * xOffset and yOffset are offsets this frame did scroll, scrollState is current scroll state. 1181 * @returns { ScrollAttribute } 1182 * @syscap SystemCapability.ArkUI.ArkUI.Full 1183 * @crossplatform 1184 * @atomicservice 1185 * @since 12 1186 */ 1187 onDidScroll(handler: ScrollOnScrollCallback): ScrollAttribute; 1188 1189 /** 1190 * Called when scrolling to the edge of the container. 1191 * 1192 * @param { function } event 1193 * @returns { ScrollAttribute } 1194 * @syscap SystemCapability.ArkUI.ArkUI.Full 1195 * @since 7 1196 */ 1197 /** 1198 * Called when scrolling to the edge of the container. 1199 * 1200 * @param { function } event 1201 * @returns { ScrollAttribute } 1202 * @syscap SystemCapability.ArkUI.ArkUI.Full 1203 * @crossplatform 1204 * @since 10 1205 */ 1206 /** 1207 * Called when scrolling to the edge of the container. 1208 * 1209 * @param { function } event 1210 * @returns { ScrollAttribute } 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @crossplatform 1213 * @atomicservice 1214 * @since 11 1215 */ 1216 /** 1217 * Called when scrolling to the edge of the container. 1218 * Anonymous Object Rectification. 1219 * 1220 * @param { OnScrollEdgeCallback } event 1221 * @returns { ScrollAttribute } 1222 * @syscap SystemCapability.ArkUI.ArkUI.Full 1223 * @crossplatform 1224 * @atomicservice 1225 * @since 18 1226 */ 1227 onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; 1228 1229 /** 1230 * Called when scrolling start. 1231 * 1232 * @param { function } event 1233 * @returns { ScrollAttribute } 1234 * @syscap SystemCapability.ArkUI.ArkUI.Full 1235 * @since 9 1236 */ 1237 /** 1238 * Called when scrolling start. 1239 * 1240 * @param { function } event 1241 * @returns { ScrollAttribute } 1242 * @syscap SystemCapability.ArkUI.ArkUI.Full 1243 * @crossplatform 1244 * @since 10 1245 */ 1246 /** 1247 * Called when scrolling start. 1248 * 1249 * @param { function } event 1250 * @returns { ScrollAttribute } 1251 * @syscap SystemCapability.ArkUI.ArkUI.Full 1252 * @crossplatform 1253 * @atomicservice 1254 * @since 11 1255 */ 1256 /** 1257 * Called when scrolling start. 1258 * Anonymous Object Rectification. 1259 * 1260 * @param { VoidCallback } event 1261 * @returns { ScrollAttribute } 1262 * @syscap SystemCapability.ArkUI.ArkUI.Full 1263 * @crossplatform 1264 * @atomicservice 1265 * @since 18 1266 */ 1267 onScrollStart(event: VoidCallback): ScrollAttribute; 1268 1269 /** 1270 * Called when scrolling has stopped. 1271 * 1272 * @param { function } event 1273 * @returns { ScrollAttribute } 1274 * @syscap SystemCapability.ArkUI.ArkUI.Full 1275 * @since 7 1276 * @deprecated since 9 1277 * @useinstead scroll/Scroll#onScrollStop 1278 */ 1279 onScrollEnd(event: () => void): ScrollAttribute; 1280 1281 /** 1282 * Called when scrolling has stopped. 1283 * 1284 * @param { function } event 1285 * @returns { ScrollAttribute } 1286 * @syscap SystemCapability.ArkUI.ArkUI.Full 1287 * @since 9 1288 */ 1289 /** 1290 * Called when scrolling has stopped. 1291 * 1292 * @param { function } event 1293 * @returns { ScrollAttribute } 1294 * @syscap SystemCapability.ArkUI.ArkUI.Full 1295 * @crossplatform 1296 * @since 10 1297 */ 1298 /** 1299 * Called when scrolling has stopped. 1300 * 1301 * @param { function } event 1302 * @returns { ScrollAttribute } 1303 * @syscap SystemCapability.ArkUI.ArkUI.Full 1304 * @crossplatform 1305 * @atomicservice 1306 * @since 11 1307 */ 1308 /** 1309 * Called when scrolling has stopped. 1310 * Anonymous Object Rectification. 1311 * 1312 * @param { VoidCallback } event 1313 * @returns { ScrollAttribute } 1314 * @syscap SystemCapability.ArkUI.ArkUI.Full 1315 * @crossplatform 1316 * @atomicservice 1317 * @since 18 1318 */ 1319 onScrollStop(event: VoidCallback): ScrollAttribute; 1320 1321 /** 1322 * Called when the status of the scroll bar is set. 1323 * 1324 * @param { BarState } barState 1325 * @returns { ScrollAttribute } 1326 * @syscap SystemCapability.ArkUI.ArkUI.Full 1327 * @since 7 1328 */ 1329 /** 1330 * Called when the status of the scroll bar is set. 1331 * 1332 * @param { BarState } barState 1333 * @returns { ScrollAttribute } 1334 * @syscap SystemCapability.ArkUI.ArkUI.Full 1335 * @crossplatform 1336 * @since 10 1337 */ 1338 /** 1339 * Called when the status of the scroll bar is set. 1340 * 1341 * @param { BarState } barState 1342 * @returns { ScrollAttribute } 1343 * @syscap SystemCapability.ArkUI.ArkUI.Full 1344 * @crossplatform 1345 * @atomicservice 1346 * @since 11 1347 */ 1348 scrollBar(barState: BarState): ScrollAttribute; 1349 1350 /** 1351 * Called when the color of the scroll bar is set. 1352 * 1353 * @param { Color | number | string } color 1354 * @returns { ScrollAttribute } 1355 * @syscap SystemCapability.ArkUI.ArkUI.Full 1356 * @since 7 1357 */ 1358 /** 1359 * Called when the color of the scroll bar is set. 1360 * 1361 * @param { Color | number | string } color 1362 * @returns { ScrollAttribute } 1363 * @syscap SystemCapability.ArkUI.ArkUI.Full 1364 * @crossplatform 1365 * @since 10 1366 */ 1367 /** 1368 * Called when the color of the scroll bar is set. 1369 * 1370 * @param { Color | number | string } color 1371 * @returns { ScrollAttribute } 1372 * @syscap SystemCapability.ArkUI.ArkUI.Full 1373 * @crossplatform 1374 * @atomicservice 1375 * @since 11 1376 */ 1377 scrollBarColor(color: Color | number | string): ScrollAttribute; 1378 1379 /** 1380 * Called when the width of the scroll bar is set. 1381 * 1382 * @param { number | string } value 1383 * @returns { ScrollAttribute } 1384 * @syscap SystemCapability.ArkUI.ArkUI.Full 1385 * @since 7 1386 */ 1387 /** 1388 * Called when the width of the scroll bar is set. 1389 * 1390 * @param { number | string } value 1391 * @returns { ScrollAttribute } 1392 * @syscap SystemCapability.ArkUI.ArkUI.Full 1393 * @crossplatform 1394 * @since 10 1395 */ 1396 /** 1397 * Called when the width of the scroll bar is set. 1398 * 1399 * @param { number | string } value 1400 * @returns { ScrollAttribute } 1401 * @syscap SystemCapability.ArkUI.ArkUI.Full 1402 * @crossplatform 1403 * @atomicservice 1404 * @since 11 1405 */ 1406 scrollBarWidth(value: number | string): ScrollAttribute; 1407 1408 /** 1409 * Called when the sliding effect is set. 1410 * 1411 * @param { EdgeEffect } edgeEffect 1412 * @returns { ScrollAttribute } 1413 * @syscap SystemCapability.ArkUI.ArkUI.Full 1414 * @since 7 1415 */ 1416 /** 1417 * Called when the sliding effect is set. 1418 * 1419 * @param { EdgeEffect } edgeEffect 1420 * @returns { ScrollAttribute } 1421 * @syscap SystemCapability.ArkUI.ArkUI.Full 1422 * @crossplatform 1423 * @since 10 1424 */ 1425 /** 1426 * Called when the sliding effect is set. 1427 * 1428 * @param { EdgeEffect } edgeEffect 1429 * @param { EdgeEffectOptions } options 1430 * @returns { ScrollAttribute } 1431 * @syscap SystemCapability.ArkUI.ArkUI.Full 1432 * @crossplatform 1433 * @atomicservice 1434 * @since 11 1435 */ 1436 edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute; 1437 1438 /** 1439 * Called when scrolling begin each frame. 1440 * 1441 * @param { function } event 1442 * @returns { ScrollAttribute } 1443 * @syscap SystemCapability.ArkUI.ArkUI.Full 1444 * @since 9 1445 */ 1446 /** 1447 * Called when scrolling begin each frame. 1448 * 1449 * @param { function } event 1450 * @returns { ScrollAttribute } 1451 * @syscap SystemCapability.ArkUI.ArkUI.Full 1452 * @crossplatform 1453 * @since 10 1454 */ 1455 /** 1456 * Called when scrolling begin each frame. 1457 * 1458 * @param { function } event 1459 * @returns { ScrollAttribute } 1460 * @syscap SystemCapability.ArkUI.ArkUI.Full 1461 * @crossplatform 1462 * @atomicservice 1463 * @since 11 1464 */ 1465 /** 1466 * Called when scrolling begin each frame. 1467 * Anonymous Object Rectification. 1468 * 1469 * @param { OnScrollFrameBeginCallback } event 1470 * @returns { ScrollAttribute } 1471 * @syscap SystemCapability.ArkUI.ArkUI.Full 1472 * @crossplatform 1473 * @atomicservice 1474 * @since 18 1475 */ 1476 onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; 1477 1478 /** 1479 * Called to setting the nested scroll options. 1480 * 1481 * @param { NestedScrollOptions } value - options for nested scrolling. 1482 * @returns { ScrollAttribute } the attribute of the scroll. 1483 * @syscap SystemCapability.ArkUI.ArkUI.Full 1484 * @since 10 1485 */ 1486 /** 1487 * Called to setting the nested scroll options. 1488 * 1489 * @param { NestedScrollOptions } value - options for nested scrolling. 1490 * @returns { ScrollAttribute } the attribute of the scroll. 1491 * @syscap SystemCapability.ArkUI.ArkUI.Full 1492 * @crossplatform 1493 * @atomicservice 1494 * @since 11 1495 */ 1496 nestedScroll(value: NestedScrollOptions): ScrollAttribute; 1497 1498 /** 1499 * Called when setting whether to enable scroll by gesture or mouse. 1500 * 1501 * @param { boolean } value 1502 * @returns { ScrollAttribute } The attribute of the scroll 1503 * @syscap SystemCapability.ArkUI.ArkUI.Full 1504 * @crossplatform 1505 * @since 10 1506 */ 1507 /** 1508 * Called when setting whether to enable scroll by gesture or mouse. 1509 * 1510 * @param { boolean } value 1511 * @returns { ScrollAttribute } The attribute of the scroll 1512 * @syscap SystemCapability.ArkUI.ArkUI.Full 1513 * @crossplatform 1514 * @atomicservice 1515 * @since 11 1516 */ 1517 enableScrollInteraction(value: boolean): ScrollAttribute; 1518 1519 /** 1520 * Called to setting the friction. 1521 * 1522 * @param { number | Resource } value - options for scrolling friction. 1523 * @returns { ScrollAttribute } the attribute of the scroll. 1524 * @syscap SystemCapability.ArkUI.ArkUI.Full 1525 * @crossplatform 1526 * @since 10 1527 */ 1528 /** 1529 * Called to setting the friction. 1530 * 1531 * @param { number | Resource } value - options for scrolling friction. 1532 * @returns { ScrollAttribute } the attribute of the scroll. 1533 * @syscap SystemCapability.ArkUI.ArkUI.Full 1534 * @crossplatform 1535 * @atomicservice 1536 * @since 11 1537 */ 1538 friction(value: number | Resource): ScrollAttribute; 1539 1540 /** 1541 * Called to setting the scroll snap options. 1542 * 1543 * @param { ScrollSnapOptions } value - options for scroll snap. 1544 * @returns { ScrollAttribute } the attribute of the scroll. 1545 * @syscap SystemCapability.ArkUI.ArkUI.Full 1546 * @since 10 1547 */ 1548 /** 1549 * Called to setting the scroll snap options. 1550 * 1551 * @param { ScrollSnapOptions } value - options for scroll snap. 1552 * @returns { ScrollAttribute } the attribute of the scroll. 1553 * @syscap SystemCapability.ArkUI.ArkUI.Full 1554 * @atomicservice 1555 * @since 11 1556 */ 1557 scrollSnap(value: ScrollSnapOptions): ScrollAttribute; 1558 1559 /** 1560 * Determines whether the scroll view stops on multiples of the content size when the user scrolls. 1561 * 1562 * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. 1563 * @returns { ScrollAttribute } the attribute of the scroll. 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @crossplatform 1566 * @since 11 1567 */ 1568 /** 1569 * Determines whether the scroll view stops on multiples of the content size when the user scrolls. 1570 * 1571 * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. 1572 * @returns { ScrollAttribute } the attribute of the scroll. 1573 * @syscap SystemCapability.ArkUI.ArkUI.Full 1574 * @crossplatform 1575 * @atomicservice 1576 * @since 12 1577 */ 1578 enablePaging(value: boolean): ScrollAttribute; 1579 1580 /** 1581 * Called to setting the initial offset 1582 * 1583 * @param { OffsetOptions } value - options for scroll initial offset. 1584 * @returns { ScrollAttribute } the attribute of the scroll. 1585 * @syscap SystemCapability.ArkUI.ArkUI.Full 1586 * @crossplatform 1587 * @atomicservice 1588 * @since 12 1589 */ 1590 initialOffset(value: OffsetOptions): ScrollAttribute; 1591} 1592 1593/** 1594 * callback of Scroll, using in onDidScroll. 1595 * 1596 * @typedef { function } ScrollOnScrollCallback 1597 * @param { number } xOffset - horizontal offset this frame did scroll. 1598 * @param { number } yOffset - vertical offset this frame did scroll. 1599 * @param { ScrollState } scrollState - current scroll state. 1600 * @syscap SystemCapability.ArkUI.ArkUI.Full 1601 * @crossplatform 1602 * @atomicservice 1603 * @since 12 1604 */ 1605declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; 1606 1607/** 1608 * Called before scroll to allow developer to control real offset the Scroll can scroll. 1609 * 1610 * @typedef { function } ScrollOnWillScrollCallback 1611 * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. 1612 * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. 1613 * @param { ScrollState } scrollState - current scroll state. 1614 * @param { ScrollSource } scrollSource - source of current scroll. 1615 * @returns { void | OffsetResult } the remain offset for the Scroll, 1616 * same as (xOffset, yOffset) when no OffsetResult is returned. 1617 * @syscap SystemCapability.ArkUI.ArkUI.Full 1618 * @crossplatform 1619 * @atomicservice 1620 * @since 12 1621 */ 1622declare type ScrollOnWillScrollCallback = 1623 (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | OffsetResult; 1624 1625/** 1626 * Defines Scroll Component. 1627 * 1628 * @syscap SystemCapability.ArkUI.ArkUI.Full 1629 * @since 7 1630 */ 1631/** 1632 * Defines Scroll Component. 1633 * 1634 * @syscap SystemCapability.ArkUI.ArkUI.Full 1635 * @crossplatform 1636 * @since 10 1637 */ 1638/** 1639 * Defines Scroll Component. 1640 * 1641 * @syscap SystemCapability.ArkUI.ArkUI.Full 1642 * @crossplatform 1643 * @atomicservice 1644 * @since 11 1645 */ 1646declare const Scroll: ScrollInterface; 1647 1648/** 1649 * Defines Scroll Component instance. 1650 * 1651 * @syscap SystemCapability.ArkUI.ArkUI.Full 1652 * @since 7 1653 */ 1654/** 1655 * Defines Scroll Component instance. 1656 * 1657 * @syscap SystemCapability.ArkUI.ArkUI.Full 1658 * @crossplatform 1659 * @since 10 1660 */ 1661/** 1662 * Defines Scroll Component instance. 1663 * 1664 * @syscap SystemCapability.ArkUI.ArkUI.Full 1665 * @crossplatform 1666 * @atomicservice 1667 * @since 11 1668 */ 1669declare const ScrollInstance: ScrollAttribute; 1670