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 * @interface CheckBoxConfiguration 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @atomicservice 147 * @since 12 148 */ 149declare interface CheckBoxConfiguration extends CommonConfiguration<CheckBoxConfiguration> { 150 /** 151 * Current name of checkbox. 152 * 153 * @type { string } 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 12 158 */ 159 name: string; 160 161 /** 162 * Indicates whether the checkbox is selected. 163 * 164 * @type { boolean } 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @crossplatform 167 * @atomicservice 168 * @since 12 169 */ 170 selected: boolean; 171 172 /** 173 * Trigger checkbox select change. 174 * 175 * @type { Callback<boolean> } 176 * @syscap SystemCapability.ArkUI.ArkUI.Full 177 * @crossplatform 178 * @atomicservice 179 * @since 12 180 */ 181 triggerChange: Callback<boolean>; 182} 183 184/** 185 * Provides an interface for the Checkbox component. 186 * 187 * @interface CheckboxInterface 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @since 8 190 */ 191/** 192 * Provides an interface for the Checkbox component. 193 * 194 * @interface CheckboxInterface 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @form 197 * @since 9 198 */ 199/** 200 * Provides an interface for the Checkbox component. 201 * 202 * @interface CheckboxInterface 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @crossplatform 205 * @form 206 * @since 10 207 */ 208/** 209 * Provides an interface for the Checkbox component. 210 * 211 * @interface CheckboxInterface 212 * @syscap SystemCapability.ArkUI.ArkUI.Full 213 * @crossplatform 214 * @form 215 * @atomicservice 216 * @since 11 217 */ 218interface CheckboxInterface { 219 /** 220 * Construct the Checkbox component. 221 * Called when the Checkbox component is used. 222 * 223 * @param { CheckboxOptions } options 224 * @returns { CheckboxAttribute } 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @since 8 227 */ 228 /** 229 * Construct the Checkbox component. 230 * Called when the Checkbox component is used. 231 * 232 * @param { CheckboxOptions } options 233 * @returns { CheckboxAttribute } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @form 236 * @since 9 237 */ 238 /** 239 * Construct the Checkbox component. 240 * Called when the Checkbox component is used. 241 * 242 * @param { CheckboxOptions } options 243 * @returns { CheckboxAttribute } 244 * @syscap SystemCapability.ArkUI.ArkUI.Full 245 * @crossplatform 246 * @form 247 * @since 10 248 */ 249 /** 250 * Construct the Checkbox component. 251 * Called when the Checkbox component is used. 252 * 253 * @param { CheckboxOptions } options 254 * @returns { CheckboxAttribute } 255 * @syscap SystemCapability.ArkUI.ArkUI.Full 256 * @crossplatform 257 * @form 258 * @atomicservice 259 * @since 11 260 */ 261 (options?: CheckboxOptions): CheckboxAttribute; 262} 263 264/** 265 * Defines the attribute functions of Checkbox. 266 * 267 * @extends CommonMethod<CheckboxAttribute> 268 * @syscap SystemCapability.ArkUI.ArkUI.Full 269 * @since 8 270 */ 271/** 272 * Defines the attribute functions of Checkbox. 273 * 274 * @extends CommonMethod<CheckboxAttribute> 275 * @syscap SystemCapability.ArkUI.ArkUI.Full 276 * @form 277 * @since 9 278 */ 279/** 280 * Defines the attribute functions of Checkbox. 281 * 282 * @extends CommonMethod<CheckboxAttribute> 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @crossplatform 285 * @form 286 * @since 10 287 */ 288/** 289 * Defines the attribute functions of Checkbox. 290 * 291 * @extends CommonMethod<CheckboxAttribute> 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @form 295 * @atomicservice 296 * @since 11 297 */ 298declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> { 299 /** 300 * setting whether checkbox is selected. 301 * 302 * @param { boolean } value 303 * @returns { CheckboxAttribute } 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @since 8 306 */ 307 /** 308 * setting whether checkbox is selected. 309 * 310 * @param { boolean } value 311 * @returns { CheckboxAttribute } 312 * @syscap SystemCapability.ArkUI.ArkUI.Full 313 * @form 314 * @since 9 315 */ 316 /** 317 * setting whether checkbox is selected. 318 * 319 * @param { boolean } value 320 * @returns { CheckboxAttribute } 321 * @syscap SystemCapability.ArkUI.ArkUI.Full 322 * @crossplatform 323 * @form 324 * @since 10 325 */ 326 /** 327 * setting whether checkbox is selected. 328 * 329 * @param { boolean } value 330 * @returns { CheckboxAttribute } 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @crossplatform 333 * @form 334 * @atomicservice 335 * @since 11 336 */ 337 select(value: boolean): CheckboxAttribute; 338 339 /** 340 * setting the display color of checkbox. 341 * 342 * @param { ResourceColor } value 343 * @returns { CheckboxAttribute } 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @since 8 346 */ 347 /** 348 * setting the display color of checkbox. 349 * 350 * @param { ResourceColor } value 351 * @returns { CheckboxAttribute } 352 * @syscap SystemCapability.ArkUI.ArkUI.Full 353 * @form 354 * @since 9 355 */ 356 /** 357 * setting the display color of checkbox. 358 * 359 * @param { ResourceColor } value 360 * @returns { CheckboxAttribute } 361 * @syscap SystemCapability.ArkUI.ArkUI.Full 362 * @crossplatform 363 * @form 364 * @since 10 365 */ 366 /** 367 * setting the display color of checkbox. 368 * 369 * @param { ResourceColor } value 370 * @returns { CheckboxAttribute } 371 * @syscap SystemCapability.ArkUI.ArkUI.Full 372 * @crossplatform 373 * @form 374 * @atomicservice 375 * @since 11 376 */ 377 selectedColor(value: ResourceColor): CheckboxAttribute; 378 379 /** 380 * setting the shape of checkbox. 381 * 382 * @param { CheckBoxShape } value - The configuration of checkbox shape. 383 * @returns { CheckboxAttribute } 384 * @syscap SystemCapability.ArkUI.ArkUI.Full 385 * @crossplatform 386 * @form 387 * @since 11 388 */ 389 /** 390 * setting the shape of checkbox. 391 * 392 * @param { CheckBoxShape } value - The configuration of checkbox shape. 393 * @returns { CheckboxAttribute } 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @crossplatform 396 * @form 397 * @atomicservice 398 * @since 12 399 */ 400 shape(value: CheckBoxShape): CheckboxAttribute; 401 402 /** 403 * Set the display border color of unselected checkbox. 404 * 405 * @param { ResourceColor } value - The color of border when checkbox unselected. 406 * @returns { CheckboxAttribute } 407 * @syscap SystemCapability.ArkUI.ArkUI.Full 408 * @crossplatform 409 * @since 10 410 */ 411 /** 412 * Set the display border color of unselected checkbox. 413 * 414 * @param { ResourceColor } value - The color of border when checkbox unselected. 415 * @returns { CheckboxAttribute } 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @atomicservice 419 * @since 11 420 */ 421 unselectedColor(value: ResourceColor): CheckboxAttribute; 422 423 /** 424 * Set the mark style of checkbox. 425 * 426 * @param { MarkStyle } value - The style configuration of checkbox mark. 427 * @returns { CheckboxAttribute } 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @crossplatform 430 * @since 10 431 */ 432 /** 433 * Set the mark style of checkbox. 434 * 435 * @param { MarkStyle } value - The style configuration of checkbox mark. 436 * @returns { CheckboxAttribute } 437 * @syscap SystemCapability.ArkUI.ArkUI.Full 438 * @crossplatform 439 * @atomicservice 440 * @since 11 441 */ 442 mark(value: MarkStyle): CheckboxAttribute; 443 444 /** 445 * Called when the selection status changes. 446 * 447 * @param { function } callback 448 * @returns { CheckboxAttribute } 449 * @syscap SystemCapability.ArkUI.ArkUI.Full 450 * @since 8 451 */ 452 /** 453 * Called when the selection status changes. 454 * 455 * @param { function } callback 456 * @returns { CheckboxAttribute } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @form 459 * @since 9 460 */ 461 /** 462 * Called when the selection status changes. 463 * 464 * @param { function } callback 465 * @returns { CheckboxAttribute } 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @crossplatform 468 * @form 469 * @since 10 470 */ 471 /** 472 * Called when the selection status changes. 473 * 474 * @param { function } callback 475 * @returns { CheckboxAttribute } 476 * @syscap SystemCapability.ArkUI.ArkUI.Full 477 * @crossplatform 478 * @form 479 * @atomicservice 480 * @since 11 481 */ 482 onChange(callback: (value: boolean) => void): CheckboxAttribute; 483 484 /** 485 * Set the content modifier of checkbox. 486 * 487 * @param { ContentModifier<CheckBoxConfiguration> } modifier - The content modifier of checkbox. 488 * @returns { CheckboxAttribute } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @atomicservice 492 * @since 12 493 */ 494 contentModifier(modifier: ContentModifier<CheckBoxConfiguration>): CheckboxAttribute; 495} 496 497/** 498 * Defines Checkbox Component. 499 * 500 * @syscap SystemCapability.ArkUI.ArkUI.Full 501 * @since 8 502 */ 503/** 504 * Defines Checkbox Component. 505 * 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @form 508 * @since 9 509 */ 510/** 511 * Defines Checkbox Component. 512 * 513 * @syscap SystemCapability.ArkUI.ArkUI.Full 514 * @crossplatform 515 * @form 516 * @since 10 517 */ 518/** 519 * Defines Checkbox Component. 520 * 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @crossplatform 523 * @form 524 * @atomicservice 525 * @since 11 526 */ 527declare const Checkbox: CheckboxInterface; 528 529/** 530 * Defines Checkbox Component instance. 531 * 532 * @syscap SystemCapability.ArkUI.ArkUI.Full 533 * @since 8 534 */ 535/** 536 * Defines Checkbox Component instance. 537 * 538 * @syscap SystemCapability.ArkUI.ArkUI.Full 539 * @form 540 * @since 9 541 */ 542/** 543 * Defines Checkbox Component instance. 544 * 545 * @syscap SystemCapability.ArkUI.ArkUI.Full 546 * @crossplatform 547 * @form 548 * @since 10 549 */ 550/** 551 * Defines Checkbox Component instance. 552 * 553 * @syscap SystemCapability.ArkUI.ArkUI.Full 554 * @crossplatform 555 * @form 556 * @atomicservice 557 * @since 11 558 */ 559declare const CheckboxInstance: CheckboxAttribute; 560