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 a Checkbox callback when onChange. 266 * 267 * @typedef { function } OnCheckboxChangeCallback 268 * @param { boolean } value - selected status 269 * @syscap SystemCapability.ArkUI.ArkUI.Full 270 * @crossplatform 271 * @form 272 * @atomicservice 273 * @since 13 274 */ 275declare type OnCheckboxChangeCallback = (value: boolean) => void; 276 277/** 278 * Defines the attribute functions of Checkbox. 279 * 280 * @extends CommonMethod<CheckboxAttribute> 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @since 8 283 */ 284/** 285 * Defines the attribute functions of Checkbox. 286 * 287 * @extends CommonMethod<CheckboxAttribute> 288 * @syscap SystemCapability.ArkUI.ArkUI.Full 289 * @form 290 * @since 9 291 */ 292/** 293 * Defines the attribute functions of Checkbox. 294 * 295 * @extends CommonMethod<CheckboxAttribute> 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @crossplatform 298 * @form 299 * @since 10 300 */ 301/** 302 * Defines the attribute functions of Checkbox. 303 * 304 * @extends CommonMethod<CheckboxAttribute> 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @crossplatform 307 * @form 308 * @atomicservice 309 * @since 11 310 */ 311declare class CheckboxAttribute extends CommonMethod<CheckboxAttribute> { 312 /** 313 * setting whether checkbox is selected. 314 * 315 * @param { boolean } value 316 * @returns { CheckboxAttribute } 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @since 8 319 */ 320 /** 321 * setting whether checkbox is selected. 322 * 323 * @param { boolean } value 324 * @returns { CheckboxAttribute } 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @form 327 * @since 9 328 */ 329 /** 330 * setting whether checkbox is selected. 331 * 332 * @param { boolean } value 333 * @returns { CheckboxAttribute } 334 * @syscap SystemCapability.ArkUI.ArkUI.Full 335 * @crossplatform 336 * @form 337 * @since 10 338 */ 339 /** 340 * setting whether checkbox is selected. 341 * 342 * @param { boolean } value 343 * @returns { CheckboxAttribute } 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @crossplatform 346 * @form 347 * @atomicservice 348 * @since 11 349 */ 350 select(value: boolean): CheckboxAttribute; 351 352 /** 353 * setting the display color of checkbox. 354 * 355 * @param { ResourceColor } value 356 * @returns { CheckboxAttribute } 357 * @syscap SystemCapability.ArkUI.ArkUI.Full 358 * @since 8 359 */ 360 /** 361 * setting the display color of checkbox. 362 * 363 * @param { ResourceColor } value 364 * @returns { CheckboxAttribute } 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @form 367 * @since 9 368 */ 369 /** 370 * setting the display color of checkbox. 371 * 372 * @param { ResourceColor } value 373 * @returns { CheckboxAttribute } 374 * @syscap SystemCapability.ArkUI.ArkUI.Full 375 * @crossplatform 376 * @form 377 * @since 10 378 */ 379 /** 380 * setting the display color of checkbox. 381 * 382 * @param { ResourceColor } value 383 * @returns { CheckboxAttribute } 384 * @syscap SystemCapability.ArkUI.ArkUI.Full 385 * @crossplatform 386 * @form 387 * @atomicservice 388 * @since 11 389 */ 390 selectedColor(value: ResourceColor): CheckboxAttribute; 391 392 /** 393 * setting the shape of checkbox. 394 * 395 * @param { CheckBoxShape } value - The configuration of checkbox shape. 396 * @returns { CheckboxAttribute } 397 * @syscap SystemCapability.ArkUI.ArkUI.Full 398 * @crossplatform 399 * @form 400 * @since 11 401 */ 402 /** 403 * setting the shape of checkbox. 404 * 405 * @param { CheckBoxShape } value - The configuration of checkbox shape. 406 * @returns { CheckboxAttribute } 407 * @syscap SystemCapability.ArkUI.ArkUI.Full 408 * @crossplatform 409 * @form 410 * @atomicservice 411 * @since 12 412 */ 413 shape(value: CheckBoxShape): CheckboxAttribute; 414 415 /** 416 * Set the display border color of unselected checkbox. 417 * 418 * @param { ResourceColor } value - The color of border when checkbox unselected. 419 * @returns { CheckboxAttribute } 420 * @syscap SystemCapability.ArkUI.ArkUI.Full 421 * @crossplatform 422 * @since 10 423 */ 424 /** 425 * Set the display border color of unselected checkbox. 426 * 427 * @param { ResourceColor } value - The color of border when checkbox unselected. 428 * @returns { CheckboxAttribute } 429 * @syscap SystemCapability.ArkUI.ArkUI.Full 430 * @crossplatform 431 * @atomicservice 432 * @since 11 433 */ 434 unselectedColor(value: ResourceColor): CheckboxAttribute; 435 436 /** 437 * Set the mark style of checkbox. 438 * 439 * @param { MarkStyle } value - The style configuration of checkbox mark. 440 * @returns { CheckboxAttribute } 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @crossplatform 443 * @since 10 444 */ 445 /** 446 * Set the mark style of checkbox. 447 * 448 * @param { MarkStyle } value - The style configuration of checkbox mark. 449 * @returns { CheckboxAttribute } 450 * @syscap SystemCapability.ArkUI.ArkUI.Full 451 * @crossplatform 452 * @atomicservice 453 * @since 11 454 */ 455 mark(value: MarkStyle): CheckboxAttribute; 456 457 /** 458 * Called when the selection status changes. 459 * 460 * @param { function } callback 461 * @returns { CheckboxAttribute } 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @since 8 464 */ 465 /** 466 * Called when the selection status changes. 467 * 468 * @param { function } callback 469 * @returns { CheckboxAttribute } 470 * @syscap SystemCapability.ArkUI.ArkUI.Full 471 * @form 472 * @since 9 473 */ 474 /** 475 * Called when the selection status changes. 476 * 477 * @param { function } callback 478 * @returns { CheckboxAttribute } 479 * @syscap SystemCapability.ArkUI.ArkUI.Full 480 * @crossplatform 481 * @form 482 * @since 10 483 */ 484 /** 485 * Called when the selection status changes. 486 * 487 * @param { function } callback 488 * @returns { CheckboxAttribute } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @form 492 * @atomicservice 493 * @since 11 494 */ 495 /** 496 * Called when the selection status changes. 497 * 498 * @param { OnCheckboxChangeCallback } callback 499 * @returns { CheckboxAttribute } 500 * @syscap SystemCapability.ArkUI.ArkUI.Full 501 * @crossplatform 502 * @form 503 * @atomicservice 504 * @since 13 505 */ 506 onChange(callback: OnCheckboxChangeCallback): CheckboxAttribute; 507 508 /** 509 * Set the content modifier of checkbox. 510 * 511 * @param { ContentModifier<CheckBoxConfiguration> } modifier - The content modifier of checkbox. 512 * @returns { CheckboxAttribute } 513 * @syscap SystemCapability.ArkUI.ArkUI.Full 514 * @crossplatform 515 * @atomicservice 516 * @since 12 517 */ 518 contentModifier(modifier: ContentModifier<CheckBoxConfiguration>): CheckboxAttribute; 519} 520 521/** 522 * Defines Checkbox Component. 523 * 524 * @syscap SystemCapability.ArkUI.ArkUI.Full 525 * @since 8 526 */ 527/** 528 * Defines Checkbox Component. 529 * 530 * @syscap SystemCapability.ArkUI.ArkUI.Full 531 * @form 532 * @since 9 533 */ 534/** 535 * Defines Checkbox Component. 536 * 537 * @syscap SystemCapability.ArkUI.ArkUI.Full 538 * @crossplatform 539 * @form 540 * @since 10 541 */ 542/** 543 * Defines Checkbox Component. 544 * 545 * @syscap SystemCapability.ArkUI.ArkUI.Full 546 * @crossplatform 547 * @form 548 * @atomicservice 549 * @since 11 550 */ 551declare const Checkbox: CheckboxInterface; 552 553/** 554 * Defines Checkbox Component instance. 555 * 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @since 8 558 */ 559/** 560 * Defines Checkbox Component instance. 561 * 562 * @syscap SystemCapability.ArkUI.ArkUI.Full 563 * @form 564 * @since 9 565 */ 566/** 567 * Defines Checkbox Component instance. 568 * 569 * @syscap SystemCapability.ArkUI.ArkUI.Full 570 * @crossplatform 571 * @form 572 * @since 10 573 */ 574/** 575 * Defines Checkbox Component instance. 576 * 577 * @syscap SystemCapability.ArkUI.ArkUI.Full 578 * @crossplatform 579 * @form 580 * @atomicservice 581 * @since 11 582 */ 583declare const CheckboxInstance: CheckboxAttribute; 584