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/*** if arkts 1.2 */ 22import { BarState, Edge, Color, EdgeEffect, ScrollSource ,Curve} from './enums' 23import { ICurve, RectResult, ScrollableCommonMethod, EdgeEffectOptions, NestedScrollOptions,CommonMethod } from './common' 24import { Dimension, Length, VoidCallback, Resource, LengthMetrics } from './units' 25import { ScrollSnapAlign, ScrollState } from './list' 26/*** endif */ 27 28/** 29 * Content scroll direction. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @since 7 34 */ 35/** 36 * Content scroll direction. 37 * 38 * @enum { number } 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @crossplatform 41 * @since 10 42 */ 43/** 44 * Enumerates the scrolling directions. 45 * 46 * @enum { number } 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @crossplatform 49 * @atomicservice 50 * @since arkts {'1.1':'11','1.2':'20'} 51 * @arkts 1.1&1.2 52 */ 53declare enum ScrollDirection { 54 /** 55 * Vertical scrolling is supported. 56 * 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @since 7 59 */ 60 /** 61 * Vertical scrolling is supported. 62 * 63 * @syscap SystemCapability.ArkUI.ArkUI.Full 64 * @crossplatform 65 * @since 10 66 */ 67 /** 68 * Only vertical scrolling is supported. 69 * 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @crossplatform 72 * @atomicservice 73 * @since arkts {'1.1':'11','1.2':'20'} 74 * @arkts 1.1&1.2 75 */ 76 Vertical, 77 78 /** 79 * Horizontal scrolling is supported. 80 * 81 * @syscap SystemCapability.ArkUI.ArkUI.Full 82 * @since 7 83 */ 84 /** 85 * Horizontal scrolling is supported. 86 * 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @since 10 90 */ 91 /** 92 * Only horizontal scrolling is supported. 93 * 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @atomicservice 97 * @since arkts {'1.1':'11','1.2':'20'} 98 * @arkts 1.1&1.2 99 */ 100 Horizontal, 101 102 /** 103 * Vertical or horizontal scrolling is supported. 104 * 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 7 107 * @deprecated since 9 108 */ 109 Free, 110 111 /** 112 * Non-scrollable. 113 * 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @since 7 116 */ 117 /** 118 * Non-scrollable. 119 * 120 * @syscap SystemCapability.ArkUI.ArkUI.Full 121 * @crossplatform 122 * @since 10 123 */ 124 /** 125 * Scrolling is disabled. 126 * 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @crossplatform 129 * @atomicservice 130 * @since arkts {'1.1':'11','1.2':'20'} 131 * @arkts 1.1&1.2 132 */ 133 None, 134 135 /** 136 * Free scrolling is supported. 137 * 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @crossplatform 140 * @atomicservice 141 * @since 20 142 */ 143 FREE = 4, 144} 145 146/** 147 * ScrollAlign. 148 * 149 * @enum { number } ScrollAlign 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @crossplatform 152 * @since 10 153 */ 154/** 155 * Enumerates alignment modes. 156 * 157 * @enum { number } ScrollAlign 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @crossplatform 160 * @atomicservice 161 * @since arkts {'1.1':'11','1.2':'20'} 162 * @arkts 1.1&1.2 163 */ 164declare enum ScrollAlign { 165 /** 166 * Start position alignment. 167 * 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @since 10 171 */ 172 /** 173 * The start edge of the list item is flush with the start edge of the list. 174 * 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @atomicservice 178 * @since arkts {'1.1':'11','1.2':'20'} 179 * @arkts 1.1&1.2 180 */ 181 START, 182 183 /** 184 * Center alignment. 185 * 186 * @syscap SystemCapability.ArkUI.ArkUI.Full 187 * @crossplatform 188 * @since 10 189 */ 190 /** 191 * The list item is centered along the main axis of the list. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @atomicservice 196 * @since arkts {'1.1':'11','1.2':'20'} 197 * @arkts 1.1&1.2 198 */ 199 CENTER, 200 201 /** 202 * End position alignment. 203 * 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @crossplatform 206 * @since 10 207 */ 208 /** 209 * The end edge of the list item is flush with the end edge of the list. 210 * 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @crossplatform 213 * @atomicservice 214 * @since arkts {'1.1':'11','1.2':'20'} 215 * @arkts 1.1&1.2 216 */ 217 END, 218 219 /** 220 * Scroll the minimum distance to fully display the specified item. 221 * 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @since 10 225 */ 226 /** 227 * The list item is automatically aligned. 228 * 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @atomicservice 232 * @since arkts {'1.1':'11','1.2':'20'} 233 * @arkts 1.1&1.2 234 */ 235 AUTO, 236} 237 238/** 239 * Represents the offset values resulting from a scroll operation. 240 * 241 * @interface OffsetResult 242 * @syscap SystemCapability.ArkUI.ArkUI.Full 243 * @crossplatform 244 * @atomicservice 245 * @since arkts {'1.1':'11','1.2':'20'} 246 * @arkts 1.1&1.2 247 */ 248declare interface OffsetResult { 249 /** 250 * Horizontal scrolling offset. 251 * 252 * @type { number } 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @crossplatform 255 * @atomicservice 256 * @since arkts {'1.1':'11','1.2':'20'} 257 * @arkts 1.1&1.2 258 */ 259 xOffset: number; 260 261 /** 262 * Vertical scrolling offset. 263 * 264 * @type { number } 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @crossplatform 267 * @atomicservice 268 * @since arkts {'1.1':'11','1.2':'20'} 269 * @arkts 1.1&1.2 270 */ 271 yOffset: number; 272} 273 274/** 275 * Provides parameters for scrolling to the edge of a scrollable container. 276 * 277 * @interface ScrollEdgeOptions 278 * @syscap SystemCapability.ArkUI.ArkUI.Full 279 * @crossplatform 280 * @atomicservice 281 * @since arkts {'1.1':'12','1.2':'20'} 282 * @arkts 1.1&1.2 283 */ 284declare interface ScrollEdgeOptions { 285 /** 286 * Fixed velocity for scrolling to the edge of the container. 287 * If the value specified is less than or equal to 0, the parameter will not take effect. 288 * 289 * @type { ?number } 290 * @default 0vp/s 291 * @syscap SystemCapability.ArkUI.ArkUI.Full 292 * @crossplatform 293 * @atomicservice 294 * @since arkts {'1.1':'12','1.2':'20'} 295 * @arkts 1.1&1.2 296 */ 297 velocity?: number; 298} 299 300/** 301 * Provides parameters for scrolling to a specific index. 302 * 303 * @interface ScrollToIndexOptions 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @atomicservice 307 * @since arkts {'1.1':'12','1.2':'20'} 308 * @arkts 1.1&1.2 309 */ 310declare interface ScrollToIndexOptions { 311 /** 312 * Extra offset for scrolling to a specified index. 313 * 314 * @type { ?LengthMetrics } 315 * @syscap SystemCapability.ArkUI.ArkUI.Full 316 * @crossplatform 317 * @atomicservice 318 * @since arkts {'1.1':'12','1.2':'20'} 319 * @arkts 1.1&1.2 320 */ 321 extraOffset?: LengthMetrics; 322} 323 324/** 325 * Provides parameters for customizing scroll animations. 326 * 327 * @interface ScrollAnimationOptions 328 * @syscap SystemCapability.ArkUI.ArkUI.Full 329 * @crossplatform 330 * @atomicservice 331 * @since arkts {'1.1':'12','1.2':'20'} 332 * @arkts 1.1&1.2 333 */ 334declare interface ScrollAnimationOptions { 335 /** 336 * Scrolling duration. 337 * 338 * <p><strong>NOTE</strong> 339 * <br>A value less than 0 evaluates to the default value. 340 * </p> 341 * 342 * @type { ?number } 343 * @default 1000 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @crossplatform 346 * @atomicservice 347 * @since arkts {'1.1':'12','1.2':'20'} 348 * @arkts 1.1&1.2 349 */ 350 duration?: number; 351 352 /** 353 * Scrolling curve. 354 * 355 * @type { ?(Curve | ICurve) } 356 * @default Curve.Ease 357 * @syscap SystemCapability.ArkUI.ArkUI.Full 358 * @crossplatform 359 * @atomicservice 360 * @since arkts {'1.1':'12','1.2':'20'} 361 * @arkts 1.1&1.2 362 */ 363 curve?: Curve | ICurve; 364 365 /** 366 * Whether to enable overscroll. 367 * 368 * <p><strong>NOTE</strong> 369 * <br> Scrolling can exceed the boundary and initiate a bounce animation when this parameter is set to <em>true</em>, 370 * and the component's <em>edgeEffect</em> attribute is set to EdgeEffect.Spring. 371 * </p> 372 * 373 * @type { ?boolean } 374 * @default false 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @crossplatform 377 * @atomicservice 378 * @since arkts {'1.1':'12','1.2':'20'} 379 * @arkts 1.1&1.2 380 */ 381 canOverScroll?: boolean; 382} 383 384/** 385 * Provides parameters for setting the initial scrolling offset. 386 * 387 * @interface OffsetOptions 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @crossplatform 390 * @atomicservice 391 * @since arkts {'1.1':'12','1.2':'20'} 392 * @arkts 1.1&1.2 393 */ 394declare interface OffsetOptions { 395 /** 396 * Horizontal scrolling offset. 397 * 398 * @type { ?Dimension } 399 * @default 0 400 * @syscap SystemCapability.ArkUI.ArkUI.Full 401 * @crossplatform 402 * @atomicservice 403 * @since arkts {'1.1':'12','1.2':'20'} 404 * @arkts 1.1&1.2 405 */ 406 xOffset?: Dimension; 407 408 /** 409 * Vertical scrolling offset. 410 * 411 * @type { ?Dimension } 412 * @default 0 413 * @syscap SystemCapability.ArkUI.ArkUI.Full 414 * @crossplatform 415 * @atomicservice 416 * @since arkts {'1.1':'12','1.2':'20'} 417 * @arkts 1.1&1.2 418 */ 419 yOffset?: Dimension; 420} 421 422/** 423 * Defines a UIScrollableCommonEvent which is used to set different common event to target component. 424 * 425 * @extends UIScrollableCommonEvent 426 * @interface UIScrollEvent 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @crossplatform 429 * @atomicservice 430 * @since 19 431 */ 432declare interface UIScrollEvent extends UIScrollableCommonEvent { 433 /** 434 * Set or reset the callback which is triggered when the Scroll will scroll. 435 * 436 * @param { ScrollOnWillScrollCallback | undefined } callback - callback function, triggered when 437 * the Scroll will scroll. 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @crossplatform 440 * @atomicservice 441 * @since 19 442 */ 443 setOnWillScroll(callback: ScrollOnWillScrollCallback | undefined): void; 444 445 /** 446 * Set or reset the callback which is triggered when the Scroll did scroll. 447 * 448 * @param { ScrollOnScrollCallback | undefined } callback - callback function, triggered when the Scroll did scroll. 449 * @syscap SystemCapability.ArkUI.ArkUI.Full 450 * @crossplatform 451 * @atomicservice 452 * @since 19 453 */ 454 setOnDidScroll(callback: ScrollOnScrollCallback | undefined): void; 455} 456 457/** 458 * Scroller 459 * 460 * @syscap SystemCapability.ArkUI.ArkUI.Full 461 * @since 7 462 */ 463/** 464 * Scroller 465 * 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @crossplatform 468 * @since 10 469 */ 470/** 471 * Defines a controller for scrollable container components. 472 * 473 * <p><strong>NOTE</strong> 474 * <br>1. The binding of a <em>Scroller</em> instance to a scrollable container component occurs during the component creation phase. 475 * <br>2. <em>Scroller</em> APIs can only be effectively called after the <em>Scroller</em> instance is bound to a scrollable container component. 476 * Otherwise, depending on the API called, it may have no effect or throw an exception. 477 * <br>3. For example, with aboutToAppear, this callback is executed after a new instance of a custom component is 478 * created and before its <em>build()</em> method is called. 479 * Therefore, if a scrollable component is defined within the <em>build</em> method of a custom component, 480 * the internal scrollable component has not yet been created during the <em>aboutToAppear</em> callback 481 * of that custom component, and therefore the <em>Scroller</em> APIs cannot be called effectively. 482 * </p> 483 * 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @crossplatform 486 * @atomicservice 487 * @since arkts {'1.1':'11','1.2':'20'} 488 * @arkts 1.1&1.2 489 */ 490declare class Scroller { 491 /** 492 * constructor. 493 * 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @since 7 496 */ 497 /** 498 * constructor. 499 * 500 * @syscap SystemCapability.ArkUI.ArkUI.Full 501 * @crossplatform 502 * @since 10 503 */ 504 /** 505 * A constructor used to create a <em>Scroller</em> object. 506 * 507 * @syscap SystemCapability.ArkUI.ArkUI.Full 508 * @crossplatform 509 * @atomicservice 510 * @since arkts {'1.1':'11','1.2':'20'} 511 * @arkts 1.1&1.2 512 */ 513 constructor(); 514 515 /** 516 * Called when the setting slides to the specified position. 517 * 518 * @param { object } value 519 * @syscap SystemCapability.ArkUI.ArkUI.Full 520 * @since 7 521 */ 522 /** 523 * Called when the setting slides to the specified position. 524 * 525 * @param { object } value 526 * @syscap SystemCapability.ArkUI.ArkUI.Full 527 * @crossplatform 528 * @since 10 529 */ 530 /** 531 * Called when the setting slides to the specified position. 532 * 533 * @param { object } value 534 * @syscap SystemCapability.ArkUI.ArkUI.Full 535 * @crossplatform 536 * @atomicservice 537 * @since 11 538 */ 539 /** 540 * Scrolls to the specified position. 541 * Anonymous Object Rectification. 542 * 543 * @param { ScrollOptions } options - Parameters for scrolling to the specified position. 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @crossplatform 546 * @atomicservice 547 * @since 18 548 */ 549 scrollTo(options: ScrollOptions); 550 551 /** 552 * Called when the setting slides to the specified position. 553 * 554 * @param { ScrollOptions } options - scroll options 555 * @syscap SystemCapability.ArkUI.ArkUI.Full 556 * @crossplatform 557 * @atomicservice 558 * @since 20 559 * @arkts 1.2 560 */ 561 scrollTo(options: ScrollOptions): void; 562 563 /** 564 * Called when scrolling to the edge of the container. 565 * 566 * @param { Edge } value 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @since 7 569 */ 570 /** 571 * Called when scrolling to the edge of the container. 572 * 573 * @param { Edge } value 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @since 10 577 */ 578 /** 579 * Called when scrolling to the edge of the container. 580 * 581 * @param { Edge } value 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @crossplatform 584 * @atomicservice 585 * @since 11 586 */ 587 /** 588 * Scrolls to the edge of the container, regardless of the scroll axis direction. 589 * 590 * @param { Edge } value - Edge position to scroll to. 591 * <br><em>Atomic service API</em>: This API can be used in atomic services since API version 11. 592 * @param { ScrollEdgeOptions } [options] - Mode of scrolling to the edge position. 593 * <br><em>Atomic service API</em>: This API can be used in atomic services since API version 12. 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @crossplatform 596 * @atomicservice 597 * @since 12 598 */ 599 scrollEdge(value: Edge, options?: ScrollEdgeOptions); 600 601 /** 602 * Called when scrolling to the edge of the container. 603 * 604 * @param { Edge } value - Edge type of the container. 605 * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @crossplatform 608 * @atomicservice 609 * @since 20 610 * @arkts 1.2 611 */ 612 scrollEdge(value: Edge, options?: ScrollEdgeOptions): void; 613 614 615 /** 616 * Performs inertial scrolling based on the initial velocity passed in. 617 * 618 * @param { number } velocity - Initial velocity of inertial scrolling. Unit: vp/s 619 * <br><em>NOTE</em> 620 * <br>If the value specified is 0, it is considered as invalid, and the scrolling for this instance will not take effect. 621 * A positive value indicates scrolling towards the top, while a negative value indicates scrolling towards the bottom. 622 * @throws { BusinessError } 401 - Parameter error. Possible causes: 623 * <br> 1. Mandatory parameters are left unspecified. 624 * <br> 2. Incorrect parameters types. 625 * <br> 3. Parameter verification failed. 626 * @throws { BusinessError } 100004 - Controller not bound to component. 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @atomicservice 630 * @since arkts {'1.1':'12','1.2':'20'} 631 * @arkts 1.1&1.2 632 */ 633 fling(velocity: number): void; 634 635 /** 636 * Called when page turning mode is set. 637 * 638 * @param { object } value 639 * @syscap SystemCapability.ArkUI.ArkUI.Full 640 * @since 9 641 */ 642 /** 643 * Called when page turning mode is set. 644 * 645 * @param { object } value 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @since 10 649 */ 650 /** 651 * Called when page turning mode is set. 652 * 653 * @param { object } value 654 * @syscap SystemCapability.ArkUI.ArkUI.Full 655 * @crossplatform 656 * @atomicservice 657 * @since 11 658 */ 659 /** 660 * Scrolls to the next or previous page. 661 * 662 * @param { ScrollPageOptions } value - Page turning mode. 663 * @syscap SystemCapability.ArkUI.ArkUI.Full 664 * @crossplatform 665 * @atomicservice 666 * @since 14 667 */ 668 scrollPage(value: ScrollPageOptions); 669 670 /** 671 * Called when page turning mode is set. 672 * 673 * @param { ScrollPageOptions } value 674 * @syscap SystemCapability.ArkUI.ArkUI.Full 675 * @crossplatform 676 * @atomicservice 677 * @since 20 678 * @arkts 1.2 679 */ 680 scrollPage(value: ScrollPageOptions): void; 681 682 /** 683 * Scrolls to the next or previous page. 684 * 685 * @param { boolean } next - Whether to turn to the next page. 686 * The value <em>true</em> means to scroll to the next page, and <em>false</em> means to scroll to the previous page. 687 * @param { Axis } direction - Scrolling direction: horizontal or vertical. 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @since 7 690 * @deprecated since 9 691 */ 692 scrollPage(value: { next: boolean; direction?: Axis }); 693 694 /** 695 * Called when viewing the scroll offset. 696 * 697 * @syscap SystemCapability.ArkUI.ArkUI.Full 698 * @since 7 699 */ 700 /** 701 * Called when viewing the scroll offset. 702 * 703 * @syscap SystemCapability.ArkUI.ArkUI.Full 704 * @crossplatform 705 * @since 10 706 */ 707 /** 708 * Obtains the current scrolling offset. 709 * 710 * @returns { OffsetResult } Returns the current scrolling offset. If the scroller not bound to a component, the return value is void. 711 * @syscap SystemCapability.ArkUI.ArkUI.Full 712 * @crossplatform 713 * @atomicservice 714 * @since arkts {'1.1':'11','1.2':'20'} 715 * @arkts 1.1&1.2 716 */ 717 currentOffset() : OffsetResult; 718 719 /** 720 * Called when sliding to the specified index. 721 * 722 * @param { number } value 723 * @param { boolean } smooth 724 * @param { ScrollAlign } align 725 * @syscap SystemCapability.ArkUI.ArkUI.Full 726 * @since 7 727 */ 728 /** 729 * Called when sliding to the specified index. 730 * 731 * @param { number } value - Index to jump to. 732 * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. 733 * @param { ScrollAlign } align - Sets the alignment mode of a specified index. 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @since 10 737 */ 738 /** 739 * Called when sliding to the specified index. 740 * 741 * @param { number } value - Index to jump to. 742 * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. 743 * @param { ScrollAlign } align - Sets the alignment mode of a specified index. 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @atomicservice 747 * @since 11 748 */ 749 /** 750 * Scrolls to a specified index, with support for setting an extra offset for the scroll. 751 * 752 * <p><strong>NOTE</strong> 753 * <br>This API only works for the <em>ArcList</em>, <em>Grid</em>, <em>List</em>, and <em>WaterFlow</em> components. 754 * </p> 755 * 756 * @param { number } value - Index of the item to be scrolled to in the container. 757 * <br><em>NOTE</em> 758 * <br>If the value set is a negative value or greater than the maximum index of the items in the container, 759 * the value is deemed abnormal, and no scrolling will be performed. 760 * @param { boolean } [smooth] - Whether to enable the smooth animation for scrolling to the item with the specified index. 761 * The value <em>true</em> means to enable that the smooth animation, and <em>false</em> means the opposite.<br>Default value: <em>false</em> 762 * @param { ScrollAlign } [align] - How the list item to scroll to is aligned with the container. 763 * <br> Default value when the container is <em>List</em>: <em>ScrollAlign.START</em> 764 * <br> Default value when the container is <em>Grid</em>: <em>ScrollAlign.AUTO</em> 765 * <br> Default value when the container is <em>WaterFlow</em>: <em>ScrollAlign.START</em> 766 * <br><em>NOTE</em> 767 * <br>This parameter is only available for the <em>List</em>, <em>Grid</em>, and <em>WaterFlow</em> components. 768 * @param { ScrollToIndexOptions } [options] - Options for scrolling to a specified index, 769 * for example, an extra offset for the scroll.<br>Default value: <em>0</em>, in vp 770 * @syscap SystemCapability.ArkUI.ArkUI.Full 771 * @crossplatform 772 * @atomicservice 773 * @since 12 774 */ 775 scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions); 776 777 /** 778 * Scroll to the specified index. 779 * 780 * @param { number } value - Index to jump to. 781 * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. 782 * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. 783 * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. 784 * @syscap SystemCapability.ArkUI.ArkUI.Full 785 * @crossplatform 786 * @atomicservice 787 * @since 20 788 * @arkts 1.2 789 */ 790 scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions): void; 791 792 /** 793 * Called when the setting slides by offset. 794 * 795 * @param { Length } dx 796 * @param { Length } dy 797 * @syscap SystemCapability.ArkUI.ArkUI.Full 798 * @since 9 799 */ 800 /** 801 * Called when the setting slides by offset. 802 * 803 * @param { Length } dx 804 * @param { Length } dy 805 * @syscap SystemCapability.ArkUI.ArkUI.Full 806 * @crossplatform 807 * @since 10 808 */ 809 /** 810 * Scrolls by the specified amount. 811 * 812 * <p><strong>NOTE</strong> 813 * <br>This API is available for the <em>ArcList</em>, <em>Scroll</em>, <em>List</em>, <em>Grid</em>, and <em>WaterFlow</em> components. 814 * </p> 815 * 816 * @param { Length } dx - Amount to scroll by in the horizontal direction. The percentage format is not supported. 817 * <br>Value range: (-∞, +∞). 818 * @param { Length } dy - Amount to scroll by in the vertical direction. The percentage format is not supported. 819 * <br>Value range: (-∞, +∞). 820 * @syscap SystemCapability.ArkUI.ArkUI.Full 821 * @crossplatform 822 * @atomicservice 823 * @since 11 824 */ 825 scrollBy(dx: Length, dy: Length); 826 827 /** 828 * Called when the setting slides by offset. 829 * 830 * @param { Length } dx 831 * @param { Length } dy 832 * @syscap SystemCapability.ArkUI.ArkUI.Full 833 * @crossplatform 834 * @atomicservice 835 * @since 20 836 * @arkts 1.2 837 */ 838 scrollBy(dx: Length, dy: Length): void; 839 840 /** 841 * Indicates whether the component scrolls to the end position. 842 * 843 * @returns { boolean } Returns whether the component scrolls to the end position. 844 * @syscap SystemCapability.ArkUI.ArkUI.Full 845 * @crossplatform 846 * @since 10 847 */ 848 /** 849 * Checks whether the component has scrolled to the bottom. 850 * 851 * <p><strong>NOTE</strong> 852 * <br>This API is available for the <em>ArcList</em>, <em>Scroll</em>, <em>List</em>, <em>Grid</em>, and <em>WaterFlow</em> components. 853 * </p> 854 * 855 * @returns { boolean } Returns whether the component scrolls to the end position. 856 * @syscap SystemCapability.ArkUI.ArkUI.Full 857 * @crossplatform 858 * @atomicservice 859 * @since arkts {'1.1':'11','1.2':'20'} 860 * @arkts 1.1&1.2 861 */ 862 isAtEnd(): boolean; 863 864 /** 865 * Get child item size and position. 866 * 867 * @param { number } index - Index of the item. 868 * @returns { RectResult } Returns the size and position. 869 * @throws { BusinessError } 401 - Parameter error. Possible causes: 870 * <br> 1. Mandatory parameters are left unspecified. 871 * <br> 2. Incorrect parameters types. 872 * <br> 3. Parameter verification failed. 873 * @throws { BusinessError } 100004 - Controller not bound to component. 874 * @syscap SystemCapability.ArkUI.ArkUI.Full 875 * @crossplatform 876 * @since 11 877 */ 878 /** 879 * Obtains the size and position of a child component relative to its container. 880 * 881 * <p><strong>NOTE</strong> 882 * <br>- The value of <em>index</em> must be the index of a child component visible in the display area. 883 * Otherwise, the value is considered invalid. 884 * <br>- The value of <em>index</em> must be the index of a child component visible in the display area. Otherwise, 885 * the value is considered invalid. 886 * </p> 887 * 888 * @param { number } index - Index of the target child component. 889 * @returns { RectResult } Returns the size and position. 890 * @throws { BusinessError } 401 - Parameter error. Possible causes: 891 * <br> 1. Mandatory parameters are left unspecified. 892 * <br> 2. Incorrect parameters types. 893 * <br> 3. Parameter verification failed. 894 * @throws { BusinessError } 100004 - Controller not bound to component. 895 * @syscap SystemCapability.ArkUI.ArkUI.Full 896 * @crossplatform 897 * @atomicservice 898 * @since arkts {'1.1':'12','1.2':'20'} 899 * @arkts 1.1&1.2 900 */ 901 getItemRect(index: number): RectResult; 902 903 /** 904 * Obtains the index of a child component based on coordinates. 905 * 906 * <p><strong>NOTE</strong> 907 * <br>The returned index is <em>-1</em> for invalid coordinates. 908 * </p> 909 * 910 * @param { number } x - X-coordinate, in vp. 911 * @param { number } y - Y-coordinate, in vp. 912 * @returns { number } Index of the item. 913 * @throws { BusinessError } 401 - Parameter error. Possible causes: 914 * <br> 1. Mandatory parameters are left unspecified. 915 * <br> 2. Incorrect parameters types. 916 * <br> 3. Parameter verification failed. 917 * @throws { BusinessError } 100004 - The controller not bound to component. 918 * @syscap SystemCapability.ArkUI.ArkUI.Full 919 * @crossplatform 920 * @atomicservice 921 * @since arkts {'1.1':'14','1.2':'20'} 922 * @arkts 1.1&1.2 923 */ 924 getItemIndex(x: number, y: number): number; 925} 926 927/** 928 * Provides parameters for scrolling to a specific position in a scrollable container. 929 * 930 * @interface ScrollOptions 931 * @syscap SystemCapability.ArkUI.ArkUI.Full 932 * @crossplatform 933 * @atomicservice 934 * @since arkts {'1.1':'18','1.2':'20'} 935 * @arkts 1.1&1.2 936 */ 937declare interface ScrollOptions { 938 /** 939 * The X-axis offset. 940 * 941 * @type { number | string } 942 * @syscap SystemCapability.ArkUI.ArkUI.Full 943 * @crossplatform 944 * @since 10 945 */ 946 /** 947 * The X-axis offset. 948 * 949 * @type { number | string } 950 * @syscap SystemCapability.ArkUI.ArkUI.Full 951 * @crossplatform 952 * @atomicservice 953 * @since 11 954 */ 955 /** 956 * Horizontal scrolling offset. 957 * Anonymous Object Rectification. 958 * 959 * <p><strong>NOTE</strong> 960 * <br>This parameter cannot be set in percentage. 961 * <br>If the value is less than 0, the offset will be 0 for non-animated scrolling. 962 * Animated scrolling stops at the starting position by default. 963 * By setting the <em>animation</em> parameter, you can enable a bounce effect when the scrolling goes beyond the boundary. 964 * <br>This parameter takes effect only when the scroll axis is the x-axis. 965 * </p> 966 * 967 * @type { number | string } 968 * @syscap SystemCapability.ArkUI.ArkUI.Full 969 * @crossplatform 970 * @atomicservice 971 * @since arkts {'1.1':'18','1.2':'20'} 972 * @arkts 1.1&1.2 973 */ 974 xOffset: number | string; 975 976 /** 977 * The Y-axis offset. 978 * 979 * @type { number | string } 980 * @syscap SystemCapability.ArkUI.ArkUI.Full 981 * @crossplatform 982 * @since 10 983 */ 984 /** 985 * The Y-axis offset. 986 * 987 * @type { number | string } 988 * @syscap SystemCapability.ArkUI.ArkUI.Full 989 * @crossplatform 990 * @atomicservice 991 * @since 11 992 */ 993 /** 994 * Vertical scrolling offset. 995 * Anonymous Object Rectification. 996 * 997 * <p><strong>NOTE</strong> 998 * <br>This parameter cannot be set in percentage. 999 * <br>If the value is less than 0, the offset will be 0 for non-animated scrolling. 1000 * Animated scrolling stops at the starting position by default. 1001 * By setting the <em>animation</em> parameter, you can enable a bounce effect when the scrolling goes beyond the boundary. 1002 * <br>This parameter takes effect only when the scroll axis is the y-axis. 1003 * </p> 1004 * 1005 * @type { number | string } 1006 * @syscap SystemCapability.ArkUI.ArkUI.Full 1007 * @crossplatform 1008 * @atomicservice 1009 * @since arkts {'1.1':'18','1.2':'20'} 1010 * @arkts 1.1&1.2 1011 */ 1012 yOffset: number | string; 1013 1014 /** 1015 * Descriptive animation. 1016 * 1017 * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters 1018 * and the boolean type enables default spring animation. 1019 * @syscap SystemCapability.ArkUI.ArkUI.Full 1020 * @crossplatform 1021 * @since 10 1022 */ 1023 /** 1024 * Descriptive animation. 1025 * 1026 * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters 1027 * and the boolean type enables default spring animation. 1028 * @syscap SystemCapability.ArkUI.ArkUI.Full 1029 * @crossplatform 1030 * @atomicservice 1031 * @since 11 1032 */ 1033 /** 1034 * Descriptive animation. 1035 * 1036 * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters 1037 * and the boolean type enables default spring animation. 1038 * @syscap SystemCapability.ArkUI.ArkUI.Full 1039 * @crossplatform 1040 * @atomicservice 1041 * @since 12 1042 */ 1043 /** 1044 * Animation configuration 1045 * Anonymous Object Rectification. 1046 * 1047 * <p><strong>NOTE</strong> 1048 * <br>Currently, the <em>List</em>, <em>Scroll</em>, <em>Grid</em>, and <em>WaterFlow</em> support the <em>Boolean</em> type and <em>ICurve</em>. 1049 * </p> 1050 * 1051 * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters 1052 * and the boolean type enables default spring animation. 1053 * @default ScrollAnimationOptions: { duration: 1000, curve: Curve.Ease, canOverScroll: false } 1054 * @syscap SystemCapability.ArkUI.ArkUI.Full 1055 * @crossplatform 1056 * @atomicservice 1057 * @since arkts {'1.1':'18','1.2':'20'} 1058 * @arkts 1.1&1.2 1059 */ 1060 animation?: ScrollAnimationOptions | boolean; 1061 1062 /** 1063 * Set whether the scroll target position can over the boundary. 1064 * 1065 * @type { ?boolean } whether the scroll target position can over the boundary. 1066 * @default false 1067 * @syscap SystemCapability.ArkUI.ArkUI.Full 1068 * @crossplatform 1069 * @atomicservice 1070 * @since 20 1071 */ 1072 canOverScroll?: boolean; 1073} 1074 1075/** 1076 * Provides parameters for page scrolling behavior. 1077 * 1078 * @interface ScrollPageOptions 1079 * @syscap SystemCapability.ArkUI.ArkUI.Full 1080 * @atomicservice 1081 * @since arkts {'1.1':'14','1.2':'20'} 1082 * @arkts 1.1&1.2 1083 */ 1084declare interface ScrollPageOptions { 1085 /** 1086 * Whether to turn to the next page.The value true means to scroll to the next page, 1087 * and false means to scroll to the previous page. 1088 * 1089 * @type { boolean } 1090 * @syscap SystemCapability.ArkUI.ArkUI.Full 1091 * @crossplatform 1092 * @atomicservice 1093 * @since arkts {'1.1':'14','1.2':'20'} 1094 * @arkts 1.1&1.2 1095 */ 1096 next: boolean; 1097 1098 /** 1099 * Whether to enable the page-turning animation.The value true means to enable the page-turning animation, 1100 * and false means the opposite. 1101 * 1102 * @type { ?boolean } 1103 * @default false 1104 * @syscap SystemCapability.ArkUI.ArkUI.Full 1105 * @crossplatform 1106 * @atomicservice 1107 * @since arkts {'1.1':'14','1.2':'20'} 1108 * @arkts 1.1&1.2 1109 */ 1110 animation?: boolean; 1111} 1112 1113/** 1114 * Define scroll snap options 1115 * 1116 * @interface ScrollSnapOptions 1117 * @syscap SystemCapability.ArkUI.ArkUI.Full 1118 * @since 10 1119 */ 1120/** 1121 * Defines a scroll snapping mode object. 1122 * 1123 * @interface ScrollSnapOptions 1124 * @syscap SystemCapability.ArkUI.ArkUI.Full 1125 * @atomicservice 1126 * @since arkts {'1.1':'11','1.2':'20'} 1127 * @arkts 1.1&1.2 1128 */ 1129declare interface ScrollSnapOptions { 1130 /** 1131 * Set scroll snap alignment. 1132 * 1133 * @type { ScrollSnapAlign } 1134 * @syscap SystemCapability.ArkUI.ArkUI.Full 1135 * @since 10 1136 */ 1137 /** 1138 * Alignment mode for the scroll snap position. 1139 * 1140 * @type { ScrollSnapAlign } 1141 * @default ScrollSnapAlign.NONE 1142 * @syscap SystemCapability.ArkUI.ArkUI.Full 1143 * @atomicservice 1144 * @since arkts {'1.1':'11','1.2':'20'} 1145 * @arkts 1.1&1.2 1146 */ 1147 snapAlign: ScrollSnapAlign; 1148 1149 /** 1150 * Set snap positions. When the type of snapPositions is Dimension, Scroll content is paginated by an integer 1151 * multiple of snapPositions. When the type of snapPositions is Array<number>, Scroll content is paginated based 1152 * on the array of snapPositions. 1153 * 1154 * @type { ?(Dimension | Array<Dimension>) } 1155 * @default 100% 1156 * @syscap SystemCapability.ArkUI.ArkUI.Full 1157 * @since 10 1158 */ 1159 /** 1160 * Pagination points for scroll snapping. 1161 * 1162 * <p><strong>NOTE</strong> 1163 * <br>1. If the value is of the Dimension type, it indicates the size of each page, and the system will paginate based on this size. 1164 * <br>2. If the value is of the Array\<Dimension\> type, each <em>Dimension</em> represents a pagination point, 1165 * and the system will paginate accordingly. Each <em>Dimension</em> value must be within the [0, scrollable distance] range. 1166 * <br>3. If this parameter is not set or <em>Dimension</em> is set to a value less than or equal to 0, the value is regarded as an invalid value. 1167 * In this case, there is no scroll snapping. When the value is of the Array\<Dimension\> type, the items in the array must be monotonically increasing. 1168 * <br>4. When the value is a percentage, the actual size is the product of the viewport of the <em>Scroll</em> component and the percentage value. 1169 * </p> 1170 * 1171 * @type { ?(Dimension | Array<Dimension>) } 1172 * @default 100% 1173 * @syscap SystemCapability.ArkUI.ArkUI.Full 1174 * @atomicservice 1175 * @since arkts {'1.1':'11','1.2':'20'} 1176 * @arkts 1.1&1.2 1177 */ 1178 snapPagination?: Dimension | Array<Dimension>; 1179 1180 /** 1181 * Set whether the beginning of the Scroll content counts an a snap. 1182 * 1183 * @type { ?boolean } 1184 * @default true 1185 * @syscap SystemCapability.ArkUI.ArkUI.Full 1186 * @since 10 1187 */ 1188 /** 1189 * Whether to enable the snap to start feature. When scroll snapping is defined for the <em>Scroll</em> component, 1190 * setting this parameter to <em>false</em> enables the component to scroll between the start and the first page. 1191 * 1192 * <p><strong>NOTE</strong> 1193 * <br>2. This attribute takes effect only when <em>snapPagination</em> is set to a value of the <em>Array\<Dimension\></em> type; 1194 * it does not work with values of the <em>Dimension</em> type. 1195 * </p> 1196 * 1197 * @type { ?boolean } 1198 * @default true 1199 * @syscap SystemCapability.ArkUI.ArkUI.Full 1200 * @atomicservice 1201 * @since arkts {'1.1':'11','1.2':'20'} 1202 * @arkts 1.1&1.2 1203 */ 1204 enableSnapToStart?: boolean; 1205 1206 /** 1207 * Set whether the end of the Scroll content counts an a snap. 1208 * 1209 * @type { ?boolean } 1210 * @default true 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @since 10 1213 */ 1214 /** 1215 * Whether to enable the snap to end feature. When scroll snapping is defined for the <em>Scroll</em> component, 1216 * setting this parameter to <em>false</em> enables the component to scroll between the end and the last page. 1217 * 1218 * <p><strong>NOTE</strong> 1219 * <br>2. This attribute takes effect only when <em>snapPagination</em> is set to a value of the <em>Array\<Dimension\></em> type; 1220 * it does not work with values of the <em>Dimension</em> type. 1221 * </p> 1222 * 1223 * @type { ?boolean } 1224 * @default true 1225 * @syscap SystemCapability.ArkUI.ArkUI.Full 1226 * @atomicservice 1227 * @since arkts {'1.1':'11','1.2':'20'} 1228 * @arkts 1.1&1.2 1229 */ 1230 enableSnapToEnd?: boolean; 1231} 1232 1233/** 1234 * Provides interfaces for scrollable containers. 1235 * 1236 * @interface ScrollInterface 1237 * @syscap SystemCapability.ArkUI.ArkUI.Full 1238 * @since 7 1239 */ 1240/** 1241 * Provides interfaces for scrollable containers. 1242 * 1243 * @interface ScrollInterface 1244 * @syscap SystemCapability.ArkUI.ArkUI.Full 1245 * @crossplatform 1246 * @since 10 1247 */ 1248/** 1249 * Provides interfaces for scrollable containers. 1250 * 1251 * @interface ScrollInterface 1252 * @syscap SystemCapability.ArkUI.ArkUI.Full 1253 * @crossplatform 1254 * @atomicservice 1255 * @since arkts {'1.1':'11','1.2':'20'} 1256 * @arkts 1.1&1.2 1257 */ 1258interface ScrollInterface { 1259 /** 1260 * Called when a scrollable container is set. 1261 * 1262 * @param { Scroller } scroller 1263 * @returns { ScrollAttribute } 1264 * @syscap SystemCapability.ArkUI.ArkUI.Full 1265 * @since 7 1266 */ 1267 /** 1268 * Called when a scrollable container is set. 1269 * 1270 * @param { Scroller } scroller 1271 * @returns { ScrollAttribute } 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @since 10 1275 */ 1276 /** 1277 * Called when a scrollable container is set. 1278 * 1279 * @param { Scroller } scroller 1280 * @returns { ScrollAttribute } 1281 * @syscap SystemCapability.ArkUI.ArkUI.Full 1282 * @crossplatform 1283 * @atomicservice 1284 * @since arkts {'1.1':'11','1.2':'20'} 1285 * @arkts 1.1&1.2 1286 */ 1287 (scroller?: Scroller): ScrollAttribute; 1288} 1289 1290/** 1291 * Represents the callback triggered when scrolling reaches an edge. 1292 * 1293 * @typedef { function } OnScrollEdgeCallback 1294 * @param { Edge } side - Edge position to scroll to. 1295 * @syscap SystemCapability.ArkUI.ArkUI.Full 1296 * @crossplatform 1297 * @atomicservice 1298 * @since arkts {'1.1':'18','1.2':'20'} 1299 * @arkts 1.1&1.2 1300 */ 1301declare type OnScrollEdgeCallback = (side: Edge) => void; 1302 1303/** 1304 * The data returned by the event handler when onScrollFrameBegin. 1305 * 1306 * @interface OnScrollFrameBeginHandlerResult 1307 * @syscap SystemCapability.ArkUI.ArkUI.Full 1308 * @crossplatform 1309 * @atomicservice 1310 * @since arkts {'1.1':'18','1.2':'20'} 1311 * @arkts 1.1&1.2 1312 */ 1313interface OnScrollFrameBeginHandlerResult { 1314 /** 1315 * Actual sliding amount, unit vp. 1316 * 1317 * @type { number } 1318 * @syscap SystemCapability.ArkUI.ArkUI.Full 1319 * @since 9 1320 */ 1321 /** 1322 * Actual sliding amount, unit vp. 1323 * 1324 * @type { number } 1325 * @syscap SystemCapability.ArkUI.ArkUI.Full 1326 * @crossplatform 1327 * @since 10 1328 */ 1329 /** 1330 * Actual sliding amount, unit vp. 1331 * 1332 * @type { number } 1333 * @syscap SystemCapability.ArkUI.ArkUI.Full 1334 * @crossplatform 1335 * @atomicservice 1336 * @since 11 1337 */ 1338 /** 1339 * Actual scroll offset. 1340 * Anonymous Object Rectification. 1341 * 1342 * @type { number } 1343 * @syscap SystemCapability.ArkUI.ArkUI.Full 1344 * @crossplatform 1345 * @atomicservice 1346 * @since arkts {'1.1':'18','1.2':'20'} 1347 * @arkts 1.1&1.2 1348 */ 1349 offsetRemain: number; 1350} 1351 1352/** 1353 * Represents the callback triggered before each frame scrolling starts. 1354 * 1355 * @typedef { function } OnScrollFrameBeginCallback 1356 * @param { number } offset - Amount to scroll by, in vp. 1357 * @param { ScrollState } state - Current scroll state. 1358 * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler 1359 * @syscap SystemCapability.ArkUI.ArkUI.Full 1360 * @crossplatform 1361 * @atomicservice 1362 * @since arkts {'1.1':'18','1.2':'20'} 1363 * @arkts 1.1&1.2 1364 */ 1365declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; 1366 1367/** 1368 * Defines the scroll attribute functions. 1369 * 1370 * @extends CommonMethod<ScrollAttribute> 1371 * @syscap SystemCapability.ArkUI.ArkUI.Full 1372 * @since 7 1373 */ 1374/** 1375 * Defines the scroll attribute functions. 1376 * 1377 * @extends CommonMethod<ScrollAttribute> 1378 * @syscap SystemCapability.ArkUI.ArkUI.Full 1379 * @crossplatform 1380 * @since 10 1381 */ 1382/** 1383 * Defines the scroll attribute functions. 1384 * 1385 * @extends ScrollableCommonMethod<ScrollAttribute> 1386 * @syscap SystemCapability.ArkUI.ArkUI.Full 1387 * @crossplatform 1388 * @atomicservice 1389 * @since arkts {'1.1':'11','1.2':'20'} 1390 * @arkts 1.1&1.2 1391 */ 1392declare class ScrollAttribute extends ScrollableCommonMethod<ScrollAttribute> { 1393 /** 1394 * Called when the scroll method is slid. 1395 * 1396 * @param { ScrollDirection } value 1397 * @returns { ScrollAttribute } 1398 * @syscap SystemCapability.ArkUI.ArkUI.Full 1399 * @since 7 1400 */ 1401 /** 1402 * Called when the scroll method is slid. 1403 * 1404 * @param { ScrollDirection } value 1405 * @returns { ScrollAttribute } 1406 * @syscap SystemCapability.ArkUI.ArkUI.Full 1407 * @crossplatform 1408 * @since 10 1409 */ 1410 /** 1411 * Sets the scrolling direction. 1412 * 1413 * @param { ScrollDirection } value - Scrolling direction.<br>Default value: <em>ScrollDirection.Vertical</em> 1414 * @returns { ScrollAttribute } 1415 * @syscap SystemCapability.ArkUI.ArkUI.Full 1416 * @crossplatform 1417 * @atomicservice 1418 * @since arkts {'1.1':'11','1.2':'20'} 1419 * @arkts 1.1&1.2 1420 */ 1421 scrollable(value: ScrollDirection): ScrollAttribute; 1422 1423 /** 1424 * Set maximum zoom scale. 1425 * 1426 * @param { number } scale - Set maximum zoom scale. 1427 * <br>Default value: 1. 1428 * <br>Value range: (0, +∞). If this parameter is set to a value less than or equal to 0, the default value is used. 1429 * @returns { ScrollAttribute } 1430 * @syscap SystemCapability.ArkUI.ArkUI.Full 1431 * @crossplatform 1432 * @atomicservice 1433 * @since 20 1434 */ 1435 maxZoomScale(scale: number): ScrollAttribute; 1436 1437 /** 1438 * Set minimum zoom scale. 1439 * 1440 * @param { number } scale - Set minimum zoom scale. 1441 * <br>Default value: 1. 1442 * <br>Value range: (0, maxZoomScale]. 1443 * @returns { ScrollAttribute } 1444 * @syscap SystemCapability.ArkUI.ArkUI.Full 1445 * @crossplatform 1446 * @atomicservice 1447 * @since 20 1448 */ 1449 minZoomScale(scale: number): ScrollAttribute; 1450 1451 /** 1452 * Current zoom scale. 1453 * This parameter supports !! for two-way binding of variables. 1454 * 1455 * @param { number } scale - Current zoom scale. 1456 * <br>Default value: 1. 1457 * <br>Value range: (0, +∞). 1458 * @returns { ScrollAttribute } 1459 * @syscap SystemCapability.ArkUI.ArkUI.Full 1460 * @crossplatform 1461 * @atomicservice 1462 * @since 20 1463 */ 1464 zoomScale(scale: number): ScrollAttribute; 1465 1466 /** 1467 * Enable bounces zoom scale. 1468 * This parameter supports !! for two-way binding of variables. 1469 * 1470 * @param { boolean } enable - Enable bounces zoom scale. 1471 * <br>Default value: true. 1472 * @returns { ScrollAttribute } 1473 * @syscap SystemCapability.ArkUI.ArkUI.Full 1474 * @crossplatform 1475 * @atomicservice 1476 * @since 20 1477 */ 1478 enableBouncesZoom(enable: boolean): ScrollAttribute; 1479 1480 /** 1481 * Called when the setting slides to the specified position. 1482 * 1483 * @param { function } event 1484 * @returns { ScrollAttribute } 1485 * @syscap SystemCapability.ArkUI.ArkUI.Full 1486 * @since 7 1487 */ 1488 /** 1489 * Called when the setting slides to the specified position. 1490 * 1491 * @param { function } event 1492 * @returns { ScrollAttribute } 1493 * @syscap SystemCapability.ArkUI.ArkUI.Full 1494 * @crossplatform 1495 * @since 10 1496 */ 1497 /** 1498 * Triggered to return the horizontal and vertical offsets, in vp, during scrolling when the specified scroll event occurs. 1499 * 1500 * <p><strong>NOTE</strong> 1501 * <br>1. This event is triggered when scrolling is started by the <em>Scroll</em> component or other input settings, 1502 * such as keyboard and mouse operations. 1503 * <br>2. This event is triggered when the controller API is called. 1504 * <br>3. This event supports the out-of-bounds bounce effect. 1505 * </p> 1506 * 1507 * @param { function } event 1508 * @returns { ScrollAttribute } 1509 * @syscap SystemCapability.ArkUI.ArkUI.Full 1510 * @crossplatform 1511 * @atomicservice 1512 * @since 11 1513 * @deprecated since 12 1514 * @useinstead scroll/Scroll#onWillScroll 1515 * 1516 */ 1517 onScroll(event: (xOffset: number, yOffset: number) => void): ScrollAttribute; 1518 1519 /** 1520 * Triggered before scrolling. 1521 * 1522 * <p><strong>NOTE</strong> 1523 * <br>1. This event is triggered when scrolling is started by the <em>Scroll</em> component or other input settings, 1524 * such as keyboard and mouse operations. 1525 * <br>2. This event is triggered when the controller API is called. 1526 * <br>3. This event supports the out-of-bounds bounce effect. 1527 * </p> 1528 * 1529 * @param { ScrollOnWillScrollCallback } handler - Callback triggered before scrolling. 1530 * @returns { ScrollAttribute } 1531 * @syscap SystemCapability.ArkUI.ArkUI.Full 1532 * @crossplatform 1533 * @atomicservice 1534 * @since arkts {'1.1':'12','1.2':'20'} 1535 * @arkts 1.1&1.2 1536 */ 1537 onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute; 1538 1539 /** 1540 * Triggered when the Scroll component scrolls. 1541 * 1542 * <p><strong>NOTE</strong> 1543 * <br>1. This event is triggered when scrolling is started by the <em>Scroll</em> component or other input settings, 1544 * such as keyboard and mouse operations. 1545 * <br>2. This event is triggered when the controller API is called. 1546 * <br>3. This event supports the out-of-bounds bounce effect. 1547 * </p> 1548 * 1549 * @param { ScrollOnScrollCallback } handler - Callback triggered when the <em>Scroll</em> component scrolls. 1550 * @returns { ScrollAttribute } 1551 * @syscap SystemCapability.ArkUI.ArkUI.Full 1552 * @crossplatform 1553 * @atomicservice 1554 * @since arkts {'1.1':'12','1.2':'20'} 1555 * @arkts 1.1&1.2 1556 */ 1557 onDidScroll(handler: ScrollOnScrollCallback): ScrollAttribute; 1558 1559 /** 1560 * Called when scrolling to the edge of the container. 1561 * 1562 * @param { function } event 1563 * @returns { ScrollAttribute } 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @since 7 1566 */ 1567 /** 1568 * Called when scrolling to the edge of the container. 1569 * 1570 * @param { function } event 1571 * @returns { ScrollAttribute } 1572 * @syscap SystemCapability.ArkUI.ArkUI.Full 1573 * @crossplatform 1574 * @since 10 1575 */ 1576 /** 1577 * Called when scrolling to the edge of the container. 1578 * 1579 * @param { function } event 1580 * @returns { ScrollAttribute } 1581 * @syscap SystemCapability.ArkUI.ArkUI.Full 1582 * @crossplatform 1583 * @atomicservice 1584 * @since 11 1585 */ 1586 /** 1587 * Triggered when scrolling reaches the edge. 1588 * Anonymous Object Rectification. 1589 * 1590 * <p><strong>NOTE</strong> 1591 * <br>1. This event is triggered when scrolling reaches the edge after being started by the <em>Scroll</em> component or other input settings, 1592 * such as keyboard and mouse operations. 1593 * <br>2. This event is triggered when the controller API is called. 1594 * <br>3. This event supports the out-of-bounds bounce effect. 1595 * </p> 1596 * 1597 * @param { OnScrollEdgeCallback } event - Edge position to scroll to. 1598 * @returns { ScrollAttribute } 1599 * @syscap SystemCapability.ArkUI.ArkUI.Full 1600 * @crossplatform 1601 * @atomicservice 1602 * @since arkts {'1.1':'18','1.2':'20'} 1603 * @arkts 1.1&1.2 1604 */ 1605 onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; 1606 1607 /** 1608 * Called when scrolling start. 1609 * 1610 * @param { function } event 1611 * @returns { ScrollAttribute } 1612 * @syscap SystemCapability.ArkUI.ArkUI.Full 1613 * @since 9 1614 */ 1615 /** 1616 * Called when scrolling start. 1617 * 1618 * @param { function } event 1619 * @returns { ScrollAttribute } 1620 * @syscap SystemCapability.ArkUI.ArkUI.Full 1621 * @crossplatform 1622 * @since 10 1623 */ 1624 /** 1625 * Called when scrolling start. 1626 * 1627 * @param { function } event 1628 * @returns { ScrollAttribute } 1629 * @syscap SystemCapability.ArkUI.ArkUI.Full 1630 * @crossplatform 1631 * @atomicservice 1632 * @since 11 1633 */ 1634 /** 1635 * Called when scrolling start. 1636 * Anonymous Object Rectification. 1637 * 1638 * <p><strong>NOTE</strong> 1639 * <br>1. This event is triggered when scrolling is started by the <em>Scroll</em> component or other input settings, such as keyboard and mouse operations. 1640 * <br>2. This event is triggered when the controller API is called, accompanied by a transition animation. 1641 * </p> 1642 * 1643 * @param { VoidCallback } event - Callback triggered when scrolling starts. 1644 * @returns { ScrollAttribute } 1645 * @syscap SystemCapability.ArkUI.ArkUI.Full 1646 * @crossplatform 1647 * @atomicservice 1648 * @since arkts {'1.1':'18','1.2':'20'} 1649 * @arkts 1.1&1.2 1650 */ 1651 onScrollStart(event: VoidCallback): ScrollAttribute; 1652 1653 /** 1654 * Triggered when scrolling stops. 1655 * 1656 * <p><strong>NOTE</strong> 1657 * <br>1. This event is triggered when scrolling is stopped by the <em>Scroll</em> component or other input settings, such as keyboard and mouse operations. 1658 * <br>2. This event is triggered when the controller API is called, accompanied by a transition animation. 1659 * </p> 1660 * 1661 * @param { function } event 1662 * @returns { ScrollAttribute } 1663 * @syscap SystemCapability.ArkUI.ArkUI.Full 1664 * @since 7 1665 * @deprecated since 9 1666 * @useinstead scroll/Scroll#onScrollStop 1667 */ 1668 onScrollEnd(event: () => void): ScrollAttribute; 1669 1670 /** 1671 * Called when scrolling has stopped. 1672 * 1673 * @param { function } event 1674 * @returns { ScrollAttribute } 1675 * @syscap SystemCapability.ArkUI.ArkUI.Full 1676 * @since 9 1677 */ 1678 /** 1679 * Called when scrolling has stopped. 1680 * 1681 * @param { function } event 1682 * @returns { ScrollAttribute } 1683 * @syscap SystemCapability.ArkUI.ArkUI.Full 1684 * @crossplatform 1685 * @since 10 1686 */ 1687 /** 1688 * Called when scrolling has stopped. 1689 * 1690 * @param { function } event 1691 * @returns { ScrollAttribute } 1692 * @syscap SystemCapability.ArkUI.ArkUI.Full 1693 * @crossplatform 1694 * @atomicservice 1695 * @since 11 1696 */ 1697 /** 1698 * Called when scrolling has stopped. 1699 * Anonymous Object Rectification. 1700 * 1701 * <p><strong>NOTE</strong> 1702 * <br>1. This event is triggered when scrolling is stopped by the <em>Scroll</em> component or other input settings, such as keyboard and mouse operations. 1703 * <br>2. This event is triggered when the controller API is called, accompanied by a transition animation. 1704 * </p> 1705 * 1706 * @param { VoidCallback } event - Callback triggered when scrolling stops. 1707 * @returns { ScrollAttribute } 1708 * @syscap SystemCapability.ArkUI.ArkUI.Full 1709 * @crossplatform 1710 * @atomicservice 1711 * @since arkts {'1.1':'18','1.2':'20'} 1712 * @arkts 1.1&1.2 1713 */ 1714 onScrollStop(event: VoidCallback): ScrollAttribute; 1715 1716 /** 1717 * Called when the Scroll did zoom. 1718 * 1719 * @param { ScrollOnDidZoomCallback } event - callback of zoom. 1720 * @returns { ScrollAttribute } 1721 * @syscap SystemCapability.ArkUI.ArkUI.Full 1722 * @crossplatform 1723 * @atomicservice 1724 * @since 20 1725 */ 1726 onDidZoom(event: ScrollOnDidZoomCallback): ScrollAttribute; 1727 1728 /** 1729 * Called when zooming has stated. 1730 * 1731 * @param { VoidCallback } event - Zoom start callback. 1732 * @returns { ScrollAttribute } 1733 * @syscap SystemCapability.ArkUI.ArkUI.Full 1734 * @crossplatform 1735 * @atomicservice 1736 * @since 20 1737 */ 1738 onZoomStart(event: VoidCallback): ScrollAttribute; 1739 1740 /** 1741 * Called when zooming has stopped. 1742 * 1743 * @param { VoidCallback } event - Zoom stop callback. 1744 * @returns { ScrollAttribute } 1745 * @syscap SystemCapability.ArkUI.ArkUI.Full 1746 * @crossplatform 1747 * @atomicservice 1748 * @since 20 1749 */ 1750 onZoomStop(event: VoidCallback): ScrollAttribute; 1751 1752 /** 1753 * Called when the status of the scroll bar is set. 1754 * 1755 * @param { BarState } barState 1756 * @returns { ScrollAttribute } 1757 * @syscap SystemCapability.ArkUI.ArkUI.Full 1758 * @since 7 1759 */ 1760 /** 1761 * Called when the status of the scroll bar is set. 1762 * 1763 * @param { BarState } barState 1764 * @returns { ScrollAttribute } 1765 * @syscap SystemCapability.ArkUI.ArkUI.Full 1766 * @crossplatform 1767 * @since 10 1768 */ 1769 /** 1770 * Sets the scrollbar state. 1771 * 1772 * @param { BarState } barState - Scrollbar state.<br>Default value: <em>BarState.Auto</em> 1773 * @returns { ScrollAttribute } 1774 * @syscap SystemCapability.ArkUI.ArkUI.Full 1775 * @crossplatform 1776 * @atomicservice 1777 * @since arkts {'1.1':'11','1.2':'20'} 1778 * @arkts 1.1&1.2 1779 */ 1780 scrollBar(barState: BarState): ScrollAttribute; 1781 1782 /** 1783 * Called when the color of the scroll bar is set. 1784 * 1785 * @param { Color | number | string } color 1786 * @returns { ScrollAttribute } 1787 * @syscap SystemCapability.ArkUI.ArkUI.Full 1788 * @since 7 1789 */ 1790 /** 1791 * Called when the color of the scroll bar is set. 1792 * 1793 * @param { Color | number | string } color 1794 * @returns { ScrollAttribute } 1795 * @syscap SystemCapability.ArkUI.ArkUI.Full 1796 * @crossplatform 1797 * @since 10 1798 */ 1799 /** 1800 * Sets the scrollbar color. 1801 * 1802 * @param { Color | number | string } color - Scrollbar color.<br>Default value: '#66182431' 1803 * @returns { ScrollAttribute } 1804 * @syscap SystemCapability.ArkUI.ArkUI.Full 1805 * @crossplatform 1806 * @atomicservice 1807 * @since arkts {'1.1':'11','1.2':'20'} 1808 * @arkts 1.1&1.2 1809 */ 1810 scrollBarColor(color: Color | number | string): ScrollAttribute; 1811 1812 /** 1813 * Called when the width of the scroll bar is set. 1814 * 1815 * @param { number | string } value 1816 * @returns { ScrollAttribute } 1817 * @syscap SystemCapability.ArkUI.ArkUI.Full 1818 * @since 7 1819 */ 1820 /** 1821 * Called when the width of the scroll bar is set. 1822 * 1823 * @param { number | string } value 1824 * @returns { ScrollAttribute } 1825 * @syscap SystemCapability.ArkUI.ArkUI.Full 1826 * @crossplatform 1827 * @since 10 1828 */ 1829 /** 1830 * Sets the scrollbar width. 1831 * 1832 * @param { number | string } value - Scrollbar width.<br>Default value: <em>4</em> <br>Unit: vp 1833 * @returns { ScrollAttribute } 1834 * @syscap SystemCapability.ArkUI.ArkUI.Full 1835 * @crossplatform 1836 * @atomicservice 1837 * @since arkts {'1.1':'11','1.2':'20'} 1838 * @arkts 1.1&1.2 1839 */ 1840 scrollBarWidth(value: number | string): ScrollAttribute; 1841 1842 /** 1843 * Called when the sliding effect is set. 1844 * 1845 * @param { EdgeEffect } edgeEffect 1846 * @returns { ScrollAttribute } 1847 * @syscap SystemCapability.ArkUI.ArkUI.Full 1848 * @since 7 1849 */ 1850 /** 1851 * Called when the sliding effect is set. 1852 * 1853 * @param { EdgeEffect } edgeEffect 1854 * @returns { ScrollAttribute } 1855 * @syscap SystemCapability.ArkUI.ArkUI.Full 1856 * @crossplatform 1857 * @since 10 1858 */ 1859 /** 1860 * Sets the effect used when the scroll boundary is reached. 1861 * 1862 * @param { EdgeEffect } edgeEffect - Effect used when the scroll boundary is reached. The spring and shadow effects are supported. 1863 * <br>Default value: <em>EdgeEffect.None</em> 1864 * @param { EdgeEffectOptions } options - Whether to enable the scroll effect when the component content is smaller than the component itself. 1865 * The value <em>{ alwaysEnabled: true }</em> means to enable the scroll effect, and <em>{ alwaysEnabled: false }</em> means the opposite. 1866 * <br>Default value: <em>{ alwaysEnabled: true }</em> 1867 * @returns { ScrollAttribute } 1868 * @syscap SystemCapability.ArkUI.ArkUI.Full 1869 * @crossplatform 1870 * @atomicservice 1871 * @since arkts {'1.1':'11','1.2':'20'} 1872 * @arkts 1.1&1.2 1873 */ 1874 edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute; 1875 1876 /** 1877 * Called when scrolling begin each frame. 1878 * 1879 * @param { function } event 1880 * @returns { ScrollAttribute } 1881 * @syscap SystemCapability.ArkUI.ArkUI.Full 1882 * @since 9 1883 */ 1884 /** 1885 * Called when scrolling begin each frame. 1886 * 1887 * @param { function } event 1888 * @returns { ScrollAttribute } 1889 * @syscap SystemCapability.ArkUI.ArkUI.Full 1890 * @crossplatform 1891 * @since 10 1892 */ 1893 /** 1894 * Called when scrolling begin each frame. 1895 * 1896 * @param { function } event 1897 * @returns { ScrollAttribute } 1898 * @syscap SystemCapability.ArkUI.ArkUI.Full 1899 * @crossplatform 1900 * @atomicservice 1901 * @since 11 1902 */ 1903 /** 1904 * Triggered when each frame scrolling starts. 1905 * Anonymous Object Rectification. 1906 * 1907 * @param { OnScrollFrameBeginCallback } event - Callback triggered when each frame scrolling starts. 1908 * @returns { ScrollAttribute } 1909 * @syscap SystemCapability.ArkUI.ArkUI.Full 1910 * @crossplatform 1911 * @atomicservice 1912 * @since arkts {'1.1':'18','1.2':'20'} 1913 * @arkts 1.1&1.2 1914 */ 1915 onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; 1916 1917 /** 1918 * Called to setting the nested scroll options. 1919 * 1920 * @param { NestedScrollOptions } value - options for nested scrolling. 1921 * @returns { ScrollAttribute } the attribute of the scroll. 1922 * @syscap SystemCapability.ArkUI.ArkUI.Full 1923 * @since 10 1924 */ 1925 /** 1926 * Sets the nested scrolling options. You can set the nested scrolling mode in the forward and backward directions 1927 * to implement scrolling linkage with the parent component. 1928 * 1929 * @param { NestedScrollOptions } value - Nested scrolling options. 1930 * <br>Default value: <em>{ scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY }</em> 1931 * @returns { ScrollAttribute } the attribute of the scroll. 1932 * @syscap SystemCapability.ArkUI.ArkUI.Full 1933 * @crossplatform 1934 * @atomicservice 1935 * @since arkts {'1.1':'11','1.2':'20'} 1936 * @arkts 1.1&1.2 1937 */ 1938 nestedScroll(value: NestedScrollOptions): ScrollAttribute; 1939 1940 /** 1941 * Called when setting whether to enable scroll by gesture or mouse. 1942 * 1943 * @param { boolean } value 1944 * @returns { ScrollAttribute } The attribute of the scroll 1945 * @syscap SystemCapability.ArkUI.ArkUI.Full 1946 * @crossplatform 1947 * @since 10 1948 */ 1949 /** 1950 * Sets whether to support scroll gestures. When this attribute is set to <em>false</em>, 1951 * scrolling by finger or mouse is not supported, but the scroll controller API is not affected. 1952 * 1953 * @param { boolean } value - Whether to support scroll gestures.<br>Default value: <em>true</em> 1954 * @returns { ScrollAttribute } The attribute of the scroll 1955 * @syscap SystemCapability.ArkUI.ArkUI.Full 1956 * @crossplatform 1957 * @atomicservice 1958 * @since arkts {'1.1':'11','1.2':'20'} 1959 * @arkts 1.1&1.2 1960 */ 1961 enableScrollInteraction(value: boolean): ScrollAttribute; 1962 1963 /** 1964 * Called to setting the friction. 1965 * 1966 * @param { number | Resource } value - options for scrolling friction. 1967 * @returns { ScrollAttribute } the attribute of the scroll. 1968 * @syscap SystemCapability.ArkUI.ArkUI.Full 1969 * @crossplatform 1970 * @since 10 1971 */ 1972 /** 1973 * Sets the friction coefficient. It applies only to gestures in the scrolling area, and 1974 * it affects only indirectly the scroll chaining during the inertial scrolling process. 1975 * If this attribute is set to a value less than or equal to 0, the default value is used. 1976 * 1977 * @param { number | Resource } value - Friction coefficient. 1978 * <br>Default value: <em>0.9</em> for wearable devices and <em>0.6</em> for non-wearable devices 1979 * <br>Since API version 11, the default value for non-wearable devices is <em>0.7</em>. 1980 * <br>Since API version 12, the default value for non-wearable devices is <em>0.75</em>. 1981 * @returns { ScrollAttribute } the attribute of the scroll. 1982 * @syscap SystemCapability.ArkUI.ArkUI.Full 1983 * @crossplatform 1984 * @atomicservice 1985 * @since arkts {'1.1':'11','1.2':'20'} 1986 * @arkts 1.1&1.2 1987 */ 1988 friction(value: number | Resource): ScrollAttribute; 1989 1990 /** 1991 * Called to setting the scroll snap options. 1992 * 1993 * @param { ScrollSnapOptions } value - options for scroll snap. 1994 * @returns { ScrollAttribute } the attribute of the scroll. 1995 * @syscap SystemCapability.ArkUI.ArkUI.Full 1996 * @since 10 1997 */ 1998 /** 1999 * Sets the scroll snapping mode. 2000 * 2001 * @param { ScrollSnapOptions } value - Scroll snapping mode. 2002 * @returns { ScrollAttribute } the attribute of the scroll. 2003 * @syscap SystemCapability.ArkUI.ArkUI.Full 2004 * @atomicservice 2005 * @since arkts {'1.1':'11','1.2':'20'} 2006 * @arkts 1.1&1.2 2007 */ 2008 scrollSnap(value: ScrollSnapOptions): ScrollAttribute; 2009 2010 /** 2011 * Determines whether the scroll view stops on multiples of the content size when the user scrolls. 2012 * 2013 * @param { boolean } value - A boolean value determines whether paging is enabled for scroll. 2014 * @returns { ScrollAttribute } the attribute of the scroll. 2015 * @syscap SystemCapability.ArkUI.ArkUI.Full 2016 * @crossplatform 2017 * @since 11 2018 */ 2019 /** 2020 * Sets whether to enable the swipe-to-turn-pages feature. 2021 * 2022 * @param { boolean } value - Whether to enable the swipe-to-turn-pages feature. Default value: false. 2023 * The value <em>true</em> means to enable the swipe-to-turn-pages feature, and <em>false</em> means the opposite. 2024 * @returns { ScrollAttribute } the attribute of the scroll. 2025 * @syscap SystemCapability.ArkUI.ArkUI.Full 2026 * @crossplatform 2027 * @atomicservice 2028 * @since arkts {'1.1':'12','1.2':'20'} 2029 * @arkts 1.1&1.2 2030 */ 2031 enablePaging(value: boolean): ScrollAttribute; 2032 2033 /** 2034 * Sets the initial scrolling offset. 2035 * 2036 * @param { OffsetOptions } value - Initial scrolling offset. When the value specified is a percentage, 2037 * the initial scrolling offset is calculated as the product of the <em>Scroll</em> component's size 2038 * in the main axis direction and the percentage value. 2039 * @returns { ScrollAttribute } the attribute of the scroll. 2040 * @syscap SystemCapability.ArkUI.ArkUI.Full 2041 * @crossplatform 2042 * @atomicservice 2043 * @since arkts {'1.1':'12','1.2':'20'} 2044 * @arkts 1.1&1.2 2045 */ 2046 initialOffset(value: OffsetOptions): ScrollAttribute; 2047} 2048 2049/** 2050 * Represents the callback triggered when the <em>Scroll</em> component scrolls. 2051 * 2052 * <p><strong>NOTE</strong> 2053 * <br>If the <em>onScrollFrameBegin</em> event and <em>scrollBy</em> method are used to implement nested scrolling, 2054 * set the <em>edgeEffect</em> attribute of the scrollable child component to <em>None</em>. For example, 2055 * if a <em>List</em> is nested in the <em>Scroll</em> component, <em>edgeEffect</em> of the <em>List</em> must be set to <em>EdgeEffect.None</em>. 2056 * </p> 2057 * 2058 * @typedef { function } ScrollOnScrollCallback 2059 * @param { number } xOffset - Horizontal offset per frame during scrolling. A positive offset indicates scrolling to the left, 2060 * and a negative offset indicates scrolling to the right. 2061 * <br>Unit: vp 2062 * @param { number } yOffset - Vertical offset per frame during scrolling. 2063 * A positive offset indicates scrolling upward, and a negative offset indicates scrolling downward. 2064 * <br>Unit: vp 2065 * @param { ScrollState } scrollState - Current scrolling state. 2066 * @syscap SystemCapability.ArkUI.ArkUI.Full 2067 * @crossplatform 2068 * @atomicservice 2069 * @since arkts {'1.1':'12','1.2':'20'} 2070 * @arkts 1.1&1.2 2071 */ 2072declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; 2073 2074/** 2075 * Called before scroll to allow developer to control real offset the Scroll can scroll. 2076 * 2077 * @typedef { function } ScrollOnWillScrollCallback 2078 * @param { number } xOffset - Horizontal offset per frame during scrolling. 2079 * A positive offset indicates scrolling to the left, and a negative offset indicates scrolling to the right. 2080 * <br>Unit: vp 2081 * @param { number } yOffset - offset per frame during scrolling. 2082 * A positive offset indicates scrolling upward, and a negative offset indicates scrolling downward. 2083 * <br>Unit: vp 2084 * @param { ScrollState } scrollState - Current scrolling state. 2085 * @param { ScrollSource } scrollSource - Source of the current scrolling operation. 2086 * @returns { void | OffsetResult } the remain offset for the Scroll, 2087 * same as (xOffset, yOffset) when no OffsetResult is returned. 2088 * @syscap SystemCapability.ArkUI.ArkUI.Full 2089 * @crossplatform 2090 * @atomicservice 2091 * @since 12 2092 */ 2093declare type ScrollOnWillScrollCallback = 2094 (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | OffsetResult; 2095 2096/** 2097 * Called before scroll to allow developer to control real offset the Scroll can scroll. 2098 * 2099 * @typedef { function } ScrollOnWillScrollCallback 2100 * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. 2101 * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. 2102 * @param { ScrollState } scrollState - current scroll state. 2103 * @param { ScrollSource } scrollSource - source of current scroll. 2104 * @returns { undefined | OffsetResult } the remain offset for the Scroll, 2105 * same as (xOffset, yOffset) when no OffsetResult is returned. 2106 * @syscap SystemCapability.ArkUI.ArkUI.Full 2107 * @crossplatform 2108 * @atomicservice 2109 * @since 20 2110 * @arkts 1.2 2111 */ 2112declare type ScrollOnWillScrollCallback = 2113(xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => undefined | OffsetResult; 2114 2115/** 2116 * callback of Scroll, using in onDidZoom. 2117 * 2118 * @typedef { function } ScrollOnDidZoomCallback 2119 * @param { number } scale - current zoom scale. 2120 * @syscap SystemCapability.ArkUI.ArkUI.Full 2121 * @crossplatform 2122 * @atomicservice 2123 * @since 20 2124 */ 2125declare type ScrollOnDidZoomCallback = (scale: number) => void; 2126 2127/** 2128 * Defines Scroll Component. 2129 * 2130 * @syscap SystemCapability.ArkUI.ArkUI.Full 2131 * @since 7 2132 */ 2133/** 2134 * Defines Scroll Component. 2135 * 2136 * @syscap SystemCapability.ArkUI.ArkUI.Full 2137 * @crossplatform 2138 * @since 10 2139 */ 2140/** 2141 * Defines Scroll Component. 2142 * 2143 * @syscap SystemCapability.ArkUI.ArkUI.Full 2144 * @crossplatform 2145 * @atomicservice 2146 * @since 11 2147 */ 2148declare const Scroll: ScrollInterface; 2149 2150/** 2151 * Defines Scroll Component instance. 2152 * 2153 * @syscap SystemCapability.ArkUI.ArkUI.Full 2154 * @since 7 2155 */ 2156/** 2157 * Defines Scroll Component instance. 2158 * 2159 * @syscap SystemCapability.ArkUI.ArkUI.Full 2160 * @crossplatform 2161 * @since 10 2162 */ 2163/** 2164 * Defines Scroll Component instance. 2165 * 2166 * @syscap SystemCapability.ArkUI.ArkUI.Full 2167 * @crossplatform 2168 * @atomicservice 2169 * @since 11 2170 */ 2171declare const ScrollInstance: ScrollAttribute; 2172