1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Declare the graphic format of the bar chart. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Declare the graphic format of the bar chart. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * Declare the graphic format of the bar chart. 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare enum BarMode { 46 /** 47 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @since 7 51 */ 52 /** 53 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since 11 66 */ 67 Scrollable = 0, 68 69 /** 70 * The width of all TabBars is evenly allocated. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75 /** 76 * The width of all TabBars is evenly allocated. 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82 /** 83 * The width of all TabBars is evenly allocated. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since 11 89 */ 90 Fixed = 1, 91} 92 93/** 94 * Declare the animation mode of tab content. 95 * 96 * @enum { number } 97 * @syscap SystemCapability.ArkUI.ArkUI.Full 98 * @crossplatform 99 * @atomicservice 100 * @since 12 101 */ 102declare enum AnimationMode { 103 /** 104 * Start animation after tabcontent is fully measured. 105 * 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @crossplatform 108 * @atomicservice 109 * @since 12 110 */ 111 CONTENT_FIRST = 0, 112 113 /** 114 * Start animation before tabcontent is fully measured. 115 * 116 * @syscap SystemCapability.ArkUI.ArkUI.Full 117 * @crossplatform 118 * @atomicservice 119 * @since 12 120 */ 121 ACTION_FIRST = 1, 122 123 /** 124 * Disable default animation. 125 * 126 * @syscap SystemCapability.ArkUI.ArkUI.Full 127 * @crossplatform 128 * @atomicservice 129 * @since 12 130 */ 131 NO_ANIMATION = 2, 132} 133 134/** 135 * Declare the location of the bar chart. 136 * 137 * @enum { number } 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 7 140 */ 141/** 142 * Declare the location of the bar chart. 143 * 144 * @enum { number } 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @crossplatform 147 * @since 10 148 */ 149/** 150 * Declare the location of the bar chart. 151 * 152 * @enum { number } 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @crossplatform 155 * @atomicservice 156 * @since 11 157 */ 158declare enum BarPosition { 159 /** 160 * 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. 161 * 162 * @syscap SystemCapability.ArkUI.ArkUI.Full 163 * @since 7 164 */ 165 /** 166 * 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. 167 * 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @since 10 171 */ 172 /** 173 * 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. 174 * 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @atomicservice 178 * @since 11 179 */ 180 Start, 181 182 /** 183 * 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. 184 * 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @since 7 187 */ 188 /** 189 * 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. 190 * 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @crossplatform 193 * @since 10 194 */ 195 /** 196 * 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. 197 * 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @crossplatform 200 * @atomicservice 201 * @since 11 202 */ 203 End, 204} 205 206/** 207 * Declare the layout style of the tab bar items. 208 * 209 * @enum { number } 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @crossplatform 212 * @since 10 213 */ 214/** 215 * Declare the layout style of the tab bar items. 216 * 217 * @enum { number } 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @crossplatform 220 * @atomicservice 221 * @since 11 222 */ 223declare enum LayoutStyle { 224 /** 225 * The tab bar items are laid in the center of the tab bar. 226 * 227 * @syscap SystemCapability.ArkUI.ArkUI.Full 228 * @crossplatform 229 * @since 10 230 */ 231 /** 232 * The tab bar items are laid in the center of the tab bar. 233 * 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @crossplatform 236 * @atomicservice 237 * @since 11 238 */ 239 ALWAYS_CENTER = 0, 240 /** 241 * The tab bar items are laid in the tab bar by an average split. 242 * 243 * @syscap SystemCapability.ArkUI.ArkUI.Full 244 * @crossplatform 245 * @since 10 246 */ 247 /** 248 * The tab bar items are laid in the tab bar by an average split. 249 * 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @crossplatform 252 * @atomicservice 253 * @since 11 254 */ 255 ALWAYS_AVERAGE_SPLIT = 1, 256 /** 257 * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. 258 * Otherwise, they are laid in the center half of the tab bar with the same space between them. 259 * 260 * @syscap SystemCapability.ArkUI.ArkUI.Full 261 * @crossplatform 262 * @since 10 263 */ 264 /** 265 * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. 266 * Otherwise, they are laid in the center half of the tab bar with the same space between them. 267 * 268 * @syscap SystemCapability.ArkUI.ArkUI.Full 269 * @crossplatform 270 * @atomicservice 271 * @since 11 272 */ 273 SPACE_BETWEEN_OR_CENTER = 2 274} 275 276/** 277 * Provides methods for switching tabs. 278 * 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @since 7 281 */ 282/** 283 * Provides methods for switching tabs. 284 * 285 * @syscap SystemCapability.ArkUI.ArkUI.Full 286 * @crossplatform 287 * @since 10 288 */ 289/** 290 * Provides methods for switching tabs. 291 * 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @atomicservice 295 * @since 11 296 */ 297declare class TabsController { 298 /** 299 * constructor. 300 * 301 * @syscap SystemCapability.ArkUI.ArkUI.Full 302 * @since 7 303 */ 304 /** 305 * constructor. 306 * 307 * @syscap SystemCapability.ArkUI.ArkUI.Full 308 * @crossplatform 309 * @since 10 310 */ 311 /** 312 * constructor. 313 * 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @atomicservice 317 * @since 11 318 */ 319 constructor(); 320 321 /** 322 * Called when the tab is switched. 323 * 324 * @param { number } value 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @since 7 327 */ 328 /** 329 * Called when the tab is switched. 330 * 331 * @param { number } value 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @crossplatform 334 * @since 10 335 */ 336 /** 337 * Called when the tab is switched. 338 * 339 * @param { number } value 340 * @syscap SystemCapability.ArkUI.ArkUI.Full 341 * @crossplatform 342 * @atomicservice 343 * @since 11 344 */ 345 changeIndex(value: number): void; 346 347 /** 348 * Called when need to preload specified tab content. 349 * 350 * @param { Optional<Array<number>> } indices - Indices of tab content to be preloaded. 351 * @returns { Promise<void> } The promise returned by the function. 352 * @throws { BusinessError } 401 - Parameter invalid. Possible causes: 353 * <br> 1. The parameter type is not Array<number>. 354 * <br> 2. The parameter is an empty array. 355 * <br> 3. The parameter contains an invalid index. 356 * @syscap SystemCapability.ArkUI.ArkUI.Full 357 * @crossplatform 358 * @atomicservice 359 * @since 12 360 */ 361 preloadItems(indices: Optional<Array<number>>): Promise<void>; 362 363 /** 364 * Set tab bar translate. 365 * 366 * @param { TranslateOptions } translate - translate options 367 * @syscap SystemCapability.ArkUI.ArkUI.Full 368 * @crossplatform 369 * @atomicservice 370 * @since 13 371 */ 372 setTabBarTranslate(translate: TranslateOptions): void; 373 374 /** 375 * Set tab bar opacity. 376 * 377 * @param { number } opacity - opacity 378 * @syscap SystemCapability.ArkUI.ArkUI.Full 379 * @crossplatform 380 * @atomicservice 381 * @since 13 382 */ 383 setTabBarOpacity(opacity: number): void; 384} 385 386/** 387 * Provides an interface for switching views. 388 * 389 * @interface TabsInterface 390 * @syscap SystemCapability.ArkUI.ArkUI.Full 391 * @since 7 392 */ 393/** 394 * Provides an interface for switching views. 395 * 396 * @interface TabsInterface 397 * @syscap SystemCapability.ArkUI.ArkUI.Full 398 * @crossplatform 399 * @since 10 400 */ 401/** 402 * Provides an interface for switching views. 403 * 404 * @interface TabsInterface 405 * @syscap SystemCapability.ArkUI.ArkUI.Full 406 * @crossplatform 407 * @atomicservice 408 * @since 11 409 */ 410interface TabsInterface { 411 /** 412 * Called when the view is switched. 413 * 414 * @param { object } value 415 * @returns { TabsAttribute } 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @since 7 418 */ 419 /** 420 * Called when the view is switched. 421 * 422 * @param { object } value 423 * @returns { TabsAttribute } 424 * @syscap SystemCapability.ArkUI.ArkUI.Full 425 * @crossplatform 426 * @since 10 427 */ 428 /** 429 * Called when the view is switched. 430 * 431 * @param { object } value 432 * @returns { TabsAttribute } 433 * @syscap SystemCapability.ArkUI.ArkUI.Full 434 * @crossplatform 435 * @atomicservice 436 * @since 11 437 */ 438 (value?: { barPosition?: BarPosition; index?: number; controller?: TabsController }): TabsAttribute; 439} 440 441/** 442 * Provides an interface for the style of an divider including stroke width, color, start margin 443 * and end margin 444 * 445 * @interface DividerStyle 446 * @syscap SystemCapability.ArkUI.ArkUI.Full 447 * @crossplatform 448 * @since 10 449 */ 450/** 451 * Provides an interface for the style of an divider including stroke width, color, start margin 452 * and end margin 453 * 454 * @interface DividerStyle 455 * @syscap SystemCapability.ArkUI.ArkUI.Full 456 * @crossplatform 457 * @atomicservice 458 * @since 11 459 */ 460interface DividerStyle { 461 /** 462 * Define the stroke width of the divider 463 * 464 * @type { Length } 465 * @default 0 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @crossplatform 468 * @since 10 469 */ 470 /** 471 * Define the stroke width of the divider 472 * 473 * @type { Length } 474 * @default 0 475 * @syscap SystemCapability.ArkUI.ArkUI.Full 476 * @crossplatform 477 * @atomicservice 478 * @since 11 479 */ 480 strokeWidth: Length; 481 482 /** 483 * Define the color of the divider 484 * 485 * @type { ?ResourceColor } 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @crossplatform 488 * @since 10 489 */ 490 /** 491 * Define the color of the divider 492 * 493 * @type { ?ResourceColor } 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @crossplatform 496 * @atomicservice 497 * @since 11 498 */ 499 color?: ResourceColor; 500 501 /** 502 * Define the start margin of the divider 503 * 504 * @type { ?Length } 505 * @default 0 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @crossplatform 508 * @since 10 509 */ 510 /** 511 * Define the start margin of the divider 512 * 513 * @type { ?Length } 514 * @default 0 515 * @syscap SystemCapability.ArkUI.ArkUI.Full 516 * @crossplatform 517 * @atomicservice 518 * @since 11 519 */ 520 startMargin?: Length; 521 522 /** 523 * Define the end margin of the divider 524 * 525 * @type { ?Length } 526 * @default 0 527 * @syscap SystemCapability.ArkUI.ArkUI.Full 528 * @crossplatform 529 * @since 10 530 */ 531 /** 532 * Define the end margin of the divider 533 * 534 * @type { ?Length } 535 * @default 0 536 * @syscap SystemCapability.ArkUI.ArkUI.Full 537 * @crossplatform 538 * @atomicservice 539 * @since 11 540 */ 541 endMargin?: Length; 542} 543 544/** 545 * Provides an interface for tabs animation. 546 * 547 * @interface TabsAnimationEvent 548 * @syscap SystemCapability.ArkUI.ArkUI.Full 549 * @crossplatform 550 * @since 11 551 */ 552/** 553 * Provides an interface for tabs animation. 554 * 555 * @interface TabsAnimationEvent 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @crossplatform 558 * @atomicservice 559 * @since 12 560 */ 561declare interface TabsAnimationEvent { 562 /** 563 * Offset of the current page to the start position of the tabs main axis. The unit is vp. 564 * 565 * @type { number } 566 * @default 0.0 vp 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @crossplatform 569 * @since 11 570 */ 571 /** 572 * Offset of the current page to the start position of the tabs main axis. The unit is vp. 573 * 574 * @type { number } 575 * @default 0.0 vp 576 * @syscap SystemCapability.ArkUI.ArkUI.Full 577 * @crossplatform 578 * @atomicservice 579 * @since 12 580 */ 581 currentOffset: number; 582 583 /** 584 * Offset of the target page to the start position of the tabs main axis. The unit is vp. 585 * 586 * @type { number } 587 * @default 0.0 vp 588 * @syscap SystemCapability.ArkUI.ArkUI.Full 589 * @crossplatform 590 * @since 11 591 */ 592 /** 593 * Offset of the target page to the start position of the tabs main axis. The unit is vp. 594 * 595 * @type { number } 596 * @default 0.0 vp 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @atomicservice 600 * @since 12 601 */ 602 targetOffset: number; 603 604 /** 605 * Start speed of the page-turning animation. The unit is vp/s. 606 * 607 * @type { number } 608 * @default 0.0 vp/s 609 * @syscap SystemCapability.ArkUI.ArkUI.Full 610 * @crossplatform 611 * @since 11 612 */ 613 /** 614 * Start speed of the page-turning animation. The unit is vp/s. 615 * 616 * @type { number } 617 * @default 0.0 vp/s 618 * @syscap SystemCapability.ArkUI.ArkUI.Full 619 * @crossplatform 620 * @atomicservice 621 * @since 12 622 */ 623 velocity: number; 624} 625 626/** 627 * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. 628 * 629 * @interface BarGridColumnOptions 630 * @syscap SystemCapability.ArkUI.ArkUI.Full 631 * @crossplatform 632 * @since 10 633 */ 634/** 635 * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. 636 * 637 * @interface BarGridColumnOptions 638 * @syscap SystemCapability.ArkUI.ArkUI.Full 639 * @crossplatform 640 * @atomicservice 641 * @since 11 642 */ 643interface BarGridColumnOptions { 644 /** 645 * Define the occupied column number when the screen is of small size 646 * 647 * @type { ?number } 648 * @syscap SystemCapability.ArkUI.ArkUI.Full 649 * @crossplatform 650 * @since 10 651 */ 652 /** 653 * Define the occupied column number when the screen is of small size 654 * 655 * @type { ?number } 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @crossplatform 658 * @atomicservice 659 * @since 11 660 */ 661 sm?: number; 662 663 /** 664 * Define the occupied column number when the screen is of middle size 665 * 666 * @type { ?number } 667 * @syscap SystemCapability.ArkUI.ArkUI.Full 668 * @crossplatform 669 * @since 10 670 */ 671 /** 672 * Define the occupied column number when the screen is of middle size 673 * 674 * @type { ?number } 675 * @syscap SystemCapability.ArkUI.ArkUI.Full 676 * @crossplatform 677 * @atomicservice 678 * @since 11 679 */ 680 md?: number; 681 682 /** 683 * Define the occupied column number when the screen is of large size 684 * 685 * @type { ?number } 686 * @syscap SystemCapability.ArkUI.ArkUI.Full 687 * @crossplatform 688 * @since 10 689 */ 690 /** 691 * Define the occupied column number when the screen is of large size 692 * 693 * @type { ?number } 694 * @syscap SystemCapability.ArkUI.ArkUI.Full 695 * @crossplatform 696 * @atomicservice 697 * @since 11 698 */ 699 lg?: number; 700 701 /** 702 * Define the margin size of the columns 703 * 704 * @type { ?Dimension } 705 * @syscap SystemCapability.ArkUI.ArkUI.Full 706 * @crossplatform 707 * @since 10 708 */ 709 /** 710 * Define the margin size of the columns 711 * 712 * @type { ?Dimension } 713 * @syscap SystemCapability.ArkUI.ArkUI.Full 714 * @crossplatform 715 * @atomicservice 716 * @since 11 717 */ 718 margin?: Dimension; 719 720 /** 721 * Define the gutter size of the columns 722 * 723 * @type { ?Dimension } 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @since 10 727 */ 728 /** 729 * Define the gutter size of the columns 730 * 731 * @type { ?Dimension } 732 * @syscap SystemCapability.ArkUI.ArkUI.Full 733 * @crossplatform 734 * @atomicservice 735 * @since 11 736 */ 737 gutter?: Dimension; 738} 739 740/** 741 * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. 742 * 743 * @interface ScrollableBarModeOptions 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @since 10 747 */ 748/** 749 * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. 750 * 751 * @interface ScrollableBarModeOptions 752 * @syscap SystemCapability.ArkUI.ArkUI.Full 753 * @crossplatform 754 * @atomicservice 755 * @since 11 756 */ 757interface ScrollableBarModeOptions { 758 /** 759 * Define the margin size of the bar items when the tab bar is scrollable. 760 * 761 * @type { ?Dimension } 762 * @syscap SystemCapability.ArkUI.ArkUI.Full 763 * @crossplatform 764 * @since 10 765 */ 766 /** 767 * Define the margin size of the bar items when the tab bar is scrollable. 768 * 769 * @type { ?Dimension } 770 * @syscap SystemCapability.ArkUI.ArkUI.Full 771 * @crossplatform 772 * @atomicservice 773 * @since 11 774 */ 775 margin?: Dimension; 776 777 /** 778 * Define the layout style of the bar items when the tab bar is not scrollable. 779 * 780 * @type { ?LayoutStyle } 781 * @syscap SystemCapability.ArkUI.ArkUI.Full 782 * @crossplatform 783 * @since 10 784 */ 785 /** 786 * Define the layout style of the bar items when the tab bar is not scrollable. 787 * 788 * @type { ?LayoutStyle } 789 * @syscap SystemCapability.ArkUI.ArkUI.Full 790 * @crossplatform 791 * @atomicservice 792 * @since 11 793 */ 794 nonScrollableLayoutStyle?: LayoutStyle; 795} 796 797/** 798 * Defines the tabs attribute functions. 799 * 800 * @extends CommonMethod<TabsAttribute> 801 * @syscap SystemCapability.ArkUI.ArkUI.Full 802 * @since 7 803 */ 804/** 805 * Defines the tabs attribute functions. 806 * 807 * @extends CommonMethod<TabsAttribute> 808 * @syscap SystemCapability.ArkUI.ArkUI.Full 809 * @crossplatform 810 * @since 10 811 */ 812/** 813 * Defines the tabs attribute functions. 814 * 815 * @extends CommonMethod<TabsAttribute> 816 * @syscap SystemCapability.ArkUI.ArkUI.Full 817 * @crossplatform 818 * @atomicservice 819 * @since 11 820 */ 821declare class TabsAttribute extends CommonMethod<TabsAttribute> { 822 /** 823 * Called when determining whether the tab is vertical. 824 * 825 * @param { boolean } value 826 * @returns { TabsAttribute } 827 * @syscap SystemCapability.ArkUI.ArkUI.Full 828 * @since 7 829 */ 830 /** 831 * Called when determining whether the tab is vertical. 832 * 833 * @param { boolean } value 834 * @returns { TabsAttribute } 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @since 10 838 */ 839 /** 840 * Called when determining whether the tab is vertical. 841 * 842 * @param { boolean } value 843 * @returns { TabsAttribute } 844 * @syscap SystemCapability.ArkUI.ArkUI.Full 845 * @crossplatform 846 * @atomicservice 847 * @since 11 848 */ 849 vertical(value: boolean): TabsAttribute; 850 851 /** 852 * Called when determining the location of the bar chart. 853 * 854 * @param { BarPosition } value 855 * @returns { TabsAttribute } 856 * @syscap SystemCapability.ArkUI.ArkUI.Full 857 * @since 9 858 */ 859 /** 860 * Called when determining the location of the bar chart. 861 * 862 * @param { BarPosition } value 863 * @returns { TabsAttribute } 864 * @syscap SystemCapability.ArkUI.ArkUI.Full 865 * @crossplatform 866 * @since 10 867 */ 868 /** 869 * Called when determining the location of the bar chart. 870 * 871 * @param { BarPosition } value 872 * @returns { TabsAttribute } 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @atomicservice 876 * @since 11 877 */ 878 barPosition(value: BarPosition): TabsAttribute; 879 880 /** 881 * Called when judging whether page switching can be performed by sliding left and right. 882 * 883 * @param { boolean } value 884 * @returns { TabsAttribute } 885 * @syscap SystemCapability.ArkUI.ArkUI.Full 886 * @since 7 887 */ 888 /** 889 * Called when judging whether page switching can be performed by sliding left and right. 890 * 891 * @param { boolean } value 892 * @returns { TabsAttribute } 893 * @syscap SystemCapability.ArkUI.ArkUI.Full 894 * @crossplatform 895 * @since 10 896 */ 897 /** 898 * Called when judging whether page switching can be performed by sliding left and right. 899 * 900 * @param { boolean } value 901 * @returns { TabsAttribute } 902 * @syscap SystemCapability.ArkUI.ArkUI.Full 903 * @crossplatform 904 * @atomicservice 905 * @since 11 906 */ 907 scrollable(value: boolean): TabsAttribute; 908 909 /** 910 * Called when the graphic format of the bar chart is selected as fixed mode. 911 * 912 * @param { BarMode.Fixed } value 913 * @returns { TabsAttribute } 914 * @syscap SystemCapability.ArkUI.ArkUI.Full 915 * @crossplatform 916 * @since 10 917 */ 918 /** 919 * Called when the graphic format of the bar chart is selected as fixed mode. 920 * 921 * @param { BarMode.Fixed } value 922 * @returns { TabsAttribute } 923 * @syscap SystemCapability.ArkUI.ArkUI.Full 924 * @crossplatform 925 * @atomicservice 926 * @since 11 927 */ 928 barMode(value: BarMode.Fixed): TabsAttribute; 929 930 /** 931 * Called when the graphic format of the bar chart is selected as scrollable mode. 932 * 933 * @param { BarMode.Scrollable } value 934 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 935 * @returns { TabsAttribute } 936 * @syscap SystemCapability.ArkUI.ArkUI.Full 937 * @crossplatform 938 * @since 10 939 */ 940 /** 941 * Called when the graphic format of the bar chart is selected as scrollable mode. 942 * 943 * @param { BarMode.Scrollable } value 944 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 945 * @returns { TabsAttribute } 946 * @syscap SystemCapability.ArkUI.ArkUI.Full 947 * @crossplatform 948 * @atomicservice 949 * @since 11 950 */ 951 barMode(value: BarMode.Scrollable, options: ScrollableBarModeOptions): TabsAttribute; 952 953 /** 954 * Called when the graphic format of the bar chart is selected. 955 * 956 * @param { BarMode } value 957 * @returns { TabsAttribute } 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @since 7 960 */ 961 /** 962 * Called when the graphic format of the bar chart is selected. 963 * 964 * @param { BarMode } value 965 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 966 * @returns { TabsAttribute } 967 * @syscap SystemCapability.ArkUI.ArkUI.Full 968 * @crossplatform 969 * @since 10 970 */ 971 /** 972 * Called when the graphic format of the bar chart is selected. 973 * 974 * @param { BarMode } value 975 * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode 976 * @returns { TabsAttribute } 977 * @syscap SystemCapability.ArkUI.ArkUI.Full 978 * @crossplatform 979 * @atomicservice 980 * @since 11 981 */ 982 barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; 983 984 /** 985 * Called when the width of the bar graph is set. 986 * Notice: barWidth only supports Number type. 987 * 988 * @param { number } value 989 * @returns { TabsAttribute } 990 * @syscap SystemCapability.ArkUI.ArkUI.Full 991 * @since 7 992 */ 993 /** 994 * Called when the width of the bar graph is set. 995 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 996 * 997 * @param { Length } value 998 * @returns { TabsAttribute } 999 * @syscap SystemCapability.ArkUI.ArkUI.Full 1000 * @since 8 1001 */ 1002 /** 1003 * Called when the width of the bar graph is set. 1004 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 1005 * 1006 * @param { Length } value 1007 * @returns { TabsAttribute } 1008 * @syscap SystemCapability.ArkUI.ArkUI.Full 1009 * @crossplatform 1010 * @since 10 1011 */ 1012 /** 1013 * Called when the width of the bar graph is set. 1014 * Notice: barWidth only supports Number type on 7, supports Length type since 8. 1015 * 1016 * @param { Length } value 1017 * @returns { TabsAttribute } 1018 * @syscap SystemCapability.ArkUI.ArkUI.Full 1019 * @crossplatform 1020 * @atomicservice 1021 * @since 11 1022 */ 1023 barWidth(value: Length): TabsAttribute; 1024 1025 /** 1026 * Called when the height of the bar graph is set. 1027 * Notice: barHeight only supports Number type. 1028 * 1029 * @param { number } value 1030 * @returns { TabsAttribute } 1031 * @syscap SystemCapability.ArkUI.ArkUI.Full 1032 * @since 7 1033 */ 1034 /** 1035 * Called when the height of the bar graph is set. 1036 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1037 * 1038 * @param { Length } value 1039 * @returns { TabsAttribute } 1040 * @syscap SystemCapability.ArkUI.ArkUI.Full 1041 * @since 8 1042 */ 1043 /** 1044 * Called when the height of the bar graph is set. 1045 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1046 * 1047 * @param { Length } value 1048 * @returns { TabsAttribute } 1049 * @syscap SystemCapability.ArkUI.ArkUI.Full 1050 * @crossplatform 1051 * @since 10 1052 */ 1053 /** 1054 * Called when the height of the bar graph is set. 1055 * Notice: barHeight only supports Number type on 7, supports Length type since 8. 1056 * 1057 * @param { Length } value 1058 * @returns { TabsAttribute } 1059 * @syscap SystemCapability.ArkUI.ArkUI.Full 1060 * @crossplatform 1061 * @atomicservice 1062 * @since 11 1063 */ 1064 barHeight(value: Length): TabsAttribute; 1065 1066 /** 1067 * Called when the animation duration of the bar graph is set. 1068 * 1069 * @param { number } value 1070 * @returns { TabsAttribute } 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @since 7 1073 */ 1074 /** 1075 * Called when the animation duration of the bar graph is set. 1076 * 1077 * @param { number } value 1078 * @returns { TabsAttribute } 1079 * @syscap SystemCapability.ArkUI.ArkUI.Full 1080 * @crossplatform 1081 * @since 10 1082 */ 1083 /** 1084 * Called when the animation duration of the bar graph is set. 1085 * 1086 * @param { number } value 1087 * @returns { TabsAttribute } 1088 * @syscap SystemCapability.ArkUI.ArkUI.Full 1089 * @crossplatform 1090 * @atomicservice 1091 * @since 11 1092 */ 1093 animationDuration(value: number): TabsAttribute; 1094 1095 /** 1096 * Set animation mode. 1097 * 1098 * @param { Optional<AnimationMode> } mode - animation mode for tabs switch animation 1099 * @returns { TabsAttribute } 1100 * @syscap SystemCapability.ArkUI.ArkUI.Full 1101 * @crossplatform 1102 * @atomicservice 1103 * @since 12 1104 */ 1105 animationMode(mode: Optional<AnimationMode>): TabsAttribute; 1106 1107 /** 1108 * Set the effect used when the component is at one of the edges. 1109 * 1110 * @param { Optional<EdgeEffect> } edgeEffect - the effect used when the component is at one of the edges 1111 * @returns { TabsAttribute } 1112 * @syscap SystemCapability.ArkUI.ArkUI.Full 1113 * @crossplatform 1114 * @atomicservice 1115 * @since 12 1116 */ 1117 edgeEffect(edgeEffect: Optional<EdgeEffect>): TabsAttribute; 1118 1119 /** 1120 * Called when the tab is switched. 1121 * 1122 * @param { function } event 1123 * @returns { TabsAttribute } 1124 * @syscap SystemCapability.ArkUI.ArkUI.Full 1125 * @since 7 1126 */ 1127 /** 1128 * Called when the tab is switched. 1129 * 1130 * @param { function } event 1131 * @returns { TabsAttribute } 1132 * @syscap SystemCapability.ArkUI.ArkUI.Full 1133 * @crossplatform 1134 * @since 10 1135 */ 1136 /** 1137 * Called when the tab is switched. 1138 * 1139 * @param { function } event 1140 * @returns { TabsAttribute } 1141 * @syscap SystemCapability.ArkUI.ArkUI.Full 1142 * @crossplatform 1143 * @atomicservice 1144 * @since 11 1145 */ 1146 onChange(event: (index: number) => void): TabsAttribute; 1147 1148 /** 1149 * Called when the tab is clicked. 1150 * 1151 * @param { function } event 1152 * @returns { TabsAttribute } 1153 * @syscap SystemCapability.ArkUI.ArkUI.Full 1154 * @crossplatform 1155 * @since 10 1156 */ 1157 /** 1158 * Called when the tab is clicked. 1159 * 1160 * @param { function } event 1161 * @returns { TabsAttribute } 1162 * @syscap SystemCapability.ArkUI.ArkUI.Full 1163 * @crossplatform 1164 * @atomicservice 1165 * @since 11 1166 */ 1167 onTabBarClick(event: (index: number) => void): TabsAttribute; 1168 1169 /** 1170 * Called when the tab content flip animation start. 1171 * 1172 * @param { function } handler - 1173 * "index": the index value of the tab that when animation start. 1174 * "targetIndex": the target index value of the tab that when animation start. 1175 * "event": the animation event callback info. 1176 * @returns { TabsAttribute } 1177 * @syscap SystemCapability.ArkUI.ArkUI.Full 1178 * @crossplatform 1179 * @since 11 1180 */ 1181 /** 1182 * Called when the tab content flip animation start. 1183 * 1184 * @param { function } handler - 1185 * "index": the index value of the tab that when animation start. 1186 * "targetIndex": the target index value of the tab that when animation start. 1187 * "event": the animation event callback info. 1188 * @returns { TabsAttribute } 1189 * @syscap SystemCapability.ArkUI.ArkUI.Full 1190 * @crossplatform 1191 * @atomicservice 1192 * @since 12 1193 */ 1194 onAnimationStart(handler: (index: number, targetIndex: number, event: TabsAnimationEvent) => void): TabsAttribute; 1195 1196 /** 1197 * Called when the tab content flip animation end. 1198 * 1199 * @param { function } handler - 1200 * "index": the index value of the tab that when animation start. 1201 * "event": the animation event callback info. 1202 * @returns { TabsAttribute } 1203 * @syscap SystemCapability.ArkUI.ArkUI.Full 1204 * @crossplatform 1205 * @since 11 1206 */ 1207 /** 1208 * Called when the tab content flip animation end. 1209 * 1210 * @param { function } handler - 1211 * "index": the index value of the tab that when animation start. 1212 * "event": the animation event callback info. 1213 * @returns { TabsAttribute } 1214 * @syscap SystemCapability.ArkUI.ArkUI.Full 1215 * @crossplatform 1216 * @atomicservice 1217 * @since 12 1218 */ 1219 onAnimationEnd(handler: (index: number, event: TabsAnimationEvent) => void): TabsAttribute; 1220 1221 /** 1222 * Called when swiping the tab content with the gesture. 1223 * 1224 * @param { function } handler - 1225 * "index": the index value of the tab that when animation start. 1226 * "event": the animation event callback info. 1227 * @returns { TabsAttribute } 1228 * @syscap SystemCapability.ArkUI.ArkUI.Full 1229 * @crossplatform 1230 * @since 11 1231 */ 1232 /** 1233 * Called when swiping the tab content with the gesture. 1234 * 1235 * @param { function } handler - 1236 * "index": the index value of the tab that when animation start. 1237 * "event": the animation event callback info. 1238 * @returns { TabsAttribute } 1239 * @syscap SystemCapability.ArkUI.ArkUI.Full 1240 * @crossplatform 1241 * @atomicservice 1242 * @since 12 1243 */ 1244 onGestureSwipe(handler: (index: number, event: TabsAnimationEvent) => void): TabsAttribute; 1245 1246 /** 1247 * Set whether the edges of tab bar are fading. 1248 * 1249 * @param { boolean } value - indicates whether the edges of tab bar are fading. 1250 * @returns { TabsAttribute } the attribute of the tabs 1251 * @syscap SystemCapability.ArkUI.ArkUI.Full 1252 * @crossplatform 1253 * @since 10 1254 */ 1255 /** 1256 * Set whether the edges of tab bar are fading. 1257 * 1258 * @param { boolean } value - indicates whether the edges of tab bar are fading. 1259 * @returns { TabsAttribute } the attribute of the tabs 1260 * @syscap SystemCapability.ArkUI.ArkUI.Full 1261 * @crossplatform 1262 * @atomicservice 1263 * @since 11 1264 */ 1265 fadingEdge(value: boolean): TabsAttribute; 1266 1267 /** 1268 * Set the divider between tab bar and tab content. 1269 * 1270 * @param { DividerStyle | null } value - indicates the style of the indicator. 1271 * @returns { TabsAttribute } the attribute of the tabs 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @since 10 1275 */ 1276 /** 1277 * Set the divider between tab bar and tab content. 1278 * 1279 * @param { DividerStyle | null } value - indicates the style of the indicator. 1280 * @returns { TabsAttribute } the attribute of the tabs 1281 * @syscap SystemCapability.ArkUI.ArkUI.Full 1282 * @crossplatform 1283 * @atomicservice 1284 * @since 11 1285 */ 1286 divider(value: DividerStyle | null): TabsAttribute; 1287 1288 /** 1289 * Set whether the tab bar overlaps with the tab content. 1290 * 1291 * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. 1292 * @returns { TabsAttribute } the attribute of the tabs 1293 * @syscap SystemCapability.ArkUI.ArkUI.Full 1294 * @since 10 1295 */ 1296 /** 1297 * Set whether the tab bar overlaps with the tab content. 1298 * 1299 * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. 1300 * @returns { TabsAttribute } the attribute of the tabs 1301 * @syscap SystemCapability.ArkUI.ArkUI.Full 1302 * @crossplatform 1303 * @atomicservice 1304 * @since 11 1305 */ 1306 barOverlap(value: boolean): TabsAttribute; 1307 1308 /** 1309 * Set the background color of the tab bar. 1310 * 1311 * @param { ResourceColor } value - indicates the background color of the tab bar. 1312 * @returns { TabsAttribute } the attribute of the tabs 1313 * @syscap SystemCapability.ArkUI.ArkUI.Full 1314 * @since 10 1315 */ 1316 /** 1317 * Set the background color of the tab bar. 1318 * 1319 * @param { ResourceColor } value - indicates the background color of the tab bar. 1320 * @returns { TabsAttribute } the attribute of the tabs 1321 * @syscap SystemCapability.ArkUI.ArkUI.Full 1322 * @crossplatform 1323 * @atomicservice 1324 * @since 11 1325 */ 1326 barBackgroundColor(value: ResourceColor): TabsAttribute; 1327 1328 /** 1329 * Set the grid alignment options of the tab bar. 1330 * 1331 * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. 1332 * @returns { TabsAttribute } the attribute of the tabs 1333 * @syscap SystemCapability.ArkUI.ArkUI.Full 1334 * @crossplatform 1335 * @since 10 1336 */ 1337 /** 1338 * Set the grid alignment options of the tab bar. 1339 * 1340 * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. 1341 * @returns { TabsAttribute } the attribute of the tabs 1342 * @syscap SystemCapability.ArkUI.ArkUI.Full 1343 * @crossplatform 1344 * @atomicservice 1345 * @since 11 1346 */ 1347 barGridAlign(value: BarGridColumnOptions): TabsAttribute; 1348 1349 /** 1350 * Custom tab content transition animation. 1351 * When undefined is set, this interface does not take effect. 1352 * 1353 * @param { function } delegate - custom content transition animation. 1354 * @returns { TabsAttribute } the attribute of the tabs 1355 * @syscap SystemCapability.ArkUI.ArkUI.Full 1356 * @crossplatform 1357 * @form 1358 * @since 11 1359 */ 1360 /** 1361 * Custom tab content transition animation. 1362 * When undefined is set, this interface does not take effect. 1363 * 1364 * @param { function } delegate - custom content transition animation. 1365 * @returns { TabsAttribute } the attribute of the tabs 1366 * @syscap SystemCapability.ArkUI.ArkUI.Full 1367 * @crossplatform 1368 * @form 1369 * @atomicservice 1370 * @since 12 1371 */ 1372 customContentTransition(delegate: (from: number, to: number) => TabContentAnimatedTransition | undefined): TabsAttribute; 1373 1374 /** 1375 * Set the BlurStyle of the tab bar. 1376 * 1377 * @param { BlurStyle } value - indicates the BlurStyle of the tab bar. 1378 * @returns { TabsAttribute } the attribute of the tabs 1379 * @syscap SystemCapability.ArkUI.ArkUI.Full 1380 * @crossplatform 1381 * @atomicservice 1382 * @since 11 1383 */ 1384 barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; 1385 1386 /** 1387 * Called when content will change. 1388 * 1389 * @param { function } handler 1390 * "currentIndex": the index value of the current tab. 1391 * "comingIndex": the index value of the tab that will change. 1392 * Tabs can change from currentIndex to comingIndex if function return true. 1393 * Tabs can not change from currentIndex to comingIndex if function return false. 1394 * @returns { TabsAttribute } 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @crossplatform 1397 * @atomicservice 1398 * @since 12 1399 */ 1400 onContentWillChange(handler: (currentIndex: number, comingIndex: number) => boolean): TabsAttribute; 1401} 1402 1403/** 1404 * Defines the Tab Content animated transition options. 1405 * 1406 * @interface TabContentAnimatedTransition 1407 * @syscap SystemCapability.ArkUI.ArkUI.Full 1408 * @crossplatform 1409 * @form 1410 * @since 11 1411 */ 1412/** 1413 * Defines the Tab Content animated transition options. 1414 * 1415 * @interface TabContentAnimatedTransition 1416 * @syscap SystemCapability.ArkUI.ArkUI.Full 1417 * @crossplatform 1418 * @form 1419 * @atomicservice 1420 * @since 12 1421 */ 1422declare interface TabContentAnimatedTransition { 1423 /** 1424 * Defines the timeout of custom content transition animation. The unit is ms. 1425 * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. 1426 * 1427 * @type { ?number } 1428 * @default 1000 ms 1429 * @syscap SystemCapability.ArkUI.ArkUI.Full 1430 * @crossplatform 1431 * @form 1432 * @since 11 1433 */ 1434 /** 1435 * Defines the timeout of custom content transition animation. The unit is ms. 1436 * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. 1437 * 1438 * @type { ?number } 1439 * @default 1000 ms 1440 * @syscap SystemCapability.ArkUI.ArkUI.Full 1441 * @crossplatform 1442 * @form 1443 * @atomicservice 1444 * @since 12 1445 */ 1446 timeout?: number; 1447 1448 /** 1449 * Called when custom content transition animation start. 1450 * 1451 * @type { function } 1452 * @syscap SystemCapability.ArkUI.ArkUI.Full 1453 * @crossplatform 1454 * @form 1455 * @since 11 1456 */ 1457 /** 1458 * Called when custom content transition animation start. 1459 * 1460 * @type { function } 1461 * @syscap SystemCapability.ArkUI.ArkUI.Full 1462 * @crossplatform 1463 * @form 1464 * @atomicservice 1465 * @since 12 1466 */ 1467 transition: (proxy: TabContentTransitionProxy) => void; 1468} 1469 1470/** 1471 * The proxy of TabContentAnimatedTransition. 1472 * 1473 * @interface TabContentTransitionProxy 1474 * @syscap SystemCapability.ArkUI.ArkUI.Full 1475 * @crossplatform 1476 * @form 1477 * @since 11 1478 */ 1479/** 1480 * The proxy of TabContentAnimatedTransition. 1481 * 1482 * @interface TabContentTransitionProxy 1483 * @syscap SystemCapability.ArkUI.ArkUI.Full 1484 * @crossplatform 1485 * @form 1486 * @atomicservice 1487 * @since 12 1488 */ 1489declare interface TabContentTransitionProxy { 1490 /** 1491 * The index of current tab content. 1492 * 1493 * @type { number } 1494 * @syscap SystemCapability.ArkUI.ArkUI.Full 1495 * @crossplatform 1496 * @form 1497 * @since 11 1498 */ 1499 /** 1500 * The index of current tab content. 1501 * 1502 * @type { number } 1503 * @syscap SystemCapability.ArkUI.ArkUI.Full 1504 * @crossplatform 1505 * @form 1506 * @atomicservice 1507 * @since 12 1508 */ 1509 from: number; 1510 1511 /** 1512 * The index of target tab content. 1513 * 1514 * @type { number } 1515 * @syscap SystemCapability.ArkUI.ArkUI.Full 1516 * @crossplatform 1517 * @form 1518 * @since 11 1519 */ 1520 /** 1521 * The index of target tab content. 1522 * 1523 * @type { number } 1524 * @syscap SystemCapability.ArkUI.ArkUI.Full 1525 * @crossplatform 1526 * @form 1527 * @atomicservice 1528 * @since 12 1529 */ 1530 to: number; 1531 1532 /** 1533 * Notifies Tabs component the custom content transition animation is complete. 1534 * 1535 * @syscap SystemCapability.ArkUI.ArkUI.Full 1536 * @crossplatform 1537 * @form 1538 * @since 11 1539 */ 1540 /** 1541 * Notifies Tabs component the custom content transition animation is complete. 1542 * 1543 * @syscap SystemCapability.ArkUI.ArkUI.Full 1544 * @crossplatform 1545 * @form 1546 * @atomicservice 1547 * @since 12 1548 */ 1549 finishTransition(): void; 1550} 1551 1552/** 1553 * Defines Tabs Component. 1554 * 1555 * @syscap SystemCapability.ArkUI.ArkUI.Full 1556 * @since 7 1557 */ 1558/** 1559 * Defines Tabs Component. 1560 * 1561 * @syscap SystemCapability.ArkUI.ArkUI.Full 1562 * @crossplatform 1563 * @since 10 1564 */ 1565/** 1566 * Defines Tabs Component. 1567 * 1568 * @syscap SystemCapability.ArkUI.ArkUI.Full 1569 * @crossplatform 1570 * @atomicservice 1571 * @since 11 1572 */ 1573declare const Tabs: TabsInterface; 1574 1575/** 1576 * Defines Tabs Component instance. 1577 * 1578 * @syscap SystemCapability.ArkUI.ArkUI.Full 1579 * @since 7 1580 */ 1581/** 1582 * Defines Tabs Component instance. 1583 * 1584 * @syscap SystemCapability.ArkUI.ArkUI.Full 1585 * @crossplatform 1586 * @since 10 1587 */ 1588/** 1589 * Defines Tabs Component instance. 1590 * 1591 * @syscap SystemCapability.ArkUI.ArkUI.Full 1592 * @crossplatform 1593 * @atomicservice 1594 * @since 11 1595 */ 1596declare const TabsInstance: TabsAttribute; 1597