/* * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * @kit ArkUI */ /*** if arkts 1.2 */ import { BackgroundBlurStyleOptions, BackgroundEffectOptions, BlurStyle, Callback, CommonMethod, Optional, TranslateOptions, DividerStyle } from './common'; import { EdgeEffect, PageFlipMode } from './enums'; import { Dimension, Length, ResourceColor } from './units'; import { CommonModifier } from "../CommonModifier"; /*** endif */ /** * CommonModifier * * @typedef { import('../api/arkui/CommonModifier').CommonModifier } CommonModifier * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 15 */ declare type CommonModifier = import('../api/arkui/CommonModifier').CommonModifier; /** * Declare the graphic format of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Declare the graphic format of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Declare the graphic format of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ declare enum BarMode { /** * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * The width of each tab is determined by the actual layout. The tabs are scrollable in the following case: * In horizontal layout, the total width exceeds the tab bar width; in vertical layout, * the total height exceeds the tab bar height. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ Scrollable = 0, /** * The width of all TabBars is evenly allocated. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * The width of all TabBars is evenly allocated. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * The width of each tab is determined by equally dividing the number of tabs by the bar width * (or bar height in the vertical layout). * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ Fixed = 1, } /** * Declare the animation mode of tab content. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ declare enum AnimationMode { /** * Load the content of the target page before starting the switching animation. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ CONTENT_FIRST = 0, /** * Start the switching animation before loading the content of the target page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ ACTION_FIRST = 1, /** * Disable the default switching animation. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ NO_ANIMATION = 2, /** * Load the content of the target page first, then jump to the vicinity of the target page without animation, * and finally jump to the target page with animation. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ CONTENT_FIRST_WITH_JUMP = 3, /** * Jump to the vicinity of the target page without animation first, * then jump to the target page with animation, and finally load the content of the target page. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ ACTION_FIRST_WITH_JUMP = 4, } /** * Declare the location of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Declare the location of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Declare the location of the bar chart. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ declare enum BarPosition { /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ Start, /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * 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. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ End, } /** * Declare the layout style of the tab bar items. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Declare the layout style of the tab bar items. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ declare enum LayoutStyle { /** * The tab bar items are laid in the center of the tab bar. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * If the tab content exceeds the tab bar width, the tabs are scrollable. * If not, the tabs are compactly centered on the tab bar and not scrollable. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ ALWAYS_CENTER = 0, /** * The tab bar items are laid in the tab bar by an average split. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * If the tab content exceeds the tab bar width, the tabs are scrollable. * If not, the tabs are not scrollable, and the width of the tab bar is evenly distributed among all tabs. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ ALWAYS_AVERAGE_SPLIT = 1, /** * The tab bar items are laid in the center of the bar when their total length is more than half of the tab bar. * Otherwise, they are laid in the center half of the tab bar with the same space between them. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * If the tab content exceeds the tab bar width, the tabs are scrollable. If the tab content exceeds * half the width of the tab bar but is still within the tab bar width, the tabs are compactly centered and * not scrollable.If the tab content does not exceed half the width of the tab bar, the tabs are centered within * half the width of the tab bar with even spacing between them and are not scrollable. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ SPACE_BETWEEN_OR_CENTER = 2 } /** * Declare the cache mode of the child components. * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'19','1.2':'20'} * @arkts 1.1&1.2 */ declare enum TabsCacheMode { /** * Caches the child components on both sides of the current child components. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'19','1.2':'20'} * @arkts 1.1&1.2 */ CACHE_BOTH_SIDE = 0, /** * Caches the latest switched child components. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'19','1.2':'20'} * @arkts 1.1&1.2 */ CACHE_LATEST_SWITCHED = 1 } /** * Provides methods for switching tabs. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Provides methods for switching tabs. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides methods for switching tabs. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ declare class TabsController { /** * constructor. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * constructor. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * constructor. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ constructor(); /** * Called when the tab is switched. * * @param { number } value * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the tab is switched. * * @param { number } value * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Switches to the specified tab. * * @param { number } value - Index of the tab. If this parameter is set to a value less than 0 * or greater than the maximum number, the default value 0 is used. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ changeIndex(value: number): void; /** * Called when need to preload specified tab content. * * @param { Optional> } indices - Indices of tab content to be preloaded, default to an empty array. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter invalid. Possible causes: *
1. The parameter type is not Array. *
2. The parameter is an empty array. *
3. The parameter contains an invalid index. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ preloadItems(indices: Optional>): Promise; /** * Set tab bar translate. * * @param { TranslateOptions } translate - translate options * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'13','1.2':'20'} * @arkts 1.1&1.2 */ setTabBarTranslate(translate: TranslateOptions): void; /** * Set tab bar opacity. * * @param { number } opacity - opacity, default to 1.0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'13','1.2':'20'} * @arkts 1.1&1.2 */ setTabBarOpacity(opacity: number): void; } /** * Options used to create Tabs. * * @typedef TabsOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ declare interface TabsOptions { /** * Set the tab location for Tabs. * * @type { ?BarPosition } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Set the tab location for Tabs. * * @type { ?BarPosition } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Set the tab location for Tabs. * * @type { ?BarPosition } * @default BarPosition.Start * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barPosition?: BarPosition; /** * Set the index of the currently displayed tab. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Set the index of the currently displayed tab. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Set the index of the currently displayed tab. * * @type { ?number } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ index?: number; /** * Set the Tabs controller. * * @type { ?TabsController } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Set the Tabs controller. * * @type { ?TabsController } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Set the Tabs controller. * * @type { ?TabsController } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ controller?: TabsController /** * Set common attributes to tabbar. * * @type { ?CommonModifier } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ barModifier?: CommonModifier } /** * Provides an interface for switching views. * * @interface TabsInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Provides an interface for switching views. * * @interface TabsInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides an interface for switching views. * * @interface TabsInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ interface TabsInterface { /** * Called when the view is switched. * * @param { object } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the view is switched. * * @param { object } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the view is switched. * * @param { object } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Called when the view is switched. * * @param { TabsOptions } [options] - Tabs options. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ (options?: TabsOptions): TabsAttribute; } /** * Provides an interface for the style of an divider including stroke width, color, start margin * and end margin * * @interface DividerStyle * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides an interface for the style of an divider including stroke width, color, start margin * and end margin * * @interface DividerStyle * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ interface DividerStyle { /** * Define the stroke width of the divider * * @type { Length } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Width of the divider. It cannot be set in percentage. * * @type { Length } * @default 0vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ strokeWidth: Length; /** * Define the color of the divider * * @type { ?ResourceColor } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Color of the divider. * * @type { ?ResourceColor } * @default #33182431 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ color?: ResourceColor; /** * Define the start margin of the divider * * @type { ?Length } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Distance between the divider and the top of the sidebar. It cannot be set in percentage. * * @type { ?Length } * @default 0vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ startMargin?: Length; /** * Define the end margin of the divider * * @type { ?Length } * @default 0 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Distance between the divider and the bottom of the sidebar. It cannot be set in percentage. * * @type { ?Length } * @default 0vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ endMargin?: Length; } /** * Provides an interface for tabs animation. * * @interface TabsAnimationEvent * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Provides an interface for tabs animation. * * @interface TabsAnimationEvent * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ declare interface TabsAnimationEvent { /** * Offset of the current page to the start position of the tabs main axis. The unit is vp. * * @type { number } * @default 0.0 vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Offset of the current page to the start position of the tabs main axis. The unit is vp. * * @type { number } * @default 0.0 vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ currentOffset: number; /** * Offset of the target page to the start position of the tabs main axis. The unit is vp. * * @type { number } * @default 0.0 vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Offset of the target page to the start position of the tabs main axis. The unit is vp. * * @type { number } * @default 0.0 vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ targetOffset: number; /** * Start speed of the page-turning animation. The unit is vp/s. * * @type { number } * @default 0.0 vp/s * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Start speed of the page-turning animation. The unit is vp/s. * * @type { number } * @default 0.0 vp/s * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ velocity: number; } /** * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. * * @interface BarGridColumnOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. * * @interface BarGridColumnOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ interface BarGridColumnOptions { /** * Define the occupied column number when the screen is of small size * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Number of columns occupied by a tab on a screen whose width is * greater than or equal to 320 vp but less than 600 vp. The value must be a non-negative even number. * * @type { ?number } * @default -1 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ sm?: number; /** * Define the occupied column number when the screen is of middle size * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Number of columns occupied by a tab on a screen whose width is * greater than or equal to 600 vp but less than 800 vp. The value must be a non-negative even number. * * @type { ?number } * @default -1 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ md?: number; /** * Define the occupied column number when the screen is of large size * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Number of columns occupied by a tab on a screen whose width is * greater than or equal to 840 vp but less than 1024 vp. The value must be a non-negative even number. * * @type { ?number } * @default -1 * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ lg?: number; /** * Define the margin size of the columns * * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Column margin in grid mode. It cannot be set in percentage. * * @type { ?Dimension } * @default 24vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ margin?: Dimension; /** * Define the gutter size of the columns * * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Column gutter (that is, gap between columns) in grid mode. It cannot be set in percentage. * * @type { ?Dimension } * @default 24vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ gutter?: Dimension; } /** * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. * * @interface ScrollableBarModeOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. * * @interface ScrollableBarModeOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ interface ScrollableBarModeOptions { /** * Define the margin size of the bar items when the tab bar is scrollable. * * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Left and right margin of the tab bar in scrollable mode. It cannot be set in percentage. * * @type { ?Dimension } * @default 0vp * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ margin?: Dimension; /** * Define the layout style of the bar items when the tab bar is not scrollable. * * @type { ?LayoutStyle } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Tab layout mode of the tab bar when not scrolling in scrollable mode. * * @type { ?LayoutStyle } * @default LayoutStyle.ALWAYS_CENTER * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ nonScrollableLayoutStyle?: LayoutStyle; } /** * Defines a tabs callback when onAnimationStart. * * @typedef { function } OnTabsAnimationStartCallback * @param { number } index - The index value of the tab that when animation start. * @param { number } targetIndex - The target index value of the tab that when animation start. * @param { TabsAnimationEvent } extraInfo - The extra callback info. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; /** * Defines a tabs callback when onAnimationEnd. * * @typedef { function } OnTabsAnimationEndCallback * @param { number } index - The index value of the tab that when animation end. * @param { TabsAnimationEvent } extraInfo - The extra callback info. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; /** * Defines a tabs callback when onGestureSwipe. * * @typedef { function } OnTabsGestureSwipeCallback * @param { number } index - The index value of the tab before gesture swipe. * @param { TabsAnimationEvent } extraInfo - The extra callback info. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; /** * Defines a tabs callback when customContentTransition. * * @typedef { function } TabsCustomContentTransitionCallback * @param { number } from - The index value of the current tab when the animation begins. * @param { number } to - The index value of the target tab when the animation begins. * @returns { TabContentAnimatedTransition | undefined } Returns animated transition options of tab or undefined. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ declare type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; /** * Defines a tabs callback when onContentWillChange. * * @typedef { function } OnTabsContentWillChangeCallback * @param { number } currentIndex - The index value of the current tab. * @param { number } comingIndex - The index value of the tab that will change. * @returns { boolean } * Tabs can change from currentIndex to comingIndex if function return true. * Tabs can not change from currentIndex to comingIndex if function return false. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; /** * Defines the tabs attribute functions. * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines the tabs attribute functions. * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines the tabs attribute functions. * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ declare class TabsAttribute extends CommonMethod { /** * Called when determining whether the tab is vertical. * * @param { boolean } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when determining whether the tab is vertical. * * @param { boolean } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets whether to use vertical tabs. * * @param { boolean } value - Whether to use vertical tabs. Default value is false. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ vertical(value: boolean): TabsAttribute; /** * Called when determining the location of the bar chart. * * @param { BarPosition } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 */ /** * Called when determining the location of the bar chart. * * @param { BarPosition } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the position of the Tabs component. * * @param { BarPosition } value - Position of the Tabs component. Default value is BarPosition.Start. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barPosition(value: BarPosition): TabsAttribute; /** * Called when judging whether page switching can be performed by sliding left and right. * * @param { boolean } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when judging whether page switching can be performed by sliding left and right. * * @param { boolean } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets whether the tabs are scrollable. * * @param { boolean } value - Whether the tabs are scrollable. Default value is true. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ scrollable(value: boolean): TabsAttribute; /** * Called when the graphic format of the bar chart is selected as fixed mode. * * @param { BarMode.Fixed } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the tab bar layout mode to BarMode.Fixed. * * @param { BarMode.Fixed } value - The width of each tab is determined by equally dividing * the number of tabs by the bar width (or bar height in the vertical layout). * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ barMode(value: BarMode.Fixed): TabsAttribute; /** * Called when the graphic format of the bar chart is selected as scrollable mode. * * @param { BarMode.Scrollable } value * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the tab bar layout mode to BarMode.Scrollable. * * @param { BarMode.Scrollable } value - The width of each tab is determined by the actual layout. * The tabs are scrollable in the following case: In horizontal layout, the total width exceeds the tab bar width; * in vertical layout, the total height exceeds the tab bar height. * @param { ScrollableBarModeOptions } [options] - Layout style of the tab bar in scrollable mode. * This parameter is effective only when the tab bar is in scrollable mode. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ barMode(value: BarMode.Scrollable, options: ScrollableBarModeOptions): TabsAttribute; /** * Called when the graphic format of the bar chart is selected. * * @param { BarMode } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the graphic format of the bar chart is selected. * * @param { BarMode } value * @param { ScrollableBarModeOptions } [options] - options indicate the options for the scrollable bar mode * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the tab bar layout mode. * * @param { BarMode } value - Layout mode. Default value is BarMode.Fixed. * @param { ScrollableBarModeOptions } [options] - Layout style of the tab bar in scrollable mode. * This parameter is effective only when the tab bar is in horizontal scrollable mode. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; /** * Called when the width of the bar graph is set. * Notice: barWidth only supports Number type. * * @param { number } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the width of the bar graph is set. * Notice: barWidth only supports Number type on 7, supports Length type since 8. * * @param { Length } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Called when the width of the bar graph is set. * Notice: barWidth only supports Number type on 7, supports Length type since 8. * * @param { Length } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the width of the tab bar. * Notice: barWidth only supports Number type on 7, supports Length type since 8. * * @param { Length } value - Width of the tab bar. If the set value is less than 0 * or greater than the width of the Tabs component, the default value is used. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barWidth(value: Length): TabsAttribute; /** * Called when the height of the bar graph is set. * Notice: barHeight only supports Number type. * * @param { number } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the height of the bar graph is set. * Notice: barHeight only supports Number type on 7, supports Length type since 8. * * @param { Length } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Called when the height of the bar graph is set. * Notice: barHeight only supports Number type on 7, supports Length type since 8. * * @param { Length } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the height of the tab bar. * Notice: barHeight only supports Number type on 7, supports Length type since 8. * * @param { Length } value - Height of the tab bar. If the set value is less than 0 or * greater than the height of the Tabs component, the default value is used. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barHeight(value: Length): TabsAttribute; /** * Called when the height of the bar graph is set. * Notice: barHeight only supports Number type on 7, supports Length type since 8. * * @param { Length } height - the height of the tabBar. * @param { boolean } noMinHeightLimit - indicates whether there is a minimum limit on the height of the tabBar * when height is set to auto, default value is false. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ barHeight(height: Length, noMinHeightLimit: boolean): TabsAttribute; /** * Sets the animation curve * * @param { Curve | ICurve } curve - animation curve for tabs switch animation, * Curve is an enumeration type for common curves, ICurve is a curve object. * Default value: * When pages are turned by swiping in TabContent, the default value is * interpolatingSpring(-1, 1, 228, 30). * When pages are turned by tapping tabs or calling the changeIndex API of TabsController, * the default value is cubicBezierCurve(0.2, 0.0, 0.1, 1.0). * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */ animationCurve(curve: Curve | ICurve): TabsAttribute; /** * Called when the animation duration of the bar graph is set. * * @param { number } value * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the animation duration of the bar graph is set. * * @param { number } value - default value: * When this property is not set or set to null, the default value is 0. * When set to a value less than 0 or undefined, the default value is 300. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the length of time required to complete the tab switching animation, * which is initiated by clicking a specific tab or by calling the changeIndex API of TabsController. * * @param { number } value - default value: * When this property is not set or set to null, the default value is 0. * When set to a value less than 0 or undefined, the default value is 300. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ animationDuration(value: number): TabsAttribute; /** * Sets the animation mode for tab switching initiated by clicking a specific tab or * by calling the changeIndex API of TabsController. * * @param { Optional } mode - animation mode for tabs switch animation. * Default value is AnimationMode.CONTENT_FIRST. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ animationMode(mode: Optional): TabsAttribute; /** * Sets the edge effect used when the boundary of the scrolling area is reached. * * @param { Optional } edgeEffect - Effect used when the boundary of the scrolling area is reached. * Default value is EdgeEffect.Spring. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ edgeEffect(edgeEffect: Optional): TabsAttribute; /** * Called when the tab is switched. * * @param { function } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Called when the tab is switched. * * @param { function } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the tab is switched. * * @param { function } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Triggered when a tab is switched. * Anonymous Object Rectification * *

NOTE: *
This event is triggered when any of the following conditions is met: * 1. The swiping animation is completed, followed by tab switching. * 2. The Controller API is called. * 3. The attribute value is updated using a state variable. * 4. A tab is clicked. *

* * @param { Callback } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onChange(event: Callback): TabsAttribute; /** * Called when a new tab becomes selected. Animation is not necessarily complete. * * @param { Callback } event - callback to notify which index has been selected * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onSelected(event: Callback): TabsAttribute; /** * Called when the tab is clicked. * * @param { function } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Called when the tab is clicked. * * @param { function } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ /** * Triggered when a tab is clicked. * Anonymous Object Rectification * * @param { Callback } event * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onTabBarClick(event: Callback): TabsAttribute; /** * Called when a new tab becomes unselected. Animation is not necessarily complete. * * @param { Callback } event - callback to notify which index has been unselected * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onUnselected(event: Callback): TabsAttribute; /** * Called when the tab content flip animation start. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "targetIndex": the target index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Called when the tab content flip animation start. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "targetIndex": the target index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Triggered when the tab switching animation starts. * Anonymous Object Rectification * * @param { OnTabsAnimationStartCallback } handler * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onAnimationStart(handler: OnTabsAnimationStartCallback): TabsAttribute; /** * Called when the tab content flip animation end. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Called when the tab content flip animation end. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Triggered when the tab switching animation ends. * Anonymous Object Rectification * * @param { OnTabsAnimationEndCallback } handler * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onAnimationEnd(handler: OnTabsAnimationEndCallback): TabsAttribute; /** * Called when swiping the tab content with the gesture. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Called when swiping the tab content with the gesture. * * @param { function } handler - * "index": the index value of the tab that when animation start. * "event": the animation event callback info. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Triggered on a frame-by-frame basis when the tab is switched by a swipe. * Anonymous Object Rectification * * @param { OnTabsGestureSwipeCallback } handler * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onGestureSwipe(handler: OnTabsGestureSwipeCallback): TabsAttribute; /** * Set whether the edges of tab bar are fading. * * @param { boolean } value - indicates whether the edges of tab bar are fading. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets whether the tab fades out when it exceeds the container width. * *

NOTE: *
It is recommended that this attribute be used together with the barBackgroundColor attribute. * If the barBackgroundColor attribute is not defined, the tab fades out in white * when it exceeds the container width by default. *

* * @param { boolean } value - Whether the tab fades out when it exceeds the container width. Default value is true. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ fadingEdge(value: boolean): TabsAttribute; /** * Set the divider between tab bar and tab content. * * @param { DividerStyle | null } value - indicates the style of the indicator. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Set the divider between tab bar and tab content. * * @param { DividerStyle | null } value - indicates the style of the indicator. Default value is null. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ divider(value: DividerStyle | null): TabsAttribute; /** * Set whether the tab bar overlaps with the tab content. * * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Sets whether the tab bar is superimposed on the TabContent component after having its background blurred. * * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. Default value is false. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barOverlap(value: boolean): TabsAttribute; /** * Set the background color of the tab bar. * * @param { ResourceColor } value - indicates the background color of the tab bar. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Set the background color of the tab bar. * * @param { ResourceColor } value - indicates the background color of the tab bar. * Default value is Color.Transparent. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barBackgroundColor(value: ResourceColor): TabsAttribute; /** * Set the grid alignment options of the tab bar. * * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Sets the visible area of the tab bar in grid mode. * *

NOTE: *
This attribute is effective only in horizontal mode. It is not applicable to XS, XL, and XXL devices. *

* * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barGridAlign(value: BarGridColumnOptions): TabsAttribute; /** * Custom tab content transition animation. * When undefined is set, this interface does not take effect. * * @param { function } delegate - custom content transition animation. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * Custom tab content transition animation. * When undefined is set, this interface does not take effect. * * @param { function } delegate - custom content transition animation. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since 12 */ /** * Custom tab content transition animation. * When undefined is set, this interface does not take effect. * Anonymous Object Rectification * *

NOTE: *
Instructions: *
1. When the custom tab switching animation is used, the default switching animation of * the Tabs component is disabled, and tabs cannot be switched through swiping. *
2. The value undefined means not to use the custom tab switching animation, * in which case the default switching animation is used. *
3. The custom tab switching animation cannot be interrupted. *
4. Currently, the custom tab switching animation can be triggered only by clicking a tab * or by calling the TabsController.changeIndex() API. *
5. When the custom tab switching animation is used, * the Tabs component supports all events except onGestureSwipe. *
6. Notes about the onChange and onAnimationEnd events: If the second custom animation is triggered * during the execution of the first custom animation, the onChange and onAnimationEnd events of * the first custom animation will be triggered when the second custom animation starts. *
7. When the custom animation is used, the stack layout is used for pages involved in the animation. * If the zIndex attribute is not set for related pages, the zIndex values of all pages are the same. * In this case, the pages are rendered in the order in which they are added to * the component tree(that is, the sequence of page indexes). In light of this, * to control the rendering levels of pages, set the zIndex attribute of the pages. *

* * @param { TabsCustomContentTransitionCallback } delegate - Custom content transition animation. * @returns { TabsAttribute } The attribute of the tabs. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ customContentTransition(delegate: TabsCustomContentTransitionCallback): TabsAttribute; /** * Sets the background blur style of the tab bar. * * @param { BlurStyle } value - Background blur style of the tab bar. Default value is BlurStyle.NONE. * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; /** * Setting page flip mode on mouse wheel event. * * @param { Optional } mode - page flip mode on mouse wheel event. The default value is PageFlipMode.CONTINUOUS. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ pageFlipMode(mode: Optional): TabsAttribute; /** * Set the BlurStyle of the tab bar. * * @param { BlurStyle } style - style indicate the blur style for the tab bar * @param { BackgroundBlurStyleOptions } options - options indicate the options for the tab bar * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ barBackgroundBlurStyle(style: BlurStyle, options: BackgroundBlurStyleOptions): TabsAttribute; /** * Set the BackgroundEffect of the tab bar. * * @param { BackgroundEffectOptions } options - options indicate the options for the tab bar * @returns { TabsAttribute } the attribute of the tabs * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ barBackgroundEffect(options: BackgroundEffectOptions): TabsAttribute; /** * Called when content will change. * * @param { function } handler * "currentIndex": the index value of the current tab. * "comingIndex": the index value of the tab that will change. * Tabs can change from currentIndex to comingIndex if function return true. * Tabs can not change from currentIndex to comingIndex if function return false. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ /** * Triggered when a new page is about to be displayed. * Anonymous Object Rectification * *

NOTE: *
This event is triggered when any of the following conditions is met: * 1. When the user swipes on the TabContent component (provided that it supports swiping) to switch to a new page. * 2. When TabsController.changeIndex is called to switch to a new page. * 3. When the **index** attribute is changed to switch to a new page. * 4. When the user clicks a tab on the tab bar to switch to a new page. * 5. When the user presses the left or right arrow key on the keyboard to switch to a new page * while the tab bar is focused. *

* * @param { OnTabsContentWillChangeCallback } handler * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ onContentWillChange(handler: OnTabsContentWillChangeCallback): TabsAttribute; /** * Sets the maximum number of child components to be cached. * * @param { number } count - the maximum number of child components to be cached, default to 0. * @param { TabsCacheMode } mode - the mode of caching child components, default to TabsCacheMode.CACHE_BOTH_SIDE. * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since arkts {'1.1':'19','1.2':'20'} * @arkts 1.1&1.2 */ cachedMaxCount(count: number, mode: TabsCacheMode): TabsAttribute; } /** * Defines the Tab Content animated transition options. * * @interface TabContentAnimatedTransition * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * Defines the Tab Content animated transition options. * * @interface TabContentAnimatedTransition * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ declare interface TabContentAnimatedTransition { /** * Defines the timeout of custom content transition animation. The unit is ms. * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. * * @type { ?number } * @default 1000 ms * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * Defines the timeout of custom content transition animation. The unit is ms. * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. * * @type { ?number } * @default 1000 ms * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ timeout?: number; /** * Called when custom content transition animation start. * * @type { function } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * Called when custom content transition animation start. * * @type { function } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since 12 */ /** * Called when custom content transition animation start. * Anonymous Object Rectification * * @type { Callback } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ transition: Callback; } /** * The proxy of TabContentAnimatedTransition. * * @interface TabContentTransitionProxy * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * The proxy of TabContentAnimatedTransition. * * @interface TabContentTransitionProxy * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ declare interface TabContentTransitionProxy { /** * The index of current tab content. * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * The index of current tab content. * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ from: number; /** * The index of target tab content. * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * The index of target tab content. * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ to: number; /** * Notifies Tabs component the custom content transition animation is complete. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 11 */ /** * Notifies Tabs component the custom content transition animation is complete. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ finishTransition(): void; } /** * Defines Tabs Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines Tabs Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines Tabs Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare const Tabs: TabsInterface; /** * Defines Tabs Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** * Defines Tabs Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 */ /** * Defines Tabs Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 11 */ declare const TabsInstance: TabsAttribute;