• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 * Defines the IndicatorType of Radio component
23 *
24 * @enum { number }
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @crossplatform
27 * @form
28 * @atomicservice
29 * @since 12
30 */
31declare enum RadioIndicatorType {
32  /**
33   * Tick shape.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @crossplatform
37   * @form
38   * @atomicservice
39   * @since 12
40   */
41  TICK = 0,
42  /**
43   * Dot shape.
44   *
45   * @syscap SystemCapability.ArkUI.ArkUI.Full
46   * @crossplatform
47   * @form
48   * @atomicservice
49   * @since 12
50   */
51  DOT = 1,
52    /**
53   * custom shape.
54   *
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @crossplatform
57   * @form
58   * @atomicservice
59   * @since 12
60   */
61  CUSTOM = 2,
62}
63
64/**
65 * Input parameter for creating a radio box.
66 *
67 * @interface RadioOptions
68 * @syscap SystemCapability.ArkUI.ArkUI.Full
69 * @since 8
70 */
71/**
72 * Input parameter for creating a radio box.
73 *
74 * @interface RadioOptions
75 * @syscap SystemCapability.ArkUI.ArkUI.Full
76 * @form
77 * @since 9
78 */
79/**
80 * Input parameter for creating a radio box.
81 *
82 * @interface RadioOptions
83 * @syscap SystemCapability.ArkUI.ArkUI.Full
84 * @crossplatform
85 * @form
86 * @since 10
87 */
88/**
89 * Input parameter for creating a radio box.
90 *
91 * @interface RadioOptions
92 * @syscap SystemCapability.ArkUI.ArkUI.Full
93 * @crossplatform
94 * @form
95 * @atomicservice
96 * @since 11
97 */
98declare interface RadioOptions {
99  /**
100   * Radio group name.
101   *
102   * @type { string }
103   * @syscap SystemCapability.ArkUI.ArkUI.Full
104   * @since 8
105   */
106  /**
107   * Radio group name.
108   *
109   * @type { string }
110   * @syscap SystemCapability.ArkUI.ArkUI.Full
111   * @form
112   * @since 9
113   */
114  /**
115   * Radio group name.
116   *
117   * @type { string }
118   * @syscap SystemCapability.ArkUI.ArkUI.Full
119   * @crossplatform
120   * @form
121   * @since 10
122   */
123  /**
124   * Radio group name.
125   *
126   * @type { string }
127   * @syscap SystemCapability.ArkUI.ArkUI.Full
128   * @crossplatform
129   * @form
130   * @atomicservice
131   * @since 11
132   */
133  group: string;
134
135  /**
136   * Radio name.
137   *
138   * @type { string }
139   * @syscap SystemCapability.ArkUI.ArkUI.Full
140   * @since 8
141   */
142  /**
143   * Radio name.
144   *
145   * @type { string }
146   * @syscap SystemCapability.ArkUI.ArkUI.Full
147   * @form
148   * @since 9
149   */
150  /**
151   * Radio name.
152   *
153   * @type { string }
154   * @syscap SystemCapability.ArkUI.ArkUI.Full
155   * @crossplatform
156   * @form
157   * @since 10
158   */
159  /**
160   * Radio name.
161   *
162   * @type { string }
163   * @syscap SystemCapability.ArkUI.ArkUI.Full
164   * @crossplatform
165   * @form
166   * @atomicservice
167   * @since 11
168   */
169  value: string;
170  /**
171   * Indicator Type.
172   *
173   * @type { ?RadioIndicatorType }
174   * @syscap SystemCapability.ArkUI.ArkUI.Full
175   * @crossplatform
176   * @form
177   * @atomicservice
178   * @since 12
179   */
180  indicatorType?: RadioIndicatorType;
181  /**
182   * builder for IndicatorType.CUSTOM
183   *
184   * @type { ?CustomBuilder }
185   * @syscap SystemCapability.ArkUI.ArkUI.Full
186   * @crossplatform
187   * @form
188   * @atomicservice
189   * @since 12
190   */
191  indicatorBuilder?: CustomBuilder;
192}
193
194/**
195 * Set radio Style.
196 *
197 * @interface RadioStyle
198 * @syscap SystemCapability.ArkUI.ArkUI.Full
199 * @crossplatform
200 * @since 10
201 */
202/**
203 * Set radio Style.
204 *
205 * @interface RadioStyle
206 * @syscap SystemCapability.ArkUI.ArkUI.Full
207 * @crossplatform
208 * @atomicservice
209 * @since 11
210 */
211declare interface RadioStyle {
212  /**
213   * Set the background color when the radio box is checked.
214   *
215   * @type { ?ResourceColor } checkedBackgroundColor - the background color when the radio box is checked.
216   * @default #007DFF
217   * @syscap SystemCapability.ArkUI.ArkUI.Full
218   * @crossplatform
219   * @since 10
220   */
221  /**
222   * Set the background color when the radio box is checked.
223   *
224   * @type { ?ResourceColor } checkedBackgroundColor - the background color when the radio box is checked.
225   * @default #007DFF
226   * @syscap SystemCapability.ArkUI.ArkUI.Full
227   * @crossplatform
228   * @atomicservice
229   * @since 11
230   */
231  checkedBackgroundColor?: ResourceColor;
232
233  /**
234   * Set the bolder color when the radio box is unchecked.
235   *
236   * @type { ?ResourceColor } uncheckedBorderColor - the bolder color when the radio box is unchecked.
237   * @default #182431
238   * @syscap SystemCapability.ArkUI.ArkUI.Full
239   * @crossplatform
240   * @since 10
241   */
242  /**
243   * Set the bolder color when the radio box is unchecked.
244   *
245   * @type { ?ResourceColor } uncheckedBorderColor - the bolder color when the radio box is unchecked.
246   * @default #182431
247   * @syscap SystemCapability.ArkUI.ArkUI.Full
248   * @crossplatform
249   * @atomicservice
250   * @since 11
251   */
252  uncheckedBorderColor?: ResourceColor;
253
254  /**
255   * Set the indicator color when the radio box is checked.
256   *
257   * @type { ?ResourceColor } indicatorColor - the indicator color when the radio box is checked.
258   * @default #FFFFFF
259   * @syscap SystemCapability.ArkUI.ArkUI.Full
260   * @crossplatform
261   * @since 10
262   */
263  /**
264   * Set the indicator color when the radio box is checked.
265   *
266   * @type { ?ResourceColor } indicatorColor - the indicator color when the radio box is checked.
267   * @default #FFFFFF
268   * @syscap SystemCapability.ArkUI.ArkUI.Full
269   * @crossplatform
270   * @atomicservice
271   * @since 11
272   */
273  indicatorColor?: ResourceColor;
274}
275
276/**
277 * Provides an interface for creating a radio box.
278 *
279 * @interface RadioInterface
280 * @syscap SystemCapability.ArkUI.ArkUI.Full
281 * @since 8
282 */
283/**
284 * Provides an interface for creating a radio box.
285 *
286 * @interface RadioInterface
287 * @syscap SystemCapability.ArkUI.ArkUI.Full
288 * @form
289 * @since 9
290 */
291/**
292 * Provides an interface for creating a radio box.
293 *
294 * @interface RadioInterface
295 * @syscap SystemCapability.ArkUI.ArkUI.Full
296 * @crossplatform
297 * @form
298 * @since 10
299 */
300/**
301 * Provides an interface for creating a radio box.
302 *
303 * @interface RadioInterface
304 * @syscap SystemCapability.ArkUI.ArkUI.Full
305 * @crossplatform
306 * @form
307 * @atomicservice
308 * @since 11
309 */
310interface RadioInterface {
311  /**
312   * Called when a radio box is created.
313   *
314   * @param { RadioOptions } options
315   * @returns { RadioAttribute }
316   * @syscap SystemCapability.ArkUI.ArkUI.Full
317   * @since 8
318   */
319  /**
320   * Called when a radio box is created.
321   *
322   * @param { RadioOptions } options
323   * @returns { RadioAttribute }
324   * @syscap SystemCapability.ArkUI.ArkUI.Full
325   * @form
326   * @since 9
327   */
328  /**
329   * Called when a radio box is created.
330   *
331   * @param { RadioOptions } options
332   * @returns { RadioAttribute }
333   * @syscap SystemCapability.ArkUI.ArkUI.Full
334   * @crossplatform
335   * @form
336   * @since 10
337   */
338  /**
339   * Called when a radio box is created.
340   *
341   * @param { RadioOptions } options
342   * @returns { RadioAttribute }
343   * @syscap SystemCapability.ArkUI.ArkUI.Full
344   * @crossplatform
345   * @form
346   * @atomicservice
347   * @since 11
348   */
349  (options: RadioOptions): RadioAttribute;
350}
351
352/**
353 * Provides methods for radio method component.
354 *
355 * @extends CommonMethod<RadioAttribute>
356 * @syscap SystemCapability.ArkUI.ArkUI.Full
357 * @since 8
358 */
359/**
360 * Provides methods for radio method component.
361 *
362 * @extends CommonMethod<RadioAttribute>
363 * @syscap SystemCapability.ArkUI.ArkUI.Full
364 * @form
365 * @since 9
366 */
367/**
368 * Provides methods for radio method component.
369 *
370 * @extends CommonMethod<RadioAttribute>
371 * @syscap SystemCapability.ArkUI.ArkUI.Full
372 * @crossplatform
373 * @form
374 * @since 10
375 */
376/**
377 * Provides methods for radio method component.
378 *
379 * @extends CommonMethod<RadioAttribute>
380 * @syscap SystemCapability.ArkUI.ArkUI.Full
381 * @crossplatform
382 * @form
383 * @atomicservice
384 * @since 11
385 */
386declare class RadioAttribute extends CommonMethod<RadioAttribute> {
387  /**
388   * Called when the radio box is selected.
389   *
390   * @param { boolean } value
391   * @returns { RadioAttribute }
392   * @syscap SystemCapability.ArkUI.ArkUI.Full
393   * @since 8
394   */
395  /**
396   * Called when the radio box is selected.
397   *
398   * @param { boolean } value
399   * @returns { RadioAttribute }
400   * @syscap SystemCapability.ArkUI.ArkUI.Full
401   * @form
402   * @since 9
403   */
404  /**
405   * Called when the radio box is selected.
406   *
407   * @param { boolean } value
408   * @returns { RadioAttribute }
409   * @syscap SystemCapability.ArkUI.ArkUI.Full
410   * @crossplatform
411   * @form
412   * @since 10
413   */
414  /**
415   * Called when the radio box is selected.
416   *
417   * @param { boolean } value
418   * @returns { RadioAttribute }
419   * @syscap SystemCapability.ArkUI.ArkUI.Full
420   * @crossplatform
421   * @form
422   * @atomicservice
423   * @since 11
424   */
425  checked(value: boolean): RadioAttribute;
426
427  /**
428   * Called when the radio box selection status changes.
429   *
430   * @param { function } callback
431   * @returns { RadioAttribute }
432   * @syscap SystemCapability.ArkUI.ArkUI.Full
433   * @since 8
434   */
435  /**
436   * Called when the radio box selection status changes.
437   *
438   * @param { function } callback
439   * @returns { RadioAttribute }
440   * @syscap SystemCapability.ArkUI.ArkUI.Full
441   * @form
442   * @since 9
443   */
444  /**
445   * Called when the radio box selection status changes.
446   *
447   * @param { function } callback
448   * @returns { RadioAttribute }
449   * @syscap SystemCapability.ArkUI.ArkUI.Full
450   * @crossplatform
451   * @form
452   * @since 10
453   */
454  /**
455   * Called when the radio box selection status changes.
456   *
457   * @param { function } callback
458   * @returns { RadioAttribute }
459   * @syscap SystemCapability.ArkUI.ArkUI.Full
460   * @crossplatform
461   * @form
462   * @atomicservice
463   * @since 11
464   */
465  onChange(callback: (isChecked: boolean) => void): RadioAttribute;
466
467  /**
468   * Set the radio style.
469   *
470   * @param { RadioStyle } value - the radio style.
471   * @returns { RadioAttribute }
472   * @syscap SystemCapability.ArkUI.ArkUI.Full
473   * @crossplatform
474   * @since 10
475   */
476  /**
477   * Set the radio style.
478   *
479   * @param { RadioStyle } value - the radio style.
480   * @returns { RadioAttribute }
481   * @syscap SystemCapability.ArkUI.ArkUI.Full
482   * @crossplatform
483   * @atomicservice
484   * @since 11
485   */
486  radioStyle(value?: RadioStyle): RadioAttribute;
487
488    /**
489   * Set the Configuration of radio.
490   *
491   * @param { ContentModifier<RadioConfiguration> } modifier - The contentModifier of radio.
492   * @returns { RadioAttribute }
493   * @syscap SystemCapability.ArkUI.ArkUI.Full
494   * @crossplatform
495   * @atomicservice
496   * @since 12
497   */
498  contentModifier(modifier: ContentModifier<RadioConfiguration>): RadioAttribute;
499}
500
501/**
502 * RadioConfiguration used by radio Configuration
503 *
504 * @interface RadioConfiguration
505 * @syscap SystemCapability.ArkUI.ArkUI.Full
506 * @crossplatform
507 * @atomicservice
508 * @since 12
509 */
510declare interface RadioConfiguration extends CommonConfiguration<RadioConfiguration> {
511    /**
512   * Radio name.
513   *
514   * @type { string }
515   * @syscap SystemCapability.ArkUI.ArkUI.Full
516   * @crossplatform
517   * @atomicservice
518   * @since 12
519   */
520  value: string;
521
522    /**
523   * Called when the radio box is selected.
524   *
525   * @type { boolean }
526   * @syscap SystemCapability.ArkUI.ArkUI.Full
527   * @crossplatform
528   * @atomicservice
529   * @since 12
530   */
531  checked: boolean;
532
533  /**
534   * Called when the radio box selection status changes.
535   *
536   * @type { Callback<boolean> }
537   * @syscap SystemCapability.ArkUI.ArkUI.Full
538   * @crossplatform
539   * @atomicservice
540   * @since 12
541   */
542  triggerChange: Callback<boolean>;
543}
544
545/**
546 * Defines Radio Component.
547 *
548 * @syscap SystemCapability.ArkUI.ArkUI.Full
549 * @since 8
550 */
551/**
552 * Defines Radio Component.
553 *
554 * @syscap SystemCapability.ArkUI.ArkUI.Full
555 * @form
556 * @since 9
557 */
558/**
559 * Defines Radio Component.
560 *
561 * @syscap SystemCapability.ArkUI.ArkUI.Full
562 * @crossplatform
563 * @form
564 * @since 10
565 */
566/**
567 * Defines Radio Component.
568 *
569 * @syscap SystemCapability.ArkUI.ArkUI.Full
570 * @crossplatform
571 * @form
572 * @atomicservice
573 * @since 11
574 */
575declare const Radio: RadioInterface;
576
577/**
578 * Defines Radio Component instance.
579 *
580 * @syscap SystemCapability.ArkUI.ArkUI.Full
581 * @since 8
582 */
583/**
584 * Defines Radio Component instance.
585 *
586 * @syscap SystemCapability.ArkUI.ArkUI.Full
587 * @form
588 * @since 9
589 */
590/**
591 * Defines Radio Component instance.
592 *
593 * @syscap SystemCapability.ArkUI.ArkUI.Full
594 * @crossplatform
595 * @form
596 * @since 10
597 */
598/**
599 * Defines Radio Component instance.
600 *
601 * @syscap SystemCapability.ArkUI.ArkUI.Full
602 * @crossplatform
603 * @form
604 * @atomicservice
605 * @since 11
606 */
607declare const RadioInstance: RadioAttribute;
608