From 73002aff110dc19cd9fe96e3a3c210cbd83a27a3 Mon Sep 17 00:00:00 2001 From: cheng-feiwang Date: Sat, 9 Aug 2025 15:36:04 +0800 Subject: [PATCH] fix sdk Signed-off-by: cheng-feiwang Change-Id: I6dac5f35908ad8d960772e1c0cb6777e7afc66f9 --- .../component/ets/alphabet_indexer.d.ts | 145 +-- api/@internal/component/ets/tab_content.d.ts | 348 +------ api/@internal/component/ets/tabs.d.ts | 315 +++---- .../component/alphabetIndexer.static.d.ets | 397 ++++++++ api/arkui/component/tabContent.static.d.ets | 612 +++++++++++++ api/arkui/component/tabs.static.d.ets | 862 ++++++++++++++++++ 6 files changed, 2056 insertions(+), 623 deletions(-) create mode 100644 api/arkui/component/alphabetIndexer.static.d.ets create mode 100644 api/arkui/component/tabContent.static.d.ets create mode 100644 api/arkui/component/tabs.static.d.ets diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index 26f03269ae..f937ef5afb 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, BlurStyle, Bindable } from './common' -import { ResourceColor, Length, Position } from './units' -import { Font } from './units' -/*** endif */ - /** * indexer align property. * @@ -46,8 +40,7 @@ import { Font } from './units' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum IndexerAlign { /** @@ -69,8 +62,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Left, @@ -93,8 +85,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Right, @@ -104,8 +95,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ START, @@ -115,8 +105,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ END, } @@ -128,8 +117,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface AlphabetIndexerOptions { /** @@ -164,8 +152,7 @@ interface AlphabetIndexerOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ arrayValue: Array; /** @@ -203,17 +190,6 @@ interface AlphabetIndexerOptions { * @since 18 */ selected: number; - /** - * ID of the selected item. - * - * @type { number | Bindable } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected: number | Bindable; } /** @@ -238,8 +214,7 @@ interface AlphabetIndexerOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface AlphabetIndexerInterface { @@ -283,8 +258,7 @@ interface AlphabetIndexerInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ (options: AlphabetIndexerOptions): AlphabetIndexerAttribute; } @@ -297,8 +271,7 @@ interface AlphabetIndexerInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerSelectCallback = (index: number) => void; @@ -310,11 +283,9 @@ declare type OnAlphabetIndexerSelectCallback = (index: number) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; - /** * Defines an AlphabetIndexer callback when onRequestPopupData. * @@ -324,8 +295,7 @@ declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; @@ -351,9 +321,7 @@ declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Arra * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - * @noninterop + * @since 11 */ declare class AlphabetIndexerAttribute extends CommonMethod { /** @@ -393,8 +361,7 @@ declare class AlphabetIndexerAttribute extends CommonMethod } index - * @returns { AlphabetIndexerAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected(index: number | Bindable): AlphabetIndexerAttribute; /** * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. @@ -982,8 +920,7 @@ declare class AlphabetIndexerAttribute extends CommonMethod { @@ -1602,8 +1337,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ tabBar(content: ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions): TabContentAttribute; @@ -1617,8 +1351,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillShow(event: VoidCallback): TabContentAttribute; @@ -1631,8 +1364,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillHide(event: VoidCallback): TabContentAttribute; } diff --git a/api/@internal/component/ets/tabs.d.ts b/api/@internal/component/ets/tabs.d.ts index 664f57f749..486ee7f689 100644 --- a/api/@internal/component/ets/tabs.d.ts +++ b/api/@internal/component/ets/tabs.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { BackgroundBlurStyleOptions, BackgroundEffectOptions, BlurStyle, Callback, CommonMethod, Optional, TranslateOptions, DividerStyle, Bindable } from './common'; -import { EdgeEffect, PageFlipMode } from './enums'; -import { Dimension, Length, ResourceColor } from './units'; -/*** endif */ - /** * CommonModifier * @@ -58,8 +52,7 @@ declare type CommonModifier = import('../api/arkui/CommonModifier').CommonModifi * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum BarMode { /** @@ -83,8 +76,7 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Scrollable = 0, @@ -108,10 +100,9 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - Fixed = 1, + Fixed = 1 } /** @@ -121,8 +112,7 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum AnimationMode { /** @@ -131,8 +121,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ CONTENT_FIRST = 0, @@ -142,8 +131,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ACTION_FIRST = 1, @@ -153,8 +141,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ NO_ANIMATION = 2, @@ -165,8 +152,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ CONTENT_FIRST_WITH_JUMP = 3, @@ -177,8 +163,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ ACTION_FIRST_WITH_JUMP = 4, } @@ -205,8 +190,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum BarPosition { /** @@ -228,8 +212,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Start, @@ -252,8 +235,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ End, } @@ -273,8 +255,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum LayoutStyle { /** @@ -291,8 +272,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ALWAYS_CENTER = 0, /** @@ -309,8 +289,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ALWAYS_AVERAGE_SPLIT = 1, /** @@ -330,8 +309,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ SPACE_BETWEEN_OR_CENTER = 2 } @@ -343,8 +321,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare enum TabsCacheMode { /** @@ -353,8 +330,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ CACHE_BOTH_SIDE = 0, @@ -364,8 +340,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ CACHE_LATEST_SWITCHED = 1 } @@ -389,8 +364,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class TabsController { /** @@ -412,8 +386,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -440,8 +413,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ changeIndex(value: number): void; @@ -457,8 +429,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ preloadItems(indices: Optional>): Promise; @@ -469,8 +440,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ setTabBarTranslate(translate: TranslateOptions): void; @@ -481,8 +451,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ setTabBarOpacity(opacity: number): void; } @@ -494,8 +463,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 * @noninterop */ declare interface TabsOptions { @@ -521,8 +489,7 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barPosition?: BarPosition; @@ -551,17 +518,6 @@ declare interface TabsOptions { * @since 11 */ index?: number; - /** - * Set the index of the currently displayed tab. - * - * @type { ?(number | Bindable) } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - index?: number | Bindable; /** * Set the Tabs controller. @@ -585,10 +541,9 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - controller?: TabsController + controller?: TabsController; /** * Set common attributes to tabbar. @@ -624,8 +579,7 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface TabsInterface { @@ -664,8 +618,7 @@ interface TabsInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ (options?: TabsOptions): TabsAttribute; } @@ -790,8 +743,7 @@ interface DividerStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabsAnimationEvent { /** @@ -811,8 +763,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ currentOffset: number; @@ -833,8 +784,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ targetOffset: number; @@ -855,8 +805,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ velocity: number; } @@ -876,8 +825,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface BarGridColumnOptions { /** @@ -897,8 +845,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ sm?: number; @@ -919,8 +866,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ md?: number; @@ -941,8 +887,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ lg?: number; @@ -962,8 +907,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ margin?: Dimension; @@ -983,8 +927,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ gutter?: Dimension; } @@ -1004,8 +947,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface ScrollableBarModeOptions { /** @@ -1024,8 +966,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ margin?: Dimension; @@ -1045,8 +986,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ nonScrollableLayoutStyle?: LayoutStyle; } @@ -1061,8 +1001,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; @@ -1075,8 +1014,7 @@ declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; @@ -1089,8 +1027,7 @@ declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimati * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; @@ -1104,8 +1041,7 @@ declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimati * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; @@ -1121,8 +1057,7 @@ declare type TabsCustomContentTransitionCallback = (from: number, to: number) => * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; @@ -1148,8 +1083,7 @@ declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingInde * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ declare class TabsAttribute extends CommonMethod { @@ -1178,8 +1112,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ vertical(value: boolean): TabsAttribute; @@ -1208,8 +1141,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barPosition(value: BarPosition): TabsAttribute; @@ -1238,8 +1170,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollable(value: boolean): TabsAttribute; @@ -1319,8 +1250,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; @@ -1362,8 +1292,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barWidth(value: Length): TabsAttribute; @@ -1405,12 +1334,11 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ 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. * @@ -1423,7 +1351,7 @@ declare class TabsAttribute extends CommonMethod { * @atomicservice * @since 20 */ - barHeight(height: Length, noMinHeightLimit: boolean): TabsAttribute; + barHeight(height: Length, noMinHeightLimit: boolean): TabsAttribute; /** * Sets the animation curve @@ -1441,7 +1369,7 @@ declare class TabsAttribute extends CommonMethod { * @atomicservice * @since 20 */ - animationCurve(curve: Curve | ICurve): TabsAttribute; + animationCurve(curve: Curve | ICurve): TabsAttribute; /** * Called when the animation duration of the bar graph is set. @@ -1469,8 +1397,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ animationDuration(value: number): TabsAttribute; @@ -1484,8 +1411,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ animationMode(mode: Optional): TabsAttribute; @@ -1498,8 +1424,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ edgeEffect(edgeEffect: Optional): TabsAttribute; @@ -1547,23 +1472,21 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onChange(event: Callback): TabsAttribute; /** - * Called when a new tab becomes selected. Animation is not necessarily complete. + * Called when a new tab becomes unselected. Animation is not necessarily complete. * - * @param { Callback } event - callback to notify which index has been selected + * @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 + * @since 18 */ - onSelected(event: Callback): TabsAttribute; + onUnselected(event: Callback): TabsAttribute; /** * Called when the tab is clicked. @@ -1593,24 +1516,10 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ 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. * @@ -1645,8 +1554,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onAnimationStart(handler: OnTabsAnimationStartCallback): TabsAttribute; @@ -1682,8 +1590,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onAnimationEnd(handler: OnTabsAnimationEndCallback): TabsAttribute; @@ -1719,8 +1626,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onGestureSwipe(handler: OnTabsGestureSwipeCallback): TabsAttribute; @@ -1747,8 +1653,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fadingEdge(value: boolean): TabsAttribute; @@ -1769,8 +1674,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ divider(value: DividerStyle | null): TabsAttribute; @@ -1790,8 +1694,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barOverlap(value: boolean): TabsAttribute; @@ -1812,8 +1715,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barBackgroundColor(value: ResourceColor): TabsAttribute; @@ -1838,8 +1740,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barGridAlign(value: BarGridColumnOptions): TabsAttribute; @@ -1897,8 +1798,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ customContentTransition(delegate: TabsCustomContentTransitionCallback): TabsAttribute; @@ -1910,8 +1810,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; @@ -1923,8 +1822,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ pageFlipMode(mode: Optional): TabsAttribute; @@ -1937,8 +1835,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ barBackgroundBlurStyle(style: BlurStyle, options: BackgroundBlurStyleOptions): TabsAttribute; @@ -1950,11 +1847,23 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ barBackgroundEffect(options: BackgroundEffectOptions): TabsAttribute; + /** + * Sets the maximum number of child components to be cached. + * + * @param { number } count - the maximum number of child components to be cached. + * @param { TabsCacheMode } mode - the mode of caching child components. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 19 + */ + cachedMaxCount(count: number, mode: TabsCacheMode): TabsAttribute; + /** * Called when content will change. * @@ -1988,24 +1897,21 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onContentWillChange(handler: OnTabsContentWillChangeCallback): TabsAttribute; /** - * Sets the maximum number of child components to be cached. + * Called when a new tab becomes selected. Animation is not necessarily complete. * - * @param { number } count - the maximum number of child components to be cached. - * @param { TabsCacheMode } mode - the mode of caching child components. + * @param { Callback } event - callback to notify which index has been selected * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ - cachedMaxCount(count: number, mode: TabsCacheMode): TabsAttribute; + onSelected(event: Callback): TabsAttribute; } /** @@ -2025,8 +1931,7 @@ declare class TabsAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabContentAnimatedTransition { /** @@ -2050,8 +1955,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ timeout?: number; @@ -2083,8 +1987,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ transition: Callback; } @@ -2106,8 +2009,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabContentTransitionProxy { /** @@ -2127,8 +2029,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ from: number; @@ -2149,8 +2050,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ to: number; @@ -2169,8 +2069,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ finishTransition(): void; } diff --git a/api/arkui/component/alphabetIndexer.static.d.ets b/api/arkui/component/alphabetIndexer.static.d.ets new file mode 100644 index 0000000000..2a4c6dcc11 --- /dev/null +++ b/api/arkui/component/alphabetIndexer.static.d.ets @@ -0,0 +1,397 @@ +'use static' +/* + * Copyright (c) 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 + * @arkts 1.2 + */ + +import { CommonMethod, BlurStyle, Bindable } from './common'; +import { ResourceColor, Length, Position } from "./units"; +import { Font } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * indexer align property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum IndexerAlign { + /** + * A dialog box is displayed on the right of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Left, + /** + * A dialog box is displayed on the left of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Right, + /** + * A dialog box is displayed on the start of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + START, + /** + * A dialog box is displayed on the end of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + END +} +/** + * AlphabetIndexer constructor options. + * + * @interface AlphabetIndexerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface AlphabetIndexerOptions { + /** + * Alphabetical index string array. + * Anonymous Object Rectification. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + arrayValue: Array; + /** + * ID of the selected item. + * + * @type { number | Bindable } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected: number | Bindable; +} +/** + * Defines an AlphabetIndexer callback when onSelect. + * + * @typedef { function } OnAlphabetIndexerSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerSelectCallback = (index: number) => void; +/** + * Defines an AlphabetIndexer callback when onPopupSelect. + * + * @typedef { function } OnAlphabetIndexerPopupSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; +/** + * Defines an AlphabetIndexer callback when onRequestPopupData. + * + * @typedef { function } OnAlphabetIndexerRequestPopupDataCallback + * @param { number } index - selected index + * @returns { Array } string array corresponding to the index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; + +/** + * The AlphabetIndexerAttribute. + * + * @extends CommonMethod + * @interface AlphabetIndexerAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface AlphabetIndexerAttribute extends CommonMethod { + /** + * Definitions color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color(value: ResourceColor | undefined): this; + /** + * Select the text color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor(value: ResourceColor | undefined): this; + /** + * Font color of the pop-up prompt text. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupColor(value: ResourceColor | undefined): this; + /** + * Select the text background color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedBackgroundColor(value: ResourceColor | undefined): this; + /** + * Background color of the pop-up window index. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupBackground(value: ResourceColor | undefined): this; + /** + * Set the selected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the selected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupSelectedColor(value: ResourceColor | undefined): this; + /** + * Set the unselected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the unselected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupUnselectedColor(value: ResourceColor | undefined): this; + /** + * Set the background color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of background. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemBackgroundColor(value: ResourceColor | undefined): this; + /** + * Whether to use pop-up index hints. + * + * @param { boolean } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + usingPopup(value: boolean | undefined): this; + /** + * Select the text text style, + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedFont(value: Font | undefined): this; + /** + * Select the text background color. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupFont(value: Font | undefined): this; + /** + * Set the font style of non-alphabetic part of the prompt pop-up window. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - indicates the style of the font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemFont(value: Font | undefined): this; + /** + * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. + * + * @param { string | number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemSize(value: string | number | undefined): this; + /** + * Definitions fonts. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + font(value: Font | undefined): this; + /** + * Alphabet index bar alignment style. The left and right alignment styles are supported, + * which affects the pop-up position of the pop-up window. + * + * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. + * @param { Length } [offset] - indicates the horizontal space between pop-up window and indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + alignStyle(value: IndexerAlign | undefined, offset?: Length | undefined): this; + /** + * Index bar selection callback. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSelect(callback: OnAlphabetIndexerSelectCallback | undefined): this; + /** + * Index bar selection callback and return the strings which display on pop-up. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerRequestPopupDataCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onRequestPopupData(callback: OnAlphabetIndexerRequestPopupDataCallback | undefined): this; + /** + * Pop-up selection callback. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerPopupSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onPopupSelect(callback: OnAlphabetIndexerPopupSelectCallback | undefined): this; + /** + * Sets the selected index. + * + * @param { number | Bindable } index + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected(index: number | Bindable | undefined): this; + /** + * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. + * + * @param { Position } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupPosition(value: Position | undefined): this; + /** + * Automatically collapses the characters when the indexer bar not high enough to display all characters. + * + * @param { boolean } value - A boolean value determines whether auto collapses is enabled for indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + autoCollapse(value: boolean | undefined): this; + /** + * Set the radius of the item of the pop-up window. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemBorderRadius(value: number | undefined): this; + /** + * Set the radius of the item of the indexer. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemBorderRadius(value: number | undefined): this; + /** + * Set the background blurStyle of title of the pop-up window. + * + * @param { BlurStyle } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupBackgroundBlurStyle(value: BlurStyle | undefined): this; + /** + * Set the background color of title of the pop-up window. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupTitleBackground(value: ResourceColor | undefined): this; + /** + * Enable or disable haptic feedback. + * + * @param { boolean } value - Default value is true, set false to disable haptic feedback. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableHapticFeedback(value: boolean | undefined): this; + + /** + * Set the attribute modifier of the component. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier - + * Set the AlphabetIndexer modifier to the component. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines AlphabetIndexer Component + * + * @param { AlphabetIndexerOptions } options - indexer constructor options + * @param { function } [content_] - container + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function AlphabetIndexer( + options: AlphabetIndexerOptions, + @memo + content_?: () => void, +): AlphabetIndexerAttribute diff --git a/api/arkui/component/tabContent.static.d.ets b/api/arkui/component/tabContent.static.d.ets new file mode 100644 index 0000000000..ff01269a20 --- /dev/null +++ b/api/arkui/component/tabContent.static.d.ets @@ -0,0 +1,612 @@ +'use static' +/* + * Copyright (c) 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 + * @arkts 1.2 + */ + +import { CommonMethod } from './common'; +import { CustomBuilder } from './builder'; +import { TextHeightAdaptivePolicy, TextOverflow, VerticalAlign } from "./enums"; +import { Dimension, Font, Length, LocalizedPadding, Padding, Resource, ResourceColor, ResourceStr, VoidCallback } from "./units"; +import { ComponentContent } from '../ComponentContent'; +import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; + +/** + * Enum for the mode of the tab bar when selected. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SelectedMode { + /** + * Indicator mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + INDICATOR = 0, + /** + * Board mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + BOARD = 1 +} +/** + * Enum for the layout mode of the content in the tab bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum LayoutMode { + /** + * The the content is laid vertically or horizontally, according to its width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + AUTO = 0, + /** + * The the content is laid vertically + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + VERTICAL = 1, + /** + * The the content is laid horizontally + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + HORIZONTAL = 2 +} +/** + * Provide an interface for the style of an SubTabBar indicator including color, height, width, border radius + * and margin top + * + * @interface SubTabBarIndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SubTabBarIndicatorStyle { + /** + * Define the color of the indicator + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; + /** + * Define the height of the indicator + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: Length; + /** + * Define the width of the indicator. + * If it is 0, the width will be equal to the width of the content + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: Length; + /** + * Define the border radius of the indicator + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + borderRadius?: Length; + /** + * Define the margin top of the indicator + * + * @type { ?Length } + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + marginTop?: Length; +} +/** + * Provide an interface for the style of an indicator including border radius + * + * @interface BoardStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface BoardStyle { + /** + * Define the border radius of the board + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + borderRadius?: Length; +} +/** + * TabBarLabelStyle object. + * + * @interface TabBarLabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarLabelStyle { + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + overflow?: TextOverflow; + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + maxLines?: number; + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + minFontSize?: number | ResourceStr; + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + maxFontSize?: number | ResourceStr; + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + heightAdaptivePolicy?: TextHeightAdaptivePolicy; + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + font?: Font; + /** + * The text color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor?: ResourceColor; + /** + * The text color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + unselectedColor?: ResourceColor; +} +/** + * TabBarIconStyle object. + * + * @interface TabBarIconStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarIconStyle { + /** + * The icon color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor?: ResourceColor; + /** + * The icon color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + unselectedColor?: ResourceColor; +} +/** + * TabBarSymbol object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TabBarSymbol { + /** + * Symbol icon in the normal style. + * + * @type { SymbolGlyphModifier } + * @default fontColor: #66182431, renderingStrategy: SymbolRenderingStrategy.MULTIPLE_OPACITY, fontSize: 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + normal: SymbolGlyphModifier; + /** + * Symbol icon in the selected style. + * + * @type { ?SymbolGlyphModifier } + * @default fontColor: #ff007dff, renderingStrategy: SymbolRenderingStrategy.MULTIPLE_OPACITY, fontSize: 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected?: SymbolGlyphModifier; +} +/** + * Icon and text for TabBar. + * + * @typedef TabBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarOptions { + /** + * TabBar icon. + * Anonymous Object Rectification + * + *

NOTE: + *
If the icon uses an SVG image, the width and height attributes of the SVG image must be deleted. + * Otherwise, the icon size will be determined by the width and height attributes of the SVG image. + *

+ * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + icon?: string | Resource; + /** + * TabBar text. + * Anonymous Object Rectification + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + text?: string | Resource; +} +/** + * Define SubTabBarStyle, the style is text and underline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class SubTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(content: ResourceStr); + /** + * constructor. + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(content: ResourceStr | ComponentContent); + /** + * Static constructor used to create a SubTabBarStyle instance. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(content: ResourceStr): SubTabBarStyle; + /** + * Static constructor used to create a SubTabBarStyle instance. You can set custom content with ComponentContent. + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(content: ResourceStr | ComponentContent): SubTabBarStyle; + /** + * Set the style of the indicator when selected + * + * @param { SubTabBarIndicatorStyle } style - indicates the indicator style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + indicator(style: SubTabBarIndicatorStyle): SubTabBarStyle; + /** + * Sets the display mode of the selected subtab. + * + *

NOTE: + *
It takes effect only in the horizontal layout. + *

+ * + * @param { SelectedMode } value - display mode of the selected subtab. Default value is SelectedMode.INDICATOR. + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedMode(value: SelectedMode): SubTabBarStyle; + /** + * Sets the background style (board style) of the selected subtab. + * + *

NOTE: + *
It takes effect only in the horizontal layout. + *

+ * + * @param { BoardStyle } value - background style object for the selected subtab. + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + board(value: BoardStyle): SubTabBarStyle; + /** + * Set the label style of the sub tab bar + * + * @param { TabBarLabelStyle } style - indicates the label style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + labelStyle(style: TabBarLabelStyle): SubTabBarStyle; + /** + * Set the padding of the sub tab bar + * + *

NOTE: + *
It cannot be set in percentage. + *
When the parameter is of the Dimension type, the value applies to all sides. + *

+ * + * @param { Padding | Dimension } value - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(value: Padding | Dimension): SubTabBarStyle; + /** + * Set the padding of the sub tab bar + * + *

NOTE: + *
This API supports mirroring but does not support percentage-based settings. + *

+ * + * @param { LocalizedPadding } padding - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(padding: LocalizedPadding): SubTabBarStyle; + /** + * Set an id to the sub tab bar to identify it + * + * @param { string } value - id of the sub tab bar to identify it + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id(value: string): SubTabBarStyle; +} +/** + * Define BottomTabBarStyle, the style is icon and text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class BottomTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); + /** + * Static constructor used to create a BottomTabBarStyle instance. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; + /** + * Set the label style of the bottom tab bar + * + * @param { TabBarLabelStyle } style - indicates the label style of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + labelStyle(style: TabBarLabelStyle): BottomTabBarStyle; + /** + * Set the padding of the bottom tab bar + * + *

NOTE: + *
It cannot be set in percentage. + *
When the parameter is of the Dimension type, the value applies to all sides. + *

+ * + * @param { Padding | Dimension | LocalizedPadding } value - indicates the padding of the bottom tab bar + * Default value is { left:4.0vp, right:4.0vp, top:0.0vp, bottom:0.0vp }. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; + /** + * Sets the layout mode of the images and texts on the bottom tab. + * + * @param { LayoutMode } value - layout mode of the images and text on the bottom tab. + * Default value is LayoutMode.VERTICAL. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + layoutMode(value: LayoutMode): BottomTabBarStyle; + /** + * Sets the vertical alignment mode of the images and text on the bottom tab. + * + * @param { VerticalAlign } value - vertical alignment mode of the images and text on the bottom tab. + * Default value is VerticalAlign.Center. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + verticalAlign(value: VerticalAlign): BottomTabBarStyle; + /** + * Sets whether the images and text on the bottom tab can be symmetrically extended by + * the minimum value of the available space on the left and right bottom tabs. + * + *

NOTE: + *
This parameter is valid only between bottom tabs in fixed horizontal mode. + *

+ * + * @param { boolean } value - indicates whether the bottom tab bar is extensible. Default value is false. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + symmetricExtensible(value: boolean): BottomTabBarStyle; + /** + * Set an id to the bottom tab bar to identify it + * + * @param { string } value - id of the bottom tab bar to identify it + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id(value: string): BottomTabBarStyle; + /** + * Sets the style of the label icon on the bottom tab. + * + * @param { TabBarIconStyle } style - style of the label icon on the bottom tab. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + iconStyle(style: TabBarIconStyle): BottomTabBarStyle; +} + +/** + * Define the TabContentAttribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabContentAttribute extends CommonMethod { + /** + * Sets the content displayed on the tab bar. + * Anonymous Object Rectification + * + *

NOTE: + *
If BottomTabBarStyle or TabBarOptions is used and an icon is set, + * a gray block will be displayed if the icon is invalid. + *
If the content exceeds the space provided by the tab bar, it will be clipped. + *

+ * + * @param { ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions } content + * Content displayed on the tab bar. + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + tabBar(content: ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions | undefined): this; + /** + * Called when the tab content is about to be displayed. The scenarios include the first-time display, + * tab switching, page switching, and window switching between the foreground and background. + * + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onWillShow(event: VoidCallback | undefined): this; + /** + * Called when the tab content is about to be hidden. The scenarios include the tab switching, + * page switching, and window switching between the foreground and background. + * + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onWillHide(event: VoidCallback | undefined): this; + + /** + * Set the attribute modifier for TabContent. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines TabContent Component + * + * @param { function } [content_] - TabContent + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function TabContent( + + @memo + content_?: () => void, +): TabContentAttribute; diff --git a/api/arkui/component/tabs.static.d.ets b/api/arkui/component/tabs.static.d.ets new file mode 100644 index 0000000000..d3cd3a9933 --- /dev/null +++ b/api/arkui/component/tabs.static.d.ets @@ -0,0 +1,862 @@ +'use static' +/* + * Copyright (c) 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 + * @arkts 1.2 + */ + +import { BackgroundBlurStyleOptions, BackgroundEffectOptions, BlurStyle, Callback, CommonMethod, Optional, TranslateOptions, DividerStyle, Bindable } from './common'; +import { EdgeEffect, PageFlipMode } from "./enums"; +import { Dimension, Length, ResourceColor } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Declare the graphic format of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum BarMode { + /** + * 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 + * @since 20 + */ + Scrollable = 0, + /** + * 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 + * @since 20 + */ + Fixed = 1 +} +/** + * Declare the animation mode of tab content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum AnimationMode { + /** + * Load the content of the target page before starting the switching animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CONTENT_FIRST = 0, + /** + * Start the switching animation before loading the content of the target page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ACTION_FIRST = 1, + /** + * Disable the default switching animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + 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 + * @since 20 + */ + 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 + * @since 20 + */ + ACTION_FIRST_WITH_JUMP = 4 +} +/** + * Declare the location of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export 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 20 + */ + 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 20 + */ + End +} +/** + * Declare the layout style of the tab bar items. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum LayoutStyle { + /** + * 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 + * @since 20 + */ + ALWAYS_CENTER = 0, + /** + * 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 + * @since 20 + */ + ALWAYS_AVERAGE_SPLIT = 1, + /** + * 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 + * @since 20 + */ + SPACE_BETWEEN_OR_CENTER = 2 +} +/** + * Declare the cache mode of the child components. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum TabsCacheMode { + /** + * Caches the child components on both sides of the current child components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CACHE_BOTH_SIDE = 0, + /** + * Caches the latest switched child components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CACHE_LATEST_SWITCHED = 1 +} +/** + * Provides methods for switching tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TabsController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * 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 + * @since 20 + */ + changeIndex(value: number): void; + /** + * Called when need to preload specified tab content. + * + * @param { Optional> } indices - Indices of tab content to be preloaded. + * @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 + * @since 20 + */ + preloadItems(indices: Optional>): Promise; + /** + * Set tab bar translate. + * + * @param { TranslateOptions } translate - translate options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTabBarTranslate(translate: TranslateOptions): void; + /** + * Set tab bar opacity. + * + * @param { number } opacity - opacity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTabBarOpacity(opacity: number): void; +} +/** + * Options used to create Tabs. + * + * @typedef TabsOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabsOptions { + /** + * Set the tab location for Tabs. + * + * @type { ?BarPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barPosition?: BarPosition; + /** + * Set the index of the currently displayed tab. + * + * @type { ?(number | Bindable) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + index?: number | Bindable; + /** + * Set the Tabs controller. + * + * @type { ?TabsController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + controller?: TabsController; +} +/** + * Provides an interface for tabs animation. + * + * @interface TabsAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export 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 + * @since 20 + */ + 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 + * @since 20 + */ + 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 + * @since 20 + */ + 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 + * @since 20 + */ +export interface BarGridColumnOptions { + /** + * 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 + * @since 20 + */ + sm?: number; + /** + * 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 + * @since 20 + */ + md?: number; + /** + * 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 + * @since 20 + */ + lg?: number; + /** + * Column margin in grid mode. It cannot be set in percentage. + * + * @type { ?Dimension } + * @default 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + margin?: Dimension; + /** + * 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 + * @since 20 + */ + gutter?: Dimension; +} +/** + * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. + * + * @interface ScrollableBarModeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ScrollableBarModeOptions { + /** + * 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 + * @since 20 + */ + margin?: Dimension; + /** + * Tab layout mode of the tab bar when not scrolling in scrollable mode. + * + * @type { ?LayoutStyle } + * @default LayoutStyle.ALWAYS_CENTER + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + 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 + * @since 20 + */ +export 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 + * @since 20 + */ +export 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 + * @since 20 + */ +export 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 + * @since 20 + */ +export 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 + * @since 20 + */ +export type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; + +/** + * The TabsAttribute. + * + * @extends CommonMethod + * @interface TabsAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabsAttribute extends CommonMethod { + /** + * 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 + * @since 20 + */ + vertical(value: boolean | undefined): this; + /** + * 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 + * @since 20 + */ + barPosition(value: BarPosition | undefined): this; + /** + * 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 + * @since 20 + */ + scrollable(value: boolean | undefined): this; + /** + * 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 + * @since 20 + */ + barMode(value: BarMode | undefined, options?: ScrollableBarModeOptions | undefined): this; + /** + * 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 + * @since 20 + */ + barWidth(value: Length | undefined): this; + /** + * 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 + * @since 20 + */ + barHeight(value: Length | undefined): this; + /** + * 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 + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + animationDuration(value: number | undefined): this; + /** + * 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 + * @since 20 + */ + animationMode(mode: AnimationMode | undefined): this; + /** + * 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 + * @since 20 + */ + edgeEffect(edgeEffect: EdgeEffect | undefined): this; + /** + * 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 + * @since 20 + */ + onChange(event: Callback | undefined): this; + /** + * 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 + * @since 20 + */ + onSelected(event: Callback | undefined): this; + /** + * Triggered when a tab is clicked. + * Anonymous Object Rectification + * + * @param { Callback } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onTabBarClick(event: Callback | undefined): this; + /** + * 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 + * @since 20 + */ + onUnselected(event: Callback | undefined): this; + /** + * Triggered when the tab switching animation starts. + * Anonymous Object Rectification + * + * @param { OnTabsAnimationStartCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onAnimationStart(handler: OnTabsAnimationStartCallback | undefined): this; + /** + * Triggered when the tab switching animation ends. + * Anonymous Object Rectification + * + * @param { OnTabsAnimationEndCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onAnimationEnd(handler: OnTabsAnimationEndCallback | undefined): this; + /** + * 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 + * @since 20 + */ + onGestureSwipe(handler: OnTabsGestureSwipeCallback | undefined): this; + /** + * 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 + * @since 20 + */ + fadingEdge(value: boolean | undefined): this; + /** + * 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 + * @since 20 + */ + divider(value: DividerStyle | null | undefined): this; + /** + * 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 + * @since 20 + */ + barOverlap(value: boolean | undefined): this; + /** + * 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 + * @since 20 + */ + barBackgroundColor(value: ResourceColor | undefined): this; + /** + * 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 + * @since 20 + */ + barGridAlign(value: BarGridColumnOptions | undefined): this; + /** + * 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 + * @since 20 + */ + customContentTransition(delegate: TabsCustomContentTransitionCallback | undefined): this; + /** + * 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 + * @since 20 + */ + barBackgroundBlurStyle(value: BlurStyle | undefined): this; + /** + * 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 + * @since 20 + */ + pageFlipMode(mode: PageFlipMode | undefined): this; + /** + * 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 + * @since 20 + */ + barBackgroundBlurStyle(style: BlurStyle | undefined, options: BackgroundBlurStyleOptions | undefined): this; + /** + * 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 + * @since 20 + */ + barBackgroundEffect(options: BackgroundEffectOptions | undefined): this; + /** + * 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 + * @since 20 + */ + onContentWillChange(handler: OnTabsContentWillChangeCallback | undefined): this; + /** + * Sets the maximum number of child components to be cached. + * + * @param { number } count - the maximum number of child components to be cached. + * @param { TabsCacheMode } mode - the mode of caching child components. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + cachedMaxCount(count: number | undefined, mode: TabsCacheMode | undefined): this; + + /** + * Sets the attribute modifier to Tabs. + * + * @param { numberAttributeModifier | AttributeModifier | undefined } modifier - + * the input modifier. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} +/** + * Defines the Tab Content animated transition options. + * + * @interface TabContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export 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 + * @since 20 + */ + timeout?: number; + /** + * Called when custom content transition animation start. + * Anonymous Object Rectification + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transition: Callback; +} +/** + * The proxy of TabContentAnimatedTransition. + * + * @interface TabContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabContentTransitionProxy { + /** + * The index of current tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + from: number; + /** + * The index of target tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + to: number; + /** + * Notifies Tabs component the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + finishTransition(): void; +} + +/** + * Defines Tabs Component + * + * @param { TabsOptions } [options] - tabs constructor options + * @param { function } [content_] - container + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Tabs( + options?: TabsOptions, + @memo + content_?: () => void, +): TabsAttribute -- Gitee