1/* 2 * Copyright (c) 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 * The type of alignment between entry and calendar. 23 * @enum {number} 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @crossplatform 26 * @since 10 27 */ 28/** 29 * The type of alignment between entry and calendar. 30 * @enum {number} 31 * @syscap SystemCapability.ArkUI.ArkUI.Full 32 * @crossplatform 33 * @atomicservice 34 * @since 11 35 */ 36declare enum CalendarAlign { 37 /** 38 * The value of calendar align type start. 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @crossplatform 41 * @since 10 42 */ 43 /** 44 * The value of calendar align type start. 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @crossplatform 47 * @atomicservice 48 * @since 11 49 */ 50 START = 0, 51 /** 52 * The value of calendar align type center. 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @crossplatform 55 * @since 10 56 */ 57 /** 58 * The value of calendar align type center. 59 * @syscap SystemCapability.ArkUI.ArkUI.Full 60 * @crossplatform 61 * @atomicservice 62 * @since 11 63 */ 64 CENTER = 1, 65 /** 66 * The value of calendar align type end. 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @crossplatform 69 * @since 10 70 */ 71 /** 72 * The value of calendar align type end. 73 * @syscap SystemCapability.ArkUI.ArkUI.Full 74 * @crossplatform 75 * @atomicservice 76 * @since 11 77 */ 78 END = 2 79} 80 81/** 82 * Defines the options of CalendarPicker. 83 * @interface CalendarOptions 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @crossplatform 86 * @since 10 87 */ 88/** 89 * Defines the options of CalendarPicker. 90 * @interface CalendarOptions 91 * @syscap SystemCapability.ArkUI.ArkUI.Full 92 * @crossplatform 93 * @atomicservice 94 * @since 11 95 */ 96declare interface CalendarOptions { 97 /** 98 * Specifies the radius of the background of the day in calendar. 99 * @type { ?(number | Resource) } 100 * @syscap SystemCapability.ArkUI.ArkUI.Full 101 * @crossplatform 102 * @since 10 103 */ 104 /** 105 * Specifies the radius of the background of the day in calendar. 106 * @type { ?(number | Resource) } 107 * @syscap SystemCapability.ArkUI.ArkUI.Full 108 * @crossplatform 109 * @atomicservice 110 * @since 11 111 */ 112 hintRadius?: number | Resource; 113 114 /** 115 * Specifies the date selector check date. 116 * @type { ?Date } 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @since 10 120 */ 121 /** 122 * Specifies the date selector check date. 123 * @type { ?Date } 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @atomicservice 127 * @since 11 128 */ 129 selected?: Date; 130 131 /** 132 * Defines the start date of the calendar date. 133 * 134 * @type { ?Date } 135 * @syscap SystemCapability.ArkUI.ArkUI.Full 136 * @crossplatform 137 * @atomicservice 138 * @since 18 139 */ 140 start?: Date; 141 142 /** 143 * Defines the end date of the calendar date. 144 * 145 * @type { ?Date } 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @atomicservice 149 * @since 18 150 */ 151 end?: Date; 152} 153 154/** 155 * Defines the CalendarPicker Component. 156 * @interface CalendarPickerInterface 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @since 10 160 */ 161/** 162 * Defines the CalendarPicker Component. 163 * @interface CalendarPickerInterface 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @atomicservice 167 * @since 11 168 */ 169interface CalendarPickerInterface { 170 /** 171 * Defines the CalendarPicker constructor. 172 * @param { CalendarOptions } options - the option of th calendarPicker. 173 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @since 10 177 */ 178 /** 179 * Defines the CalendarPicker constructor. 180 * @param { CalendarOptions } options - the option of th calendarPicker. 181 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 182 * @syscap SystemCapability.ArkUI.ArkUI.Full 183 * @crossplatform 184 * @atomicservice 185 * @since 11 186 */ 187 (options?: CalendarOptions): CalendarPickerAttribute; 188} 189 190/** 191 * Defines the CalendarPicker attribute functions. 192 * @extends CommonMethod<CalendarPickerAttribute> 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @since 10 196 */ 197/** 198 * Defines the CalendarPicker attribute functions. 199 * @extends CommonMethod<CalendarPickerAttribute> 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @crossplatform 202 * @atomicservice 203 * @since 11 204 */ 205declare class CalendarPickerAttribute extends CommonMethod<CalendarPickerAttribute> { 206 /** 207 * Set the alignment between entry and calendar dialog. 208 * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog. 209 * @param { Offset } offset - The offset between entry and calendar dialog. 210 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @crossplatform 213 * @since 10 214 */ 215 /** 216 * Set the alignment between entry and calendar dialog. 217 * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog. 218 * @param { Offset } offset - The offset between entry and calendar dialog. 219 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 220 * @syscap SystemCapability.ArkUI.ArkUI.Full 221 * @crossplatform 222 * @atomicservice 223 * @since 11 224 */ 225 edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute; 226 227 /** 228 * Set the alignment between entry and calendar dialog. 229 * @param { Optional<CalendarAlign> } alignType - The type of alignment between entry and calendar dialog. 230 * @param { Offset } offset - The offset between entry and calendar dialog. 231 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 232 * @syscap SystemCapability.ArkUI.ArkUI.Full 233 * @crossplatform 234 * @atomicservice 235 * @since 18 236 */ 237 edgeAlign(alignType: Optional<CalendarAlign>, offset?: Offset): CalendarPickerAttribute; 238 239 /** 240 * Sets the text style of entry 241 * @param { PickerTextStyle } value - indicates the text style of entry. 242 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 243 * @syscap SystemCapability.ArkUI.ArkUI.Full 244 * @crossplatform 245 * @since 10 246 */ 247 /** 248 * Sets the text style of entry 249 * @param { PickerTextStyle } value - indicates the text style of entry. 250 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 251 * @syscap SystemCapability.ArkUI.ArkUI.Full 252 * @crossplatform 253 * @atomicservice 254 * @since 11 255 */ 256 textStyle(value: PickerTextStyle): CalendarPickerAttribute; 257 258 /** 259 * Sets the text style of entry 260 * @param { Optional<PickerTextStyle> } style - indicates the text style of entry. 261 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @atomicservice 265 * @since 18 266 */ 267 textStyle(style: Optional<PickerTextStyle>): CalendarPickerAttribute; 268 269 /** 270 * Callback for selected date changed. 271 * @param { function } callback - Callback for selected date changed. 272 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 273 * @syscap SystemCapability.ArkUI.ArkUI.Full 274 * @crossplatform 275 * @since 10 276 */ 277 /** 278 * Callback for selected date changed. 279 * @param { function } callback - Callback for selected date changed. 280 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @crossplatform 283 * @atomicservice 284 * @since 11 285 */ 286 /** 287 * Callback for selected date changed. 288 * Anonymous Object Rectification. 289 * @param { Callback<Date> } callback - callback for selected date changed. 290 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 291 * @syscap SystemCapability.ArkUI.ArkUI.Full 292 * @crossplatform 293 * @atomicservice 294 * @since 18 295 */ 296 onChange(callback: Callback<Date>): CalendarPickerAttribute; 297 298 /** 299 * Callback for selected date changed. 300 * @param { Optional<Callback<Date>> } callback - callback for selected date changed. 301 * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. 302 * @syscap SystemCapability.ArkUI.ArkUI.Full 303 * @crossplatform 304 * @atomicservice 305 * @since 18 306 */ 307 onChange(callback: Optional<Callback<Date>>): CalendarPickerAttribute; 308} 309 310/** 311 * Defines the DatePickerDialogOptions for Calendar Picker Dialog. 312 * @extends CalendarOptions 313 * @interface CalendarDialogOptions 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @since 10 317 */ 318/** 319 * Defines the DatePickerDialogOptions for Calendar Picker Dialog. 320 * @extends CalendarOptions 321 * @interface CalendarDialogOptions 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @crossplatform 324 * @atomicservice 325 * @since 11 326 */ 327declare interface CalendarDialogOptions extends CalendarOptions { 328 /** 329 * Called when the OK button in the dialog is clicked. 330 * @type { ?function } 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @crossplatform 333 * @since 10 334 */ 335 /** 336 * Called when the OK button in the dialog is clicked. 337 * @type { ?function } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @atomicservice 341 * @since 11 342 */ 343 /** 344 * Called when the OK button in the dialog is clicked. 345 * Anonymous Object Rectification. 346 * @type { ?Callback<Date> } 347 * @syscap SystemCapability.ArkUI.ArkUI.Full 348 * @crossplatform 349 * @atomicservice 350 * @since 18 351 */ 352 onAccept?: Callback<Date>; 353 354 /** 355 * Called when the Cancel button in the dialog is clicked. 356 * @type { ?function } 357 * @syscap SystemCapability.ArkUI.ArkUI.Full 358 * @crossplatform 359 * @since 10 360 */ 361 /** 362 * Called when the Cancel button in the dialog is clicked. 363 * @type { ?function } 364 * @syscap SystemCapability.ArkUI.ArkUI.Full 365 * @crossplatform 366 * @atomicservice 367 * @since 11 368 */ 369 /** 370 * Called when the Cancel button in the dialog is clicked. 371 * Anonymous Object Rectification. 372 * @type { ?VoidCallback } 373 * @syscap SystemCapability.ArkUI.ArkUI.Full 374 * @crossplatform 375 * @atomicservice 376 * @since 18 377 */ 378 onCancel?: VoidCallback; 379 380 /** 381 * This event is triggered when a date is selected in dialog. 382 * @type { ?function } 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @crossplatform 385 * @since 10 386 */ 387 /** 388 * This event is triggered when a date is selected in dialog. 389 * @type { ?function } 390 * @syscap SystemCapability.ArkUI.ArkUI.Full 391 * @crossplatform 392 * @atomicservice 393 * @since 11 394 */ 395 /** 396 * This event is triggered when a date is selected in dialog. 397 * Anonymous Object Rectification. 398 * @type { ?Callback<Date> } 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @crossplatform 401 * @atomicservice 402 * @since 18 403 */ 404 onChange?: Callback<Date>; 405 406 /** 407 * Defines the calendarPickerDialog's background color 408 * 409 * @type { ?ResourceColor } 410 * @default Color.Transparent 411 * @syscap SystemCapability.ArkUI.ArkUI.Full 412 * @crossplatform 413 * @since 11 414 */ 415 /** 416 * Defines the calendarPickerDialog's background color 417 * 418 * @type { ?ResourceColor } 419 * @default Color.Transparent 420 * @syscap SystemCapability.ArkUI.ArkUI.Full 421 * @crossplatform 422 * @atomicservice 423 * @since 12 424 */ 425 backgroundColor?: ResourceColor; 426 427 /** 428 * Defines the calendarPickerDialog's background blur Style 429 * 430 * @type { ?BlurStyle } 431 * @default BlurStyle.COMPONENT_ULTRA_THICK 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @since 11 435 */ 436 /** 437 * Defines the calendarPickerDialog's background blur Style 438 * 439 * @type { ?BlurStyle } 440 * @default BlurStyle.COMPONENT_ULTRA_THICK 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @crossplatform 443 * @atomicservice 444 * @since 12 445 */ 446 backgroundBlurStyle?: BlurStyle; 447 448 /** 449 * Style of accept button. 450 * 451 * @type { ?PickerDialogButtonStyle } 452 * @syscap SystemCapability.ArkUI.ArkUI.Full 453 * @crossplatform 454 * @atomicservice 455 * @since 12 456 */ 457 acceptButtonStyle?: PickerDialogButtonStyle; 458 459 /** 460 * Style of cancel button. 461 * 462 * @type { ?PickerDialogButtonStyle } 463 * @syscap SystemCapability.ArkUI.ArkUI.Full 464 * @crossplatform 465 * @atomicservice 466 * @since 12 467 */ 468 cancelButtonStyle?: PickerDialogButtonStyle; 469 470 /** 471 * Callback function when the dialog appears. 472 * 473 * @type { ?function } 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @crossplatform 476 * @atomicservice 477 * @since 12 478 */ 479 /** 480 * Callback function when the dialog appears. 481 * Anonymous Object Rectification. 482 * 483 * @type { ?VoidCallback } 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @crossplatform 486 * @atomicservice 487 * @since 18 488 */ 489 onDidAppear?: VoidCallback; 490 491 /** 492 * Callback function when the dialog disappears. 493 * 494 * @type { ?function } 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @atomicservice 498 * @since 12 499 */ 500 /** 501 * Callback function when the dialog disappears. 502 * Anonymous Object Rectification. 503 * 504 * @type { ?VoidCallback } 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @crossplatform 507 * @atomicservice 508 * @since 18 509 */ 510 onDidDisappear?: VoidCallback; 511 512 /** 513 * Callback function before the dialog openAnimation starts. 514 * 515 * @type { ?function } 516 * @syscap SystemCapability.ArkUI.ArkUI.Full 517 * @crossplatform 518 * @atomicservice 519 * @since 12 520 */ 521 /** 522 * Callback function before the dialog openAnimation starts. 523 * Anonymous Object Rectification. 524 * 525 * @type { ?VoidCallback } 526 * @syscap SystemCapability.ArkUI.ArkUI.Full 527 * @crossplatform 528 * @atomicservice 529 * @since 18 530 */ 531 onWillAppear?: VoidCallback; 532 533 /** 534 * Callback function before the dialog closeAnimation starts. 535 * 536 * @type { ?function } 537 * @syscap SystemCapability.ArkUI.ArkUI.Full 538 * @crossplatform 539 * @atomicservice 540 * @since 12 541 */ 542 /** 543 * Callback function before the dialog closeAnimation starts. 544 * Anonymous Object Rectification. 545 * 546 * @type { ?VoidCallback } 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @atomicservice 550 * @since 18 551 */ 552 onWillDisappear?: VoidCallback; 553 554 /** 555 * Defines the dialog's shadow. 556 * 557 * @type { ?(ShadowOptions | ShadowStyle) } 558 * @syscap SystemCapability.ArkUI.ArkUI.Full 559 * @crossplatform 560 * @atomicservice 561 * @since 12 562 */ 563 shadow?: ShadowOptions | ShadowStyle; 564 565 /** 566 * Defines whether to respond to the hover mode. 567 * 568 * @type { ?boolean } 569 * @default false 570 * @syscap SystemCapability.ArkUI.ArkUI.Full 571 * @crossplatform 572 * @atomicservice 573 * @since 14 574 */ 575 enableHoverMode?: boolean; 576 577 /** 578 * Defines the dialog's display area in hover mode. 579 * 580 * @type { ?HoverModeAreaType } 581 * @default HoverModeAreaType.BOTTOM_SCREEN 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @crossplatform 584 * @atomicservice 585 * @since 14 586 */ 587 hoverModeArea?: HoverModeAreaType; 588} 589 590/** 591 * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog. 592 * @syscap SystemCapability.ArkUI.ArkUI.Full 593 * @crossplatform 594 * @since 10 595 */ 596/** 597 * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog. 598 * @syscap SystemCapability.ArkUI.ArkUI.Full 599 * @crossplatform 600 * @atomicservice 601 * @since 11 602 */ 603declare class CalendarPickerDialog { 604 /** 605 * Invoking method display. 606 * @param { CalendarDialogOptions } options - the option of th calendarPicker. 607 * @syscap SystemCapability.ArkUI.ArkUI.Full 608 * @crossplatform 609 * @since 10 610 */ 611 /** 612 * Invoking method display. 613 * @param { CalendarDialogOptions } options - the option of th calendarPicker. 614 * @syscap SystemCapability.ArkUI.ArkUI.Full 615 * @crossplatform 616 * @atomicservice 617 * @since 11 618 */ 619 static show(options?: CalendarDialogOptions): void; 620} 621 622/** 623 * Defines CalendarPicker Component. 624 * @syscap SystemCapability.ArkUI.ArkUI.Full 625 * @crossplatform 626 * @since 10 627 */ 628/** 629 * Defines CalendarPicker Component. 630 * @syscap SystemCapability.ArkUI.ArkUI.Full 631 * @crossplatform 632 * @atomicservice 633 * @since 11 634 */ 635declare const CalendarPicker: CalendarPickerInterface; 636 637/** 638 * Defines CalendarPicker Component instance. 639 * @syscap SystemCapability.ArkUI.ArkUI.Full 640 * @crossplatform 641 * @since 10 642 */ 643/** 644 * Defines CalendarPicker Component instance. 645 * @syscap SystemCapability.ArkUI.ArkUI.Full 646 * @crossplatform 647 * @atomicservice 648 * @since 11 649 */ 650declare const CalendarPickerInstance: CalendarPickerAttribute; 651