• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkUI
19 */
20
21/**
22 * Define the initialization parameters of the arc alphabet index bar
23 *
24 * @typedef ArcAlphabetIndexerInitInfo
25 * @syscap SystemCapability.ArkUI.ArkUI.Circle
26 * @crossplatform
27 * @atomicservice
28 * @since 18
29 */
30declare interface ArcAlphabetIndexerInitInfo  {
31  /**
32   * Array of alphabetic indexed strings, cannot be set to empty.
33   *
34   * @type { string[] }
35   * @syscap SystemCapability.ArkUI.ArkUI.Circle
36   * @crossplatform
37   * @atomicservice
38   * @since 18
39   */
40  arrayValue: string[];
41  /**
42   * The index value of the initial selected item.
43   *
44   * @type { number } - If it is out of the index range, the default value is 0
45   * @syscap SystemCapability.ArkUI.ArkUI.Circle
46   * @crossplatform
47   * @atomicservice
48   * @since 18
49   */
50  selected: number;
51}
52
53/**
54  * Callback when index bar is selected.
55  *
56  * @typedef { function } OnSelectCallback
57  * @param { number } index - the selected index
58  * @syscap SystemCapability.ArkUI.ArkUI.Circle
59  * @crossplatform
60  * @atomicservice
61  * @since 18
62  */
63declare type OnSelectCallback =  (index: number) => void;
64
65/**
66 * Arc Alphabet index bar.
67 *
68 * @interface ArcAlphabetIndexerInterface
69 * @syscap SystemCapability.ArkUI.ArkUI.Circle
70 * @crossplatform
71 * @atomicservice
72 * @since 18
73 */
74export interface ArcAlphabetIndexerInterface {
75  /**
76   * Create ArcAlphabetIndexer component
77   *
78   * ArrayValue: Alphabetical index string array.
79   * selected: ID of the selected item.
80   *
81   * @param { ArcAlphabetIndexerInitInfo } info
82   * @returns { ArcAlphabetIndexerAttribute }
83   * @syscap SystemCapability.ArkUI.ArkUI.Circle
84   * @crossplatform
85   * @atomicservice
86   * @since 18
87   */
88  (info: ArcAlphabetIndexerInitInfo): ArcAlphabetIndexerAttribute;
89}
90
91/**
92 * Defines the arc alphabet index bar attribute functions.
93 *
94 * @extends CommonMethod<ArcAlphabetIndexerAttribute>
95 * @syscap SystemCapability.ArkUI.ArkUI.Circle
96 * @crossplatform
97 * @atomicservice
98 * @since 18
99 */
100declare class ArcAlphabetIndexerAttribute extends CommonMethod<ArcAlphabetIndexerAttribute> {
101  /**
102   * Definitions text color.
103   *
104   * @param { Optional<ColorMetrics> } color
105   * @returns { ArcAlphabetIndexerAttribute }
106   * @syscap SystemCapability.ArkUI.ArkUI.Circle
107   * @crossplatform
108   * @atomicservice
109   * @since 18
110   */
111  color(color: Optional<ColorMetrics>): ArcAlphabetIndexerAttribute;
112
113  /**
114   * Selected text color.
115   *
116   * @param { Optional<ColorMetrics> } color
117   * @returns { ArcAlphabetIndexerAttribute }
118   * @syscap SystemCapability.ArkUI.ArkUI.Circle
119   * @crossplatform
120   * @atomicservice
121   * @since 18
122   */
123  selectedColor(color: Optional<ColorMetrics>): ArcAlphabetIndexerAttribute;
124
125  /**
126   * Font color of the pop-up prompt text.
127   *
128   * @param { Optional<ColorMetrics> } color
129   * @returns { ArcAlphabetIndexerAttribute }
130   * @syscap SystemCapability.ArkUI.ArkUI.Circle
131   * @crossplatform
132   * @atomicservice
133   * @since 18
134   */
135  popupColor(color: Optional<ColorMetrics>): ArcAlphabetIndexerAttribute;
136
137  /**
138   * Select the text background color.
139   *
140   * @param { Optional<ColorMetrics> } color
141   * @returns { ArcAlphabetIndexerAttribute }
142   * @syscap SystemCapability.ArkUI.ArkUI.Circle
143   * @crossplatform
144   * @atomicservice
145   * @since 18
146   */
147  selectedBackgroundColor(color: Optional<ColorMetrics>): ArcAlphabetIndexerAttribute;
148
149  /**
150   * Background color of the pop-up window.
151   *
152   * @param { Optional<ColorMetrics> } color
153   * @returns { ArcAlphabetIndexerAttribute }
154   * @syscap SystemCapability.ArkUI.ArkUI.Circle
155   * @crossplatform
156   * @atomicservice
157   * @since 18
158   */
159  popupBackground(color: Optional<ColorMetrics>): ArcAlphabetIndexerAttribute;
160
161  /**
162   * Whether to use pop-up index hints.
163   *
164   * @param { Optional<boolean> } enabled
165   * @returns { ArcAlphabetIndexerAttribute }
166   * @syscap SystemCapability.ArkUI.ArkUI.Circle
167   * @crossplatform
168   * @atomicservice
169   * @since 18
170   */
171  usePopup(enabled: Optional<boolean>): ArcAlphabetIndexerAttribute;
172
173  /**
174   * Selected text style.
175   *
176   * @param { Optional<Font> } font
177   * @returns { ArcAlphabetIndexerAttribute }
178   * @syscap SystemCapability.ArkUI.ArkUI.Circle
179   * @crossplatform
180   * @atomicservice
181   * @since 18
182   */
183  selectedFont(font: Optional<Font>): ArcAlphabetIndexerAttribute;
184
185  /**
186   * Popup text style.
187   *
188   * @param { Optional<Font> } font
189   * @returns { ArcAlphabetIndexerAttribute }
190   * @syscap SystemCapability.ArkUI.ArkUI.Circle
191   * @crossplatform
192   * @atomicservice
193   * @since 18
194   */
195  popupFont(font: Optional<Font>): ArcAlphabetIndexerAttribute;
196
197  /**
198   * Definitions fonts.
199   *
200   * @param { Optional<Font> } font
201   * @returns { ArcAlphabetIndexerAttribute }
202   * @syscap SystemCapability.ArkUI.ArkUI.Circle
203   * @crossplatform
204   * @atomicservice
205   * @since 18
206   */
207  font(font: Optional<Font>): ArcAlphabetIndexerAttribute;
208
209  /**
210   * Size of the letter area on the letter index bar. The letter area is a circle. Set the diameter of the circle.
211   *
212   * @param { Optional<LengthMetrics> } size
213   * @returns { ArcAlphabetIndexerAttribute }
214   * @syscap SystemCapability.ArkUI.ArkUI.Circle
215   * @crossplatform
216   * @atomicservice
217   * @since 18
218   */
219  itemSize(size: Optional<LengthMetrics>): ArcAlphabetIndexerAttribute;
220
221  /**
222   * Sets the selected index.
223   *
224   * @param { Optional<number> } index
225   * @returns { ArcAlphabetIndexerAttribute }
226   * @syscap SystemCapability.ArkUI.ArkUI.Circle
227   * @crossplatform
228   * @atomicservice
229   * @since 18
230   */
231  selected(index: Optional<number>): ArcAlphabetIndexerAttribute;
232
233  /**
234   * Automatically collapses the characters when the indexer bar not enough to display all characters.
235   *
236   * @param { Optional<boolean> } enable - A boolean value determines whether auto collapses is enabled for indexer bar.
237   * @returns { ArcAlphabetIndexerAttribute }
238   * @syscap SystemCapability.ArkUI.ArkUI.Circle
239   * @crossplatform
240   * @atomicservice
241   * @since 18
242   */
243  autoCollapse(enable: Optional<boolean>): ArcAlphabetIndexerAttribute;
244
245  /**
246   * Index bar selection callback.
247   *
248   * @param { Optional<OnSelectCallback> } handler
249   * @returns { ArcAlphabetIndexerAttribute }
250   * @syscap SystemCapability.ArkUI.ArkUI.Circle
251   * @crossplatform
252   * @atomicservice
253   * @since 18
254   */
255  onSelect(handler: Optional<OnSelectCallback>): ArcAlphabetIndexerAttribute;
256
257  /**
258   * Set the background blurStyle of the pop-up window.
259   *
260   * @param { Optional<BlurStyle> } style
261   * @returns { ArcAlphabetIndexerAttribute }
262   * @syscap SystemCapability.ArkUI.ArkUI.Circle
263   * @crossplatform
264   * @atomicservice
265   * @since 18
266   */
267  popupBackgroundBlurStyle(style: Optional<BlurStyle>): ArcAlphabetIndexerAttribute;
268}
269
270/**
271 * Defines ArcAlphabetIndexer Component.
272 *
273 * @syscap SystemCapability.ArkUI.ArkUI.Circle
274 * @crossplatform
275 * @atomicservice
276 * @since 18
277 */
278/**
279 * Defines ArcAlphabetIndexer Component.
280 *
281 * @syscap SystemCapability.ArkUI.ArkUI.Circle
282 * @crossplatform
283 * @atomicservice
284 * @uicomponent
285 * @since 19
286 */
287declare const ArcAlphabetIndexer: ArcAlphabetIndexerInterface;
288
289/**
290 * Defines ArcAlphabetIndexer Component instance.
291 *
292 * @syscap SystemCapability.ArkUI.ArkUI.Circle
293 * @crossplatform
294 * @atomicservice
295 * @since 18
296 */
297declare const ArcAlphabetIndexerInstance: ArcAlphabetIndexerAttribute;