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 */ 40declare interface CheckboxOptions { 41 /** 42 * Current name of Checkbox. 43 * 44 * @type { ?string } 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @since 8 47 */ 48 /** 49 * Current name of Checkbox. 50 * 51 * @type { ?string } 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @since 9 54 * @form 55 */ 56 /** 57 * Current name of Checkbox. 58 * 59 * @type { ?string } 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 * @form 64 */ 65 name?: string; 66 67 /** 68 * Sets the group of Checkbox. 69 * 70 * @type { ?string } 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @since 8 73 */ 74 /** 75 * Sets the group of Checkbox. 76 * 77 * @type { ?string } 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @since 9 80 * @form 81 */ 82 /** 83 * Sets the group of Checkbox. 84 * 85 * @type { ?string } 86 * @syscap SystemCapability.ArkUI.ArkUI.Full 87 * @crossplatform 88 * @since 10 89 * @form 90 */ 91 group?: string; 92} 93 94/** 95 * Provides an interface for the Checkbox component. 96 * 97 * @interface CheckboxInterface 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @since 8 100 */ 101/** 102 * Provides an interface for the Checkbox component. 103 * 104 * @interface CheckboxInterface 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 9 107 * @form 108 */ 109/** 110 * Provides an interface for the Checkbox component. 111 * 112 * @interface CheckboxInterface 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @crossplatform 115 * @since 10 116 * @form 117 */ 118interface CheckboxInterface { 119 /** 120 * Construct the Checkbox component. 121 * Called when the Checkbox component is used. 122 * 123 * @param { CheckboxOptions } options 124 * @returns { CheckboxAttribute } 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @since 8 127 */ 128 /** 129 * Construct the Checkbox component. 130 * Called when the Checkbox component is used. 131 * 132 * @param { CheckboxOptions } options 133 * @returns { CheckboxAttribute } 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @since 9 136 * @form 137 */ 138 /** 139 * Construct the Checkbox component. 140 * Called when the Checkbox component is used. 141 * 142 * @param { CheckboxOptions } options 143 * @returns { CheckboxAttribute } 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @since 10 147 * @form 148 */ 149 (options?: CheckboxOptions): CheckboxAttribute; 150} 151 152/** 153 * Defines the attribute functions of Checkbox. 154 * 155 * @extends CommonMethod 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @since 8 158 */ 159/** 160 * Defines the attribute functions of Checkbox. 161 * 162 * @extends CommonMethod 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @since 9 165 * @form 166 */ 167/** 168 * Defines the attribute functions of Checkbox. 169 * 170 * @extends CommonMethod 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @crossplatform 173 * @since 10 174 * @form 175 */ 176declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> { 177 /** 178 * setting whether checkbox is selected. 179 * 180 * @param { boolean } value 181 * @returns { CheckboxAttribute } 182 * @syscap SystemCapability.ArkUI.ArkUI.Full 183 * @since 8 184 */ 185 /** 186 * setting whether checkbox is selected. 187 * 188 * @param { boolean } value 189 * @returns { CheckboxAttribute } 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @since 9 192 * @form 193 */ 194 /** 195 * setting whether checkbox is selected. 196 * 197 * @param { boolean } value 198 * @returns { CheckboxAttribute } 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @crossplatform 201 * @since 10 202 * @form 203 */ 204 select(value: boolean): CheckboxAttribute; 205 206 /** 207 * setting the display color of checkbox. 208 * 209 * @param { ResourceColor } value 210 * @returns { CheckboxAttribute } 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @since 8 213 */ 214 /** 215 * setting the display color of checkbox. 216 * 217 * @param { ResourceColor } value 218 * @returns { CheckboxAttribute } 219 * @syscap SystemCapability.ArkUI.ArkUI.Full 220 * @since 9 221 * @form 222 */ 223 /** 224 * setting the display color of checkbox. 225 * 226 * @param { ResourceColor } value 227 * @returns { CheckboxAttribute } 228 * @syscap SystemCapability.ArkUI.ArkUI.Full 229 * @crossplatform 230 * @since 10 231 * @form 232 */ 233 selectedColor(value: ResourceColor): CheckboxAttribute; 234 235 /** 236 * Set the display border color of unselected checkbox. 237 * 238 * @param { ResourceColor } value - The color of border when checkbox unselected. 239 * @returns { CheckboxAttribute } 240 * @syscap SystemCapability.ArkUI.ArkUI.Full 241 * @crossplatform 242 * @since 10 243 */ 244 unselectedColor(value: ResourceColor): CheckboxAttribute; 245 246 /** 247 * Set the mark style of checkbox. 248 * 249 * @param { MarkStyle } value - The style configuration of checkbox mark. 250 * @returns { CheckboxAttribute } 251 * @syscap SystemCapability.ArkUI.ArkUI.Full 252 * @crossplatform 253 * @since 10 254 */ 255 mark(value: MarkStyle): CheckboxAttribute; 256 257 /** 258 * Called when the selection status changes. 259 * 260 * @param { function } callback 261 * @returns { CheckboxAttribute } 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @since 8 264 */ 265 /** 266 * Called when the selection status changes. 267 * 268 * @param { function } callback 269 * @returns { CheckboxAttribute } 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @since 9 272 * @form 273 */ 274 /** 275 * Called when the selection status changes. 276 * 277 * @param { function } callback 278 * @returns { CheckboxAttribute } 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @crossplatform 281 * @since 10 282 * @form 283 */ 284 onChange(callback: (value: boolean) => void): CheckboxAttribute; 285} 286 287/** 288 * Defines Checkbox Component. 289 * 290 * @syscap SystemCapability.ArkUI.ArkUI.Full 291 * @since 8 292 */ 293/** 294 * Defines Checkbox Component. 295 * 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @since 9 298 * @form 299 */ 300/** 301 * Defines Checkbox Component. 302 * 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @crossplatform 305 * @since 10 306 * @form 307 */ 308declare const Checkbox: CheckboxInterface; 309 310/** 311 * Defines Checkbox Component instance. 312 * 313 * @syscap SystemCapability.ArkUI.ArkUI.Full 314 * @since 8 315 */ 316/** 317 * Defines Checkbox Component instance. 318 * 319 * @syscap SystemCapability.ArkUI.ArkUI.Full 320 * @since 9 321 * @form 322 */ 323/** 324 * Defines Checkbox Component instance. 325 * 326 * @syscap SystemCapability.ArkUI.ArkUI.Full 327 * @crossplatform 328 * @since 10 329 * @form 330 */ 331declare const CheckboxInstance: CheckboxAttribute; 332