• 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 * Defines the options of Checkbox.
18 *
19 * @interface CheckboxOptions
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 8
22 */
23/**
24 * Defines the options of Checkbox.
25 *
26 * @interface CheckboxOptions
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @since 9
29 * @form
30 */
31/**
32 * Defines the options of Checkbox.
33 *
34 * @interface CheckboxOptions
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @since 10
38 * @form
39 */
40/**
41 * Defines the options of Checkbox.
42 *
43 * @interface CheckboxOptions
44 * @syscap SystemCapability.ArkUI.ArkUI.Full
45 * @crossplatform
46 * @atomicservice
47 * @since 11
48 * @form
49 */
50declare interface CheckboxOptions {
51  /**
52   * Current name of Checkbox.
53   *
54   * @type { ?string }
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @since 8
57   */
58  /**
59   * Current name of Checkbox.
60   *
61   * @type { ?string }
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @since 9
64   * @form
65   */
66  /**
67   * Current name of Checkbox.
68   *
69   * @type { ?string }
70   * @syscap SystemCapability.ArkUI.ArkUI.Full
71   * @crossplatform
72   * @since 10
73   * @form
74   */
75  /**
76   * Current name of Checkbox.
77   *
78   * @type { ?string }
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @crossplatform
81   * @atomicservice
82   * @since 11
83   * @form
84   */
85  name?: string;
86
87  /**
88   * Sets the group of Checkbox.
89   *
90   * @type { ?string }
91   * @syscap SystemCapability.ArkUI.ArkUI.Full
92   * @since 8
93   */
94  /**
95   * Sets the group of Checkbox.
96   *
97   * @type { ?string }
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @since 9
100   * @form
101   */
102  /**
103   * Sets the group of Checkbox.
104   *
105   * @type { ?string }
106   * @syscap SystemCapability.ArkUI.ArkUI.Full
107   * @crossplatform
108   * @since 10
109   * @form
110   */
111  /**
112   * Sets the group of Checkbox.
113   *
114   * @type { ?string }
115   * @syscap SystemCapability.ArkUI.ArkUI.Full
116   * @crossplatform
117   * @atomicservice
118   * @since 11
119   * @form
120   */
121  group?: string;
122}
123
124/**
125 * Provides an interface for the Checkbox component.
126 *
127 * @interface CheckboxInterface
128 * @syscap SystemCapability.ArkUI.ArkUI.Full
129 * @since 8
130 */
131/**
132 * Provides an interface for the Checkbox component.
133 *
134 * @interface CheckboxInterface
135 * @syscap SystemCapability.ArkUI.ArkUI.Full
136 * @since 9
137 * @form
138 */
139/**
140 * Provides an interface for the Checkbox component.
141 *
142 * @interface CheckboxInterface
143 * @syscap SystemCapability.ArkUI.ArkUI.Full
144 * @crossplatform
145 * @since 10
146 * @form
147 */
148/**
149 * Provides an interface for the Checkbox component.
150 *
151 * @interface CheckboxInterface
152 * @syscap SystemCapability.ArkUI.ArkUI.Full
153 * @crossplatform
154 * @atomicservice
155 * @since 11
156 * @form
157 */
158interface CheckboxInterface {
159  /**
160   * Construct the Checkbox component.
161   * Called when the Checkbox component is used.
162   *
163   * @param { CheckboxOptions } options
164   * @returns { CheckboxAttribute }
165   * @syscap SystemCapability.ArkUI.ArkUI.Full
166   * @since 8
167   */
168  /**
169   * Construct the Checkbox component.
170   * Called when the Checkbox component is used.
171   *
172   * @param { CheckboxOptions } options
173   * @returns { CheckboxAttribute }
174   * @syscap SystemCapability.ArkUI.ArkUI.Full
175   * @since 9
176   * @form
177   */
178  /**
179   * Construct the Checkbox component.
180   * Called when the Checkbox component is used.
181   *
182   * @param { CheckboxOptions } options
183   * @returns { CheckboxAttribute }
184   * @syscap SystemCapability.ArkUI.ArkUI.Full
185   * @crossplatform
186   * @since 10
187   * @form
188   */
189  /**
190   * Construct the Checkbox component.
191   * Called when the Checkbox component is used.
192   *
193   * @param { CheckboxOptions } options
194   * @returns { CheckboxAttribute }
195   * @syscap SystemCapability.ArkUI.ArkUI.Full
196   * @crossplatform
197   * @atomicservice
198   * @since 11
199   * @form
200   */
201  (options?: CheckboxOptions): CheckboxAttribute;
202}
203
204/**
205 * Defines the attribute functions of Checkbox.
206 *
207 * @extends CommonMethod<CheckboxAttribute>
208 * @syscap SystemCapability.ArkUI.ArkUI.Full
209 * @since 8
210 */
211/**
212 * Defines the attribute functions of Checkbox.
213 *
214 * @extends CommonMethod<CheckboxAttribute>
215 * @syscap SystemCapability.ArkUI.ArkUI.Full
216 * @since 9
217 * @form
218 */
219/**
220 * Defines the attribute functions of Checkbox.
221 *
222 * @extends CommonMethod<CheckboxAttribute>
223 * @syscap SystemCapability.ArkUI.ArkUI.Full
224 * @crossplatform
225 * @since 10
226 * @form
227 */
228/**
229 * Defines the attribute functions of Checkbox.
230 *
231 * @extends CommonMethod<CheckboxAttribute>
232 * @syscap SystemCapability.ArkUI.ArkUI.Full
233 * @crossplatform
234 * @atomicservice
235 * @since 11
236 * @form
237 */
238declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> {
239  /**
240   * setting whether checkbox is selected.
241   *
242   * @param { boolean } value
243   * @returns { CheckboxAttribute }
244   * @syscap SystemCapability.ArkUI.ArkUI.Full
245   * @since 8
246   */
247  /**
248   * setting whether checkbox is selected.
249   *
250   * @param { boolean } value
251   * @returns { CheckboxAttribute }
252   * @syscap SystemCapability.ArkUI.ArkUI.Full
253   * @since 9
254   * @form
255   */
256  /**
257   * setting whether checkbox is selected.
258   *
259   * @param { boolean } value
260   * @returns { CheckboxAttribute }
261   * @syscap SystemCapability.ArkUI.ArkUI.Full
262   * @crossplatform
263   * @since 10
264   * @form
265   */
266  /**
267   * setting whether checkbox is selected.
268   *
269   * @param { boolean } value
270   * @returns { CheckboxAttribute }
271   * @syscap SystemCapability.ArkUI.ArkUI.Full
272   * @crossplatform
273   * @atomicservice
274   * @since 11
275   * @form
276   */
277  select(value: boolean): CheckboxAttribute;
278
279  /**
280   * setting the display color of checkbox.
281   *
282   * @param { ResourceColor } value
283   * @returns { CheckboxAttribute }
284   * @syscap SystemCapability.ArkUI.ArkUI.Full
285   * @since 8
286   */
287  /**
288   * setting the display color of checkbox.
289   *
290   * @param { ResourceColor } value
291   * @returns { CheckboxAttribute }
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @since 9
294   * @form
295   */
296  /**
297   * setting the display color of checkbox.
298   *
299   * @param { ResourceColor } value
300   * @returns { CheckboxAttribute }
301   * @syscap SystemCapability.ArkUI.ArkUI.Full
302   * @crossplatform
303   * @since 10
304   * @form
305   */
306  /**
307   * setting the display color of checkbox.
308   *
309   * @param { ResourceColor } value
310   * @returns { CheckboxAttribute }
311   * @syscap SystemCapability.ArkUI.ArkUI.Full
312   * @crossplatform
313   * @atomicservice
314   * @since 11
315   * @form
316   */
317  selectedColor(value: ResourceColor): CheckboxAttribute;
318
319  /**
320   * setting the shape of checkbox.
321   *
322   * @param { CheckBoxShape } value - The configuration of checkbox shape.
323   * @returns { CheckboxAttribute }
324   * @syscap SystemCapability.ArkUI.ArkUI.Full
325   * @crossplatform
326   * @since 11
327   * @form
328   */
329  shape(value: CheckBoxShape): CheckboxAttribute;
330
331  /**
332   * Set the display border color of unselected checkbox.
333   *
334   * @param { ResourceColor } value - The color of border when checkbox unselected.
335   * @returns { CheckboxAttribute }
336   * @syscap SystemCapability.ArkUI.ArkUI.Full
337   * @crossplatform
338   * @since 10
339   */
340  /**
341   * Set the display border color of unselected checkbox.
342   *
343   * @param { ResourceColor } value - The color of border when checkbox unselected.
344   * @returns { CheckboxAttribute }
345   * @syscap SystemCapability.ArkUI.ArkUI.Full
346   * @crossplatform
347   * @atomicservice
348   * @since 11
349   */
350  unselectedColor(value: ResourceColor): CheckboxAttribute;
351
352  /**
353   * Set the mark style of checkbox.
354   *
355   * @param { MarkStyle } value - The style configuration of checkbox mark.
356   * @returns { CheckboxAttribute }
357   * @syscap SystemCapability.ArkUI.ArkUI.Full
358   * @crossplatform
359   * @since 10
360   */
361  /**
362   * Set the mark style of checkbox.
363   *
364   * @param { MarkStyle } value - The style configuration of checkbox mark.
365   * @returns { CheckboxAttribute }
366   * @syscap SystemCapability.ArkUI.ArkUI.Full
367   * @crossplatform
368   * @atomicservice
369   * @since 11
370   */
371  mark(value: MarkStyle): CheckboxAttribute;
372
373  /**
374   * Called when the selection status changes.
375   *
376   * @param { function } callback
377   * @returns { CheckboxAttribute }
378   * @syscap SystemCapability.ArkUI.ArkUI.Full
379   * @since 8
380   */
381  /**
382   * Called when the selection status changes.
383   *
384   * @param { function } callback
385   * @returns { CheckboxAttribute }
386   * @syscap SystemCapability.ArkUI.ArkUI.Full
387   * @since 9
388   * @form
389   */
390  /**
391   * Called when the selection status changes.
392   *
393   * @param { function } callback
394   * @returns { CheckboxAttribute }
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @crossplatform
397   * @since 10
398   * @form
399   */
400  /**
401   * Called when the selection status changes.
402   *
403   * @param { function } callback
404   * @returns { CheckboxAttribute }
405   * @syscap SystemCapability.ArkUI.ArkUI.Full
406   * @crossplatform
407   * @atomicservice
408   * @since 11
409   * @form
410   */
411  onChange(callback: (value: boolean) => void): CheckboxAttribute;
412}
413
414/**
415 * Defines Checkbox Component.
416 *
417 * @syscap SystemCapability.ArkUI.ArkUI.Full
418 * @since 8
419 */
420/**
421 * Defines Checkbox Component.
422 *
423 * @syscap SystemCapability.ArkUI.ArkUI.Full
424 * @since 9
425 * @form
426 */
427/**
428 * Defines Checkbox Component.
429 *
430 * @syscap SystemCapability.ArkUI.ArkUI.Full
431 * @crossplatform
432 * @since 10
433 * @form
434 */
435/**
436 * Defines Checkbox Component.
437 *
438 * @syscap SystemCapability.ArkUI.ArkUI.Full
439 * @crossplatform
440 * @atomicservice
441 * @since 11
442 * @form
443 */
444declare const Checkbox: CheckboxInterface;
445
446/**
447 * Defines Checkbox Component instance.
448 *
449 * @syscap SystemCapability.ArkUI.ArkUI.Full
450 * @since 8
451 */
452/**
453 * Defines Checkbox Component instance.
454 *
455 * @syscap SystemCapability.ArkUI.ArkUI.Full
456 * @since 9
457 * @form
458 */
459/**
460 * Defines Checkbox Component instance.
461 *
462 * @syscap SystemCapability.ArkUI.ArkUI.Full
463 * @crossplatform
464 * @since 10
465 * @form
466 */
467/**
468 * Defines Checkbox Component instance.
469 *
470 * @syscap SystemCapability.ArkUI.ArkUI.Full
471 * @crossplatform
472 * @atomicservice
473 * @since 11
474 * @form
475 */
476declare const CheckboxInstance: CheckboxAttribute;
477