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/** 22 * CommonModifier 23 * 24 * @typedef { import('../api/arkui/CommonModifier').CommonModifier } CommonModifier 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @crossplatform 27 * @atomicservice 28 * @since 15 29 */ 30declare type CommonModifier = import('../api/arkui/CommonModifier').CommonModifier; 31 32/** 33 * Declare the graphic format of the bar chart. 34 * 35 * @enum { number } 36 * @syscap SystemCapability.ArkUI.ArkUI.Full 37 * @since 7 38 */ 39/** 40 * Declare the graphic format of the bar chart. 41 * 42 * @enum { number } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 10 46 */ 47/** 48 * Declare the graphic format of the bar chart. 49 * 50 * @enum { number } 51 * @syscap SystemCapability.ArkUI.ArkUI.Full 52 * @crossplatform 53 * @atomicservice 54 * @since 11 55 */ 56declare enum BarMode { 57 /** 58 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 59 * 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @since 7 62 */ 63 /** 64 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 65 * 66 * @syscap SystemCapability.ArkUI.ArkUI.Full 67 * @crossplatform 68 * @since 10 69 */ 70 /** 71 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 72 * 73 * @syscap SystemCapability.ArkUI.ArkUI.Full 74 * @crossplatform 75 * @atomicservice 76 * @since 11 77 */ 78 Scrollable = 0, 79 80 /** 81 * The width of all TabBars is evenly allocated. 82 * 83 * @syscap SystemCapability.ArkUI.ArkUI.Full 84 * @since 7 85 */ 86 /** 87 * The width of all TabBars is evenly allocated. 88 * 89 * @syscap SystemCapability.ArkUI.ArkUI.Full 90 * @crossplatform 91 * @since 10 92 */ 93 /** 94 * The width of all TabBars is evenly allocated. 95 * 96 * @syscap SystemCapability.ArkUI.ArkUI.Full 97 * @crossplatform 98 * @atomicservice 99 * @since 11 100 */ 101 Fixed = 1, 102} 103 104/** 105 * Declare the animation mode of tab content. 106 * 107 * @enum { number } 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since 12 112 */ 113declare enum AnimationMode { 114 /** 115 * Start animation after tabcontent is fully measured. 116 * 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @atomicservice 120 * @since 12 121 */ 122 CONTENT_FIRST = 0, 123 124 /** 125 * Start animation before tabcontent is fully measured. 126 * 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @crossplatform 129 * @atomicservice 130 * @since 12 131 */ 132 ACTION_FIRST = 1, 133 134 /** 135 * Disable default animation. 136 * 137 * @syscap SystemCapability.ArkUI.ArkUI.Full 138 * @crossplatform 139 * @atomicservice 140 * @since 12 141 */ 142 NO_ANIMATION = 2, 143 144 /** 145 * Jump to some index near the target without animation, then start animation after tabcontent is fully measured. 146 * 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @crossplatform 149 * @atomicservice 150 * @since 15 151 */ 152 CONTENT_FIRST_WITH_JUMP = 3, 153 154 /** 155 * Jump to some index near the target without animation, then start animation before tabcontent is fully measured. 156 * 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @atomicservice 160 * @since 15 161 */ 162 ACTION_FIRST_WITH_JUMP = 4, 163} 164 165/** 166 * Declare the location of the bar chart. 167 * 168 * @enum { number } 169 * @syscap SystemCapability.ArkUI.ArkUI.Full 170 * @since 7 171 */ 172/** 173 * Declare the location of the bar chart. 174 * 175 * @enum { number } 176 * @syscap SystemCapability.ArkUI.ArkUI.Full 177 * @crossplatform 178 * @since 10 179 */ 180/** 181 * Declare the location of the bar chart. 182 * 183 * @enum { number } 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @crossplatform 186 * @atomicservice 187 * @since 11 188 */ 189declare enum BarPosition { 190 /** 191 * When the vertical attribute method is set to true, the tab is on the left of the container. When the vertical property method is set to false, the tab is at the top of the container. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @since 7 195 */ 196 /** 197 * When the vertical attribute method is set to true, the tab is on the left of the container. When the vertical property method is set to false, the tab is at the top of the container. 198 * 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @crossplatform 201 * @since 10 202 */ 203 /** 204 * When the vertical attribute method is set to true, the tab is on the left of the container. When the vertical property method is set to false, the tab is at the top of the container. 205 * 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @atomicservice 209 * @since 11 210 */ 211 Start, 212 213 /** 214 * When the vertical attribute method is set to true, the tab is located on the right of the container. When the vertical property method is set to false, the tab is at the bottom of the container. 215 * 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @since 7 218 */ 219 /** 220 * When the vertical attribute method is set to true, the tab is located on the right of the container. When the vertical property method is set to false, the tab is at the bottom of the container. 221 * 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @since 10 225 */ 226 /** 227 * When the vertical attribute method is set to true, the tab is located on the right of the container. When the vertical property method is set to false, the tab is at the bottom of the container. 228 * 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @atomicservice 232 * @since 11 233 */ 234 End, 235} 236 237/** 238 * Declare the layout style of the tab bar items. 239 * 240 * @enum { number } 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @since 10 244 */ 245/** 246 * Declare the layout style of the tab bar items. 247 * 248 * @enum { number } 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @crossplatform 251 * @atomicservice 252 * @since 11 253 */ 254declare enum LayoutStyle { 255 /** 256 * The tab bar items are laid in the center of the tab bar. 257 * 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @crossplatform 260 * @since 10 261 */ 262 /** 263 * The tab bar items are laid in the center of the tab bar. 264 * 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @crossplatform 267 * @atomicservice 268 * @since 11 269 */ 270 ALWAYS_CENTER = 0, 271 /** 272 * The tab bar items are laid in the tab bar by an average split. 273 * 274 * @syscap SystemCapability.ArkUI.ArkUI.Full 275 * @crossplatform 276 * @since 10 277 */ 278 /** 279 * The tab bar items are laid in the tab bar by an average split. 280 * 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @crossplatform 283 * @atomicservice 284 * @since 11 285 */ 286 ALWAYS_AVERAGE_SPLIT = 1, 287 /** 288 * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. 289 * Otherwise, they are laid in the center half of the tab bar with the same space between them. 290 * 291 * @syscap SystemCapability.ArkUI.ArkUI.Full 292 * @crossplatform 293 * @since 10 294 */ 295 /** 296 * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. 297 * Otherwise, they are laid in the center half of the tab bar with the same space between them. 298 * 299 * @syscap SystemCapability.ArkUI.ArkUI.Full 300 * @crossplatform 301 * @atomicservice 302 * @since 11 303 */ 304 SPACE_BETWEEN_OR_CENTER = 2 305} 306 307/** 308 * Provides methods for switching tabs. 309 * 310 * @syscap SystemCapability.ArkUI.ArkUI.Full 311 * @since 7 312 */ 313/** 314 * Provides methods for switching tabs. 315 * 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @crossplatform 318 * @since 10 319 */ 320/** 321 * Provides methods for switching tabs. 322 * 323 * @syscap SystemCapability.ArkUI.ArkUI.Full 324 * @crossplatform 325 * @atomicservice 326 * @since 11 327 */ 328declare class TabsController { 329 /** 330 * constructor. 331 * 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @since 7 334 */ 335 /** 336 * constructor. 337 * 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @since 10 341 */ 342 /** 343 * constructor. 344 * 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @atomicservice 348 * @since 11 349 */ 350 constructor(); 351 352 /** 353 * Called when the tab is switched. 354 * 355 * @param { number } value 356 * @syscap SystemCapability.ArkUI.ArkUI.Full 357 * @since 7 358 */ 359 /** 360 * Called when the tab is switched. 361 * 362 * @param { number } value 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @since 10 366 */ 367 /** 368 * Called when the tab is switched. 369 * 370 * @param { number } value 371 * @syscap SystemCapability.ArkUI.ArkUI.Full 372 * @crossplatform 373 * @atomicservice 374 * @since 11 375 */ 376 changeIndex(value: number): void; 377 378 /** 379 * Called when need to preload specified tab content. 380 * 381 * @param { Optional<Array<number>> } indices - Indices of tab content to be preloaded. 382 * @returns { Promise<void> } The promise returned by the function. 383 * @throws { BusinessError } 401 - Parameter invalid. Possible causes: 384 * <br> 1. The parameter type is not Array<number>. 385 * <br> 2. The parameter is an empty array. 386 * <br> 3. The parameter contains an invalid index. 387 * @syscap SystemCapability.ArkUI.ArkUI.Full 388 * @crossplatform 389 * @atomicservice 390 * @since 12 391 */ 392 preloadItems(indices: Optional<Array<number>>): Promise<void>; 393 394 /** 395 * Set tab bar translate. 396 * 397 * @param { TranslateOptions } translate - translate options 398 * @syscap SystemCapability.ArkUI.ArkUI.Full 399 * @crossplatform 400 * @atomicservice 401 * @since 13 402 */ 403 setTabBarTranslate(translate: TranslateOptions): void; 404 405 /** 406 * Set tab bar opacity. 407 * 408 * @param { number } opacity - opacity 409 * @syscap SystemCapability.ArkUI.ArkUI.Full 410 * @crossplatform 411 * @atomicservice 412 * @since 13 413 */ 414 setTabBarOpacity(opacity: number): void; 415} 416 417/** 418 * Options used to create Tabs. 419 * 420 * @typedef TabsOptions 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @atomicservice 424 * @since 15 425 */ 426declare interface TabsOptions { 427 /** 428 * Set the tab location for Tabs. 429 * 430 * @type { ?BarPosition } 431 * @syscap SystemCapability.ArkUI.ArkUI.Full 432 * @since 7 433 */ 434 /** 435 * Set the tab location for Tabs. 436 * 437 * @type { ?BarPosition } 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @crossplatform 440 * @since 10 441 */ 442 /** 443 * Set the tab location for Tabs. 444 * 445 * @type { ?BarPosition } 446 * @syscap SystemCapability.ArkUI.ArkUI.Full 447 * @crossplatform 448 * @atomicservice 449 * @since 11 450 */ 451 barPosition?: BarPosition; 452 453 /** 454 * Set the index of the currently displayed tab. 455 * 456 * @type { ?number } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @since 7 459 */ 460 /** 461 * Set the index of the currently displayed tab. 462 * 463 * @type { ?number } 464 * @syscap SystemCapability.ArkUI.ArkUI.Full 465 * @crossplatform 466 * @since 10 467 */ 468 /** 469 * Set the index of the currently displayed tab. 470 * 471 * @type { ?number } 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @crossplatform 474 * @atomicservice 475 * @since 11 476 */ 477 index?: number; 478 479 /** 480 * Set the Tabs controller. 481 * 482 * @type { ?TabsController } 483 * @syscap SystemCapability.ArkUI.ArkUI.Full 484 * @since 7 485 */ 486 /** 487 * Set the Tabs controller. 488 * 489 * @type { ?TabsController } 490 * @syscap SystemCapability.ArkUI.ArkUI.Full 491 * @crossplatform 492 * @since 10 493 */ 494 /** 495 * Set the Tabs controller. 496 * 497 * @type { ?TabsController } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @atomicservice 501 * @since 11 502 */ 503 controller?: TabsController 504 505 /** 506 * Set common attributes to tabbar. 507 * 508 * @type { ?CommonModifier } 509 * @syscap SystemCapability.ArkUI.ArkUI.Full 510 * @crossplatform 511 * @atomicservice 512 * @since 15 513 */ 514 barModifier?: CommonModifier 515} 516 517/** 518 * Provides an interface for switching views. 519 * 520 * @interface TabsInterface 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @since 7 523 */ 524/** 525 * Provides an interface for switching views. 526 * 527 * @interface TabsInterface 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @since 10 531 */ 532/** 533 * Provides an interface for switching views. 534 * 535 * @interface TabsInterface 536 * @syscap SystemCapability.ArkUI.ArkUI.Full 537 * @crossplatform 538 * @atomicservice 539 * @since 11 540 */ 541interface TabsInterface { 542 /** 543 * Called when the view is switched. 544 * 545 * @param { object } value 546 * @returns { TabsAttribute } 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @since 7 549 */ 550 /** 551 * Called when the view is switched. 552 * 553 * @param { object } value 554 * @returns { TabsAttribute } 555 * @syscap SystemCapability.ArkUI.ArkUI.Full 556 * @crossplatform 557 * @since 10 558 */ 559 /** 560 * Called when the view is switched. 561 * 562 * @param { object } value 563 * @returns { TabsAttribute } 564 * @syscap SystemCapability.ArkUI.ArkUI.Full 565 * @crossplatform 566 * @atomicservice 567 * @since 11 568 */ 569 /** 570 * Called when the view is switched. 571 * 572 * @param { TabsOptions } [options] - Tabs options. 573 * @returns { TabsAttribute } 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @atomicservice 577 * @since 15 578 */ 579 (options?: TabsOptions): TabsAttribute; 580} 581 582/** 583 * Provides an interface for the style of an divider including stroke width, color, start margin 584 * and end margin 585 * 586 * @interface DividerStyle 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @crossplatform 589 * @since 10 590 */ 591/** 592 * Provides an interface for the style of an divider including stroke width, color, start margin 593 * and end margin 594 * 595 * @interface DividerStyle 596 * @syscap SystemCapability.ArkUI.ArkUI.Full 597 * @crossplatform 598 * @atomicservice 599 * @since 11 600 */ 601interface DividerStyle { 602 /** 603 * Define the stroke width of the divider 604 * 605 * @type { Length } 606 * @default 0 607 * @syscap SystemCapability.ArkUI.ArkUI.Full 608 * @crossplatform 609 * @since 10 610 */ 611 /** 612 * Define the stroke width of the divider 613 * 614 * @type { Length } 615 * @default 0 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @crossplatform 618 * @atomicservice 619 * @since 11 620 */ 621 strokeWidth: Length; 622 623 /** 624 * Define the color of the divider 625 * 626 * @type { ?ResourceColor } 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @since 10 630 */ 631 /** 632 * Define the color of the divider 633 * 634 * @type { ?ResourceColor } 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @crossplatform 637 * @atomicservice 638 * @since 11 639 */ 640 color?: ResourceColor; 641 642 /** 643 * Define the start margin of the divider 644 * 645 * @type { ?Length } 646 * @default 0 647 * @syscap SystemCapability.ArkUI.ArkUI.Full 648 * @crossplatform 649 * @since 10 650 */ 651 /** 652 * Define the start margin of the divider 653 * 654 * @type { ?Length } 655 * @default 0 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @crossplatform 658 * @atomicservice 659 * @since 11 660 */ 661 startMargin?: Length; 662 663 /** 664 * Define the end margin of the divider 665 * 666 * @type { ?Length } 667 * @default 0 668 * @syscap SystemCapability.ArkUI.ArkUI.Full 669 * @crossplatform 670 * @since 10 671 */ 672 /** 673 * Define the end margin of the divider 674 * 675 * @type { ?Length } 676 * @default 0 677 * @syscap SystemCapability.ArkUI.ArkUI.Full 678 * @crossplatform 679 * @atomicservice 680 * @since 11 681 */ 682 endMargin?: Length; 683} 684 685/** 686 * Provides an interface for tabs animation. 687 * 688 * @interface TabsAnimationEvent 689 * @syscap SystemCapability.ArkUI.ArkUI.Full 690 * @crossplatform 691 * @since 11 692 */ 693/** 694 * Provides an interface for tabs animation. 695 * 696 * @interface TabsAnimationEvent 697 * @syscap SystemCapability.ArkUI.ArkUI.Full 698 * @crossplatform 699 * @atomicservice 700 * @since 12 701 */ 702declare interface TabsAnimationEvent { 703 /** 704 * Offset of the current page to the start position of the tabs main axis. The unit is vp. 705 * 706 * @type { number } 707 * @default 0.0 vp 708 * @syscap SystemCapability.ArkUI.ArkUI.Full 709 * @crossplatform 710 * @since 11 711 */ 712 /** 713 * Offset of the current page to the start position of the tabs main axis. The unit is vp. 714 * 715 * @type { number } 716 * @default 0.0 vp 717 * @syscap SystemCapability.ArkUI.ArkUI.Full 718 * @crossplatform 719 * @atomicservice 720 * @since 12 721 */ 722 currentOffset: number; 723 724 /** 725 * Offset of the target page to the start position of the tabs main axis. The unit is vp. 726 * 727 * @type { number } 728 * @default 0.0 vp 729 * @syscap SystemCapability.ArkUI.ArkUI.Full 730 * @crossplatform 731 * @since 11 732 */ 733 /** 734 * Offset of the target page to the start position of the tabs main axis. The unit is vp. 735 * 736 * @type { number } 737 * @default 0.0 vp 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @atomicservice 741 * @since 12 742 */ 743 targetOffset: number; 744 745 /** 746 * Start speed of the page-turning animation. The unit is vp/s. 747 * 748 * @type { number } 749 * @default 0.0 vp/s 750 * @syscap SystemCapability.ArkUI.ArkUI.Full 751 * @crossplatform 752 * @since 11 753 */ 754 /** 755 * Start speed of the page-turning animation. The unit is vp/s. 756 * 757 * @type { number } 758 * @default 0.0 vp/s 759 * @syscap SystemCapability.ArkUI.ArkUI.Full 760 * @crossplatform 761 * @atomicservice 762 * @since 12 763 */ 764 velocity: number; 765} 766 767/** 768 * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. 769 * 770 * @interface BarGridColumnOptions 771 * @syscap SystemCapability.ArkUI.ArkUI.Full 772 * @crossplatform 773 * @since 10 774 */ 775/** 776 * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. 777 * 778 * @interface BarGridColumnOptions 779 * @syscap SystemCapability.ArkUI.ArkUI.Full 780 * @crossplatform 781 * @atomicservice 782 * @since 11 783 */ 784interface BarGridColumnOptions { 785 /** 786 * Define the occupied column number when the screen is of small size 787 * 788 * @type { ?number } 789 * @syscap SystemCapability.ArkUI.ArkUI.Full 790 * @crossplatform 791 * @since 10 792 */ 793 /** 794 * Define the occupied column number when the screen is of small size 795 * 796 * @type { ?number } 797 * @syscap SystemCapability.ArkUI.ArkUI.Full 798 * @crossplatform 799 * @atomicservice 800 * @since 11 801 */ 802 sm?: number; 803 804 /** 805 * Define the occupied column number when the screen is of middle size 806 * 807 * @type { ?number } 808 * @syscap SystemCapability.ArkUI.ArkUI.Full 809 * @crossplatform 810 * @since 10 811 */ 812 /** 813 * Define the occupied column number when the screen is of middle size 814 * 815 * @type { ?number } 816 * @syscap SystemCapability.ArkUI.ArkUI.Full 817 * @crossplatform 818 * @atomicservice 819 * @since 11 820 */ 821 md?: number; 822 823 /** 824 * Define the occupied column number when the screen is of large size 825 * 826 * @type { ?number } 827 * @syscap SystemCapability.ArkUI.ArkUI.Full 828 * @crossplatform 829 * @since 10 830 */ 831 /** 832 * Define the occupied column number when the screen is of large size 833 * 834 * @type { ?number } 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @atomicservice 838 * @since 11 839 */ 840 lg?: number; 841 842 /** 843 * Define the margin size of the columns 844 * 845 * @type { ?Dimension } 846 * @syscap SystemCapability.ArkUI.ArkUI.Full 847 * @crossplatform 848 * @since 10 849 */ 850 /** 851 * Define the margin size of the columns 852 * 853 * @type { ?Dimension } 854 * @syscap SystemCapability.ArkUI.ArkUI.Full 855 * @crossplatform 856 * @atomicservice 857 * @since 11 858 */ 859 margin?: Dimension; 860 861 /** 862 * Define the gutter size of the columns 863 * 864 * @type { ?Dimension } 865 * @syscap SystemCapability.ArkUI.ArkUI.Full 866 * @crossplatform 867 * @since 10 868 */ 869 /** 870 * Define the gutter size of the columns 871 * 872 * @type { ?Dimension } 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @atomicservice 876 * @since 11 877 */ 878 gutter?: Dimension; 879} 880 881/** 882 * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. 883 * 884 * @interface ScrollableBarModeOptions 885 * @syscap SystemCapability.ArkUI.ArkUI.Full 886 * @crossplatform 887 * @since 10 888 */ 889/** 890 * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. 891 * 892 * @interface ScrollableBarModeOptions 893 * @syscap SystemCapability.ArkUI.ArkUI.Full 894 * @crossplatform 895 * @atomicservice 896 * @since 11 897 */ 898interface ScrollableBarModeOptions { 899 /** 900 * Define the margin size of the bar items when the tab bar is scrollable. 901 * 902 * @type { ?Dimension } 903 * @syscap SystemCapability.ArkUI.ArkUI.Full 904 * @crossplatform 905 * @since 10 906 */ 907 /** 908 * Define the margin size of the bar items when the tab bar is scrollable. 909 * 910 * @type { ?Dimension } 911 * @syscap SystemCapability.ArkUI.ArkUI.Full 912 * @crossplatform 913 * @atomicservice 914 * @since 11 915 */ 916 margin?: Dimension; 917 918 /** 919 * Define the layout style of the bar items when the tab bar is not scrollable. 920 * 921 * @type { ?LayoutStyle } 922 * @syscap SystemCapability.ArkUI.ArkUI.Full 923 * @crossplatform 924 * @since 10 925 */ 926 /** 927 * Define the layout style of the bar items when the tab bar is not scrollable. 928 * 929 * @type { ?LayoutStyle } 930 * @syscap SystemCapability.ArkUI.ArkUI.Full 931 * @crossplatform 932 * @atomicservice 933 * @since 11 934 */ 935 nonScrollableLayoutStyle?: LayoutStyle; 936} 937 938/** 939 * Defines a tabs callback when onAnimationStart. 940 * 941 * @typedef { function } OnTabsAnimationStartCallback 942 * @param { number } index - The index value of the tab that when animation start. 943 * @param { number } targetIndex - The target index value of the tab that when animation start. 944 * @param { TabsAnimationEvent } extraInfo - The extra callback info. 945 * @syscap SystemCapability.ArkUI.ArkUI.Full 946 * @crossplatform 947 * @atomicservice 948 * @since 18 949 */ 950declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; 951 952/** 953 * Defines a tabs callback when onAnimationEnd. 954 * 955 * @typedef { function } OnTabsAnimationEndCallback 956 * @param { number } index - The index value of the tab that when animation end. 957 * @param { TabsAnimationEvent } extraInfo - The extra callback info. 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @crossplatform 960 * @atomicservice 961 * @since 18 962 */ 963declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; 964 965/** 966 * Defines a tabs callback when onGestureSwipe. 967 * 968 * @typedef { function } OnTabsGestureSwipeCallback 969 * @param { number } index - The index value of the tab before gesture swipe. 970 * @param { TabsAnimationEvent } extraInfo - The extra callback info. 971 * @syscap SystemCapability.ArkUI.ArkUI.Full 972 * @crossplatform 973 * @atomicservice 974 * @since 18 975 */ 976declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; 977 978/** 979 * Defines a tabs callback when customContentTransition. 980 * 981 * @typedef { function } TabsCustomContentTransitionCallback 982 * @param { number } from - The index value of the current tab when the animation begins. 983 * @param { number } to - The index value of the target tab when the animation begins. 984 * @returns { TabContentAnimatedTransition | undefined } Returns animated transition options of tab or undefined. 985 * @syscap SystemCapability.ArkUI.ArkUI.Full 986 * @crossplatform 987 * @atomicservice 988 * @since 18 989 */ 990declare type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; 991 992/** 993 * Defines a tabs callback when onContentWillChange. 994 * 995 * @typedef { function } OnTabsContentWillChangeCallback 996 * @param { number } currentIndex - The index value of the current tab. 997 * @param { number } comingIndex - The index value of the tab that will change. 998 * @returns { boolean } 999 * Tabs can change from currentIndex to comingIndex if function return true. 1000 * Tabs can not change from currentIndex to comingIndex if function return false. 1001 * @syscap SystemCapability.ArkUI.ArkUI.Full 1002 * @crossplatform 1003 * @atomicservice 1004 * @since 18 1005 */ 1006declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; 1007 1008/** 1009 * Defines the tabs attribute functions. 1010 * 1011 * @extends CommonMethod<TabsAttribute> 1012 * @syscap SystemCapability.ArkUI.ArkUI.Full 1013 * @since 7 1014 */ 1015/** 1016 * Defines the tabs attribute functions. 1017 * 1018 * @extends CommonMethod<TabsAttribute> 1019 * @syscap SystemCapability.ArkUI.ArkUI.Full 1020 * @crossplatform 1021 * @since 10 1022 */ 1023/** 1024 * Defines the tabs attribute functions. 1025 * 1026 * @extends CommonMethod<TabsAttribute> 1027 * @syscap SystemCapability.ArkUI.ArkUI.Full 1028 * @crossplatform 1029 * @atomicservice 1030 * @since 11 1031 */ 1032declare class TabsAttribute extends CommonMethod<TabsAttribute> { 1033 /** 1034 * Called when determining whether the tab is vertical. 1035 * 1036 * @param { boolean } value 1037 * @returns { TabsAttribute } 1038 * @syscap SystemCapability.ArkUI.ArkUI.Full 1039 * @since 7 1040 */ 1041 /** 1042 * Called when determining whether the tab is vertical. 1043 * 1044 * @param { boolean } value 1045 * @returns { TabsAttribute } 1046 * @syscap SystemCapability.ArkUI.ArkUI.Full 1047 * @crossplatform 1048 * @since 10 1049 */ 1050 /** 1051 * Called when determining whether the tab is vertical. 1052 * 1053 * @param { boolean } value 1054 * @returns { TabsAttribute } 1055 * @syscap SystemCapability.ArkUI.ArkUI.Full 1056 * @crossplatform 1057 * @atomicservice 1058 * @since 11 1059 */ 1060 vertical(value: boolean): TabsAttribute; 1061 1062 /** 1063 * Called when determining the location of the bar chart. 1064 * 1065 * @param { BarPosition } value 1066 * @returns { TabsAttribute } 1067 * @syscap SystemCapability.ArkUI.ArkUI.Full 1068 * @since 9 1069 */ 1070 /** 1071 * Called when determining the location of the bar chart. 1072 * 1073 * @param { BarPosition } value 1074 * @returns { TabsAttribute } 1075 * @syscap SystemCapability.ArkUI.ArkUI.Full 1076 * @crossplatform 1077 * @since 10 1078 */ 1079 /** 1080 * Called when determining the location of the bar chart. 1081 * 1082 * @param { BarPosition } value 1083 * @returns { TabsAttribute } 1084 * @syscap SystemCapability.ArkUI.ArkUI.Full 1085 * @crossplatform 1086 * @atomicservice 1087 * @since 11 1088 */ 1089 barPosition(value: BarPosition): TabsAttribute; 1090 1091 /** 1092 * Called when judging whether page switching can be performed by sliding left and right. 1093 * 1094 * @param { boolean } value 1095 * @returns { TabsAttribute } 1096 * @syscap SystemCapability.ArkUI.ArkUI.Full 1097 * @since 7 1098 */ 1099 /** 1100 * Called when judging whether page switching can be performed by sliding left and right. 1101 * 1102 * @param { boolean } value 1103 * @returns { TabsAttribute } 1104 * @syscap SystemCapability.ArkUI.ArkUI.Full 1105 * @crossplatform 1106 * @since 10 1107 */ 1108 /** 1109 * Called when judging whether page switching can be performed by sliding left and right. 1110 * 1111 * @param { boolean } value 1112 * @returns { TabsAttribute } 1113 * @syscap SystemCapability.ArkUI.ArkUI.Full 1114 * @crossplatform 1115 * @atomicservice 1116 * @since 11 1117 */ 1118 scrollable(value: boolean): TabsAttribute; 1119 1120 /** 1121 * Called when the graphic format of the bar chart is selected as fixed mode. 1122 * 1123 * @param { BarMode.Fixed } value 1124 * @returns { TabsAttribute } 1125 * @syscap SystemCapability.ArkUI.ArkUI.Full 1126 * @crossplatform 1127 * @since 10 1128 */ 1129 /** 1130 * Called when the graphic format of the bar chart is selected as fixed mode. 1131 * 1132 * @param { BarMode.Fixed } value 1133 * @returns { TabsAttribute } 1134 * @syscap SystemCapability.ArkUI.ArkUI.Full 1135 * @crossplatform 1136 * @atomicservice 1137 * @since 11 1138 */ 1139 barMode(value: BarMode.Fixed): TabsAttribute; 1140 1141 /** 1142 * Called when the graphic format of the bar chart is selected as scrollable mode. 1143 * 1144 * @param { BarMode.Scrollable } value 1145 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 1146 * @returns { TabsAttribute } 1147 * @syscap SystemCapability.ArkUI.ArkUI.Full 1148 * @crossplatform 1149 * @since 10 1150 */ 1151 /** 1152 * Called when the graphic format of the bar chart is selected as scrollable mode. 1153 * 1154 * @param { BarMode.Scrollable } value 1155 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 1156 * @returns { TabsAttribute } 1157 * @syscap SystemCapability.ArkUI.ArkUI.Full 1158 * @crossplatform 1159 * @atomicservice 1160 * @since 11 1161 */ 1162 barMode(value: BarMode.Scrollable, options: ScrollableBarModeOptions): TabsAttribute; 1163 1164 /** 1165 * Called when the graphic format of the bar chart is selected. 1166 * 1167 * @param { BarMode } value 1168 * @returns { TabsAttribute } 1169 * @syscap SystemCapability.ArkUI.ArkUI.Full 1170 * @since 7 1171 */ 1172 /** 1173 * Called when the graphic format of the bar chart is selected. 1174 * 1175 * @param { BarMode } value 1176 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 1177 * @returns { TabsAttribute } 1178 * @syscap SystemCapability.ArkUI.ArkUI.Full 1179 * @crossplatform 1180 * @since 10 1181 */ 1182 /** 1183 * Called when the graphic format of the bar chart is selected. 1184 * 1185 * @param { BarMode } value 1186 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 1187 * @returns { TabsAttribute } 1188 * @syscap SystemCapability.ArkUI.ArkUI.Full 1189 * @crossplatform 1190 * @atomicservice 1191 * @since 11 1192 */ 1193 barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; 1194 1195 /** 1196 * Called when the width of the bar graph is set. 1197 * Notice: barWidth only supports Number type. 1198 * 1199 * @param { number } value 1200 * @returns { TabsAttribute } 1201 * @syscap SystemCapability.ArkUI.ArkUI.Full 1202 * @since 7 1203 */ 1204 /** 1205 * Called when the width of the bar graph is set. 1206 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 1207 * 1208 * @param { Length } value 1209 * @returns { TabsAttribute } 1210 * @syscap SystemCapability.ArkUI.ArkUI.Full 1211 * @since 8 1212 */ 1213 /** 1214 * Called when the width of the bar graph is set. 1215 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 1216 * 1217 * @param { Length } value 1218 * @returns { TabsAttribute } 1219 * @syscap SystemCapability.ArkUI.ArkUI.Full 1220 * @crossplatform 1221 * @since 10 1222 */ 1223 /** 1224 * Called when the width of the bar graph is set. 1225 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 1226 * 1227 * @param { Length } value 1228 * @returns { TabsAttribute } 1229 * @syscap SystemCapability.ArkUI.ArkUI.Full 1230 * @crossplatform 1231 * @atomicservice 1232 * @since 11 1233 */ 1234 barWidth(value: Length): TabsAttribute; 1235 1236 /** 1237 * Called when the height of the bar graph is set. 1238 * Notice: barHeight only supports Number type. 1239 * 1240 * @param { number } value 1241 * @returns { TabsAttribute } 1242 * @syscap SystemCapability.ArkUI.ArkUI.Full 1243 * @since 7 1244 */ 1245 /** 1246 * Called when the height of the bar graph is set. 1247 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1248 * 1249 * @param { Length } value 1250 * @returns { TabsAttribute } 1251 * @syscap SystemCapability.ArkUI.ArkUI.Full 1252 * @since 8 1253 */ 1254 /** 1255 * Called when the height of the bar graph is set. 1256 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1257 * 1258 * @param { Length } value 1259 * @returns { TabsAttribute } 1260 * @syscap SystemCapability.ArkUI.ArkUI.Full 1261 * @crossplatform 1262 * @since 10 1263 */ 1264 /** 1265 * Called when the height of the bar graph is set. 1266 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1267 * 1268 * @param { Length } value 1269 * @returns { TabsAttribute } 1270 * @syscap SystemCapability.ArkUI.ArkUI.Full 1271 * @crossplatform 1272 * @atomicservice 1273 * @since 11 1274 */ 1275 barHeight(value: Length): TabsAttribute; 1276 1277 /** 1278 * Called when the animation duration of the bar graph is set. 1279 * 1280 * @param { number } value 1281 * @returns { TabsAttribute } 1282 * @syscap SystemCapability.ArkUI.ArkUI.Full 1283 * @since 7 1284 */ 1285 /** 1286 * Called when the animation duration of the bar graph is set. 1287 * 1288 * @param { number } value 1289 * @returns { TabsAttribute } 1290 * @syscap SystemCapability.ArkUI.ArkUI.Full 1291 * @crossplatform 1292 * @since 10 1293 */ 1294 /** 1295 * Called when the animation duration of the bar graph is set. 1296 * 1297 * @param { number } value 1298 * @returns { TabsAttribute } 1299 * @syscap SystemCapability.ArkUI.ArkUI.Full 1300 * @crossplatform 1301 * @atomicservice 1302 * @since 11 1303 */ 1304 animationDuration(value: number): TabsAttribute; 1305 1306 /** 1307 * Set animation mode. 1308 * 1309 * @param { Optional<AnimationMode> } mode - animation mode for tabs switch animation 1310 * @returns { TabsAttribute } 1311 * @syscap SystemCapability.ArkUI.ArkUI.Full 1312 * @crossplatform 1313 * @atomicservice 1314 * @since 12 1315 */ 1316 animationMode(mode: Optional<AnimationMode>): TabsAttribute; 1317 1318 /** 1319 * Set the effect used when the component is at one of the edges. 1320 * 1321 * @param { Optional<EdgeEffect> } edgeEffect - the effect used when the component is at one of the edges 1322 * @returns { TabsAttribute } 1323 * @syscap SystemCapability.ArkUI.ArkUI.Full 1324 * @crossplatform 1325 * @atomicservice 1326 * @since 12 1327 */ 1328 edgeEffect(edgeEffect: Optional<EdgeEffect>): TabsAttribute; 1329 1330 /** 1331 * Called when the tab is switched. 1332 * 1333 * @param { function } event 1334 * @returns { TabsAttribute } 1335 * @syscap SystemCapability.ArkUI.ArkUI.Full 1336 * @since 7 1337 */ 1338 /** 1339 * Called when the tab is switched. 1340 * 1341 * @param { function } event 1342 * @returns { TabsAttribute } 1343 * @syscap SystemCapability.ArkUI.ArkUI.Full 1344 * @crossplatform 1345 * @since 10 1346 */ 1347 /** 1348 * Called when the tab is switched. 1349 * 1350 * @param { function } event 1351 * @returns { TabsAttribute } 1352 * @syscap SystemCapability.ArkUI.ArkUI.Full 1353 * @crossplatform 1354 * @atomicservice 1355 * @since 11 1356 */ 1357 /** 1358 * Called when the tab is switched. 1359 * Anonymous Object Rectification 1360 * 1361 * @param { Callback<number> } event 1362 * @returns { TabsAttribute } 1363 * @syscap SystemCapability.ArkUI.ArkUI.Full 1364 * @crossplatform 1365 * @atomicservice 1366 * @since 18 1367 */ 1368 onChange(event: Callback<number>): TabsAttribute; 1369 1370 /** 1371 * Called when a new tab becomes selected. Animation is not necessarily complete. 1372 * 1373 * @param { Callback<number> } event - callback to notify which index has been selected 1374 * @returns { TabsAttribute } 1375 * @syscap SystemCapability.ArkUI.ArkUI.Full 1376 * @crossplatform 1377 * @atomicservice 1378 * @since 18 1379 */ 1380 onSelected(event: Callback<number>): TabsAttribute; 1381 1382 /** 1383 * Called when the tab is clicked. 1384 * 1385 * @param { function } event 1386 * @returns { TabsAttribute } 1387 * @syscap SystemCapability.ArkUI.ArkUI.Full 1388 * @crossplatform 1389 * @since 10 1390 */ 1391 /** 1392 * Called when the tab is clicked. 1393 * 1394 * @param { function } event 1395 * @returns { TabsAttribute } 1396 * @syscap SystemCapability.ArkUI.ArkUI.Full 1397 * @crossplatform 1398 * @atomicservice 1399 * @since 11 1400 */ 1401 /** 1402 * Called when the tab is clicked. 1403 * Anonymous Object Rectification 1404 * 1405 * @param { Callback<number> } event 1406 * @returns { TabsAttribute } 1407 * @syscap SystemCapability.ArkUI.ArkUI.Full 1408 * @crossplatform 1409 * @atomicservice 1410 * @since 18 1411 */ 1412 onTabBarClick(event: Callback<number>): TabsAttribute; 1413 1414 /** 1415 * Called when a new tab becomes unselected. Animation is not necessarily complete. 1416 * 1417 * @param { Callback<number> } event - callback to notify which index has been unselected 1418 * @returns { TabsAttribute } 1419 * @syscap SystemCapability.ArkUI.ArkUI.Full 1420 * @crossplatform 1421 * @atomicservice 1422 * @since 18 1423 */ 1424 onUnselected(event: Callback<number>): TabsAttribute; 1425 1426 /** 1427 * Called when the tab content flip animation start. 1428 * 1429 * @param { function } handler - 1430 * "index": the index value of the tab that when animation start. 1431 * "targetIndex": the target index value of the tab that when animation start. 1432 * "event": the animation event callback info. 1433 * @returns { TabsAttribute } 1434 * @syscap SystemCapability.ArkUI.ArkUI.Full 1435 * @crossplatform 1436 * @since 11 1437 */ 1438 /** 1439 * Called when the tab content flip animation start. 1440 * 1441 * @param { function } handler - 1442 * "index": the index value of the tab that when animation start. 1443 * "targetIndex": the target index value of the tab that when animation start. 1444 * "event": the animation event callback info. 1445 * @returns { TabsAttribute } 1446 * @syscap SystemCapability.ArkUI.ArkUI.Full 1447 * @crossplatform 1448 * @atomicservice 1449 * @since 12 1450 */ 1451 /** 1452 * Called when the tab content flip animation start. 1453 * Anonymous Object Rectification 1454 * 1455 * @param { OnTabsAnimationStartCallback } handler 1456 * @returns { TabsAttribute } 1457 * @syscap SystemCapability.ArkUI.ArkUI.Full 1458 * @crossplatform 1459 * @atomicservice 1460 * @since 18 1461 */ 1462 onAnimationStart(handler: OnTabsAnimationStartCallback): TabsAttribute; 1463 1464 /** 1465 * Called when the tab content flip animation end. 1466 * 1467 * @param { function } handler - 1468 * "index": the index value of the tab that when animation start. 1469 * "event": the animation event callback info. 1470 * @returns { TabsAttribute } 1471 * @syscap SystemCapability.ArkUI.ArkUI.Full 1472 * @crossplatform 1473 * @since 11 1474 */ 1475 /** 1476 * Called when the tab content flip animation end. 1477 * 1478 * @param { function } handler - 1479 * "index": the index value of the tab that when animation start. 1480 * "event": the animation event callback info. 1481 * @returns { TabsAttribute } 1482 * @syscap SystemCapability.ArkUI.ArkUI.Full 1483 * @crossplatform 1484 * @atomicservice 1485 * @since 12 1486 */ 1487 /** 1488 * Called when the tab content flip animation end. 1489 * Anonymous Object Rectification 1490 * 1491 * @param { OnTabsAnimationEndCallback } handler 1492 * @returns { TabsAttribute } 1493 * @syscap SystemCapability.ArkUI.ArkUI.Full 1494 * @crossplatform 1495 * @atomicservice 1496 * @since 18 1497 */ 1498 onAnimationEnd(handler: OnTabsAnimationEndCallback): TabsAttribute; 1499 1500 /** 1501 * Called when swiping the tab content with the gesture. 1502 * 1503 * @param { function } handler - 1504 * "index": the index value of the tab that when animation start. 1505 * "event": the animation event callback info. 1506 * @returns { TabsAttribute } 1507 * @syscap SystemCapability.ArkUI.ArkUI.Full 1508 * @crossplatform 1509 * @since 11 1510 */ 1511 /** 1512 * Called when swiping the tab content with the gesture. 1513 * 1514 * @param { function } handler - 1515 * "index": the index value of the tab that when animation start. 1516 * "event": the animation event callback info. 1517 * @returns { TabsAttribute } 1518 * @syscap SystemCapability.ArkUI.ArkUI.Full 1519 * @crossplatform 1520 * @atomicservice 1521 * @since 12 1522 */ 1523 /** 1524 * Called when swiping the tab content with the gesture. 1525 * Anonymous Object Rectification 1526 * 1527 * @param { OnTabsGestureSwipeCallback } handler 1528 * @returns { TabsAttribute } 1529 * @syscap SystemCapability.ArkUI.ArkUI.Full 1530 * @crossplatform 1531 * @atomicservice 1532 * @since 18 1533 */ 1534 onGestureSwipe(handler: OnTabsGestureSwipeCallback): TabsAttribute; 1535 1536 /** 1537 * Set whether the edges of tab bar are fading. 1538 * 1539 * @param { boolean } value - indicates whether the edges of tab bar are fading. 1540 * @returns { TabsAttribute } the attribute of the tabs 1541 * @syscap SystemCapability.ArkUI.ArkUI.Full 1542 * @crossplatform 1543 * @since 10 1544 */ 1545 /** 1546 * Set whether the edges of tab bar are fading. 1547 * 1548 * @param { boolean } value - indicates whether the edges of tab bar are fading. 1549 * @returns { TabsAttribute } the attribute of the tabs 1550 * @syscap SystemCapability.ArkUI.ArkUI.Full 1551 * @crossplatform 1552 * @atomicservice 1553 * @since 11 1554 */ 1555 fadingEdge(value: boolean): TabsAttribute; 1556 1557 /** 1558 * Set the divider between tab bar and tab content. 1559 * 1560 * @param { DividerStyle | null } value - indicates the style of the indicator. 1561 * @returns { TabsAttribute } the attribute of the tabs 1562 * @syscap SystemCapability.ArkUI.ArkUI.Full 1563 * @crossplatform 1564 * @since 10 1565 */ 1566 /** 1567 * Set the divider between tab bar and tab content. 1568 * 1569 * @param { DividerStyle | null } value - indicates the style of the indicator. 1570 * @returns { TabsAttribute } the attribute of the tabs 1571 * @syscap SystemCapability.ArkUI.ArkUI.Full 1572 * @crossplatform 1573 * @atomicservice 1574 * @since 11 1575 */ 1576 divider(value: DividerStyle | null): TabsAttribute; 1577 1578 /** 1579 * Set whether the tab bar overlaps with the tab content. 1580 * 1581 * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. 1582 * @returns { TabsAttribute } the attribute of the tabs 1583 * @syscap SystemCapability.ArkUI.ArkUI.Full 1584 * @since 10 1585 */ 1586 /** 1587 * Set whether the tab bar overlaps with the tab content. 1588 * 1589 * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. 1590 * @returns { TabsAttribute } the attribute of the tabs 1591 * @syscap SystemCapability.ArkUI.ArkUI.Full 1592 * @crossplatform 1593 * @atomicservice 1594 * @since 11 1595 */ 1596 barOverlap(value: boolean): TabsAttribute; 1597 1598 /** 1599 * Set the background color of the tab bar. 1600 * 1601 * @param { ResourceColor } value - indicates the background color of the tab bar. 1602 * @returns { TabsAttribute } the attribute of the tabs 1603 * @syscap SystemCapability.ArkUI.ArkUI.Full 1604 * @since 10 1605 */ 1606 /** 1607 * Set the background color of the tab bar. 1608 * 1609 * @param { ResourceColor } value - indicates the background color of the tab bar. 1610 * @returns { TabsAttribute } the attribute of the tabs 1611 * @syscap SystemCapability.ArkUI.ArkUI.Full 1612 * @crossplatform 1613 * @atomicservice 1614 * @since 11 1615 */ 1616 barBackgroundColor(value: ResourceColor): TabsAttribute; 1617 1618 /** 1619 * Set the grid alignment options of the tab bar. 1620 * 1621 * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. 1622 * @returns { TabsAttribute } the attribute of the tabs 1623 * @syscap SystemCapability.ArkUI.ArkUI.Full 1624 * @crossplatform 1625 * @since 10 1626 */ 1627 /** 1628 * Set the grid alignment options of the tab bar. 1629 * 1630 * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. 1631 * @returns { TabsAttribute } the attribute of the tabs 1632 * @syscap SystemCapability.ArkUI.ArkUI.Full 1633 * @crossplatform 1634 * @atomicservice 1635 * @since 11 1636 */ 1637 barGridAlign(value: BarGridColumnOptions): TabsAttribute; 1638 1639 /** 1640 * Custom tab content transition animation. 1641 * When undefined is set, this interface does not take effect. 1642 * 1643 * @param { function } delegate - custom content transition animation. 1644 * @returns { TabsAttribute } the attribute of the tabs 1645 * @syscap SystemCapability.ArkUI.ArkUI.Full 1646 * @crossplatform 1647 * @form 1648 * @since 11 1649 */ 1650 /** 1651 * Custom tab content transition animation. 1652 * When undefined is set, this interface does not take effect. 1653 * 1654 * @param { function } delegate - custom content transition animation. 1655 * @returns { TabsAttribute } the attribute of the tabs 1656 * @syscap SystemCapability.ArkUI.ArkUI.Full 1657 * @crossplatform 1658 * @form 1659 * @atomicservice 1660 * @since 12 1661 */ 1662 /** 1663 * Custom tab content transition animation. 1664 * When undefined is set, this interface does not take effect. 1665 * Anonymous Object Rectification 1666 * 1667 * @param { TabsCustomContentTransitionCallback } delegate - Custom content transition animation. 1668 * @returns { TabsAttribute } The attribute of the tabs. 1669 * @syscap SystemCapability.ArkUI.ArkUI.Full 1670 * @crossplatform 1671 * @atomicservice 1672 * @since 18 1673 */ 1674 customContentTransition(delegate: TabsCustomContentTransitionCallback): TabsAttribute; 1675 1676 /** 1677 * Set the BlurStyle of the tab bar. 1678 * 1679 * @param { BlurStyle } value - indicates the BlurStyle of the tab bar. 1680 * @returns { TabsAttribute } the attribute of the tabs 1681 * @syscap SystemCapability.ArkUI.ArkUI.Full 1682 * @crossplatform 1683 * @atomicservice 1684 * @since 11 1685 */ 1686 barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; 1687 1688 /** 1689 * Set the BlurStyle of the tab bar. 1690 * 1691 * @param { BlurStyle } style - style indicate the blur style for the tab bar 1692 * @param { BackgroundBlurStyleOptions } options - options indicate the options for the tab bar 1693 * @returns { TabsAttribute } the attribute of the tabs 1694 * @syscap SystemCapability.ArkUI.ArkUI.Full 1695 * @crossplatform 1696 * @atomicservice 1697 * @since 18 1698 */ 1699 barBackgroundBlurStyle(style: BlurStyle, options: BackgroundBlurStyleOptions): TabsAttribute; 1700 1701 /** 1702 * Set the BackgroundEffect of the tab bar. 1703 * 1704 * @param { BackgroundEffectOptions } options - options indicate the options for the tab bar 1705 * @returns { TabsAttribute } the attribute of the tabs 1706 * @syscap SystemCapability.ArkUI.ArkUI.Full 1707 * @crossplatform 1708 * @atomicservice 1709 * @since 18 1710 */ 1711 barBackgroundEffect(options: BackgroundEffectOptions): TabsAttribute; 1712 1713 /** 1714 * Setting page flip mode on mouse wheel event. 1715 * 1716 * @param { Optional<PageFlipMode> } mode - page flip mode on mouse wheel event. The default value is PageFlipMode.CONTINUOUS. 1717 * @returns { TabsAttribute } 1718 * @syscap SystemCapability.ArkUI.ArkUI.Full 1719 * @crossplatform 1720 * @atomicservice 1721 * @since 15 1722 */ 1723 pageFlipMode(mode: Optional<PageFlipMode>): TabsAttribute; 1724 1725 /** 1726 * Called when content will change. 1727 * 1728 * @param { function } handler 1729 * "currentIndex": the index value of the current tab. 1730 * "comingIndex": the index value of the tab that will change. 1731 * Tabs can change from currentIndex to comingIndex if function return true. 1732 * Tabs can not change from currentIndex to comingIndex if function return false. 1733 * @returns { TabsAttribute } 1734 * @syscap SystemCapability.ArkUI.ArkUI.Full 1735 * @crossplatform 1736 * @atomicservice 1737 * @since 12 1738 */ 1739 /** 1740 * Called when content will change. 1741 * Anonymous Object Rectification 1742 * 1743 * @param { OnTabsContentWillChangeCallback } handler 1744 * @returns { TabsAttribute } 1745 * @syscap SystemCapability.ArkUI.ArkUI.Full 1746 * @crossplatform 1747 * @atomicservice 1748 * @since 18 1749 */ 1750 onContentWillChange(handler: OnTabsContentWillChangeCallback): TabsAttribute; 1751} 1752 1753/** 1754 * Defines the Tab Content animated transition options. 1755 * 1756 * @interface TabContentAnimatedTransition 1757 * @syscap SystemCapability.ArkUI.ArkUI.Full 1758 * @crossplatform 1759 * @form 1760 * @since 11 1761 */ 1762/** 1763 * Defines the Tab Content animated transition options. 1764 * 1765 * @interface TabContentAnimatedTransition 1766 * @syscap SystemCapability.ArkUI.ArkUI.Full 1767 * @crossplatform 1768 * @form 1769 * @atomicservice 1770 * @since 12 1771 */ 1772declare interface TabContentAnimatedTransition { 1773 /** 1774 * Defines the timeout of custom content transition animation. The unit is ms. 1775 * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. 1776 * 1777 * @type { ?number } 1778 * @default 1000 ms 1779 * @syscap SystemCapability.ArkUI.ArkUI.Full 1780 * @crossplatform 1781 * @form 1782 * @since 11 1783 */ 1784 /** 1785 * Defines the timeout of custom content transition animation. The unit is ms. 1786 * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. 1787 * 1788 * @type { ?number } 1789 * @default 1000 ms 1790 * @syscap SystemCapability.ArkUI.ArkUI.Full 1791 * @crossplatform 1792 * @form 1793 * @atomicservice 1794 * @since 12 1795 */ 1796 timeout?: number; 1797 1798 /** 1799 * Called when custom content transition animation start. 1800 * 1801 * @type { function } 1802 * @syscap SystemCapability.ArkUI.ArkUI.Full 1803 * @crossplatform 1804 * @form 1805 * @since 11 1806 */ 1807 /** 1808 * Called when custom content transition animation start. 1809 * 1810 * @type { function } 1811 * @syscap SystemCapability.ArkUI.ArkUI.Full 1812 * @crossplatform 1813 * @form 1814 * @atomicservice 1815 * @since 12 1816 */ 1817 /** 1818 * Called when custom content transition animation start. 1819 * Anonymous Object Rectification 1820 * 1821 * @type { Callback<TabContentTransitionProxy> } 1822 * @syscap SystemCapability.ArkUI.ArkUI.Full 1823 * @crossplatform 1824 * @form 1825 * @atomicservice 1826 * @since 18 1827 */ 1828 transition: Callback<TabContentTransitionProxy>; 1829} 1830 1831/** 1832 * The proxy of TabContentAnimatedTransition. 1833 * 1834 * @interface TabContentTransitionProxy 1835 * @syscap SystemCapability.ArkUI.ArkUI.Full 1836 * @crossplatform 1837 * @form 1838 * @since 11 1839 */ 1840/** 1841 * The proxy of TabContentAnimatedTransition. 1842 * 1843 * @interface TabContentTransitionProxy 1844 * @syscap SystemCapability.ArkUI.ArkUI.Full 1845 * @crossplatform 1846 * @form 1847 * @atomicservice 1848 * @since 12 1849 */ 1850declare interface TabContentTransitionProxy { 1851 /** 1852 * The index of current tab content. 1853 * 1854 * @type { number } 1855 * @syscap SystemCapability.ArkUI.ArkUI.Full 1856 * @crossplatform 1857 * @form 1858 * @since 11 1859 */ 1860 /** 1861 * The index of current tab content. 1862 * 1863 * @type { number } 1864 * @syscap SystemCapability.ArkUI.ArkUI.Full 1865 * @crossplatform 1866 * @form 1867 * @atomicservice 1868 * @since 12 1869 */ 1870 from: number; 1871 1872 /** 1873 * The index of target tab content. 1874 * 1875 * @type { number } 1876 * @syscap SystemCapability.ArkUI.ArkUI.Full 1877 * @crossplatform 1878 * @form 1879 * @since 11 1880 */ 1881 /** 1882 * The index of target tab content. 1883 * 1884 * @type { number } 1885 * @syscap SystemCapability.ArkUI.ArkUI.Full 1886 * @crossplatform 1887 * @form 1888 * @atomicservice 1889 * @since 12 1890 */ 1891 to: number; 1892 1893 /** 1894 * Notifies Tabs component the custom content transition animation is complete. 1895 * 1896 * @syscap SystemCapability.ArkUI.ArkUI.Full 1897 * @crossplatform 1898 * @form 1899 * @since 11 1900 */ 1901 /** 1902 * Notifies Tabs component the custom content transition animation is complete. 1903 * 1904 * @syscap SystemCapability.ArkUI.ArkUI.Full 1905 * @crossplatform 1906 * @form 1907 * @atomicservice 1908 * @since 12 1909 */ 1910 finishTransition(): void; 1911} 1912 1913/** 1914 * Defines Tabs Component. 1915 * 1916 * @syscap SystemCapability.ArkUI.ArkUI.Full 1917 * @since 7 1918 */ 1919/** 1920 * Defines Tabs Component. 1921 * 1922 * @syscap SystemCapability.ArkUI.ArkUI.Full 1923 * @crossplatform 1924 * @since 10 1925 */ 1926/** 1927 * Defines Tabs Component. 1928 * 1929 * @syscap SystemCapability.ArkUI.ArkUI.Full 1930 * @crossplatform 1931 * @atomicservice 1932 * @since 11 1933 */ 1934declare const Tabs: TabsInterface; 1935 1936/** 1937 * Defines Tabs Component instance. 1938 * 1939 * @syscap SystemCapability.ArkUI.ArkUI.Full 1940 * @since 7 1941 */ 1942/** 1943 * Defines Tabs Component instance. 1944 * 1945 * @syscap SystemCapability.ArkUI.ArkUI.Full 1946 * @crossplatform 1947 * @since 10 1948 */ 1949/** 1950 * Defines Tabs Component instance. 1951 * 1952 * @syscap SystemCapability.ArkUI.ArkUI.Full 1953 * @crossplatform 1954 * @atomicservice 1955 * @since 11 1956 */ 1957declare const TabsInstance: TabsAttribute; 1958