diff --git a/api/@ohos.arkui.ArcAlphabetIndexer.static.d.ets b/api/@ohos.arkui.ArcAlphabetIndexer.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d3f8080af8f04da7b8d077e470c5e6243fc681c --- /dev/null +++ b/api/@ohos.arkui.ArcAlphabetIndexer.static.d.ets @@ -0,0 +1,267 @@ +/* + * 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 { memo, ComponentBuilder, CommonMethod, Optional, ColorMetrics, Font, BlurStyle, LengthMetrics, Bindable } from '@ohos.arkui.component'; + +/** + * Define the initialization parameters of the arc alphabet index bar + * + * @interface ArcAlphabetIndexerInitInfo + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare interface ArcAlphabetIndexerInitInfo { + /** + * Array of alphabetic indexed strings, cannot be set to empty. + * + * @type { string[] } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + arrayValue: string[]; + /** + * The index value of the initial selected item. + * + * @type { number | Bindable } - If it is out of the index range, the default value is 0 + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + selected: number | Bindable; +} + +/** + * Callback when index bar is selected. + * + * @typedef { function } OnSelectCallback + * @param { number } index - the selected index + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare type OnSelectCallback = (index: number) => void; + +/** + * Defines the arc alphabet index bar attribute functions. + * + * @extends CommonMethod + * @interface ArcAlphabetIndexerAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + * @noninterop + */ +export declare interface ArcAlphabetIndexerAttribute extends CommonMethod { + /** + * Definitions text color. + * + * @param { Optional } color + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + color(color: Optional): this; + + /** + * Selected text color. + * + * @param { Optional } color + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + selectedColor(color: Optional): this; + + /** + * Font color of the pop-up prompt text. + * + * @param { Optional } color + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + popupColor(color: Optional): this; + + /** + * Select the text background color. + * + * @param { Optional } color + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + selectedBackgroundColor(color: Optional): this; + + /** + * Background color of the pop-up window. + * + * @param { Optional } color + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + popupBackground(color: Optional): this; + + /** + * Whether to use pop-up index hints. + * + * @param { Optional } enabled + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + usePopup(enabled: Optional): this; + + /** + * Selected text style. + * + * @param { Optional } font + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + selectedFont(font: Optional): this; + + /** + * Popup text style. + * + * @param { Optional } font + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + popupFont(font: Optional): this; + + /** + * Definitions fonts. + * + * @param { Optional } font + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + font(font: Optional): this; + + /** + * Size of the letter area on the letter index bar. The letter area is a circle. Set the diameter of the circle. + * + * @param { Optional } size + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + itemSize(size: Optional): this; + + /** + * Sets the selected index. + * + * @param { Optional | Bindable } index + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + selected(index: Optional | Bindable): this; + + /** + * Automatically collapses the characters when the indexer bar not enough to display all characters. + * + * @param { Optional } enable - A boolean value determines whether auto collapses is enabled for indexer bar. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + autoCollapse(enable: Optional): this; + + /** + * Index bar selection callback. + * + * @param { Optional } handler + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + onSelect(handler: Optional): this; + + /** + * Set the background blurStyle of the pop-up window. + * + * @param { Optional } style + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + */ + popupBackgroundBlurStyle(style: Optional): this; +} + +/** + * Defines ArcAlphabetIndexer Component. + * + * @param { ArcAlphabetIndexerInitInfo } info - The initialization parameters of the arc alphabet index bar + * @param { function } [content_] + * @returns { ArcAlphabetIndexerAttribute } - The attribute of the ArcAlphabetIndexer. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @crossplatform + * @atomicservice + * @since 20 + * @noninterop + */ +@memo +@ComponentBuilder +export declare function ArcAlphabetIndexer( + info: ArcAlphabetIndexerInitInfo, + @memo + content_?: () => void, +): ArcAlphabetIndexerAttribute;