• 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 * @since 8
19 */
20/**
21 * Defines the options of Checkbox.
22 * @form
23 * @since 9
24 */
25declare interface CheckboxOptions {
26  /**
27   * Current name of Checkbox.
28   * @since 8
29   */
30  /**
31   * Current name of Checkbox.
32   * @form
33   * @since 9
34   */
35  name?: string;
36
37  /**
38   * Sets the group of Checkbox.
39   * @since 8
40   */
41  /**
42   * Sets the group of Checkbox.
43   * @form
44   * @since 9
45   */
46  group?: string;
47}
48
49/**
50 * Provides an interface for the Checkbox component.
51 * @since 8
52 */
53/**
54 * Provides an interface for the Checkbox component.
55 * @form
56 * @since 9
57 */
58interface CheckboxInterface {
59  /**
60   * Construct the Checkbox component.
61   * Called when the Checkbox component is used.
62   * @since 8
63   */
64  /**
65   * Construct the Checkbox component.
66   * Called when the Checkbox component is used.
67   * @form
68   * @since 9
69   */
70  (options?: CheckboxOptions): CheckboxAttribute;
71}
72
73/**
74 * Defines the attribute functions of Checkbox.
75 * @since 8
76 */
77/**
78 * Defines the attribute functions of Checkbox.
79 * @form
80 * @since 9
81 */
82declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> {
83  /**
84   * setting whether checkbox is selected.
85   * @since 8
86   */
87  /**
88   * setting whether checkbox is selected.
89   * @form
90   * @since 9
91   */
92  select(value: boolean): CheckboxAttribute;
93
94  /**
95   * setting the display color of checkbox.
96   * @since 8
97   */
98  /**
99   * setting the display color of checkbox.
100   * @form
101   * @since 9
102   */
103  selectedColor(value: ResourceColor): CheckboxAttribute;
104
105  /**
106   * Called when the selection status changes.
107   * @since 8
108   */
109  /**
110   * Called when the selection status changes.
111   * @form
112   * @since 9
113   */
114  onChange(callback: (value: boolean) => void): CheckboxAttribute;
115}
116
117/**
118 * Defines Checkbox Component.
119 * @since 8
120 */
121/**
122 * Defines Checkbox Component.
123 * @form
124 * @since 9
125 */
126declare const Checkbox: CheckboxInterface;
127
128/**
129 * Defines Checkbox Component instance.
130 * @since 8
131 */
132/**
133 * Defines Checkbox Component instance.
134 * @form
135 * @since 9
136 */
137declare const CheckboxInstance: CheckboxAttribute;
138