From a755bdcb2ec99832035926587582654871a02a85 Mon Sep 17 00:00:00 2001 From: ziyoulihen <909000590@qq.com> Date: Mon, 8 Sep 2025 16:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E7=BB=84=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A3=B0=E6=98=8E=E9=80=82=E9=85=8D1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: youzhi92 --- api/@ohos.arkui.advanced.Chip.static.d.ets | 703 ++++++++ ...ohos.arkui.advanced.ChipGroup.static.d.ets | 640 +++++++ api/@ohos.arkui.advanced.Counter.static.d.ets | 473 ++++++ ....arkui.advanced.SegmentButton.static.d.ets | 1209 +++++++++++++ ...rkui.advanced.SegmentButtonV2.static.d.ets | 1502 +++++++++++++++++ 5 files changed, 4527 insertions(+) create mode 100644 api/@ohos.arkui.advanced.Chip.static.d.ets create mode 100644 api/@ohos.arkui.advanced.ChipGroup.static.d.ets create mode 100644 api/@ohos.arkui.advanced.Counter.static.d.ets create mode 100644 api/@ohos.arkui.advanced.SegmentButton.static.d.ets create mode 100644 api/@ohos.arkui.advanced.SegmentButtonV2.static.d.ets diff --git a/api/@ohos.arkui.advanced.Chip.static.d.ets b/api/@ohos.arkui.advanced.Chip.static.d.ets new file mode 100644 index 0000000000..793137d919 --- /dev/null +++ b/api/@ohos.arkui.advanced.Chip.static.d.ets @@ -0,0 +1,703 @@ +'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 { Builder, ResourceStr, SizeOptions, ResourceColor, VoidCallback, Dimension, LengthMetrics, Direction } from './@ohos.arkui.component'; +import { SymbolGlyphModifier } from './@ohos.arkui.modifier'; + +/** + * Enum for ChipSize + * + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export declare enum ChipSize { + + /** + * Normal type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + NORMAL = "NORMAL", + + /** + * Small type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + SMALL = "SMALL" +} + +/** + * Enum for AccessibilitySelectedType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export declare enum AccessibilitySelectedType { + /** + * Default type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + CLICKED = 0, + + /** + * Checked type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + CHECKED = 1, + + /** + * Selected type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + SELECTED = 2 +} + + /** + * Defines the icon common option. + * + * @interface IconCommonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface IconCommonOptions { + + /** + * Image resource. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + src: ResourceStr; + + /** + * Image size option. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + size?: SizeOptions; + + /** + * Image filled color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + fillColor?: ResourceColor; + + /** + * Image filled color when chip is activated. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + * @noninterop + */ + activatedFillColor?: ResourceColor; +} + + /** + * Defines the suffix icon option. + * + * @extends IconCommonOptions + * @interface SuffixIconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface SuffixIconOptions extends IconCommonOptions { + + /** + * Called when the suffix icon is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + action?: VoidCallback; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + + /** + * Defines the prefix icon option. + * + * @extends IconCommonOptions + * @interface PrefixIconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface PrefixIconOptions extends IconCommonOptions {} + +/** + * Defines accessibility icon options. + * + * @interface AccessibilityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface AccessibilityOptions { + /** + * Set accessibility level for accessibility icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * Set accessibility text for accessibility icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for accessibility icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; +} + +/** + * Defines accessibility options of default close icon. + * + * @extends AccessibilityOptions + * @interface CloseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface CloseOptions extends AccessibilityOptions {} + +/** + * Defines chip symbolglyph options. + * + * @interface ChipSymbolGlyphOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipSymbolGlyphOptions { + + /** + * Symbol normal. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + normal?: SymbolGlyphModifier; + + /** + * Symbol activated. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + activated?: SymbolGlyphModifier; +} + +/** + * Defines accessibility options of suffix symbol. + * + * @interface ChipSuffixSymbolGlyphOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipSuffixSymbolGlyphOptions { + /** + * Set normal accessibility options for suffix symbol. + * + * @type { ?AccessibilityOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + normalAccessibility?: AccessibilityOptions; + + /** + * Set activated accessibility options for suffix symbol. + * + * @type { ?AccessibilityOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + activatedAccessibility?: AccessibilityOptions; + + /** + * Called when the suffix symbol is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + action?: VoidCallback; +} + + /** + * Defines label margin. + * + * @interface LabelMarginOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface LabelMarginOptions { + + /** + * Left label margin length. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + left?: Dimension; + + /** + * Right label margin length. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + right?: Dimension; +} + +/** + * Defines localized label margin. + * + * @interface LocalizedLabelMarginOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface LocalizedLabelMarginOptions { + + /** + * start localized label margin length. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + start?: LengthMetrics; + + /** + * end localized label margin length. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + end?: LengthMetrics; +} + + /** + * Defines label option. + * + * @interface LabelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface LabelOptions { + + /** + * Text content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text: string; + + /** + * Text font size. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontSize?: Dimension; + + /** + * Text font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontColor?: ResourceColor; + + /** + * Text font color when chip is activated. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + activatedFontColor?: ResourceColor; + + /** + * Text font family. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontFamily?: string; + + /** + * Label margin. + * + * @type { ?LabelMarginOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + labelMargin?: LabelMarginOptions; + + /** + * Localized label margin. + * + * @type { ?LocalizedLabelMarginOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + localizedLabelMargin?: LocalizedLabelMarginOptions; +} + + /** + * Defines chip options. + * + * @interface ChipOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipOptions { + /** + * Chip prefix icon. + * + * @type { ?PrefixIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + prefixIcon?: PrefixIconOptions; + + /** + * Chip prefix symbol. + * + * @type { ?ChipSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + prefixSymbol?: ChipSymbolGlyphOptions; + + /** + * Chip label. + * + * @type { LabelOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + label: LabelOptions; + + /** + * Chip suffix icon. + * + * @type { ?SuffixIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixIcon?: SuffixIconOptions; + + /** + * Chip suffix symbol. + * + * @type { ?ChipSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixSymbol?: ChipSymbolGlyphOptions; + + /** + * Set options for suffix symbol. + * + * @type { ?ChipSuffixSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixSymbolOptions?: ChipSuffixSymbolGlyphOptions; + + /** + * Show close icon. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + allowClose?: boolean; + + /** + * Set options for default close icon when 'allowaClose' is true. + * + * @type { ?CloseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + closeOptions?: CloseOptions; + + /** + * Enable chip. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + enabled?: boolean; + + /** + * Set whether chip is active or not. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + activated?: boolean; + + /** + * Chip background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundColor?: ResourceColor; + + /** + * Chip background color when chip is activated. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + activatedBackgroundColor?: ResourceColor; + + /** + * Chip radius. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + borderRadius?: Dimension; + + /** + * Chip size. + * + * @type { ?(ChipSize | SizeOptions) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + size?: ChipSize | SizeOptions; + + /** + * On close action. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onClose?: VoidCallback; + + /** + * On clicked action. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onClicked?: VoidCallback; + + /** + * Indicates the attribute of the current chip direction. + * + * @type { ?Direction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + direction?: Direction; + + /** + * Set accessibility description for Chip. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for Chip. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * Set accessibility selected type for Chip. + * + * @type { ?AccessibilitySelectedType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilitySelectedType?: AccessibilitySelectedType; +} + + /** + * Build function of Chip. + * + * @param { ChipOptions } options - chip option. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Builder +export declare function Chip(options: ChipOptions): void; \ No newline at end of file diff --git a/api/@ohos.arkui.advanced.ChipGroup.static.d.ets b/api/@ohos.arkui.advanced.ChipGroup.static.d.ets new file mode 100644 index 0000000000..bf053bb5cd --- /dev/null +++ b/api/@ohos.arkui.advanced.ChipGroup.static.d.ets @@ -0,0 +1,640 @@ +'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 { Component, BuilderParam, Builder, ResourceStr, SizeOptions, ResourceColor, VoidCallback, Length } from './@ohos.arkui.component'; +import { PropRef, Require } from './@ohos.arkui.stateManagement'; +import { ChipSize, ChipSymbolGlyphOptions, CloseOptions, ChipSuffixSymbolGlyphOptions } from './@ohos.arkui.advanced.Chip'; +import { SymbolGlyphModifier } from './@ohos.arkui.modifier'; + +/** + * Defines icon options. + * + * @interface IconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface IconOptions { + + /** + * Image resource. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + src: ResourceStr; + + /** + * Image size option. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + size?: SizeOptions; +} + +/** + * Defines suffix icon options. + * + * @extends IconOptions + * @interface SuffixImageIconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface SuffixImageIconOptions extends IconOptions { + /** + * Called when the suffix image icon is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + action?: VoidCallback; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + +/** + * Defines label options. + * + * @interface LabelOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface LabelOptions { + + /** + * Text content. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text: string; +} + + +/** + * Defines chipItem options. + * + * @interface ChipGroupItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipGroupItemOptions { + + /** + * Prefix icon. + * + * @type { ?IconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + prefixIcon?: IconOptions; + + /** + * Prefix symbol. + * + * @type { ?ChipSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + prefixSymbol?: ChipSymbolGlyphOptions; + + /** + * Chip label. + * + * @type { LabelOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + label: LabelOptions; + + /** + * Suffix icon. + * + * @type { ?SuffixImageIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixImageIcon?: SuffixImageIconOptions; + + /** + * suffix symbol. + * + * @type { ?ChipSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixSymbol?: ChipSymbolGlyphOptions; + + /** + * Set options for suffix symbol. + * + * @type { ?ChipSuffixSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + suffixSymbolOptions?: ChipSuffixSymbolGlyphOptions; + + /** + * Allow close. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + allowClose?: boolean; + + /** + * Set options for default close icon when 'allowaClose' is true. + * + * @type { ?CloseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + closeOptions?: CloseOptions; + + /** + * Set accessibility description for ChipGroup item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for ChipGroup item. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + + +/** + * Defines ChipItemStyle. + * + * @interface ChipItemStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipItemStyle { + + /** + * Chip size. + * + * @type { ?(ChipSize | SizeOptions) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + size?: ChipSize | SizeOptions; + + /** + * ChipItem background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundColor?: ResourceColor; + + /** + * Text font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontColor?: ResourceColor; + + /** + * Selected Text font color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontColor?: ResourceColor; + + /** + * Selected chip item background color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedBackgroundColor?: ResourceColor; +} + + +/** + * Defines chip group space. + * + * @interface ChipGroupSpaceOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipGroupSpaceOptions { + + /** + * Space between items. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + itemSpace?: string | double; + + /** + * Start space. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + startSpace?: Length; + + /** + * End space. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + endSpace?: Length; +} + +/** + * Defines IconItemOptions. + * + * @interface IconItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface IconItemOptions { + /** + * IconOptions. + * + * @type { IconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon: IconOptions; + + /** + * Icon Action. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + action: VoidCallback; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + +/** + * Defines symbol item options. + * + * @interface SymbolItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface SymbolItemOptions { + /** + * Set symbol. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + symbol: SymbolGlyphModifier; + + /** + * Called when the symbol item is clicked. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + action: VoidCallback; + + /** + * Set accessibility text for symbol. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for symbol. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for symbol. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + +/** + * Defines ChipGroupPaddingOptions. + * + * @interface ChipGroupPaddingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface ChipGroupPaddingOptions { + /** + * Top of chip group padding. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + top: Length; + + /** + * Bottom of chip group padding. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + bottom: Length; +} + +/** + * Defines IconGroupSuffix. + * + * @struct IconGroupSuffix + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Component +export declare struct IconGroupSuffix { + /** + * Suffix item. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + /** + * Suffix item. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require @PropRef + items: Array; +} + +/** + * Defines the suffix builder of the Chip Group. + * + * @typedef { function } ChipGroupSuffixBuilder + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Builder +export type ChipGroupSuffixBuilder = () => void; + +/** + * Defines chipGroup. + * + * @struct ChipGroup + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Component +export declare struct ChipGroup { + + /** + * Chip item. + * + * @type { ChipGroupItemOptions[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require @PropRef + items: ChipGroupItemOptions[]; + + /** + * Chip item style. + * + * @type { ?ChipItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + itemStyle?: ChipItemStyle; + + /** + * Default selected chip item indexes. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + selectedIndexes?: Array; + + /** + * Support multiple chip item selection. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + multiple?: boolean; + + /** + * Chip group space. + * + * @type { ?ChipGroupSpaceOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + chipGroupSpace?: ChipGroupSpaceOptions; + + /** + * Chip group padding (only support top and bottom). + * + * @type { ?ChipGroupPaddingOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + chipGroupPadding?: ChipGroupPaddingOptions; + + /** + * Chip group callback. when chip status is changed, this onChange is called. + * + * @type { ?Callback> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onChange?: Callback>; + + /** + * The builder function which will be rendered in the suffix of ChipGroup. + * + * @type { ?ChipGroupSuffixBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @BuilderParam + suffix?: ChipGroupSuffixBuilder; +} \ No newline at end of file diff --git a/api/@ohos.arkui.advanced.Counter.static.d.ets b/api/@ohos.arkui.advanced.Counter.static.d.ets new file mode 100644 index 0000000000..151f0bd5ea --- /dev/null +++ b/api/@ohos.arkui.advanced.Counter.static.d.ets @@ -0,0 +1,473 @@ +/* + * Copyright (c) 2023 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 + */ + +import { Component, Direction, ResourceStr, VoidCallback } from './@ohos.arkui.component'; +import { PropRef } from './@ohos.arkui.stateManagement'; + + /** + * Enum for the counter type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare enum CounterType { + /** + * List counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + LIST = 0, + + /** + * Compact counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + COMPACT = 1, + + /** + * Inline counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + INLINE = 2, + + /** + * Date inline counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + INLINE_DATE = 3 +} + +/** + * The hover callback of Counter. + * + * @typedef { function } OnCounterHoverCallback + * @param { boolean } isHover - the hover status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export type OnCounterHoverCallback = (isHover: boolean) => void; + + /** + * Defines the common options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class CommonOptions { + /** + * Set the focusable of the counter component. + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + focusable?: boolean; + + /** + * Set the step of the couter component, ranges greater than or equal to 1 + * + * @type { ?double } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + step?: double; + + /** + * Trigger a mouse hover event at the increased button. + * + * @type { ?OnCounterHoverCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onHoverIncrease?: OnCounterHoverCallback; + + /** + * Trigger a mouse hover event at the decreased button. + * + * @type { ?OnCounterHoverCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onHoverDecrease?: OnCounterHoverCallback; +} + +/** + * The change callback of the inline Counter. + * + * @typedef { function } OnInlineCounterChange + * @param { double } value - value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export type OnInlineCounterChange = (value: double) => void; + + /** + * Defines the inline style options. + * + * @extends CommonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class InlineStyleOptions extends CommonOptions { + /** + * Set initial value of the counter component, ranges from min to max. + * + * @type { ?double } + * @default 0.0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + value?: double; + + /** + * Set minimum value of the counter component + * + * @type { ?double } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + min?: double; + + /** + * Set maximum value of the counter component + * + * @type { ?double } + * @default 999 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + max?: double; + + /** + * Set text width of the counter component, ranges greater than or equal to 0 + * + * @type { ?double } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + textWidth?: double; + + /** + * Trigger a event when the value of the counter has been changed. + * + * @type { ?OnInlineCounterChange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onChange?: OnInlineCounterChange; +} + + /** + * Defines the number style options. + * + * @extends InlineStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class NumberStyleOptions extends InlineStyleOptions { + /** + * Set the label of the counter component. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + label?: ResourceStr; + + /** + * Trigger a event when the increased button got focus. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onFocusIncrease?: VoidCallback; + + /** + * Trigger a event when the decreased button got focus. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onFocusDecrease?: VoidCallback; + + /** + * Trigger a event when the increased button lose focus. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onBlurIncrease?: VoidCallback; + + /** + * Trigger a event when the decreased button lose focus. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onBlurDecrease?: VoidCallback; +} + + /** + * Defines the date data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class DateData { + /** + * The year of the DateData, ranges from 1 to 5000. + * + * @type { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + year: int; + + /** + * The month of the DateData. + * + * @type { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + month: int; + + /** + * The day of the DateData. + * + * @type { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + day: int; + + /** + * Constructor of the DateData. + * + * @param { int } year - set the year of the DateData. + * @param { int } month - set the month of the DateData. + * @param { int } day - set the day of the DateData. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(year: int, month: int, day: int); + + /** + * Convert the date data to string. + * + * @returns { string } date data in string form. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + toString(): string; +} + +/** + * The change callback of the date style counter. + * + * @typedef { function } OnDateCounterChangeCallback + * @param { DateData } date - date + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export type OnDateCounterChangeCallback = (date: DateData) => void; + + /** + * Defines the date style options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class DateStyleOptions extends CommonOptions { + /** + * Set the year of the counter component, ranges from 1 to 5000. + * + * @type { ?int } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + year?: int; + + /** + * Set the month of the counter component. + * + * @type { ?int } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + month?: int; + + /** + * Set the day of the counter component. + * + * @type { ?int } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + day?: int; + + /** + * Trigger a event when the date of the counter has been changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onDateChange?: OnDateCounterChangeCallback; +} + + + /** + * Defines the counter options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare class CounterOptions { + /** + * Set the type of the counter component. + * + * @type { CounterType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + type: CounterType; + + /** + * Set the counter attribute of the LIST or COMPACT counter component. + * + * @type { ?NumberStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + numberOptions?: NumberStyleOptions; + + /** + * Set the counter attribute of the INLINE counter component. + * + * @type { ?InlineStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + inlineOptions?: InlineStyleOptions; + + /** + * Set the counter attribute of the INLINE_DATE counter component. + * + * @type { ?DateStyleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + dateOptions?: DateStyleOptions; + + /** + * Indicates the attribute of the current counter direction. + * + * @type { ?Direction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + direction?: Direction; +} + + /** + * Defines Counter Component. + * + * @struct CounterComponent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Component +declare struct CounterComponent { + /** + * The options of a counter component. + * + * @type { CounterOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + options: CounterOptions; +} + +export { + CounterComponent, + CounterOptions, + DateData, + CounterType, +}; diff --git a/api/@ohos.arkui.advanced.SegmentButton.static.d.ets b/api/@ohos.arkui.advanced.SegmentButton.static.d.ets new file mode 100644 index 0000000000..73cdf48368 --- /dev/null +++ b/api/@ohos.arkui.advanced.SegmentButton.static.d.ets @@ -0,0 +1,1209 @@ +'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 { + PropRef, + ObjectLink, + Link, + Observed, +} from './@ohos.arkui.stateManagement'; +import { + ResourceStr, + SizeOptions, + ResourceColor, + PX , + VP , + FP , + LPX , + Resource, + FontWeight, + Padding, + Dimension, + LocalizedPadding, + BlurStyle, + Direction, + LengthMetrics, + Component, + BuilderParam, + Builder, +} from './@ohos.arkui.component'; + + /** + * Defines text only item of SegmentButton. + * + * @interface SegmentButtonTextItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + +interface SegmentButtonTextItem { + /** + * The text of text only item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; +} + + /** + * Defines icon only item of SegmentButton. + * + * @interface SegmentButtonIconItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface SegmentButtonIconItem { + /** + * The icon of icon only item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon: ResourceStr; + + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + iconAccessibilityText?: ResourceStr; + /** + * The icon of icon only item in the selected state. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIcon: ResourceStr; + + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIconAccessibilityText?: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; +} + + /** + * Defines icon and text item of SegmentButton. + * + * @interface SegmentButtonIconTextItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface SegmentButtonIconTextItem { + /** + * The icon of icon and text item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon: ResourceStr; + + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + iconAccessibilityText?: ResourceStr; + /** + * The icon of icon and text item in the selected state. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIcon: ResourceStr; + + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIconAccessibilityText?: ResourceStr; + /** + * The text of icon and text item. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; +} + + /** + * Defines the DimensionNoPercentage type. + * + * @typedef { PX | VP | FP | LPX | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare type DimensionNoPercentage = PX | VP | FP | LPX | Resource; + +/** + * Defines the BorderRadiusMode type. + * + * @enum { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare enum BorderRadiusMode { + /** + * Default mode, radius is auto calculated by framework. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + DEFAULT = 0, + + /** + * Custom mode, radius can be set by developers. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + CUSTOM = 1 +} + + /** + * Defines SegmentButton common options. + * + * @interface CommonSegmentButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface CommonSegmentButtonOptions { + /** + * The font color of buttons. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontColor?: ResourceColor; + + /** + * The font color of selected button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontColor?: ResourceColor; + /** + * The font size of buttons. + * + * @type { ?DimensionNoPercentage } + * @default $r('sys.float.ohos_id_text_size_body2') + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontSize?: DimensionNoPercentage; + + /** + * The font size of selected button. + * + * @type { ?DimensionNoPercentage } + * @default $r('sys.float.ohos_id_text_size_body2') + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontSize?: DimensionNoPercentage; + + /** + * The font weight of buttons. + * + * @type { ?FontWeight } + * @default FontWeight.Regular + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontWeight?: FontWeight; + + /** + * The font weight of selected button. + * + * @type { ?FontWeight } + * @default FontWeight.Medium + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontWeight?: FontWeight; + + /** + * The background color of SegmentButton. + * + * @type { ?ResourceColor } + * @default $r('sys.color.ohos_id_color_button_normal') + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundColor?: ResourceColor; + + /** + * The background color of selected button. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedBackgroundColor?: ResourceColor; + + /** + * The image size of buttons. + * + * @type { ?SizeOptions } + * @default SizeOptions { width: 24, height: 24 } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + imageSize?: SizeOptions; + + /** + * The padding of buttons. + * + * @type { ?(Padding | Dimension) } + * @default For text only / icon only buttons Padding { top: 4, right: 8, bottom: 4, left: 8 }. + * For text & icon buttons Padding { top: 6, right: 8, bottom: 6, left: 8 }. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + buttonPadding?: Padding | Dimension; + + /** + * The localized padding of buttons. + * + * @type { ?LocalizedPadding } + * @default For text only / icon only buttons LocalizedPadding + * { top: LengthMetrics.vp(4), end: LengthMetrics.vp(8), bottom: LengthMetrics.vp(4), start: LengthMetrics.vp(8) }. + * For text & icon buttons LocalizedPadding + * { top: LengthMetrics.vp(6), end: LengthMetrics.vp(8), bottom: LengthMetrics.vp(6), start: LengthMetrics.vp(8) }. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + localizedButtonPadding?: LocalizedPadding; + + /** + * The padding of text in button. + * + * @type { ?(Padding | Dimension) } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + textPadding?: Padding | Dimension; + + /** + * The localized padding of text in button. + * + * @type { ?LocalizedPadding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + localizedTextPadding?: LocalizedPadding; + + /** + * The blurStyle of background. + * + * @type { ?BlurStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundBlurStyle?: BlurStyle; + + /** + * Indicates the attribute of the current segment button direction. + * + * @type { ?Direction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + direction?: Direction; + + /** + * The border radius mode of SegmentButton. + * + * @type { ?BorderRadiusMode } + * @default BorderRadiusMode.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + borderRadiusMode?: BorderRadiusMode; + + /** + * The background border radius of SegmentButton. + * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundBorderRadius?: LengthMetrics; + + /** + * The border radius of selected item in SegmentButton. + * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + itemBorderRadius?: LengthMetrics; +} + + /** + * Defines the ItemRestriction type. + * + * @typedef { [T, T] | [T, T, T] | [T, T, T, T] | [T, T, T, T, T] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare type ItemRestriction = [T, T] | [T, T, T] | [T, T, T, T] | [T, T, T, T, T]; + + /** + * Defines the SegmentButtonItemTuple type. + * + * @typedef { ItemRestriction | ItemRestriction | ItemRestriction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare type SegmentButtonItemTuple = ItemRestriction | ItemRestriction | ItemRestriction; + + /** + * Defines the SegmentButtonItemArray type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +declare type SegmentButtonItemArray = Array | Array | Array; + + /** + * Defines SegmentButton tab options. + * + * @extends CommonSegmentButtonOptions + * @interface TabSegmentButtonConstructionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface TabSegmentButtonConstructionOptions extends CommonSegmentButtonOptions { + /** + * The items of tab type of SegmentButton. + * + * @type { ItemRestriction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + buttons: ItemRestriction; +} + + /** + * Defines SegmentButton capsule options. + * + * @extends CommonSegmentButtonOptions + * @interface CapsuleSegmentButtonConstructionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface CapsuleSegmentButtonConstructionOptions extends CommonSegmentButtonOptions { + /** + * The items of capsule type of SegmentButton. + * + * @type { SegmentButtonItemTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + buttons: SegmentButtonItemTuple; + + /** + * Support multiple selections flag. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + multiply?: boolean; +} + + /** + * Defines the type of SegmentButton options of tab type. + * + * @extends TabSegmentButtonConstructionOptions + * @interface TabSegmentButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface TabSegmentButtonOptions extends TabSegmentButtonConstructionOptions { + /** + * The type of SegmentButton. + * + * @type { "tab" } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + type: "tab"; +} + + /** + * Defines the type of SegmentButton options of capsule type. + * + * @extends CapsuleSegmentButtonConstructionOptions + * @interface CapsuleSegmentButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface CapsuleSegmentButtonOptions extends CapsuleSegmentButtonConstructionOptions { + /** + * The type of SegmentButton. + * + * @type { "capsule" } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + type: "capsule"; +} + + /** + * Construct parameter types for SegmentButtonItemOptions. + * + * @interface SegmentButtonItemOptionsConstructorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +interface SegmentButtonItemOptionsConstructorOptions { + /** + * The icon of icon and text item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon?: ResourceStr; + + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + iconAccessibilityText?: ResourceStr; + + /** + * The icon of icon and text item in the selected state. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIcon?: ResourceStr; + + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIconAccessibilityText?: ResourceStr; + + /** + * The text of icon and text item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text?: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; +} + + /** + * The options for SegmentButton items. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Observed +declare class SegmentButtonItemOptions { + /** + * The icon of item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon?: ResourceStr; + + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + iconAccessibilityText?: ResourceStr; + + /** + * The icon of selected item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIcon?: ResourceStr; + + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedIconAccessibilityText?: ResourceStr; + + /** + * The text of item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text?: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * The constructor used to create a SegmentButtonOptionsArray object. + * + * @param { SegmentButtonItemOptionsConstructorOptions } options - item info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(options: SegmentButtonItemOptionsConstructorOptions); +} + + /** + * The class for SegmentButton item options array. + * + * @extends Array + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Observed +declare class SegmentButtonItemOptionsArray extends Array { + /** + * The constructor used to create a SegmentButtonItemOptionsArray object. + * + * @param { SegmentButtonItemTuple } elements - The SegmentButton items. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(elements: SegmentButtonItemTuple); + + /** + * Appends new elements to the end of SegmentButtonItemOptionsArray. + * + * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. + * @returns { int } Returns the new length of SegmentButtonItemOptionsArray. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + push(...items: SegmentButtonItemArray): int; + + /** + * Removes the last element from SegmentButtonItemOptionsArray. + * + * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + pop(): SegmentButtonItemOptions | undefined; + + /** + * Removes the first element from SegmentButtonItemOptionsArray. + * + * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + shift(): SegmentButtonItemOptions | undefined; + + /** + * Appends new elements to the start of SegmentButtonItemOptionsArray. + * + * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. + * @returns { int } Returns the new length of SegmentButtonItemOptionsArray. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + unshift(...items: SegmentButtonItemArray): int; + + /** + * Changes the elements of SegmentButtonItemOptionsArray by removing or replacing existing elements and/or adding new elements in place. + * + * @param { int } start - The zero-based location in the array from which to start removing elements. + * @param { int } deleteCount - The number of elements to remove. + * @param { SegmentButtonItemOptions[] } items - Elements to insert into the array in place of the deleted elements. + * @returns { SegmentButtonItemOptions[] } Returns a SegmentButtonItemOptions array containing the deleted elements. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + splice(start: int, deleteCount: int, ...items: SegmentButtonItemOptions[]): SegmentButtonItemOptions[]; + + /** + * The function used to create a SegmentButtonItemOptionsArray object. + * + * @param { SegmentButtonItemTuple } elements - The SegmentButton items. + * @returns { SegmentButtonItemOptionsArray } Returns the a new SegmentButtonItemOptionsArray object. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + static create(elements: SegmentButtonItemTuple): SegmentButtonItemOptionsArray; +} + + /** + * The class for SegmentButton options. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Observed +declare class SegmentButtonOptions { + /** + * The type of SegmentButton. + * + * @type { "tab" | "capsule" } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + type: "tab" | "capsule"; + + /** + * The support multiple selections flag of SegmentButton. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + multiply: boolean; + + /** + * The buttons information of SegmentButton. + * + * @type { SegmentButtonOptionsArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + buttons: SegmentButtonItemOptionsArray; + + /** + * The font color of buttons. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontColor: ResourceColor; + + /** + * The font color of selected button. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontColor: ResourceColor; + + /** + * The font size of buttons. + * + * @type { DimensionNoPercentage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontSize: DimensionNoPercentage; + + /** + * The font size of selected button. + * + * @type { DimensionNoPercentage } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontSize: DimensionNoPercentage; + + /** + * The font weight of buttons. + * + * @type { FontWeight } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + fontWeight: FontWeight; + + /** + * The font weight of selected button. + * + * @type { FontWeight } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedFontWeight: FontWeight; + + /** + * The background color of SegmentButton. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundColor: ResourceColor; + + /** + * The background color of selected button. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + selectedBackgroundColor: ResourceColor; + + /** + * The image size of buttons. + * + * @type { SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + imageSize: SizeOptions; + + /** + * The padding of buttons. + * + * @type { Padding | Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + buttonPadding: Padding | Dimension; + + /** + * The localized padding of buttons. + * + * @type { ?LocalizedPadding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + localizedButtonPadding?: LocalizedPadding; + + /** + * The padding of text in button. + * + * @type { Padding | Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + textPadding: Padding | Dimension; + + /** + * The localized padding of text in button. + * + * @type { ?LocalizedPadding } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + localizedTextPadding?: LocalizedPadding; + + /** + * The blurStyle of background. + * + * @type { BlurStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundBlurStyle: BlurStyle; + + /** + * The constructor used to create a SegmentButtonOptions object. + * + * @param { TabSegmentButtonOptions | CapsuleSegmentButtonOptions } options - The options of SegmentButton. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(options: TabSegmentButtonOptions | CapsuleSegmentButtonOptions); + + /** + * The function used to create a SegmentButtonOptions of tab type. + * + * @param { TabSegmentButtonConstructionOptions } options - The options of SegmentButton. + * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of tab type. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + static tab(options: TabSegmentButtonConstructionOptions): SegmentButtonOptions; + + /** + * The function used to create a SegmentButtonOptions of capsule type. + * + * @param { CapsuleSegmentButtonConstructionOptions } options - The options of SegmentButton. + * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of capsule type. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + static capsule(options: CapsuleSegmentButtonConstructionOptions): SegmentButtonOptions; + + /** + * Indicates the attribute of the current segment button direction. + * + * @type { ?Direction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + direction?: Direction; + + /** + * The border radius mode of SegmentButton. + * + * @type { ?BorderRadiusMode } + * @default BorderRadiusMode.Default + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + borderRadiusMode?: BorderRadiusMode; + + /** + * The background border radius of SegmentButton. + * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + backgroundBorderRadius?: LengthMetrics; + + /** + * The border radius of selected item in SegmentButton. + * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + itemBorderRadius?: LengthMetrics; +} + + /** + * Declare Component SegmentButton + * + * @struct SegmentButton + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@Component +declare struct SegmentButton { + /** + * The options of SegmentButton. + * + * @type { SegmentButtonOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @ObjectLink + options: SegmentButtonOptions; + + /** + * The selectedIndex. + * + * @type { int[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Link + selectedIndexes: int[]; + + /** + * The max font scale of the segmented button option text. + * @type { double | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @PropRef + maxFontScale: double | Resource; + + /** + * The click event callback will be triggered when a option button of SegmentButton is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + onItemClicked?: Callback; +} + +export { + SegmentButton, + SegmentButtonOptions, + SegmentButtonItemOptionsArray, + TabSegmentButtonOptions, + TabSegmentButtonConstructionOptions, + CapsuleSegmentButtonOptions, + CapsuleSegmentButtonConstructionOptions, + SegmentButtonTextItem, + SegmentButtonIconItem, + SegmentButtonIconTextItem, + DimensionNoPercentage, + CommonSegmentButtonOptions, + ItemRestriction, + SegmentButtonItemTuple, + SegmentButtonItemArray, + SegmentButtonItemOptionsConstructorOptions, + SegmentButtonItemOptions, + BorderRadiusMode +}; diff --git a/api/@ohos.arkui.advanced.SegmentButtonV2.static.d.ets b/api/@ohos.arkui.advanced.SegmentButtonV2.static.d.ets new file mode 100644 index 0000000000..36df92f41b --- /dev/null +++ b/api/@ohos.arkui.advanced.SegmentButtonV2.static.d.ets @@ -0,0 +1,1502 @@ +'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 api/@ohos.arkui.advanced.SegmentButtonV2.static.d.ets + * @kit ArkUI + * @arkts 1.2 + */ + +import { + ResourceStr, + Resource, + LocalizedPadding, + FontWeight, + ShadowOptions, + ShadowStyle, + BlurStyle, + BackgroundBlurStyleOptions, + BackgroundEffectOptions, + Direction, +} from './@ohos.arkui.component'; +import { ObservedV2, Trace, Require, Param, Event } from './@ohos.arkui.stateManagement'; +import { ColorMetrics, LengthMetrics, SizeT } from './@ohos.arkui.node'; +import { ImageModifier, SymbolGlyphModifier, TextModifier } from './@ohos.arkui.modifier'; + +/** + * Defines the options of the segmented button item. + * + * @interface SegmentButtonV2ItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export interface SegmentButtonV2ItemOptions { + /** + * Sets the text of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + text?: ResourceStr; + + /** + * Sets the image icon of the segmented button item. + * This field will be useless if the symbol field is sets. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + icon?: ResourceStr; + + /** + * Sets the symbol icon of the segmented button item. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + symbol?: Resource; + + /** + * Sets whether segmented button item is enabled? + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + enabled?: boolean; + + /** + * Sets modifier for the text of the segmented button item. + * + * @type { ?TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + textModifier?: TextModifier; + + /** + * Sets modifier for the image icon of the segmented button item. + * + * @type { ?ImageModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + iconModifier?: ImageModifier; + + /** + * Sets modifier for the symbol icon of the segmented button item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + symbolModifier?: SymbolGlyphModifier; + + /** + * Sets the accessibility text of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityText?: ResourceStr; + + /** + * Sets the accessibility description of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityDescription?: ResourceStr; + + /** + * Sets the accessibility level of the segmented button item. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + accessibilityLevel?: string; +} + +/** + * The callback function that will be invoked when the selectedIndex of the segmented button is changed. + * + * @typedef { function } OnSelectedIndexChange + * @param { int } selectedIndex - the index of selected item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export type OnSelectedIndexChange = (selectedIndex: int) => void; + +/** + * The callback function that will be invoked when the selectedIndexes of the segmented button is changed. + * + * @typedef { function } OnSelectedIndexesChange + * @param { int[] } selectedIndexes - the index of selected items + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +export type OnSelectedIndexesChange = (selectedIndexes: int[]) => void; + +/** + * Defines segmented button item. + * + * @interface SegmentButtonV2Item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@ObservedV2 +export declare class SegmentButtonV2Item { + /** + * Sets the text of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace text?: ResourceStr; + + /** + * Sets the image icon of the segmented button item. + * This field will be useless if the symbol field is sets. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace icon?: ResourceStr; + + /** + * Sets the symbol icon of the segmented button item. + * + * @type { ?Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace symbol?: Resource; + + /** + * Sets whether segmented button item is enabled? + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace enabled: boolean; + + /** + * Sets modifier for the text of the segmented button item. + * + * @type { ?TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace textModifier?: TextModifier; + + /** + * Sets modifier for the image icon of the segmented button item. + * + * @type { ?ImageModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace iconModifier?: ImageModifier; + + /** + * Sets modifier for the symbol icon of the segmented button item. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace symbolModifier?: SymbolGlyphModifier; + + /** + * Sets the accessibility text of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace accessibilityText?: ResourceStr; + + /** + * Sets the accessibility description of the segmented button item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace accessibilityDescription?: ResourceStr; + + /** + * Sets the accessibility level of the segmented button item. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Trace accessibilityLevel?: string; + + /** + * The constructor of SegmentedButtonItem + * + * @param { SegmentedButtonItemOptions } options - the options of the segmented button item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(options: SegmentButtonV2ItemOptions); + + /** + * Is the segmented button item set with both text and icon? + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + get isHybrid(): boolean; +} + +/** + * Defines the items of the segmented button. + * + * @extends Array + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@ObservedV2 +export declare class SegmentButtonV2Items extends Array { + /** + * The constructor of SegmentedButtonItems + * + * @param { SegmentButtonV2ItemOptions[] } items - the options array of the segmented button items + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + constructor(items: SegmentButtonV2ItemOptions[]); + + /** + * Is there an option in the segmented button options that sets both text and icon? + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + get hasHybrid(): boolean; +} + +/** + * Defines segmented button with tab style. + * + * @struct TabSegmentedButton + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@ComponentV2 +export declare struct TabSegmentButtonV2 { + /** + * Sets the items of the segmented button. + * + * @type { SegmentButtonV2Items } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly items: SegmentButtonV2Items; + + /** + * Sets the selected index of the segmented button. + * + * @type { int } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly selectedIndex: int; + + /** + * Sets the callback function which will be invoked when the selected index of the segmented button is changed. + * + * @type { ?OnSelectedIndexChange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + $selectedIndex?: OnSelectedIndexChange; + + /** + * Sets the callback function which will be invoked when the item of the segmented button is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + onItemClicked?: Callback; + + /** + * Sets the min font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinFontScale?: double | Resource; + + /** + * Sets the max font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMaxFontScale?: double | Resource; + + /** + * Sets the space for all item of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSpace?: LengthMetrics; + + /** + * Sets the font size for the text of all segmented button items that are not selected. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontSize?: LengthMetrics; + + /** + * Sets the font size for the text of all segmented button selected items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontSize?: LengthMetrics; + + /** + * Sets the font color for the text of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontColor?: ColorMetrics; + + /** + * Sets the font color for the text of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontColor?: ColorMetrics; + + /** + * Sets the font weight for the text of all segmented button items that are not selected. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontWeight?: FontWeight; + + /** + * Sets the font weight for the text of all segmented button selected items. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontWeight?: FontWeight; + + /** + * Sets the border radius for all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBorderRadius?: LengthMetrics; + + /** + * Sets the background color for all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedBackgroundColor?: ColorMetrics; + + /** + * Sets the size for the icon of all segmented button items. + * + * @type { ?SizeT } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconSize?: SizeT; + + /** + * Sets the fill color for the icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconFillColor?: ColorMetrics; + + /** + * Sets the fill color for the icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedIconFillColor?: ColorMetrics; + + /** + * Sets the font size for the symbol icon of all segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontSize?: LengthMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontColor?: ColorMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedSymbolFontColor?: ColorMetrics; + + /** + * Sets the min height of all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinHeight?: LengthMetrics; + + /** + * Sets the padding of all segmented button items. + * + * @type { ?LocalizedPadding } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemPadding?: LocalizedPadding; + + /** + * Sets the shadow of all segmented button items. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemShadow?: ShadowOptions | ShadowStyle; + + /** + * Sets the background color of the segmented button. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundColor?: ColorMetrics; + + /** + * Sets the background blur style of the segmented button. + * + * @type { ?BlurStyle } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundBlurStyle?: BlurStyle; + + /** + * Sets the background blur style options of the segmented button. + * + * @type { ?BackgroundBlurStyleOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions; + + /** + * Sets the background effect of the segmented button. + * + * @type { ?BackgroundEffectOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundEffect?: BackgroundEffectOptions; + + /** + * Sets the border radius of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBorderRadius?: LengthMetrics; + + /** + * Sets the min height of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonMinHeight?: LengthMetrics; + + /** + * Sets the padding of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonPadding?: LengthMetrics; + + /** + * Sets the language direction of the segmented button. + * + * @type { ?Direction } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly languageDirection?: Direction; + + /** + * Sets the build function of the segmented button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + build(): void; +} + +/** + * Defines the segmented button with capsule style. + * + * @struct CapsuleSegmentButtonV2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@ComponentV2 +export declare struct CapsuleSegmentButtonV2 { + /** + * Sets the items of the segmented button. + * + * @type { SegmentButtonV2Items } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly items: SegmentButtonV2Items; + + /** + * Sets the selected index of the segmented button. + * + * @type { int } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly selectedIndex: int; + + /** + * Sets the callback function which will be invoked when the selected index of the segmented button is changed. + * + * @type { ?OnSelectedIndexChange } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + $selectedIndex?: OnSelectedIndexChange; + + /** + * Sets the callback function which will be invoked when the item of the segmented button is clicked. + * + * @type { ?Callback } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + onItemClicked?: Callback; + + /** + * Sets the min font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinFontScale?: double | Resource; + + /** + * Sets the max font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMaxFontScale?: double | Resource; + + /** + * Sets the space for all item of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSpace?: LengthMetrics; + + /** + * Sets the font color for the text of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontColor?: ColorMetrics; + + /** + * Sets the font color for the text of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontColor?: ColorMetrics; + + /** + * Sets the font size for the text of all segmented button items that are not selected. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontSize?: LengthMetrics; + + /** + * Sets the font size for the text of all segmented button selected items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontSize?: LengthMetrics; + + /** + * Sets the font weight for the text of all segmented button items that are not selected. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontWeight?: FontWeight; + + /** + * Sets the font weight for the text of all segmented button selected items. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontWeight?: FontWeight; + + /** + * Sets the border radius for all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBorderRadius?: LengthMetrics; + + /** + * Sets the background color for all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedBackgroundColor?: ColorMetrics; + + /** + * Sets the size for the icon of all segmented button items. + * + * @type { ?SizeT } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconSize?: SizeT; + + /** + * Sets the fill color for the icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconFillColor?: ColorMetrics; + + /** + * Sets the fill color for the icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedIconFillColor?: ColorMetrics; + + /** + * Sets the font size for the symbol icon of all segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontSize?: LengthMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontColor?: ColorMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedSymbolFontColor?: ColorMetrics; + + /** + * Sets the min height of all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinHeight?: LengthMetrics; + + /** + * Sets the padding of all segmented button items. + * + * @type { ?LocalizedPadding } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemPadding?: LocalizedPadding; + + /** + * Sets the shadow of all segmented button items. + * + * @type { ?(ShadowOptions | ShadowStyle) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemShadow?: ShadowOptions | ShadowStyle; + + /** + * Sets the background color of the segmented button. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundColor?: ColorMetrics; + + /** + * Sets the background blur style of the segmented button. + * + * @type { ?BlurStyle } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundBlurStyle?: BlurStyle; + + /** + * Sets the background blur style options of the segmented button. + * + * @type { ?BackgroundBlurStyleOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions; + + /** + * Sets the background effect of the segmented button. + * + * @type { ?BackgroundEffectOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBackgroundEffect?: BackgroundEffectOptions; + + /** + * Sets the border radius of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonBorderRadius?: LengthMetrics; + + /** + * Sets the min height of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonMinHeight?: LengthMetrics; + + /** + * Sets the padding of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly buttonPadding?: LengthMetrics; + + /** + * Sets the language direction of the segmented button. + * + * @type { ?Direction } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly languageDirection?: Direction; + + /** + * Sets the build function of the segmented button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + build(): void; +} + +/** + * Defines the segmented button with capsule style. + * + * @struct CapsuleSegmentButtonV2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ +@ComponentV2 +export declare struct MultiCapsuleSegmentButtonV2 { + /** + * Sets the items of the segmented button. + * + * @type { SegmentButtonV2Items } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly items: SegmentButtonV2Items; + + /** + * Sets the selection of the segmented button. + * + * @type { int[] } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Require + @Param + readonly selectedIndexes: int[]; + + /** + * Sets the callback function will be invoked when the selectedInexes field of the segmented button is changed. + * + * @type { ?OnSelectedIndexesChange } OnSelectedIndexesChange + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + $selectedIndexes: OnSelectedIndexesChange; + + /** + * Sets the callback function will be invoked when the item of the segmented button is clicked. + * + * @type { ?Callback } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Event + onItemClicked?: Callback; + + /** + * Sets the min font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinFontScale?: double | Resource; + + /** + * Sets the max font scale for all items of the segmented button. + * + * @type { ?(double | Resource) } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMaxFontScale?: double | Resource; + + /** + * Sets the space for each item of the segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSpace?: LengthMetrics; + + /** + * Sets the font color for the text of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontColor?: ColorMetrics; + + /** + * Sets the font color for the text of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontColor?: ColorMetrics; + + /** + * Sets the font size for the text of all segmented button items that are not selected. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontSize?: LengthMetrics; + + /** + * Sets the font size for the text of all segmented button selected items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontSize?: LengthMetrics; + + /** + * Sets the font weight for the text of all segmented button items that are not selected. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemFontWeight?: FontWeight; + + /** + * Sets the font weight for the text of all segmented button selected items. + * + * @type { ?FontWeight } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedFontWeight?: FontWeight; + + /** + * Sets the border radius for all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBorderRadius?: LengthMetrics; + + /** + * Sets the background color for all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBackgroundColor?: ColorMetrics; + + /** + * Sets the background effect of all segmented button items that are not selected. + * + * @type { ?BackgroundEffectOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBackgroundEffect?: BackgroundEffectOptions; + + /** + * Sets the background blur style of all segmented button items that are not selected. + * + * @type { ?BlurStyle } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBackgroundBlurStyle?: BlurStyle; + + /** + * Sets the background blur style options of all segmented button items that are not selected. + * + * @type { ?BackgroundBlurStyleOptions } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions; + + /** + * Sets the background color for all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedBackgroundColor?: ColorMetrics; + + /** + * Sets the size for the icon of all segmented button items. + * + * @type { ?SizeT } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconSize?: SizeT; + + /** + * Sets the fill color for the icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemIconFillColor?: ColorMetrics; + + /** + * Sets the fill color for the icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedIconFillColor?: ColorMetrics; + + /** + * Sets the font size for the symbol icon of all segmented button. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontSize?: LengthMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button items that are not selected. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSymbolFontColor?: ColorMetrics; + + /** + * Sets the font color for the symbol icon of all segmented button selected items. + * + * @type { ?ColorMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemSelectedSymbolFontColor?: ColorMetrics; + + /** + * Sets the min height of all segmented button items. + * + * @type { ?LengthMetrics } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemMinHeight?: LengthMetrics; + + /** + * Sets the padding of all segmented button items. + * + * @type { ?LocalizedPadding } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly itemPadding?: LocalizedPadding; + + /** + * Sets the language direction of the segmented button. + * + * @type { ?Direction } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + @Param + readonly languageDirection?: Direction; + + /** + * Sets the build function of the segmented button. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + * @noninterop + */ + build(): void; +} -- Gitee