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