1/* 2 * Copyright (c) 2021-2025 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 { ChildrenMainSize, ItemDragInfo, RectResult, ScrollableCommonMethod, Optional, 23 OnWillScrollCallback, OnScrollCallback, OnItemDragStartCallback } from './common'; 24import { Axis } from './enums'; 25import { OnScrollFrameBeginCallback, ScrollAlign, Scroller } from './scroll'; 26import { Dimension, Length, LengthConstrain, ResourceColor } from './units'; 27/*** endif */ 28 29/** 30 * Declare scroll status 31 * 32 * @enum { number } 33 * @syscap SystemCapability.ArkUI.ArkUI.Full 34 * @since 7 35 */ 36/** 37 * Declare scroll status 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @form 42 * @since 9 43 */ 44/** 45 * Declare scroll status 46 * 47 * @enum { number } 48 * @syscap SystemCapability.ArkUI.ArkUI.Full 49 * @crossplatform 50 * @form 51 * @since 10 52 */ 53/** 54 * Declare scroll status 55 * 56 * @enum { number } 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @crossplatform 59 * @form 60 * @atomicservice 61 * @since arkts {'1.1':'11','1.2':'20'} 62 * @arkts 1.1&1.2 63 */ 64declare enum ScrollState { 65 /** 66 * Not activated. 67 * 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @since 7 70 */ 71 /** 72 * Not activated. 73 * 74 * @syscap SystemCapability.ArkUI.ArkUI.Full 75 * @form 76 * @since 9 77 */ 78 /** 79 * Not activated. 80 * 81 * @syscap SystemCapability.ArkUI.ArkUI.Full 82 * @crossplatform 83 * @form 84 * @since 10 85 */ 86 /** 87 * Idle state. Triggered when the scroll state returns to idle, and when the controller's 88 * non-animated methods are used to control the scroll. 89 * 90 * @syscap SystemCapability.ArkUI.ArkUI.Full 91 * @crossplatform 92 * @form 93 * @atomicservice 94 * @since arkts {'1.1':'11','1.2':'20'} 95 * @arkts 1.1&1.2 96 */ 97 Idle, 98 99 /** 100 * Scrolling status. 101 * 102 * @syscap SystemCapability.ArkUI.ArkUI.Full 103 * @since 7 104 */ 105 /** 106 * Scrolling status. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @form 110 * @since 9 111 */ 112 /** 113 * Scrolling status. 114 * 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @crossplatform 117 * @form 118 * @since 10 119 */ 120 /** 121 * Scrolling state. Triggered when the list is dragged with the finger, 122 * when the scrollbar is dragged, or when the mouse scroll wheel is used. 123 * 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @form 127 * @atomicservice 128 * @since arkts {'1.1':'11','1.2':'20'} 129 * @arkts 1.1&1.2 130 */ 131 Scroll, 132 133 /** 134 * Drag status. 135 * 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @since 7 138 */ 139 /** 140 * Drag status. 141 * 142 * @syscap SystemCapability.ArkUI.ArkUI.Full 143 * @form 144 * @since 9 145 */ 146 /** 147 * Drag status. 148 * 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @crossplatform 151 * @form 152 * @since 10 153 */ 154 /** 155 * Inertial scrolling state. 156 * 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @form 160 * @atomicservice 161 * @since arkts {'1.1':'11','1.2':'20'} 162 * @arkts 1.1&1.2 163 */ 164 Fling, 165} 166 167/** 168 * Declare list item alignment status 169 * 170 * @enum { number } 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @form 173 * @since 9 174 */ 175/** 176 * Declare list item alignment status 177 * 178 * @enum { number } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @crossplatform 181 * @form 182 * @since 10 183 */ 184/** 185 * Declare list item alignment status 186 * 187 * @enum { number } 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @crossplatform 190 * @form 191 * @atomicservice 192 * @since arkts {'1.1':'11','1.2':'20'} 193 * @arkts 1.1&1.2 194 */ 195declare enum ListItemAlign { 196 /** 197 * Start position in the direction of cross axis. 198 * 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @form 201 * @since 9 202 */ 203 /** 204 * Start position in the direction of cross axis. 205 * 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @form 209 * @since 10 210 */ 211 /** 212 * The list items are packed toward the start edge of the <em>List</em> component along the cross axis. 213 * 214 * @syscap SystemCapability.ArkUI.ArkUI.Full 215 * @crossplatform 216 * @form 217 * @atomicservice 218 * @since arkts {'1.1':'11','1.2':'20'} 219 * @arkts 1.1&1.2 220 */ 221 Start, 222 223 /** 224 * Center position in the direction of cross axis. 225 * 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @form 228 * @since 9 229 */ 230 /** 231 * Center position in the direction of cross axis. 232 * 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @crossplatform 235 * @form 236 * @since 10 237 */ 238 /** 239 * The list items are centered in the <em>List</em> component along the cross axis. 240 * 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @form 244 * @atomicservice 245 * @since arkts {'1.1':'11','1.2':'20'} 246 * @arkts 1.1&1.2 247 */ 248 Center, 249 250 /** 251 * End position in the direction of cross axis 252 * 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @form 255 * @since 9 256 */ 257 /** 258 * End position in the direction of cross axis 259 * 260 * @syscap SystemCapability.ArkUI.ArkUI.Full 261 * @crossplatform 262 * @form 263 * @since 10 264 */ 265 /** 266 * The list items are packed toward the end edge of the <em>List</em> component along the cross axis. 267 * 268 * @syscap SystemCapability.ArkUI.ArkUI.Full 269 * @crossplatform 270 * @form 271 * @atomicservice 272 * @since arkts {'1.1':'11','1.2':'20'} 273 * @arkts 1.1&1.2 274 */ 275 End, 276} 277 278/** 279 * Declare list item group area 280 * 281 * @enum { number } 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @crossplatform 284 * @atomicservice 285 * @since arkts {'1.1':'12','1.2':'20'} 286 * @arkts 1.1&1.2 287 */ 288declare enum ListItemGroupArea { 289 /** 290 * The edge of the viewport is in the position of <em>none</em>. 291 * 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @atomicservice 295 * @since arkts {'1.1':'12','1.2':'20'} 296 * @arkts 1.1&1.2 297 */ 298 NONE = 0, 299 300 /** 301 * The edge of the viewport is in the position of a list item. 302 * 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @atomicservice 306 * @since arkts {'1.1':'12','1.2':'20'} 307 * @arkts 1.1&1.2 308 */ 309 IN_LIST_ITEM_AREA = 1, 310 311 /** 312 * The edge of the viewport is in the position of a header. 313 * 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @atomicservice 317 * @since arkts {'1.1':'12','1.2':'20'} 318 * @arkts 1.1&1.2 319 */ 320 IN_HEADER_AREA = 2, 321 322 /** 323 * The edge of the viewport is in the position of a footer. 324 * 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @crossplatform 327 * @atomicservice 328 * @since arkts {'1.1':'12','1.2':'20'} 329 * @arkts 1.1&1.2 330 */ 331 IN_FOOTER_AREA = 3, 332} 333 334/** 335 * Declare item group sticky style. 336 * 337 * @enum { number } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @form 340 * @since 9 341 */ 342/** 343 * Declare item group sticky style. 344 * 345 * @enum { number } 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @crossplatform 348 * @form 349 * @since 10 350 */ 351/** 352 * Declare item group sticky style. 353 * 354 * @enum { number } 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @form 358 * @atomicservice 359 * @since arkts {'1.1':'11','1.2':'20'} 360 * @arkts 1.1&1.2 361 */ 362declare enum StickyStyle { 363 /** 364 * The header and footer of each item group will not be pinned. 365 * 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @form 368 * @since 9 369 */ 370 /** 371 * The header and footer of each item group will not be pinned. 372 * 373 * @syscap SystemCapability.ArkUI.ArkUI.Full 374 * @crossplatform 375 * @form 376 * @since 10 377 */ 378 /** 379 * In the ListItemGroup component, the header is not pinned to the top, 380 * and the footer is not pinned to the bottom. 381 * 382 * @syscap SystemCapability.ArkUI.ArkUI.Full 383 * @crossplatform 384 * @form 385 * @atomicservice 386 * @since arkts {'1.1':'11','1.2':'20'} 387 * @arkts 1.1&1.2 388 */ 389 None = 0, 390 391 /** 392 * The header of each item group will be pinned. 393 * 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @form 396 * @since 9 397 */ 398 /** 399 * The header of each item group will be pinned. 400 * 401 * @syscap SystemCapability.ArkUI.ArkUI.Full 402 * @crossplatform 403 * @form 404 * @since 10 405 */ 406 /** 407 * In the ListItemGroup component, the header is pinned to the top, 408 * and the footer is not pinned to the bottom. 409 * 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @crossplatform 412 * @form 413 * @atomicservice 414 * @since arkts {'1.1':'11','1.2':'20'} 415 * @arkts 1.1&1.2 416 */ 417 Header = 1, 418 419 /** 420 * The footer of each item group will be pinned. 421 * 422 * @syscap SystemCapability.ArkUI.ArkUI.Full 423 * @form 424 * @since 9 425 */ 426 /** 427 * The footer of each item group will be pinned. 428 * 429 * @syscap SystemCapability.ArkUI.ArkUI.Full 430 * @crossplatform 431 * @form 432 * @since 10 433 */ 434 /** 435 * In the <em>ListItemGroup</em> component, the footer is pinned to the bottom, 436 * and the header is not pinned to the top. 437 * 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @crossplatform 440 * @form 441 * @atomicservice 442 * @since arkts {'1.1':'11','1.2':'20'} 443 * @arkts 1.1&1.2 444 */ 445 Footer = 2, 446} 447 448/** 449 * Declare edge effect of chain animation. 450 * 451 * @enum { number } 452 * @syscap SystemCapability.ArkUI.ArkUI.Full 453 * @systemapi 454 * @since arkts {'1.1':'10','1.2':'20'} 455 * @arkts 1.1&1.2 456 */ 457declare enum ChainEdgeEffect { 458 /** 459 * Default edge effect. Compress the space in the drag direction 460 * and stretch the space in the opposite drag direction. 461 * 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @systemapi 464 * @since arkts {'1.1':'10','1.2':'20'} 465 * @arkts 1.1&1.2 466 */ 467 DEFAULT, 468 469 /** 470 * Stretch all space. 471 * 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @systemapi 474 * @since arkts {'1.1':'10','1.2':'20'} 475 * @arkts 1.1&1.2 476 */ 477 STRETCH, 478} 479 480/** 481 * Declare limited position when scroll end. 482 * 483 * @enum { number } 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @since 10 486 */ 487/** 488 * Declare limited position when scroll end. 489 * 490 * @enum { number } 491 * @syscap SystemCapability.ArkUI.ArkUI.Full 492 * @crossplatform 493 * @atomicservice 494 * @since arkts {'1.1':'11','1.2':'20'} 495 * @arkts 1.1&1.2 496 */ 497declare enum ScrollSnapAlign { 498 /** 499 * Default no item scroll snap alignment effect. When scroll end, 500 * list item will stop without limit. 501 * 502 * @syscap SystemCapability.ArkUI.ArkUI.Full 503 * @since 10 504 */ 505 /** 506 * No alignment. This is the default value. 507 * 508 * @syscap SystemCapability.ArkUI.ArkUI.Full 509 * @crossplatform 510 * @atomicservice 511 * @since arkts {'1.1':'11','1.2':'20'} 512 * @arkts 1.1&1.2 513 */ 514 NONE = 0, 515 516 /** 517 * The first item in view will be aligned at the start of list. 518 * 519 * @syscap SystemCapability.ArkUI.ArkUI.Full 520 * @since 10 521 */ 522 /** 523 * The first item in the view is aligned at the start of the list. 524 * 525 * <p><strong>NOTE</strong> 526 * <br>When the list hits the end, the items at the end must be completely displayed. 527 * In this case, the items at the start may not be aligned. 528 * </p> 529 * 530 * @syscap SystemCapability.ArkUI.ArkUI.Full 531 * @crossplatform 532 * @atomicservice 533 * @since arkts {'1.1':'11','1.2':'20'} 534 * @arkts 1.1&1.2 535 */ 536 START = 1, 537 538 /** 539 * The middle item in view will be aligned at the center of list. 540 * 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @since 10 543 */ 544 /** 545 * The middle items in the view are aligned in the center of the list. 546 * 547 * <p><strong>NOTE</strong> 548 * <br>The top and end items can be aligned in the center of the list. 549 * In this case, a blank area may result, and the first or last item is aligned to the center of the list. 550 * </pr> 551 * 552 * @syscap SystemCapability.ArkUI.ArkUI.Full 553 * @crossplatform 554 * @atomicservice 555 * @since arkts {'1.1':'11','1.2':'20'} 556 * @arkts 1.1&1.2 557 */ 558 CENTER = 2, 559 560 /** 561 * The last item in view will be aligned at the end of list. 562 * 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @since 10 565 */ 566 /** 567 * The last item in the view is aligned at the end of the list. 568 * 569 * <p><strong>NOTE</strong> 570 * <br>When the list hits the start, the items at the start must be completely displayed. 571 * In this case, the items at the end may not be aligned. 572 * </p> 573 * 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @atomicservice 577 * @since arkts {'1.1':'11','1.2':'20'} 578 * @arkts 1.1&1.2 579 */ 580 END = 3, 581} 582 583/** 584 * Defines the chain animation options. 585 * 586 * @interface ChainAnimationOptions 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @systemapi 589 * @since arkts {'1.1':'10','1.2':'20'} 590 * @arkts 1.1&1.2 591 */ 592declare interface ChainAnimationOptions { 593 /** 594 * Minimum space for chain animation. 595 * 596 * @type { Length } 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @systemapi 599 * @since arkts {'1.1':'10','1.2':'20'} 600 * @arkts 1.1&1.2 601 */ 602 minSpace: Length; 603 604 /** 605 * Maximum space for chain animation. 606 * 607 * @type { Length } 608 * @syscap SystemCapability.ArkUI.ArkUI.Full 609 * @systemapi 610 * @since arkts {'1.1':'10','1.2':'20'} 611 * @arkts 1.1&1.2 612 */ 613 maxSpace: Length; 614 615 /** 616 * Conductivity of chain animation. 617 * 618 * @type { ?number } 619 * @default 0.7 620 * @syscap SystemCapability.ArkUI.ArkUI.Full 621 * @systemapi 622 * @since arkts {'1.1':'10','1.2':'20'} 623 * @arkts 1.1&1.2 624 */ 625 conductivity?: number; 626 627 /** 628 * Intensity of chain animation. 629 * 630 * @type { ?number } 631 * @default 0.3 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @systemapi 634 * @since arkts {'1.1':'10','1.2':'20'} 635 * @arkts 1.1&1.2 636 */ 637 intensity?: number; 638 639 /** 640 * Edge effect of chain animation. 641 * 642 * @type { ?ChainEdgeEffect } 643 * @default ChainEdgeEffect.DEFAULT 644 * @syscap SystemCapability.ArkUI.ArkUI.Full 645 * @systemapi 646 * @since arkts {'1.1':'10','1.2':'20'} 647 * @arkts 1.1&1.2 648 */ 649 edgeEffect?: ChainEdgeEffect; 650 651 /** 652 * Stiffness of chain spring. 653 * 654 * @type { ?number } 655 * @default 228 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @systemapi 658 * @since arkts {'1.1':'10','1.2':'20'} 659 * @arkts 1.1&1.2 660 */ 661 stiffness?: number; 662 663 /** 664 * Damping of chain spring. 665 * 666 * @type { ?number } 667 * @default 30 668 * @syscap SystemCapability.ArkUI.ArkUI.Full 669 * @systemapi 670 * @since arkts {'1.1':'10','1.2':'20'} 671 * @arkts 1.1&1.2 672 */ 673 damping?: number; 674} 675 676/** 677 * Defines a UIListEvent which is used to set different common event to target component. 678 * 679 * @extends UIScrollableCommonEvent 680 * @interface UIListEvent 681 * @syscap SystemCapability.ArkUI.ArkUI.Full 682 * @crossplatform 683 * @atomicservice 684 * @since 19 685 */ 686declare interface UIListEvent extends UIScrollableCommonEvent { 687 /** 688 * Set or reset the callback which is triggered when the List will scroll. 689 * 690 * @param { OnWillScrollCallback | undefined } callback - The callback will be triggered when the List will scroll. 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @crossplatform 693 * @atomicservice 694 * @since 19 695 */ 696 setOnWillScroll(callback: OnWillScrollCallback | undefined): void; 697 698 /** 699 * Set or reset the callback which is triggered when List view did scroll. 700 * 701 * @param { OnScrollCallback | undefined } callback - callback function, triggered when the List view did scroll. 702 * @syscap SystemCapability.ArkUI.ArkUI.Full 703 * @crossplatform 704 * @atomicservice 705 * @since 19 706 */ 707 setOnDidScroll(callback: OnScrollCallback | undefined): void; 708 709 /** 710 * Set or reset the callback which is triggered when the start, end, or center positions of the display change. 711 * 712 * @param { OnListScrollIndexCallback | undefined } callback - callback function, triggered when the 713 * start, end, or center positions of the display change. 714 * @syscap SystemCapability.ArkUI.ArkUI.Full 715 * @crossplatform 716 * @atomicservice 717 * @since 19 718 */ 719 setOnScrollIndex(callback: OnListScrollIndexCallback | undefined): void; 720 721 /** 722 * Set or reset the callback which is triggered when the list visible content changes. 723 * 724 * @param { OnScrollVisibleContentChangeCallback | undefined } callback - callback function, triggered when 725 * the list visible content changes. 726 * @syscap SystemCapability.ArkUI.ArkUI.Full 727 * @crossplatform 728 * @atomicservice 729 * @since 19 730 */ 731 setOnScrollVisibleContentChange(callback: OnScrollVisibleContentChangeCallback | undefined): void; 732} 733 734/** 735 * Defines the close swipe action options. 736 * 737 * @interface CloseSwipeActionOptions 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @since 11 741 */ 742/** 743 * Defines the close swipe action options. 744 * 745 * @interface CloseSwipeActionOptions 746 * @syscap SystemCapability.ArkUI.ArkUI.Full 747 * @crossplatform 748 * @atomicservice 749 * @since arkts {'1.1':'12','1.2':'20'} 750 * @arkts 1.1&1.2 751 */ 752declare interface CloseSwipeActionOptions { 753 /** 754 * Called after collapse animation completed. 755 * 756 * @type { ?function } 757 * @syscap SystemCapability.ArkUI.ArkUI.Full 758 * @crossplatform 759 * @since 11 760 */ 761 /** 762 * Triggered after the collapse animation is complete. 763 * 764 * @type { ?function } 765 * @syscap SystemCapability.ArkUI.ArkUI.Full 766 * @crossplatform 767 * @atomicservice 768 * @since arkts {'1.1':'12','1.2':'20'} 769 * @arkts 1.1&1.2 770 */ 771 onFinish?: ()=>void 772} 773 774/** 775 * Defines the visible list content info. 776 * 777 * @interface VisibleListContentInfo 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @crossplatform 780 * @atomicservice 781 * @since arkts {'1.1':'12','1.2':'20'} 782 * @arkts 1.1&1.2 783 */ 784declare interface VisibleListContentInfo { 785 /** 786 * Index of the list item or list item group in the list display area. 787 * 788 * @type { number } 789 * @syscap SystemCapability.ArkUI.ArkUI.Full 790 * @crossplatform 791 * @atomicservice 792 * @since arkts {'1.1':'12','1.2':'20'} 793 * @arkts 1.1&1.2 794 */ 795 index: number 796 797 /** 798 * Position of the top or bottom edge of the viewport in the 799 * list item group to which the edge is located, if applicable. 800 * 801 * @type { ?ListItemGroupArea } 802 * @syscap SystemCapability.ArkUI.ArkUI.Full 803 * @crossplatform 804 * @atomicservice 805 * @since arkts {'1.1':'12','1.2':'20'} 806 * @arkts 1.1&1.2 807 */ 808 itemGroupArea?: ListItemGroupArea 809 810 /** 811 * Index of the starting or ending list item in the list 812 * item group to which the top or bottom edge of the viewport is located. 813 * 814 * @type { ?number } 815 * @syscap SystemCapability.ArkUI.ArkUI.Full 816 * @crossplatform 817 * @atomicservice 818 * @since arkts {'1.1':'12','1.2':'20'} 819 * @arkts 1.1&1.2 820 */ 821 itemIndexInGroup?: number 822} 823 824/** 825 * Called when a child component enters or leaves the list display area. 826 * 827 * @typedef {function} OnScrollVisibleContentChangeCallback 828 * @param {VisibleListContentInfo} start - Information about the currently displayed first list item or list item group. 829 * @param {VisibleListContentInfo} end - Information about the currently displayed last list item or list item group. 830 * @syscap SystemCapability.ArkUI.ArkUI.Full 831 * @crossplatform 832 * @atomicservice 833 * @since arkts {'1.1':'12','1.2':'20'} 834 * @arkts 1.1&1.2 835 */ 836declare type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; 837 838/** 839 * Defines the callback type used in onScrollIndex. 840 * 841 * @typedef {function} OnListScrollIndexCallback 842 * @param {number} start - the first index in visible content. 843 * @param {number} end - the last index in visible content. 844 * @param {number} center - the center index in visible content. 845 * @syscap SystemCapability.ArkUI.ArkUI.Full 846 * @crossplatform 847 * @form 848 * @atomicservice 849 * @since 19 850 */ 851declare type OnListScrollIndexCallback = (start: number, end: number, center: number) => void; 852 853/** 854 * @extends Scroller 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @crossplatform 857 * @since 11 858 */ 859/** 860 * @extends Scroller 861 * @syscap SystemCapability.ArkUI.ArkUI.Full 862 * @crossplatform 863 * @atomicservice 864 * @since arkts {'1.1':'12','1.2':'20'} 865 * @arkts 1.1&1.2 866 */ 867declare class ListScroller extends Scroller { 868 /** 869 * Gets the size and position of a ListItem in a ListItemGroup. 870 * 871 * @param { number } index - Index of the ListItemGroup in List. 872 * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. 873 * @returns { RectResult } Returns the size and position. 874 * @throws { BusinessError } 401 - Parameter error. Possible causes: 875 * <br> 1. Mandatory parameters are left unspecified. 876 * <br> 2. Incorrect parameters types. 877 * <br> 3. Parameter verification failed. 878 * @throws { BusinessError } 100004 - Controller not bound to component. 879 * @syscap SystemCapability.ArkUI.ArkUI.Full 880 * @crossplatform 881 * @since 11 882 */ 883 /** 884 * Obtains the size of a list item in a list item group and its position relative to the list. 885 * 886 * <p><strong>NOTE</strong>: 887 * <br>- The value of <em>index</em> must be the index of a child component visible in the display area. 888 * Otherwise, the value is considered invalid. 889 * <br>- The child component for which <em>index</em> is set must be a list item group. Otherwise, 890 * the <em>index </em>value is considered invalid. 891 * <br>- The value of <em>indexInGroup</em> must be the index of a list item in the list item group 892 * visible in the display area. Otherwise, the value is considered invalid. 893 * <br>- When <em>index</em> or <em>indexInGroup</em> is set to an invalid value, the returned size and position are both <em>0</em>. 894 * </p> 895 * 896 * @param { number } index - Index of the list item group in the list. 897 * @param { number } indexInGroup - Index of the list item in the list item group. 898 * @returns { RectResult } - Size of the list item in the list item group and its position relative to the list. 899 * @throws { BusinessError } 401 - Parameter error. Possible causes: 900 * <br> 1. Mandatory parameters are left unspecified. 901 * <br> 2. Incorrect parameters types. 902 * <br> 3. Parameter verification failed. 903 * @throws { BusinessError } 100004 - Controller not bound to component. 904 * @syscap SystemCapability.ArkUI.ArkUI.Full 905 * @crossplatform 906 * @atomicservice 907 * @since arkts {'1.1':'12','1.2':'20'} 908 * @arkts 1.1&1.2 909 */ 910 getItemRectInGroup(index: number, indexInGroup: number): RectResult; 911 912 /** 913 * Called when sliding to the specified index in specified ListItemGroup. 914 * 915 * @param { number } index - Index of the ListItemGroup in List. 916 * @param { number } indexInGroup - Index of the ListItem in ListItemGroup. 917 * @param { boolean } smooth - If true, scroll to index item with animation. If false, scroll to index item without animation. 918 * @param { ScrollAlign } align - Sets the alignment mode of a specified index. 919 * @throws { BusinessError } 401 - Parameter error. Possible causes: 920 * <br> 1. Mandatory parameters are left unspecified. 921 * <br> 2. Incorrect parameters types. 922 * <br> 3. Parameter verification failed. 923 * @throws { BusinessError } 100004 - Controller not bound to component. 924 * @syscap SystemCapability.ArkUI.ArkUI.Full 925 * @crossplatform 926 * @since 11 927 */ 928 /** 929 * Scrolls to the specified list item in the specified list item group. 930 * 931 * @param { number } index - Index of the target list item group in the current container. 932 * <br><em>NOTE</em> 933 * <br>If the value set is a negative value or greater than the maximum index of the items in the container, 934 * the value is deemed abnormal, and no scrolling will be performed. 935 * @param { number } indexInGroup - Index of the target list item in the list item group specified by <em>index</em>. 936 * <br><em>NOTE</em> 937 * <br>If the value set is a negative value or greater than the maximum index of the items in the list item group, 938 * the value is deemed abnormal, and no scrolling will be performed. 939 * @param { boolean } smooth - Whether to enable the smooth animation for scrolling to the item with the specified index. 940 * 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> 941 * @param { ScrollAlign } align - How the list item to scroll to is aligned with the container.<br>Default value: <em>ScrollAlign.START</em> 942 * @throws { BusinessError } 401 - Parameter error. Possible causes: 943 * <br> 1. Mandatory parameters are left unspecified. 944 * <br> 2. Incorrect parameters types. 945 * <br> 3. Parameter verification failed. 946 * @throws { BusinessError } 100004 - Controller not bound to component. 947 * @syscap SystemCapability.ArkUI.ArkUI.Full 948 * @crossplatform 949 * @atomicservice 950 * @since arkts {'1.1':'12','1.2':'20'} 951 * @arkts 1.1&1.2 952 */ 953 scrollToItemInGroup(index: number, indexInGroup:number, smooth?: boolean, align?: ScrollAlign): void; 954 955 /** 956 * Collapse all listItem. 957 * 958 * @param { CloseSwipeActionOptions } options - Options of close Swipe items. 959 * @throws { BusinessError } 401 - Parameter error. Possible causes: 960 * <br> 1. Mandatory parameters are left unspecified. 961 * <br> 2. Incorrect parameters types. 962 * <br> 3. Parameter verification failed. 963 * @throws { BusinessError } 100004 - Controller not bound to component. 964 * @syscap SystemCapability.ArkUI.ArkUI.Full 965 * @crossplatform 966 * @since 11 967 */ 968 /** 969 * Collapses the list items in the EXPANDED state and sets callback events. 970 * 971 * <p><strong>NOTE</strong>: 972 * <br>- A <em>ListScroller</em> must be bound to the <em>List</em> component. 973 * </p> 974 * 975 * @param { CloseSwipeActionOptions } options - Callback events for collapsing list items in the EXPANDED state. 976 * @throws { BusinessError } 401 - Parameter error. Possible causes: 977 * <br> 1. Mandatory parameters are left unspecified. 978 * <br> 2. Incorrect parameters types. 979 * <br> 3. Parameter verification failed. 980 * @throws { BusinessError } 100004 - Controller not bound to component. 981 * @syscap SystemCapability.ArkUI.ArkUI.Full 982 * @crossplatform 983 * @atomicservice 984 * @since arkts {'1.1':'12','1.2':'20'} 985 * @arkts 1.1&1.2 986 */ 987 closeAllSwipeActions(options?: CloseSwipeActionOptions): void; 988 989 /** 990 * Obtains the index information of the child component at the specified coordinates. 991 * 992 * <p><strong>NOTE</strong>: 993 * <br>- If the provided value of <em>x</em> or <em>y</em> is invalid, 994 * the returned VisibleListContentInfo object has the <em>index</em> property set to <em>-1</em>, 995 * and both <em>itemGroupArea</em> and <em>itemIndexInGroup</em> are <em>undefined</em>. 996 * </p> 997 * 998 * @param { number } x - X-coordinate, in vp. 999 * @param { number } y - Y-coordinate, in vp. 1000 * @returns { VisibleListContentInfo } Index information of the child component at the specified coordinates. 1001 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1002 * <br> 1. Mandatory parameters are left unspecified. 1003 * <br> 2. Incorrect parameters types. 1004 * <br> 3. Parameter verification failed. 1005 * @throws { BusinessError } 100004 - The controller not bound to component. 1006 * @syscap SystemCapability.ArkUI.ArkUI.Full 1007 * @crossplatform 1008 * @atomicservice 1009 * @since arkts {'1.1':'14','1.2':'20'} 1010 * @arkts 1.1&1.2 1011 */ 1012 getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; 1013} 1014 1015/** 1016 * Defines the options of the <em>List</em> component. 1017 * 1018 * <p><strong>NOTE</strong>: 1019 * <br>- The default value of the universal attribute clip is <em>true</em> for the <em>List</em> component. 1020 * </p> 1021 * 1022 * @interface ListOptions 1023 * @syscap SystemCapability.ArkUI.ArkUI.Full 1024 * @crossplatform 1025 * @form 1026 * @atomicservice 1027 * @since arkts {'1.1':'18','1.2':'20'} 1028 * @arkts 1.1&1.2 1029 */ 1030interface ListOptions { 1031 /** 1032 * Set initialIndex. 1033 * 1034 * @type { ?number } 1035 * @syscap SystemCapability.ArkUI.ArkUI.Full 1036 * @since 7 1037 */ 1038 /** 1039 * Set initialIndex. 1040 * 1041 * @type { ?number } 1042 * @syscap SystemCapability.ArkUI.ArkUI.Full 1043 * @form 1044 * @since 9 1045 */ 1046 /** 1047 * Set initialIndex. 1048 * 1049 * @type { ?number } 1050 * @syscap SystemCapability.ArkUI.ArkUI.Full 1051 * @crossplatform 1052 * @form 1053 * @since 10 1054 */ 1055 /** 1056 * Set initialIndex. 1057 * 1058 * @type { ?number } 1059 * @syscap SystemCapability.ArkUI.ArkUI.Full 1060 * @crossplatform 1061 * @form 1062 * @atomicservice 1063 * @since 11 1064 */ 1065 /** 1066 * Index of the item to be displayed at the start when the list is initially loaded. 1067 * Anonymous Object Rectification. 1068 * 1069 * <p><strong>NOTE</strong> 1070 * <br>If the set value is a negative number or is greater than the index of the last item in the list, 1071 * the value is invalid. In this case, the default value will be used. 1072 * </p> 1073 * 1074 * @type { ?number } 1075 * @default 0 1076 * @syscap SystemCapability.ArkUI.ArkUI.Full 1077 * @crossplatform 1078 * @form 1079 * @atomicservice 1080 * @since arkts {'1.1':'18','1.2':'20'} 1081 * @arkts 1.1&1.2 1082 */ 1083 initialIndex?: number; 1084 /** 1085 * Set space. 1086 * 1087 * @type { ?(number | string) } 1088 * @syscap SystemCapability.ArkUI.ArkUI.Full 1089 * @since 7 1090 */ 1091 /** 1092 * Set space. 1093 * 1094 * @type { ?(number | string) } 1095 * @syscap SystemCapability.ArkUI.ArkUI.Full 1096 * @form 1097 * @since 9 1098 */ 1099 /** 1100 * Set space. 1101 * 1102 * @type { ?(number | string) } 1103 * @syscap SystemCapability.ArkUI.ArkUI.Full 1104 * @crossplatform 1105 * @form 1106 * @since 10 1107 */ 1108 /** 1109 * Set space. 1110 * 1111 * @type { ?(number | string) } 1112 * @syscap SystemCapability.ArkUI.ArkUI.Full 1113 * @crossplatform 1114 * @form 1115 * @atomicservice 1116 * @since 11 1117 */ 1118 /** 1119 * Spacing between list items along the main axis. 1120 * Anonymous Object Rectification. 1121 * 1122 * <p><strong>NOTE</strong> 1123 * <br>If this parameter is set to a negative number or a value greater than or equal to the length of the list content area, the default value is used. 1124 * <br>If this parameter is set to a value less than the width of the list divider, the width of the list divider is used as the spacing. 1125 * <br> Child components of <em>List</em> whose <em>visibility</em> attribute is set to <em>None</em> are not displayed, 1126 * but the spacing above and below them still takes effect. 1127 * </p> 1128 * 1129 * @type { ?(number | string) } 1130 * @default 0 1131 * @syscap SystemCapability.ArkUI.ArkUI.Full 1132 * @crossplatform 1133 * @form 1134 * @atomicservice 1135 * @since arkts {'1.1':'18','1.2':'20'} 1136 * @arkts 1.1&1.2 1137 */ 1138 space?: number | string; 1139 /** 1140 * Set scroller. 1141 * 1142 * @type { ?Scroller } 1143 * @syscap SystemCapability.ArkUI.ArkUI.Full 1144 * @since 7 1145 */ 1146 /** 1147 * Set scroller. 1148 * 1149 * @type { ?Scroller } 1150 * @syscap SystemCapability.ArkUI.ArkUI.Full 1151 * @form 1152 * @since 9 1153 */ 1154 /** 1155 * Set scroller. 1156 * 1157 * @type { ?Scroller } 1158 * @syscap SystemCapability.ArkUI.ArkUI.Full 1159 * @crossplatform 1160 * @form 1161 * @since 10 1162 */ 1163 /** 1164 * Set scroller. 1165 * 1166 * @type { ?Scroller } 1167 * @syscap SystemCapability.ArkUI.ArkUI.Full 1168 * @crossplatform 1169 * @form 1170 * @atomicservice 1171 * @since 11 1172 */ 1173 /** 1174 * Scroller, which can be bound to scrollable components. 1175 * Anonymous Object Rectification. 1176 * 1177 * <p><strong>NOTE</strong> 1178 * <br>The scroller cannot be bound to other scrollable components. 1179 * </p> 1180 * 1181 * @type { ?Scroller } 1182 * @syscap SystemCapability.ArkUI.ArkUI.Full 1183 * @crossplatform 1184 * @form 1185 * @atomicservice 1186 * @since arkts {'1.1':'18','1.2':'20'} 1187 * @arkts 1.1&1.2 1188 */ 1189 scroller?: Scroller; 1190} 1191 1192/** 1193 * The list interface is extended. 1194 * 1195 * @interface ListInterface 1196 * @syscap SystemCapability.ArkUI.ArkUI.Full 1197 * @since 7 1198 */ 1199/** 1200 * The list interface is extended. 1201 * 1202 * @interface ListInterface 1203 * @syscap SystemCapability.ArkUI.ArkUI.Full 1204 * @form 1205 * @since 9 1206 */ 1207/** 1208 * The list interface is extended. 1209 * 1210 * @interface ListInterface 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @crossplatform 1213 * @form 1214 * @since 10 1215 */ 1216/** 1217 * The list interface is extended. 1218 * 1219 * @interface ListInterface 1220 * @syscap SystemCapability.ArkUI.ArkUI.Full 1221 * @crossplatform 1222 * @form 1223 * @atomicservice 1224 * @since arkts {'1.1':'11','1.2':'20'} 1225 * @arkts 1.1&1.2 1226 */ 1227interface ListInterface { 1228 /** 1229 * Called when interface data is called. 1230 * 1231 * @param { object } value 1232 * @returns { ListAttribute } 1233 * @syscap SystemCapability.ArkUI.ArkUI.Full 1234 * @since 7 1235 */ 1236 /** 1237 * Called when interface data is called. 1238 * 1239 * @param { object } value 1240 * @returns { ListAttribute } 1241 * @syscap SystemCapability.ArkUI.ArkUI.Full 1242 * @form 1243 * @since 9 1244 */ 1245 /** 1246 * Called when interface data is called. 1247 * 1248 * @param { object } value 1249 * @returns { ListAttribute } 1250 * @syscap SystemCapability.ArkUI.ArkUI.Full 1251 * @crossplatform 1252 * @form 1253 * @since 10 1254 */ 1255 /** 1256 * Called when interface data is called. 1257 * 1258 * @param { object } value 1259 * @returns { ListAttribute } 1260 * @syscap SystemCapability.ArkUI.ArkUI.Full 1261 * @crossplatform 1262 * @form 1263 * @atomicservice 1264 * @since 11 1265 */ 1266 /** 1267 * Called when interface data is called. 1268 * Anonymous Object Rectification. 1269 * 1270 * @param { ListOptions } [options] - list options 1271 * @returns { ListAttribute } 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @form 1275 * @atomicservice 1276 * @since arkts {'1.1':'18','1.2':'20'} 1277 * @arkts 1.1&1.2 1278 */ 1279 (options?: ListOptions): ListAttribute; 1280} 1281 1282/** 1283 * Defines the divider style of the list or list item group. 1284 * 1285 * @interface ListDividerOptions 1286 * @syscap SystemCapability.ArkUI.ArkUI.Full 1287 * @crossplatform 1288 * @form 1289 * @atomicservice 1290 * @since arkts {'1.1':'18','1.2':'20'} 1291 * @arkts 1.1&1.2 1292 */ 1293declare interface ListDividerOptions { 1294 /** 1295 * Set strokeWidth. 1296 * 1297 * @type { Length } 1298 * @syscap SystemCapability.ArkUI.ArkUI.Full 1299 * @since 7 1300 */ 1301 /** 1302 * Set strokeWidth. 1303 * 1304 * @type { Length } 1305 * @syscap SystemCapability.ArkUI.ArkUI.Full 1306 * @form 1307 * @since 9 1308 */ 1309 /** 1310 * Set strokeWidth. 1311 * 1312 * @type { Length } 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @crossplatform 1315 * @form 1316 * @since 10 1317 */ 1318 /** 1319 * Set strokeWidth. 1320 * 1321 * @type { Length } 1322 * @syscap SystemCapability.ArkUI.ArkUI.Full 1323 * @crossplatform 1324 * @form 1325 * @atomicservice 1326 * @since 11 1327 */ 1328 /** 1329 * Width of the divider. 1330 * Anonymous Object Rectification. 1331 * 1332 * @type { Length } 1333 * @syscap SystemCapability.ArkUI.ArkUI.Full 1334 * @crossplatform 1335 * @form 1336 * @atomicservice 1337 * @since arkts {'1.1':'18','1.2':'20'} 1338 * @arkts 1.1&1.2 1339 */ 1340 strokeWidth: Length; 1341 /** 1342 * Set color. 1343 * 1344 * @type { ?ResourceColor } 1345 * @syscap SystemCapability.ArkUI.ArkUI.Full 1346 * @since 7 1347 */ 1348 /** 1349 * Set color. 1350 * 1351 * @type { ?ResourceColor } 1352 * @syscap SystemCapability.ArkUI.ArkUI.Full 1353 * @form 1354 * @since 9 1355 */ 1356 /** 1357 * Set color. 1358 * 1359 * @type { ?ResourceColor } 1360 * @syscap SystemCapability.ArkUI.ArkUI.Full 1361 * @crossplatform 1362 * @form 1363 * @since 10 1364 */ 1365 /** 1366 * Set color. 1367 * 1368 * @type { ?ResourceColor } 1369 * @syscap SystemCapability.ArkUI.ArkUI.Full 1370 * @crossplatform 1371 * @form 1372 * @atomicservice 1373 * @since 11 1374 */ 1375 /** 1376 * Color of the divider. 1377 * Anonymous Object Rectification. 1378 * 1379 * @type { ?ResourceColor } 1380 * @default 0x08000000 1381 * @syscap SystemCapability.ArkUI.ArkUI.Full 1382 * @crossplatform 1383 * @form 1384 * @atomicservice 1385 * @since arkts {'1.1':'18','1.2':'20'} 1386 * @arkts 1.1&1.2 1387 */ 1388 color?: ResourceColor; 1389 /** 1390 * Set startMargin. 1391 * 1392 * @type { ?Length } 1393 * @syscap SystemCapability.ArkUI.ArkUI.Full 1394 * @since 7 1395 */ 1396 /** 1397 * Set startMargin. 1398 * 1399 * @type { ?Length } 1400 * @syscap SystemCapability.ArkUI.ArkUI.Full 1401 * @form 1402 * @since 9 1403 */ 1404 /** 1405 * Set startMargin. 1406 * 1407 * @type { ?Length } 1408 * @syscap SystemCapability.ArkUI.ArkUI.Full 1409 * @crossplatform 1410 * @form 1411 * @since 10 1412 */ 1413 /** 1414 * Set startMargin. 1415 * 1416 * @type { ?Length } 1417 * @syscap SystemCapability.ArkUI.ArkUI.Full 1418 * @crossplatform 1419 * @form 1420 * @atomicservice 1421 * @since 11 1422 */ 1423 /** 1424 * Distance between the divider and the start edge of the list. 1425 * Anonymous Object Rectification. 1426 * 1427 * @type { ?Length } 1428 * @default 0vp 1429 * @syscap SystemCapability.ArkUI.ArkUI.Full 1430 * @crossplatform 1431 * @form 1432 * @atomicservice 1433 * @since arkts {'1.1':'18','1.2':'20'} 1434 * @arkts 1.1&1.2 1435 */ 1436 startMargin?: Length; 1437 /** 1438 * Set endMargin. 1439 * 1440 * @type { ?Length } 1441 * @syscap SystemCapability.ArkUI.ArkUI.Full 1442 * @since 7 1443 */ 1444 /** 1445 * Set endMargin. 1446 * 1447 * @type { ?Length } 1448 * @syscap SystemCapability.ArkUI.ArkUI.Full 1449 * @form 1450 * @since 9 1451 */ 1452 /** 1453 * Set endMargin. 1454 * 1455 * @type { ?Length } 1456 * @syscap SystemCapability.ArkUI.ArkUI.Full 1457 * @crossplatform 1458 * @form 1459 * @since 10 1460 */ 1461 /** 1462 * Set endMargin. 1463 * 1464 * @type { ?Length } 1465 * @syscap SystemCapability.ArkUI.ArkUI.Full 1466 * @crossplatform 1467 * @form 1468 * @atomicservice 1469 * @since 11 1470 */ 1471 /** 1472 * Distance between the divider and the end edge of the list. 1473 * Anonymous Object Rectification. 1474 * 1475 * @type { ?Length } 1476 * @default 0vp 1477 * @syscap SystemCapability.ArkUI.ArkUI.Full 1478 * @crossplatform 1479 * @form 1480 * @atomicservice 1481 * @since arkts {'1.1':'18','1.2':'20'} 1482 * @arkts 1.1&1.2 1483 */ 1484 endMargin?: Length; 1485} 1486 1487/** 1488 * @extends CommonMethod<ListAttribute> 1489 * @syscap SystemCapability.ArkUI.ArkUI.Full 1490 * @since 7 1491 */ 1492/** 1493 * @extends CommonMethod<ListAttribute> 1494 * @syscap SystemCapability.ArkUI.ArkUI.Full 1495 * @form 1496 * @since 9 1497 */ 1498/** 1499 * @extends CommonMethod<ListAttribute> 1500 * @syscap SystemCapability.ArkUI.ArkUI.Full 1501 * @crossplatform 1502 * @form 1503 * @since 10 1504 */ 1505/** 1506 * @extends ScrollableCommonMethod<ListAttribute> 1507 * @syscap SystemCapability.ArkUI.ArkUI.Full 1508 * @crossplatform 1509 * @form 1510 * @atomicservice 1511 * @since arkts {'1.1':'11','1.2':'20'} 1512 * @arkts 1.1&1.2 1513 */ 1514declare class ListAttribute extends ScrollableCommonMethod<ListAttribute> { 1515 /** 1516 * Called when need to decide how much lanes the list will show. 1517 * 1518 * @param { number | LengthConstrain } value 1519 * @returns { ListAttribute } 1520 * @syscap SystemCapability.ArkUI.ArkUI.Full 1521 * @form 1522 * @since 9 1523 */ 1524 /** 1525 * Called when need to decide how much lanes the list will show. 1526 * 1527 * @param { number | LengthConstrain } value 1528 * @param { Dimension } gutter 1529 * @returns { ListAttribute } 1530 * @syscap SystemCapability.ArkUI.ArkUI.Full 1531 * @crossplatform 1532 * @form 1533 * @since 10 1534 */ 1535 /** 1536 * Sets the number of columns or rows in the list. If the value is set to the gutter type, it indicates the gap between columns. 1537 * It takes effect when the number of columns is greater than 1. 1538 * 1539 * @param { number | LengthConstrain } value - Number of columns or rows in the list.<br>Default value: <em>1</em> 1540 * @param { Dimension } gutter - Gap between columns.<br>Default value: <em>0</em> 1541 * @returns { ListAttribute } 1542 * @syscap SystemCapability.ArkUI.ArkUI.Full 1543 * @crossplatform 1544 * @form 1545 * @atomicservice 1546 * @since arkts {'1.1':'11','1.2':'20'} 1547 * @arkts 1.1&1.2 1548 */ 1549 lanes(value: number | LengthConstrain, gutter?: Dimension): ListAttribute; 1550 1551 /** 1552 * Called when need to decide how to align lanes in the direction of the cross axis. 1553 * 1554 * @param { ListItemAlign } value 1555 * @returns { ListAttribute } 1556 * @syscap SystemCapability.ArkUI.ArkUI.Full 1557 * @form 1558 * @since 9 1559 */ 1560 /** 1561 * Called when need to decide how to align lanes in the direction of the cross axis. 1562 * 1563 * @param { ListItemAlign } value 1564 * @returns { ListAttribute } 1565 * @syscap SystemCapability.ArkUI.ArkUI.Full 1566 * @crossplatform 1567 * @form 1568 * @since 10 1569 */ 1570 /** 1571 * Alignment mode of list items along the cross axis when the cross-axis width of the list is greater 1572 * than the cross-axis width of list items multiplied by the value of lanes. 1573 * 1574 * @param { ListItemAlign } value - Alignment mode of list items along the cross axis.<br>Default value: <em>ListItemAlign.Start</em> 1575 * @returns { ListAttribute } 1576 * @syscap SystemCapability.ArkUI.ArkUI.Full 1577 * @crossplatform 1578 * @form 1579 * @atomicservice 1580 * @since arkts {'1.1':'11','1.2':'20'} 1581 * @arkts 1.1&1.2 1582 */ 1583 alignListItem(value: ListItemAlign): ListAttribute; 1584 1585 /** 1586 * Called when the arrangement direction of the list component is set. 1587 * 1588 * @param { Axis } value 1589 * @returns { ListAttribute } 1590 * @syscap SystemCapability.ArkUI.ArkUI.Full 1591 * @since 7 1592 */ 1593 /** 1594 * Called when the arrangement direction of the list component is set. 1595 * 1596 * @param { Axis } value 1597 * @returns { ListAttribute } 1598 * @syscap SystemCapability.ArkUI.ArkUI.Full 1599 * @form 1600 * @since 9 1601 */ 1602 /** 1603 * Called when the arrangement direction of the list component is set. 1604 * 1605 * @param { Axis } value 1606 * @returns { ListAttribute } 1607 * @syscap SystemCapability.ArkUI.ArkUI.Full 1608 * @crossplatform 1609 * @form 1610 * @since 10 1611 */ 1612 /** 1613 * Sets the direction in which the list items are arranged. 1614 * 1615 * @param { Axis } value - Direction in which the list items are arranged.<br>Default value: <em>Axis.Vertical</em> 1616 * @returns { ListAttribute } 1617 * @syscap SystemCapability.ArkUI.ArkUI.Full 1618 * @crossplatform 1619 * @form 1620 * @atomicservice 1621 * @since arkts {'1.1':'11','1.2':'20'} 1622 * @arkts 1.1&1.2 1623 */ 1624 listDirection(value: Axis): ListAttribute; 1625 1626 /** 1627 * Called when the display mode of the side slider is set. 1628 * 1629 * @param { BarState } value 1630 * @returns { ListAttribute } 1631 * @syscap SystemCapability.ArkUI.ArkUI.Full 1632 * @since 7 1633 */ 1634 /** 1635 * Called when the display mode of the side slider is set. 1636 * 1637 * @param { BarState } value 1638 * @returns { ListAttribute } 1639 * @syscap SystemCapability.ArkUI.ArkUI.Full 1640 * @form 1641 * @since 9 1642 */ 1643 /** 1644 * Called when the display mode of the side slider is set. 1645 * 1646 * @param { BarState } value 1647 * @returns { ListAttribute } 1648 * @syscap SystemCapability.ArkUI.ArkUI.Full 1649 * @crossplatform 1650 * @form 1651 * @since 10 1652 */ 1653 /** 1654 * Sets the scrollbar state. 1655 * 1656 * @param { BarState } value - Scrollbar state. 1657 * <br><em>NOTE</em> 1658 * <br>Default value: <em>BarState.Auto</em> 1659 * @returns { ListAttribute } 1660 * @syscap SystemCapability.ArkUI.ArkUI.Full 1661 * @crossplatform 1662 * @form 1663 * @atomicservice 1664 * @since 11 1665 */ 1666 scrollBar(value: BarState): ListAttribute; 1667 1668 /** 1669 * Called when the sliding effect is set. 1670 * 1671 * @param { EdgeEffect } value 1672 * @returns { ListAttribute } 1673 * @syscap SystemCapability.ArkUI.ArkUI.Full 1674 * @since 7 1675 */ 1676 /** 1677 * Called when the sliding effect is set. 1678 * 1679 * @param { EdgeEffect } value 1680 * @returns { ListAttribute } 1681 * @syscap SystemCapability.ArkUI.ArkUI.Full 1682 * @form 1683 * @since 9 1684 */ 1685 /** 1686 * Called when the sliding effect is set. 1687 * 1688 * @param { EdgeEffect } value 1689 * @returns { ListAttribute } 1690 * @syscap SystemCapability.ArkUI.ArkUI.Full 1691 * @crossplatform 1692 * @form 1693 * @since 10 1694 */ 1695 /** 1696 * Sets the effect used when the scroll boundary is reached. 1697 * 1698 * <p><strong>NOTE</strong>: 1699 * <br>- By default, this component can produce a bounce effect only when there is more than one screen of content. 1700 * To produce a bounce effect when there is less than one screen of content, 1701 * use the <em>options</em> parameter of the <em>edgeEffect</em> attribute. 1702 * </p> 1703 * 1704 * @param { EdgeEffect } value - Effect used when the scroll boundary is reached. The spring and shadow effects are supported. 1705 * <br>Default value: <em>EdgeEffect.Spring</em> 1706 * @param { EdgeEffectOptions } options - Whether to enable the scroll effect when the component content is smaller than the component itself. 1707 * The value <em>{ alwaysEnabled: true }</em> means to enable the scroll effect, and <em>{ alwaysEnabled: false }</em> means the opposite. 1708 * <br>Default value: <em>{ alwaysEnabled: false }</em> 1709 * @returns { ListAttribute } 1710 * @syscap SystemCapability.ArkUI.ArkUI.Full 1711 * @crossplatform 1712 * @form 1713 * @atomicservice 1714 * @since 11 1715 */ 1716 edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): ListAttribute; 1717 1718 1719 /** 1720 * Called when need to decide contentStartOffset the list will show. 1721 * @param { number } value - the value Of startOffset. 1722 * @returns { ListAttribute } the attribute of the list. 1723 * @syscap SystemCapability.ArkUI.ArkUI.Full 1724 * @crossplatform 1725 * @since 11 1726 */ 1727 /** 1728 * Sets the offset from the start of the list content to the boundary of the list display area. 1729 * @param { number } value - Offset from the start of the list content to the boundary of the list display 1730 * <br>Default value: <em>0</em> 1731 * @returns { ListAttribute } the attribute of the list. 1732 * @syscap SystemCapability.ArkUI.ArkUI.Full 1733 * @crossplatform 1734 * @atomicservice 1735 * @since arkts {'1.1':'12','1.2':'20'} 1736 * @arkts 1.1&1.2 1737 */ 1738 contentStartOffset(value: number): ListAttribute; 1739 1740 /** 1741 * Called when need to decide contentEndOffset the list will show. 1742 * @param { number } value - the value Of endOffset. 1743 * @returns { ListAttribute } the attribute of the list. 1744 * @syscap SystemCapability.ArkUI.ArkUI.Full 1745 * @crossplatform 1746 * @since 11 1747 */ 1748 /** 1749 * Sets the offset from the end of the list content to the boundary of the list display area. 1750 * 1751 * @param { number } value - Offset from the end of the list content to the boundary of the list display area. 1752 * <br>Default value: <em>0</em> 1753 * @returns { ListAttribute } the attribute of the list. 1754 * @syscap SystemCapability.ArkUI.ArkUI.Full 1755 * @crossplatform 1756 * @atomicservice 1757 * @since arkts {'1.1':'12','1.2':'20'} 1758 * @arkts 1.1&1.2 1759 */ 1760 contentEndOffset(value: number): ListAttribute; 1761 1762 /** 1763 * Called when the ListItem split line style is set. 1764 * 1765 * @param { object | null } value 1766 * @returns { ListAttribute } 1767 * @syscap SystemCapability.ArkUI.ArkUI.Full 1768 * @since 7 1769 */ 1770 /** 1771 * Called when the ListItem split line style is set. 1772 * 1773 * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value 1774 * @returns { ListAttribute } 1775 * @syscap SystemCapability.ArkUI.ArkUI.Full 1776 * @form 1777 * @since 9 1778 */ 1779 /** 1780 * Called when the ListItem split line style is set. 1781 * 1782 * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value 1783 * @returns { ListAttribute } 1784 * @syscap SystemCapability.ArkUI.ArkUI.Full 1785 * @crossplatform 1786 * @form 1787 * @since 10 1788 */ 1789 /** 1790 * Called when the ListItem split line style is set. 1791 * 1792 * @param { {strokeWidth: Length;color?: ResourceColor;startMargin?: Length;endMargin?: Length;} | null } value 1793 * @returns { ListAttribute } 1794 * @syscap SystemCapability.ArkUI.ArkUI.Full 1795 * @crossplatform 1796 * @form 1797 * @atomicservice 1798 * @since 11 1799 */ 1800 /** 1801 * Sets the style of the divider for the list items. By default, there is no divider. 1802 * Anonymous Object Rectification. 1803 * 1804 * @param { ListDividerOptions | null } value - Style of the divider for the list items.<br>Default value: <em>null</em> 1805 * @returns { ListAttribute } 1806 * @syscap SystemCapability.ArkUI.ArkUI.Full 1807 * @crossplatform 1808 * @form 1809 * @atomicservice 1810 * @since arkts {'1.1':'18','1.2':'20'} 1811 * @arkts 1.1&1.2 1812 */ 1813 divider( 1814 value: ListDividerOptions | null, 1815 ): ListAttribute; 1816 1817 /** 1818 * Sets whether to enable edit mode. 1819 * 1820 * @param { boolean } value - Whether to enable edit mode.<br>Default value: <em>false</em> 1821 * @returns { ListAttribute } 1822 * @syscap SystemCapability.ArkUI.ArkUI.Full 1823 * @since 7 1824 * @deprecated since 9 1825 */ 1826 editMode(value: boolean): ListAttribute; 1827 1828 /** 1829 * Called when judging whether it is multiSelectable. 1830 * 1831 * @param { boolean } value 1832 * @returns { ListAttribute } 1833 * @syscap SystemCapability.ArkUI.ArkUI.Full 1834 * @since 8 1835 */ 1836 /** 1837 * Called when judging whether it is multiSelectable. 1838 * 1839 * @param { boolean } value 1840 * @returns { ListAttribute } 1841 * @syscap SystemCapability.ArkUI.ArkUI.Full 1842 * @form 1843 * @since 9 1844 */ 1845 /** 1846 * Called when judging whether it is multiSelectable. 1847 * 1848 * @param { boolean } value 1849 * @returns { ListAttribute } 1850 * @syscap SystemCapability.ArkUI.ArkUI.Full 1851 * @crossplatform 1852 * @form 1853 * @since 10 1854 */ 1855 /** 1856 * Sets whether to enable multiselect. 1857 * 1858 * @param { boolean } value - Whether to enable multiselect. 1859 * <br><em>false</em> (default): Multiselect is disabled. 1860 * <br><em>true</em>: Multiselect is enabled. 1861 * @returns { ListAttribute } 1862 * @syscap SystemCapability.ArkUI.ArkUI.Full 1863 * @crossplatform 1864 * @form 1865 * @atomicservice 1866 * @since arkts {'1.1':'11','1.2':'20'} 1867 * @arkts 1.1&1.2 1868 */ 1869 multiSelectable(value: boolean): ListAttribute; 1870 1871 /** 1872 * Called when the minimum number of list item caches is set for long list deferred loading. 1873 * 1874 * @param { number } value 1875 * @returns { ListAttribute } 1876 * @syscap SystemCapability.ArkUI.ArkUI.Full 1877 * @since 7 1878 */ 1879 /** 1880 * Called when the minimum number of list item caches is set for long list deferred loading. 1881 * 1882 * @param { number } value 1883 * @returns { ListAttribute } 1884 * @syscap SystemCapability.ArkUI.ArkUI.Full 1885 * @form 1886 * @since 9 1887 */ 1888 /** 1889 * Called when the minimum number of list item caches is set for long list deferred loading. 1890 * 1891 * @param { number } value 1892 * @returns { ListAttribute } 1893 * @syscap SystemCapability.ArkUI.ArkUI.Full 1894 * @crossplatform 1895 * @form 1896 * @since 10 1897 */ 1898 /** 1899 * Called when the minimum number of list item caches is set for long list deferred loading. 1900 * 1901 * @param { number } value - Number of list items to be preloaded. 1902 * <br>Default value: number of nodes visible on the screen, with the maximum value of 16 1903 * <br>Value range: [0, +∞) 1904 * @returns { ListAttribute } 1905 * @syscap SystemCapability.ArkUI.ArkUI.Full 1906 * @crossplatform 1907 * @form 1908 * @atomicservice 1909 * @since arkts {'1.1':'11','1.2':'20'} 1910 * @arkts 1.1&1.2 1911 */ 1912 cachedCount(value: number): ListAttribute; 1913 1914 /** 1915 * Sets the number of list items or list item groups to be cached (preloaded) and specifies whether to display the preloaded nodes. 1916 * 1917 * @param { number } count - Number of list items to be preloaded. 1918 * <br>Default value: number of nodes visible on the screen, with the maximum value of 16 1919 * <br>Value range: [0, +∞) 1920 * @param { boolean } show - Whether to display the preloaded list items.<br> Default value: <em>false</em> 1921 * @returns { ListAttribute } the attribute of the list. 1922 * @syscap SystemCapability.ArkUI.ArkUI.Full 1923 * @crossplatform 1924 * @form 1925 * @atomicservice 1926 * @since arkts {'1.1':'14','1.2':'20'} 1927 * @arkts 1.1&1.2 1928 */ 1929 cachedCount(count: number, show: boolean): ListAttribute; 1930 1931 /** 1932 * Called when setting whether to enable chain linkage dynamic effect. 1933 * 1934 * @param { boolean } value 1935 * @returns { ListAttribute } 1936 * @syscap SystemCapability.ArkUI.ArkUI.Full 1937 * @since 7 1938 */ 1939 /** 1940 * Called when setting whether to enable chain linkage dynamic effect. 1941 * 1942 * @param { boolean } value 1943 * @returns { ListAttribute } 1944 * @syscap SystemCapability.ArkUI.ArkUI.Full 1945 * @form 1946 * @since 9 1947 */ 1948 /** 1949 * Called when setting whether to enable chain linkage dynamic effect. 1950 * 1951 * @param { boolean } value 1952 * @returns { ListAttribute } 1953 * @syscap SystemCapability.ArkUI.ArkUI.Full 1954 * @crossplatform 1955 * @form 1956 * @since 10 1957 */ 1958 /** 1959 * Sets whether to enable chained animations, which provide a visually connected, 1960 * or "chained," effect when the list is scrolled or its top or bottom edge is dragged. 1961 * 1962 * @param { boolean } value - Whether to enable chained animations. 1963 * <br><em>false</em> (default): Chained animations are disabled. 1964 * <br><em>true</em>: Chained animations are enabled. 1965 * @returns { ListAttribute } 1966 * @syscap SystemCapability.ArkUI.ArkUI.Full 1967 * @crossplatform 1968 * @form 1969 * @atomicservice 1970 * @since arkts {'1.1':'11','1.2':'20'} 1971 * @arkts 1.1&1.2 1972 */ 1973 chainAnimation(value: boolean): ListAttribute; 1974 1975 /** 1976 * Called to setting chain linkage dynamic effect options. 1977 * 1978 * @param { ChainAnimationOptions } value - options of the chain animation. 1979 * @returns { ListAttribute } the attribute of the list. 1980 * @syscap SystemCapability.ArkUI.ArkUI.Full 1981 * @systemapi 1982 * @since arkts {'1.1':'10','1.2':'20'} 1983 * @arkts 1.1&1.2 1984 */ 1985 chainAnimationOptions(value: ChainAnimationOptions): ListAttribute; 1986 1987 /** 1988 * Called when header or footer of item group will be pinned. 1989 * 1990 * @param { StickyStyle } value 1991 * @returns { ListAttribute } 1992 * @syscap SystemCapability.ArkUI.ArkUI.Full 1993 * @form 1994 * @since 9 1995 */ 1996 /** 1997 * Called when header or footer of item group will be pinned. 1998 * 1999 * @param { StickyStyle } value 2000 * @returns { ListAttribute } 2001 * @syscap SystemCapability.ArkUI.ArkUI.Full 2002 * @crossplatform 2003 * @form 2004 * @since 10 2005 */ 2006 /** 2007 * Sets whether to pin the header to the top or the footer to the bottom in the list item group, 2008 * 2009 * <p><strong>NOTE</strong>: 2010 * <br>- Occasionally, after <em>sticky</em> is set, floating-point calculation precision may result in small gaps appearing during scrolling. 2011 * To address this issue, you can apply the pixelRound attribute to the current component, which rounds down the pixel values and help eliminate the gaps. 2012 * </p> 2013 * 2014 * @param { StickyStyle } value - Whether to pin the header to the top or the footer to the bottom in the list item group. 2015 * <br> Default value: <em>StickyStyle.None</em> 2016 * @returns { ListAttribute } 2017 * @syscap SystemCapability.ArkUI.ArkUI.Full 2018 * @crossplatform 2019 * @form 2020 * @atomicservice 2021 * @since arkts {'1.1':'11','1.2':'20'} 2022 * @arkts 1.1&1.2 2023 */ 2024 sticky(value: StickyStyle): ListAttribute; 2025 2026 /** 2027 * Called to set list item scroll end alignment effect. 2028 * 2029 * @param { ScrollSnapAlign } value - options of the list alignment effect. 2030 * @returns { ListAttribute } the attribute of the list. 2031 * @syscap SystemCapability.ArkUI.ArkUI.Full 2032 * @since 10 2033 */ 2034 /** 2035 * Sets the scroll snap alignment effect for list items. 2036 * This effect aligns list items to the nearest snap point when scrolling ends. 2037 * 2038 * @param { ScrollSnapAlign } value - Alignment mode of the scroll snap position.<br>Default value: <em>ScrollSnapAlign.NONE</em> 2039 * @returns { ListAttribute } the attribute of the list. 2040 * @syscap SystemCapability.ArkUI.ArkUI.Full 2041 * @crossplatform 2042 * @atomicservice 2043 * @since arkts {'1.1':'11','1.2':'20'} 2044 * @arkts 1.1&1.2 2045 */ 2046 scrollSnapAlign(value: ScrollSnapAlign): ListAttribute; 2047 2048 /** 2049 * Called to setting the nested scroll options. 2050 * 2051 * @param { NestedScrollOptions } value - options for nested scrolling. 2052 * @returns { ListAttribute } the attribute of the list. 2053 * @syscap SystemCapability.ArkUI.ArkUI.Full 2054 * @since 10 2055 */ 2056 /** 2057 * Sets the nested scrolling options. You can set the nested scrolling mode in the forward and backward 2058 * directions to implement scrolling linkage with the parent component. 2059 * 2060 * @param { NestedScrollOptions } value - Nested scrolling options. 2061 * @returns { ListAttribute } the attribute of the list. 2062 * @syscap SystemCapability.ArkUI.ArkUI.Full 2063 * @crossplatform 2064 * @atomicservice 2065 * @since 11 2066 */ 2067 nestedScroll(value: NestedScrollOptions): ListAttribute; 2068 2069 /** 2070 * Called when setting whether to enable scroll by gesture or mouse. 2071 * 2072 * @param { boolean } value 2073 * @returns { ListAttribute } The attribute of the list 2074 * @syscap SystemCapability.ArkUI.ArkUI.Full 2075 * @crossplatform 2076 * @since 10 2077 */ 2078 /** 2079 * Sets whether to support scroll gestures. When this attribute is set to <em>false</em>, 2080 * scrolling by finger or mouse is not supported, but the scroll controller API is not affected. 2081 * 2082 * @param { boolean } value - Whether to support scroll gestures.<br>Default value: <em>true</em> 2083 * @returns { ListAttribute } The attribute of the list 2084 * @syscap SystemCapability.ArkUI.ArkUI.Full 2085 * @crossplatform 2086 * @atomicservice 2087 * @since 11 2088 */ 2089 enableScrollInteraction(value: boolean): ListAttribute; 2090 2091 /** 2092 * Called to setting the friction. 2093 * 2094 * @param { number | Resource } value - options for scrolling friction. 2095 * @returns { ListAttribute } the attribute of the list. 2096 * @syscap SystemCapability.ArkUI.ArkUI.Full 2097 * @crossplatform 2098 * @since 10 2099 */ 2100 /** 2101 * Sets the friction coefficient. It applies only to gestures in the scrolling area, 2102 * and it affects only indirectly the scroll chaining during the inertial scrolling process. 2103 * A value less than or equal to 0 evaluates to the default value. 2104 * 2105 * @param { number | Resource } value - Friction coefficient. 2106 * <br>Default value: <em>0.9</em> for wearable devices and <em>0.6</em> for non-wearable devices. 2107 * <br>Since API version 11, the default value for non-wearable devices is <em>0.7</em>. 2108 * <br>Since API version 12, the default value for non-wearable devices is <em>0.75</em>. 2109 * @returns { ListAttribute } the attribute of the list. 2110 * @syscap SystemCapability.ArkUI.ArkUI.Full 2111 * @crossplatform 2112 * @atomicservice 2113 * @since 11 2114 */ 2115 friction(value: number | Resource): ListAttribute; 2116 2117 /** 2118 * Sets the size information of the child components of a <em>List</em> component along the main axis. 2119 * 2120 * @param { ChildrenMainSize } value - children main size for List 2121 * @returns { ListAttribute } the attribute of the list. 2122 * @syscap SystemCapability.ArkUI.ArkUI.Full 2123 * @crossplatform 2124 * @atomicservice 2125 * @since arkts {'1.1':'12','1.2':'20'} 2126 * @arkts 1.1&1.2 2127 */ 2128 childrenMainSize(value: ChildrenMainSize): ListAttribute; 2129 2130 /** 2131 * Sets whether the visible content position should remain unchanged when data is inserted or deleted above the visible area. 2132 * 2133 * <p><strong>NOTE</strong>: 2134 * <br>- The visible content position will only remain unchanged when <em>LazyForEach</em> is used to insert or delete data outside the visible area. 2135 * If <em>ForEach</em> is used to insert or delete data, or if <em>LazyForEach</em> is used for data reloading, 2136 * the visible content position will change even if <em>maintainVisibleContentPosition</em> is set to <em>true</em>. 2137 * <br>- When <em>maintainVisibleContentPosition</em> is set to <em>true</em>, 2138 * inserting or deleting data above the visible area will trigger <em>onDidScroll</em> and <em>onScrollIndex</em> events. 2139 * <br>- In a multi-column scenario, setting <em>maintainVisibleContentPosition</em> to <em>true</em> allows 2140 * you to insert or delete entire rows of data while keeping the visible content position unchanged. 2141 * If the insertion or deletion does not involve entire rows, however, the visible content position will still change. 2142 * </p> 2143 * 2144 * @param { boolean } enabled - Whether the visible content position should remain unchanged 2145 * when data is inserted or deleted above the visible area.<br>Default value: <em>false</em> 2146 * @returns { ListAttribute } the attribute of the list. 2147 * @syscap SystemCapability.ArkUI.ArkUI.Full 2148 * @crossplatform 2149 * @atomicservice 2150 * @since arkts {'1.1':'12','1.2':'20'} 2151 * @arkts 1.1&1.2 2152 */ 2153 maintainVisibleContentPosition(enabled: boolean): ListAttribute; 2154 2155 /** 2156 * Sets whether the list's layout starts from the bottom (end) rather than the top (beginning). 2157 * 2158 * <p><strong>NOTE</strong>: 2159 * <br>- When <em>stackFromEnd</em> is set to <em>true</em>, the following rules apply: 2160 * <br>If the content of the <em>List</em> component is shorter than the component height, 2161 * the content will be aligned to the bottom of the component. 2162 * <br>- If the height of a list item in the visible area changes, or if a new list item is inserted, 2163 * the list items above the changed or inserted item will move upwards to accommodate the new layout. 2164 * <br>- The default value of <em>initialIndex</em> becomes the total number of list items minus one. 2165 * </p> 2166 * 2167 * @param { boolean } enabled - Whether the list's layout starts from the bottom (end) rather than the top (beginning). 2168 * <br>Default value: <em>false</em> 2169 * @returns { ListAttribute } the attribute of the list. 2170 * @syscap SystemCapability.ArkUI.ArkUI.Full 2171 * @crossplatform 2172 * @atomicservice 2173 * @since arkts {'1.1':'19','1.2':'20'} 2174 * @arkts 1.1&1.2 2175 */ 2176 stackFromEnd(enabled: boolean): ListAttribute; 2177 2178 /** 2179 * Sets the focus wrap mode of the List component. 2180 * 2181 * @param { Optional<FocusWrapMode> } mode - the focus wrap mode of the List component. 2182 * <br>Default value: **FocusWrapMode.DEFAULT**. 2183 * @returns { ListAttribute } the attribute of the list. 2184 * @syscap SystemCapability.ArkUI.ArkUI.Full 2185 * @crossplatform 2186 * @atomicservice 2187 * @since 20 2188 */ 2189 focusWrapMode(mode: Optional<FocusWrapMode>): ListAttribute; 2190 2191 /** 2192 * Set whether to synchronously load child nodes within one frame. 2193 * 2194 * @param { boolean } enable - Whether to synchronously load child nodes within one frame 2195 * @returns { ListAttribute } The attribute of the list. 2196 * @syscap SystemCapability.ArkUI.ArkUI.Full 2197 * @crossplatform 2198 * @atomicservice 2199 * @since 20 2200 */ 2201 syncLoad(enable: boolean): ListAttribute; 2202 2203 /** 2204 * Called when the offset and status callback of the slide are set. 2205 * 2206 * @param { function } event 2207 * @returns { ListAttribute } 2208 * @syscap SystemCapability.ArkUI.ArkUI.Full 2209 * @since 7 2210 */ 2211 /** 2212 * Called when the offset and status callback of the slide are set. 2213 * 2214 * @param { function } event 2215 * @returns { ListAttribute } 2216 * @syscap SystemCapability.ArkUI.ArkUI.Full 2217 * @form 2218 * @since 9 2219 */ 2220 /** 2221 * Called when the offset and status callback of the slide are set. 2222 * 2223 * @param { function } event 2224 * @returns { ListAttribute } 2225 * @syscap SystemCapability.ArkUI.ArkUI.Full 2226 * @crossplatform 2227 * @form 2228 * @since 10 2229 */ 2230 /** 2231 * Triggered when the list scrolls. 2232 * 2233 * @param { function } event 2234 * @returns { ListAttribute } 2235 * @syscap SystemCapability.ArkUI.ArkUI.Full 2236 * @crossplatform 2237 * @form 2238 * @atomicservice 2239 * @since 11 2240 * @deprecated since 12 2241 * @useinstead common.ScrollableCommonMethod#onDidScroll 2242 */ 2243 onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): ListAttribute; 2244 2245 /** 2246 * Called when the start and end positions of the display change. 2247 * 2248 * @param { function } event 2249 * @returns { ListAttribute } 2250 * @syscap SystemCapability.ArkUI.ArkUI.Full 2251 * @since 7 2252 */ 2253 /** 2254 * Called when the start and end positions of the display change. 2255 * 2256 * @param { function } event 2257 * @returns { ListAttribute } 2258 * @syscap SystemCapability.ArkUI.ArkUI.Full 2259 * @form 2260 * @since 9 2261 */ 2262 /** 2263 * Called when the start and end positions of the display change. 2264 * 2265 * @param { function } event 2266 * @returns { ListAttribute } 2267 * @syscap SystemCapability.ArkUI.ArkUI.Full 2268 * @crossplatform 2269 * @form 2270 * @since 10 2271 */ 2272 /** 2273 * Triggered when a child component enters or leaves the list display area. 2274 * 2275 * @param { function } event 2276 * @returns { ListAttribute } 2277 * @syscap SystemCapability.ArkUI.ArkUI.Full 2278 * @crossplatform 2279 * @form 2280 * @atomicservice 2281 * @since arkts {'1.1':'11','1.2':'20'} 2282 * @arkts 1.1&1.2 2283 */ 2284 onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; 2285 2286 /** 2287 * Triggered when a child component enters or leaves the list display area. 2288 * 2289 * @param { OnScrollVisibleContentChangeCallback } handler - Callback invoked when the displayed content changes. 2290 * @returns { ListAttribute } 2291 * @syscap SystemCapability.ArkUI.ArkUI.Full 2292 * @crossplatform 2293 * @atomicservice 2294 * @since arkts {'1.1':'12','1.2':'20'} 2295 * @arkts 1.1&1.2 2296 */ 2297 onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; 2298 2299 /** 2300 * Called when the list begins to arrive. 2301 * 2302 * @param { function } event 2303 * @returns { ListAttribute } 2304 * @syscap SystemCapability.ArkUI.ArkUI.Full 2305 * @since 7 2306 */ 2307 /** 2308 * Called when the list begins to arrive. 2309 * 2310 * @param { function } event 2311 * @returns { ListAttribute } 2312 * @syscap SystemCapability.ArkUI.ArkUI.Full 2313 * @form 2314 * @since 9 2315 */ 2316 /** 2317 * Called when the list begins to arrive. 2318 * 2319 * @param { function } event 2320 * @returns { ListAttribute } 2321 * @syscap SystemCapability.ArkUI.ArkUI.Full 2322 * @crossplatform 2323 * @form 2324 * @since 10 2325 */ 2326 /** 2327 * Triggered when the list reaches the start position. 2328 * 2329 * @param { function } event 2330 * @returns { ListAttribute } 2331 * @syscap SystemCapability.ArkUI.ArkUI.Full 2332 * @crossplatform 2333 * @form 2334 * @atomicservice 2335 * @since 11 2336 */ 2337 onReachStart(event: () => void): ListAttribute; 2338 2339 /** 2340 * Called when the list reaches the end. 2341 * 2342 * @param { function } event 2343 * @returns { ListAttribute } 2344 * @syscap SystemCapability.ArkUI.ArkUI.Full 2345 * @since 7 2346 */ 2347 /** 2348 * Called when the list reaches the end. 2349 * 2350 * @param { function } event 2351 * @returns { ListAttribute } 2352 * @syscap SystemCapability.ArkUI.ArkUI.Full 2353 * @form 2354 * @since 9 2355 */ 2356 /** 2357 * Called when the list reaches the end. 2358 * 2359 * @param { function } event 2360 * @returns { ListAttribute } 2361 * @syscap SystemCapability.ArkUI.ArkUI.Full 2362 * @crossplatform 2363 * @form 2364 * @since 10 2365 */ 2366 /** 2367 * Triggered when the list reaches the end position. 2368 * 2369 * @param { function } event 2370 * @returns { ListAttribute } 2371 * @syscap SystemCapability.ArkUI.ArkUI.Full 2372 * @crossplatform 2373 * @form 2374 * @atomicservice 2375 * @since 11 2376 */ 2377 onReachEnd(event: () => void): ListAttribute; 2378 2379 /** 2380 * Called when the slider start. 2381 * 2382 * @param { function } event 2383 * @returns { ListAttribute } 2384 * @syscap SystemCapability.ArkUI.ArkUI.Full 2385 * @form 2386 * @since 9 2387 */ 2388 /** 2389 * Called when the slider start. 2390 * 2391 * @param { function } event 2392 * @returns { ListAttribute } 2393 * @syscap SystemCapability.ArkUI.ArkUI.Full 2394 * @crossplatform 2395 * @form 2396 * @since 10 2397 */ 2398 /** 2399 * Triggered when the list starts scrolling initiated by the user's finger dragging the list or its scrollbar. 2400 * This event is also triggered when the animation contained in the scrolling triggered by Scroller starts. 2401 * 2402 * @param { function } event 2403 * @returns { ListAttribute } 2404 * @syscap SystemCapability.ArkUI.ArkUI.Full 2405 * @crossplatform 2406 * @form 2407 * @atomicservice 2408 * @since 11 2409 */ 2410 onScrollStart(event: () => void): ListAttribute; 2411 2412 /** 2413 * Called when the slider stops. 2414 * 2415 * @param { function } event 2416 * @returns { ListAttribute } 2417 * @syscap SystemCapability.ArkUI.ArkUI.Full 2418 * @since 7 2419 */ 2420 /** 2421 * Called when the slider stops. 2422 * 2423 * @param { function } event 2424 * @returns { ListAttribute } 2425 * @syscap SystemCapability.ArkUI.ArkUI.Full 2426 * @form 2427 * @since 9 2428 */ 2429 /** 2430 * Called when the slider stops. 2431 * 2432 * @param { function } event 2433 * @returns { ListAttribute } 2434 * @syscap SystemCapability.ArkUI.ArkUI.Full 2435 * @crossplatform 2436 * @form 2437 * @since 10 2438 */ 2439 /** 2440 * Triggered when the list stops scrolling after the user's finger leaves the screen. 2441 * This event is also triggered when the animation contained in the scrolling triggered by Scroller stops. 2442 * 2443 * @param { function } event 2444 * @returns { ListAttribute } 2445 * @syscap SystemCapability.ArkUI.ArkUI.Full 2446 * @crossplatform 2447 * @form 2448 * @atomicservice 2449 * @since 11 2450 */ 2451 onScrollStop(event: () => void): ListAttribute; 2452 2453 /** 2454 * Triggered when a list item is deleted. 2455 * 2456 * @param { function } event 2457 * @returns { ListAttribute } 2458 * @syscap SystemCapability.ArkUI.ArkUI.Full 2459 * @since 7 2460 * @deprecated since 9 2461 */ 2462 onItemDelete(event: (index: number) => boolean): ListAttribute; 2463 2464 /** 2465 * Called when a list item is moved. 2466 * 2467 * @param { function } event 2468 * @returns { ListAttribute } 2469 * @syscap SystemCapability.ArkUI.ArkUI.Full 2470 * @since 7 2471 */ 2472 /** 2473 * Called when a list item is moved. 2474 * 2475 * @param { function } event 2476 * @returns { ListAttribute } 2477 * @syscap SystemCapability.ArkUI.ArkUI.Full 2478 * @crossplatform 2479 * @since 10 2480 */ 2481 /** 2482 * Triggered when a list item moves. 2483 * 2484 * @param { function } event 2485 * @returns { ListAttribute } 2486 * @syscap SystemCapability.ArkUI.ArkUI.Full 2487 * @crossplatform 2488 * @atomicservice 2489 * @since arkts {'1.1':'11','1.2':'20'} 2490 * @arkts 1.1&1.2 2491 */ 2492 onItemMove(event: (from: number, to: number) => boolean): ListAttribute; 2493 2494 /** 2495 * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. 2496 * (To be triggered, press and hold for 170 milliseconds (ms)) 2497 * 2498 * @param { function } event 2499 * @returns { ListAttribute } 2500 * @syscap SystemCapability.ArkUI.ArkUI.Full 2501 * @since 8 2502 */ 2503 /** 2504 * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. 2505 * (To be triggered, press and hold for 170 milliseconds (ms)) 2506 * 2507 * @param { function } event 2508 * @returns { ListAttribute } 2509 * @syscap SystemCapability.ArkUI.ArkUI.Full 2510 * @crossplatform 2511 * @since 10 2512 */ 2513 /** 2514 * Triggered when a list item starts to be dragged. 2515 * 2516 * @param { function } event 2517 * @returns { ListAttribute } 2518 * @syscap SystemCapability.ArkUI.ArkUI.Full 2519 * @crossplatform 2520 * @atomicservice 2521 * @since 11 2522 */ 2523 onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => ((() => any) | void)): ListAttribute; 2524 2525 /** 2526 * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. 2527 * (To be triggered, press and hold for 170 milliseconds (ms)) 2528 * 2529 * @param { OnItemDragStartCallback } event - callback function, triggered when the item drag start. 2530 * @returns { ListAttribute } Returns the instance of the ListAttribute. 2531 * @syscap SystemCapability.ArkUI.ArkUI.Full 2532 * @atomicservice 2533 * @since 20 2534 * @arkts 1.2 2535 */ 2536 onItemDragStart(event: OnItemDragStartCallback): ListAttribute; 2537 2538 /** 2539 * After binding, a callback is triggered when the component is dragged to the range of the component. 2540 * 2541 * @param { function } event 2542 * @returns { ListAttribute } 2543 * @syscap SystemCapability.ArkUI.ArkUI.Full 2544 * @since 8 2545 */ 2546 /** 2547 * After binding, a callback is triggered when the component is dragged to the range of the component. 2548 * 2549 * @param { function } event 2550 * @returns { ListAttribute } 2551 * @syscap SystemCapability.ArkUI.ArkUI.Full 2552 * @crossplatform 2553 * @since 10 2554 */ 2555 /** 2556 * Triggered when the dragged item enters the drop target of the list. 2557 * 2558 * @param { function } event 2559 * @returns { ListAttribute } 2560 * @syscap SystemCapability.ArkUI.ArkUI.Full 2561 * @crossplatform 2562 * @atomicservice 2563 * @since arkts {'1.1':'11','1.2':'20'} 2564 * @arkts 1.1&1.2 2565 */ 2566 onItemDragEnter(event: (event: ItemDragInfo) => void): ListAttribute; 2567 2568 /** 2569 * After binding, a callback is triggered when the drag moves within the range of a placeable component. 2570 * 2571 * @param { function } event 2572 * @returns { ListAttribute } 2573 * @syscap SystemCapability.ArkUI.ArkUI.Full 2574 * @since 8 2575 */ 2576 /** 2577 * After binding, a callback is triggered when the drag moves within the range of a placeable component. 2578 * 2579 * @param { function } event 2580 * @returns { ListAttribute } 2581 * @syscap SystemCapability.ArkUI.ArkUI.Full 2582 * @crossplatform 2583 * @since 10 2584 */ 2585 /** 2586 * Triggered when the dragged item moves over the drop target of the list. 2587 * 2588 * @param { function } event 2589 * @returns { ListAttribute } 2590 * @syscap SystemCapability.ArkUI.ArkUI.Full 2591 * @crossplatform 2592 * @atomicservice 2593 * @since arkts {'1.1':'11','1.2':'20'} 2594 * @arkts 1.1&1.2 2595 */ 2596 onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): ListAttribute; 2597 2598 /** 2599 * After binding, a callback is triggered when the component is dragged out of the component range. 2600 * 2601 * @param { function } event 2602 * @returns { ListAttribute } 2603 * @syscap SystemCapability.ArkUI.ArkUI.Full 2604 * @since 8 2605 */ 2606 /** 2607 * After binding, a callback is triggered when the component is dragged out of the component range. 2608 * 2609 * @param { function } event 2610 * @returns { ListAttribute } 2611 * @syscap SystemCapability.ArkUI.ArkUI.Full 2612 * @crossplatform 2613 * @since 10 2614 */ 2615 /** 2616 * Triggered when the dragged item leaves the drop target of the list. 2617 * 2618 * @param { function } event 2619 * @returns { ListAttribute } 2620 * @syscap SystemCapability.ArkUI.ArkUI.Full 2621 * @crossplatform 2622 * @atomicservice 2623 * @since arkts {'1.1':'11','1.2':'20'} 2624 * @arkts 1.1&1.2 2625 */ 2626 onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): ListAttribute; 2627 2628 /** 2629 * The component bound to this event can be used as the drag release target. 2630 * This callback is triggered when the drag behavior is stopped within the scope of the component. 2631 * 2632 * @param { function } event 2633 * @returns { ListAttribute } 2634 * @syscap SystemCapability.ArkUI.ArkUI.Full 2635 * @since 8 2636 */ 2637 /** 2638 * The component bound to this event can be used as the drag release target. 2639 * This callback is triggered when the drag behavior is stopped within the scope of the component. 2640 * 2641 * @param { function } event 2642 * @returns { ListAttribute } 2643 * @syscap SystemCapability.ArkUI.ArkUI.Full 2644 * @crossplatform 2645 * @since 10 2646 */ 2647 /** 2648 * Triggered when the dragged item is dropped on the drop target of the list. 2649 * 2650 * @param { function } event 2651 * @returns { ListAttribute } 2652 * @syscap SystemCapability.ArkUI.ArkUI.Full 2653 * @crossplatform 2654 * @atomicservice 2655 * @since arkts {'1.1':'11','1.2':'20'} 2656 * @arkts 1.1&1.2 2657 */ 2658 onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): ListAttribute; 2659 2660 /** 2661 * Called when scrolling begin each frame. 2662 * 2663 * @param { function } event 2664 * @returns { ListAttribute } 2665 * @syscap SystemCapability.ArkUI.ArkUI.Full 2666 * @form 2667 * @since 9 2668 */ 2669 /** 2670 * Called when scrolling begin each frame. 2671 * 2672 * @param { function } event 2673 * @returns { ListAttribute } 2674 * @syscap SystemCapability.ArkUI.ArkUI.Full 2675 * @crossplatform 2676 * @form 2677 * @since 10 2678 */ 2679 /** 2680 * Triggered when the list starts to scroll. The input parameters indicate the amount by which the list will scroll. 2681 * The event handler then works out the amount by which the list needs to scroll based on the real-world situation 2682 * and returns the result. 2683 * 2684 * @param { function } event 2685 * @returns { ListAttribute } 2686 * @syscap SystemCapability.ArkUI.ArkUI.Full 2687 * @crossplatform 2688 * @form 2689 * @atomicservice 2690 * @since 11 2691 */ 2692 /** 2693 * Triggered when the list starts to scroll. The input parameters indicate the amount by which the list will scroll. 2694 * The event handler then works out the amount by which the list needs to scroll based on the real-world situation 2695 * and returns the result. 2696 * Anonymous Object Rectification. 2697 * 2698 * @param { OnScrollFrameBeginCallback } event - callback function, triggered when the scrolling begin each frame. 2699 * @returns { ListAttribute } Returns the instance of the ListAttribute. 2700 * @syscap SystemCapability.ArkUI.ArkUI.Full 2701 * @crossplatform 2702 * @form 2703 * @atomicservice 2704 * @since 20 2705 */ 2706 onScrollFrameBegin(event: OnScrollFrameBeginCallback): ListAttribute; 2707 2708 /** 2709 * Called when scrolling begin each frame. 2710 * Anonymous Object Rectification. 2711 * 2712 * @param { OnScrollFrameBeginCallback } event - callback function, triggered when the scrolling begin each frame. 2713 * @returns { ListAttribute } Returns the instance of the ListAttribute. 2714 * @syscap SystemCapability.ArkUI.ArkUI.Full 2715 * @crossplatform 2716 * @form 2717 * @atomicservice 2718 * @since 20 2719 * @arkts 1.2 2720 */ 2721 onScrollFrameBegin(event: OnScrollFrameBeginCallback): ListAttribute; 2722 2723 /** 2724 * Called when the scrollable will scroll. 2725 * 2726 * @param { Optional<OnWillScrollCallback> } handler - callback of scrollable. 2727 * @returns { ListAttribute } 2728 * @syscap SystemCapability.ArkUI.ArkUI.Full 2729 * @atomicservice 2730 * @since 20 2731 * @arkts 1.2 2732 */ 2733 onWillScroll(handler: Optional<OnWillScrollCallback>): ListAttribute; 2734 2735 /** 2736 * Called when the scrollable did scroll. 2737 * 2738 * @param { OnScrollCallback } handler - callback of scrollable, 2739 * scrollOffset is offset this frame did scroll, scrollState is current scroll state. 2740 * @returns { ListAttribute } 2741 * @syscap SystemCapability.ArkUI.ArkUI.Full 2742 * @form 2743 * @atomicservice 2744 * @since 20 2745 * @arkts 1.2 2746 */ 2747 onDidScroll(handler: OnScrollCallback): ListAttribute; 2748} 2749 2750/** 2751 * Defines List Component. 2752 * 2753 * @syscap SystemCapability.ArkUI.ArkUI.Full 2754 * @since 7 2755 */ 2756/** 2757 * Defines List Component. 2758 * 2759 * @syscap SystemCapability.ArkUI.ArkUI.Full 2760 * @form 2761 * @since 9 2762 */ 2763/** 2764 * Defines List Component. 2765 * 2766 * @syscap SystemCapability.ArkUI.ArkUI.Full 2767 * @crossplatform 2768 * @form 2769 * @since 10 2770 */ 2771/** 2772 * Defines List Component. 2773 * 2774 * @syscap SystemCapability.ArkUI.ArkUI.Full 2775 * @crossplatform 2776 * @form 2777 * @atomicservice 2778 * @since 11 2779 */ 2780/** 2781 * Defines List Component. 2782 * It is recommended to use LazyForEach or Repeat to generate child components. 2783 * 2784 * @syscap SystemCapability.ArkUI.ArkUI.Full 2785 * @crossplatform 2786 * @form 2787 * @atomicservice 2788 * @since 20 2789 */ 2790declare const List: ListInterface; 2791 2792/** 2793 * Defines List Component instance. 2794 * 2795 * @syscap SystemCapability.ArkUI.ArkUI.Full 2796 * @since 7 2797 */ 2798/** 2799 * Defines List Component instance. 2800 * 2801 * @syscap SystemCapability.ArkUI.ArkUI.Full 2802 * @form 2803 * @since 9 2804 */ 2805/** 2806 * Defines List Component instance. 2807 * 2808 * @syscap SystemCapability.ArkUI.ArkUI.Full 2809 * @crossplatform 2810 * @form 2811 * @since 10 2812 */ 2813/** 2814 * Defines List Component instance. 2815 * 2816 * @syscap SystemCapability.ArkUI.ArkUI.Full 2817 * @crossplatform 2818 * @form 2819 * @atomicservice 2820 * @since 11 2821 */ 2822declare const ListInstance: ListAttribute; 2823