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 * The alignment of dialog, 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * The alignment of dialog, 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * The alignment of dialog, 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare enum DialogAlignment { 46 /** 47 * Vertical top alignment. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @since 7 51 */ 52 /** 53 * Vertical top alignment. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * Vertical top alignment. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since 11 66 */ 67 Top, 68 69 /** 70 * Align vertically to the center. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75 /** 76 * Align vertically to the center. 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82 /** 83 * Align vertically to the center. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since 11 89 */ 90 Center, 91 92 /** 93 * Vertical bottom alignment. 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 7 97 */ 98 /** 99 * Vertical bottom alignment. 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 10 104 */ 105 /** 106 * Vertical bottom alignment. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since 11 112 */ 113 Bottom, 114 115 /** 116 * Default alignment. 117 * 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @since 7 120 */ 121 /** 122 * Default alignment. 123 * 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @since 10 127 */ 128 /** 129 * Default alignment. 130 * 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @crossplatform 133 * @atomicservice 134 * @since 11 135 */ 136 Default, 137 138 /** 139 * Align the upper left corner. 140 * 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @since 8 143 */ 144 /** 145 * Align the upper left corner. 146 * 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @crossplatform 149 * @since 10 150 */ 151 /** 152 * Align the upper left corner. 153 * 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 11 158 */ 159 TopStart, 160 161 /** 162 * Align the upper right corner. 163 * 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @since 8 166 */ 167 /** 168 * Align the upper right corner. 169 * 170 * @syscap SystemCapability.ArkUI.ArkUI.Full 171 * @crossplatform 172 * @since 10 173 */ 174 /** 175 * Align the upper right corner. 176 * 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @crossplatform 179 * @atomicservice 180 * @since 11 181 */ 182 TopEnd, 183 184 /** 185 * Left center alignment. 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @since 8 189 */ 190 /** 191 * Left center alignment. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @since 10 196 */ 197 /** 198 * Left center alignment. 199 * 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @crossplatform 202 * @atomicservice 203 * @since 11 204 */ 205 CenterStart, 206 207 /** 208 * Right center alignment. 209 * 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @since 8 212 */ 213 /** 214 * Right center alignment. 215 * 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @crossplatform 218 * @since 10 219 */ 220 /** 221 * Right center alignment. 222 * 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @atomicservice 226 * @since 11 227 */ 228 CenterEnd, 229 230 /** 231 * Align the lower left corner. 232 * 233 * @syscap SystemCapability.ArkUI.ArkUI.Full 234 * @since 8 235 */ 236 /** 237 * Align the lower left corner. 238 * 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @crossplatform 241 * @since 10 242 */ 243 /** 244 * Align the lower left corner. 245 * 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @atomicservice 249 * @since 11 250 */ 251 BottomStart, 252 253 /** 254 * Align the lower right corner. 255 * 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @since 8 258 */ 259 /** 260 * Align the lower right corner. 261 * 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @since 10 265 */ 266 /** 267 * Align the lower right corner. 268 * 269 * @syscap SystemCapability.ArkUI.ArkUI.Full 270 * @crossplatform 271 * @atomicservice 272 * @since 11 273 */ 274 BottomEnd, 275} 276 277/** 278* The arrangement of buttons in dialog. 279* 280* @enum { number } 281* @syscap SystemCapability.ArkUI.ArkUI.Full 282* @crossplatform 283* @since 10 284*/ 285/** 286* The arrangement of buttons in dialog. 287* 288* @enum { number } 289* @syscap SystemCapability.ArkUI.ArkUI.Full 290* @crossplatform 291* @atomicservice 292* @since 11 293*/ 294declare enum DialogButtonDirection { 295 /** 296 * Two or fewer buttons are arranged horizontally, 297 * and two or more buttons are arranged vertically. 298 * @syscap SystemCapability.ArkUI.ArkUI.Full 299 * @crossplatform 300 * @since 10 301 */ 302 /** 303 * Two or fewer buttons are arranged horizontally, 304 * and two or more buttons are arranged vertically. 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @crossplatform 307 * @atomicservice 308 * @since 11 309 */ 310 AUTO = 0, 311 312 /** 313 * Buttons are arranged horizontally. 314 * 315 * @syscap SystemCapability.ArkUI.ArkUI.Full 316 * @crossplatform 317 * @since 10 318 */ 319 /** 320 * Buttons are arranged horizontally. 321 * 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @crossplatform 324 * @atomicservice 325 * @since 11 326 */ 327 HORIZONTAL = 1, 328 329 /** 330 * Buttons are arranged vertically. 331 * 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @crossplatform 334 * @since 10 335 */ 336 /** 337 * Buttons are arranged vertically. 338 * 339 * @syscap SystemCapability.ArkUI.ArkUI.Full 340 * @crossplatform 341 * @atomicservice 342 * @since 11 343 */ 344 VERTICAL = 2, 345} 346 347/** 348 * Base button param. 349 * 350 * @interface AlertDialogButtonBaseOptions 351 * @syscap SystemCapability.ArkUI.ArkUI.Full 352 * @crossplatform 353 * @atomicservice 354 * @since 13 355 */ 356declare interface AlertDialogButtonBaseOptions { 357 /** 358 * Enable switch of button. 359 * 360 * @type { ?boolean } 361 * @default true 362 * @syscap SystemCapability.ArkUI.ArkUI.Full 363 * @crossplatform 364 * @since 10 365 */ 366 /** 367 * Enable switch of button. 368 * 369 * @type { ?boolean } 370 * @default true 371 * @syscap SystemCapability.ArkUI.ArkUI.Full 372 * @crossplatform 373 * @atomicservice 374 * @since 11 375 */ 376 enabled?: boolean; 377 378 /** 379 * Default focus switch of button. 380 * 381 * @type { ?boolean } 382 * @default false 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @crossplatform 385 * @since 10 386 */ 387 /** 388 * Default focus switch of button. 389 * 390 * @type { ?boolean } 391 * @default false 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @crossplatform 394 * @atomicservice 395 * @since 11 396 */ 397 defaultFocus?: boolean; 398 399 /** 400 * Style of button. 401 * 402 * @type { ?DialogButtonStyle } 403 * @default - 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @crossplatform 406 * @since 10 407 */ 408 /** 409 * Style of button. 410 * 411 * @type { ?DialogButtonStyle } 412 * @default - 413 * @syscap SystemCapability.ArkUI.ArkUI.Full 414 * @crossplatform 415 * @atomicservice 416 * @since 11 417 */ 418 style?: DialogButtonStyle; 419 420 /** 421 * Text content of button. 422 * 423 * @type { ResourceStr } 424 * @syscap SystemCapability.ArkUI.ArkUI.Full 425 * @crossplatform 426 * @since 10 427 */ 428 /** 429 * Text content of button. 430 * 431 * @type { ResourceStr } 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @atomicservice 435 * @since 11 436 */ 437 value: ResourceStr; 438 439 /** 440 * Text color of button. 441 * 442 * @type { ?ResourceColor } 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @crossplatform 445 * @since 10 446 */ 447 /** 448 * Text color of button. 449 * 450 * @type { ?ResourceColor } 451 * @syscap SystemCapability.ArkUI.ArkUI.Full 452 * @crossplatform 453 * @atomicservice 454 * @since 11 455 */ 456 fontColor?: ResourceColor; 457 458 /** 459 * Background color of button. 460 * 461 * @type { ?ResourceColor } 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @crossplatform 464 * @since 10 465 */ 466 /** 467 * Background color of button. 468 * 469 * @type { ?ResourceColor } 470 * @syscap SystemCapability.ArkUI.ArkUI.Full 471 * @crossplatform 472 * @atomicservice 473 * @since 11 474 */ 475 backgroundColor?: ResourceColor; 476 477 /** 478 * Method executed by the callback. 479 * 480 * @type { function } 481 * @syscap SystemCapability.ArkUI.ArkUI.Full 482 * @crossplatform 483 * @since 10 484 */ 485 /** 486 * Method executed by the callback. 487 * 488 * @type { function } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @atomicservice 492 * @since 11 493 */ 494 /** 495 * Method executed by the callback. 496 * 497 * @type { VoidCallback } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @atomicservice 501 * @since 13 502 */ 503 action: VoidCallback; 504} 505 506/** 507 * Base button param used for AlertDialogParamWithOptions. 508 * 509 * @interface AlertDialogButtonOptions 510 * @syscap SystemCapability.ArkUI.ArkUI.Full 511 * @crossplatform 512 * @since 10 513 */ 514/** 515 * Base button param used for AlertDialogParamWithOptions. 516 * 517 * @interface AlertDialogButtonOptions 518 * @syscap SystemCapability.ArkUI.ArkUI.Full 519 * @crossplatform 520 * @atomicservice 521 * @since 11 522 */ 523/** 524 * Button param used for AlertDialogParamWithOptions. 525 * 526 * @interface AlertDialogButtonOptions 527 * @syscap SystemCapability.ArkUI.ArkUI.Full 528 * @crossplatform 529 * @atomicservice 530 * @since 13 531 */ 532declare interface AlertDialogButtonOptions extends AlertDialogButtonBaseOptions { 533 /** 534 * Define whether the button responds to Enter/Space key by default. 535 * 536 * @type { ?boolean } 537 * @syscap SystemCapability.ArkUI.ArkUI.Full 538 * @crossplatform 539 * @atomicservice 540 * @since 12 541 */ 542 primary?: boolean; 543} 544 545/** 546 * Defines TextStyle in the AlertDialog. 547 * 548 * @interface TextStyle 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @crossplatform 551 * @atomicservice 552 * @since 12 553 */ 554declare interface TextStyle { 555 /** 556 * Set the word break type. 557 * 558 * @type { ?WordBreak } 559 * @syscap SystemCapability.ArkUI.ArkUI.Full 560 * @crossplatform 561 * @atomicservice 562 * @since 12 563 */ 564 wordBreak?: WordBreak; 565} 566 567/** 568 * Base param used for AlertDialog.show method. 569 * 570 * @interface AlertDialogParam 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @since 7 573 */ 574/** 575 * Base param used for AlertDialog.show method. 576 * 577 * @interface AlertDialogParam 578 * @syscap SystemCapability.ArkUI.ArkUI.Full 579 * @crossplatform 580 * @since 10 581 */ 582/** 583 * Base param used for AlertDialog.show method. 584 * 585 * @interface AlertDialogParam 586 * @syscap SystemCapability.ArkUI.ArkUI.Full 587 * @crossplatform 588 * @atomicservice 589 * @since 11 590 */ 591declare interface AlertDialogParam { 592 /** 593 * Title Properties 594 * 595 * @type { ?ResourceStr } 596 * @syscap SystemCapability.ArkUI.ArkUI.Full 597 * @since 7 598 */ 599 /** 600 * Title Properties 601 * 602 * @type { ?ResourceStr } 603 * @syscap SystemCapability.ArkUI.ArkUI.Full 604 * @crossplatform 605 * @since 10 606 */ 607 /** 608 * Title Properties 609 * 610 * @type { ?ResourceStr } 611 * @syscap SystemCapability.ArkUI.ArkUI.Full 612 * @crossplatform 613 * @atomicservice 614 * @since 11 615 */ 616 title?: ResourceStr; 617 618 /** 619 * Subtitle Properties 620 * @type { ?ResourceStr } 621 * @syscap SystemCapability.ArkUI.ArkUI.Full 622 * @crossplatform 623 * @since 10 624 */ 625 /** 626 * Subtitle Properties 627 * @type { ?ResourceStr } 628 * @syscap SystemCapability.ArkUI.ArkUI.Full 629 * @crossplatform 630 * @atomicservice 631 * @since 11 632 */ 633 subtitle?: ResourceStr; 634 635 /** 636 * message Properties 637 * 638 * @type { ResourceStr } 639 * @syscap SystemCapability.ArkUI.ArkUI.Full 640 * @since 7 641 */ 642 /** 643 * message Properties 644 * 645 * @type { ResourceStr } 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @since 10 649 */ 650 /** 651 * message Properties 652 * 653 * @type { ResourceStr } 654 * @syscap SystemCapability.ArkUI.ArkUI.Full 655 * @crossplatform 656 * @atomicservice 657 * @since 11 658 */ 659 message: ResourceStr; 660 661 /** 662 * Allows users to click the mask layer to exit. 663 * 664 * @type { ?boolean } 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @since 7 667 */ 668 /** 669 * Allows users to click the mask layer to exit. 670 * 671 * @type { ?boolean } 672 * @syscap SystemCapability.ArkUI.ArkUI.Full 673 * @crossplatform 674 * @since 10 675 */ 676 /** 677 * Allows users to click the mask layer to exit. 678 * 679 * @type { ?boolean } 680 * @syscap SystemCapability.ArkUI.ArkUI.Full 681 * @crossplatform 682 * @atomicservice 683 * @since 11 684 */ 685 autoCancel?: boolean; 686 687 /** 688 * Execute Cancel Function. 689 * 690 * @type { ?function } 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @since 7 693 */ 694 /** 695 * Execute Cancel Function. 696 * 697 * @type { ?function } 698 * @syscap SystemCapability.ArkUI.ArkUI.Full 699 * @crossplatform 700 * @since 10 701 */ 702 /** 703 * Execute Cancel Function. 704 * 705 * @type { ?function } 706 * @syscap SystemCapability.ArkUI.ArkUI.Full 707 * @crossplatform 708 * @atomicservice 709 * @since 11 710 */ 711 /** 712 * Execute Cancel Function. 713 * 714 * @type { ?VoidCallback } 715 * @syscap SystemCapability.ArkUI.ArkUI.Full 716 * @crossplatform 717 * @atomicservice 718 * @since 13 719 */ 720 cancel?: VoidCallback; 721 722 /** 723 * Alignment in the vertical direction. 724 * 725 * @type { ?DialogAlignment } 726 * @syscap SystemCapability.ArkUI.ArkUI.Full 727 * @since 7 728 */ 729 /** 730 * Alignment in the vertical direction. 731 * 732 * @type { ?DialogAlignment } 733 * @syscap SystemCapability.ArkUI.ArkUI.Full 734 * @crossplatform 735 * @since 10 736 */ 737 /** 738 * Alignment in the vertical direction. 739 * 740 * @type { ?DialogAlignment } 741 * @syscap SystemCapability.ArkUI.ArkUI.Full 742 * @crossplatform 743 * @atomicservice 744 * @since 11 745 */ 746 alignment?: DialogAlignment; 747 748 /** 749 * Offset of the pop-up window relative to the alignment position. 750 * 751 * @type { ?Offset } 752 * @syscap SystemCapability.ArkUI.ArkUI.Full 753 * @since 7 754 */ 755 /** 756 * Offset of the pop-up window relative to the alignment position. 757 * 758 * @type { ?Offset } 759 * @syscap SystemCapability.ArkUI.ArkUI.Full 760 * @crossplatform 761 * @since 10 762 */ 763 /** 764 * Offset of the pop-up window relative to the alignment position. 765 * 766 * @type { ?Offset } 767 * @syscap SystemCapability.ArkUI.ArkUI.Full 768 * @crossplatform 769 * @atomicservice 770 * @since 11 771 */ 772 offset?: Offset; 773 774 /** 775 * Grid count of dialog. 776 * 777 * @type { ?number } 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @since 7 780 */ 781 /** 782 * Grid count of dialog. 783 * 784 * @type { ?number } 785 * @syscap SystemCapability.ArkUI.ArkUI.Full 786 * @crossplatform 787 * @since 10 788 */ 789 /** 790 * Grid count of dialog. 791 * 792 * @type { ?number } 793 * @syscap SystemCapability.ArkUI.ArkUI.Full 794 * @crossplatform 795 * @atomicservice 796 * @since 11 797 */ 798 gridCount?: number; 799 800 /** 801 * Mask Region of dialog. The size cannot exceed the main window. 802 * 803 * @type { ?Rectangle } 804 * @syscap SystemCapability.ArkUI.ArkUI.Full 805 * @crossplatform 806 * @since 10 807 */ 808 /** 809 * Mask Region of dialog. The size cannot exceed the main window. 810 * 811 * @type { ?Rectangle } 812 * @syscap SystemCapability.ArkUI.ArkUI.Full 813 * @crossplatform 814 * @atomicservice 815 * @since 11 816 */ 817 maskRect?: Rectangle; 818 819 /** 820 * Whether to display in the sub window. 821 * 822 * @type { ?boolean } 823 * @default false 824 * @syscap SystemCapability.ArkUI.ArkUI.Full 825 * @crossplatform 826 * @since 11 827 */ 828 /** 829 * Whether to display in the sub window. 830 * 831 * @type { ?boolean } 832 * @default false 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @crossplatform 835 * @atomicservice 836 * @since 12 837 */ 838 showInSubWindow?: boolean; 839 840 /** 841 * Whether it is a modal dialog 842 * @type { ?boolean } 843 * @default true 844 * @syscap SystemCapability.ArkUI.ArkUI.Full 845 * @crossplatform 846 * @since 11 847 */ 848 /** 849 * Whether it is a modal dialog 850 * @type { ?boolean } 851 * @default true 852 * @syscap SystemCapability.ArkUI.ArkUI.Full 853 * @crossplatform 854 * @atomicservice 855 * @since 12 856 */ 857 isModal?: boolean; 858 859 /** 860 * Defines the alertDialog's background color 861 * 862 * @type { ?ResourceColor } 863 * @default Color.Transparent 864 * @syscap SystemCapability.ArkUI.ArkUI.Full 865 * @crossplatform 866 * @since 11 867 */ 868 /** 869 * Defines the alertDialog's background color 870 * 871 * @type { ?ResourceColor } 872 * @default Color.Transparent 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @atomicservice 876 * @since 12 877 */ 878 backgroundColor?: ResourceColor; 879 880 /** 881 * Defines the alertDialog's background blur Style 882 * 883 * @type { ?BlurStyle } 884 * @default BlurStyle.COMPONENT_ULTRA_THICK 885 * @syscap SystemCapability.ArkUI.ArkUI.Full 886 * @crossplatform 887 * @since 11 888 */ 889 /** 890 * Defines the alertDialog's background blur Style 891 * 892 * @type { ?BlurStyle } 893 * @default BlurStyle.COMPONENT_ULTRA_THICK 894 * @syscap SystemCapability.ArkUI.ArkUI.Full 895 * @crossplatform 896 * @atomicservice 897 * @since 12 898 */ 899 backgroundBlurStyle?: BlurStyle; 900 901 /** 902 * Callback function when the dialog interactive dismiss 903 * 904 * @type { ?Callback<DismissDialogAction> } 905 * @syscap SystemCapability.ArkUI.ArkUI.Full 906 * @crossplatform 907 * @atomicservice 908 * @since 12 909 */ 910 onWillDismiss?: Callback<DismissDialogAction>; 911 912 /** 913 * Transition parameters of opening/closing AlertDialog. 914 * 915 * @type { ?TransitionEffect } 916 * @syscap SystemCapability.ArkUI.ArkUI.Full 917 * @crossplatform 918 * @atomicservice 919 * @since 12 920 */ 921 transition?: TransitionEffect; 922 923 /** 924 * Defines the alertDialog's corner radius. 925 * 926 * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) } 927 * @syscap SystemCapability.ArkUI.ArkUI.Full 928 * @crossplatform 929 * @atomicservice 930 * @since 12 931 */ 932 cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses; 933 934 /** 935 * Defines the alertDialog's width. 936 * 937 * @type { ?Dimension } 938 * @syscap SystemCapability.ArkUI.ArkUI.Full 939 * @crossplatform 940 * @atomicservice 941 * @since 12 942 */ 943 width?: Dimension; 944 945 /** 946 * Defines the alertDialog's height. 947 * 948 * @type { ?Dimension } 949 * @syscap SystemCapability.ArkUI.ArkUI.Full 950 * @crossplatform 951 * @atomicservice 952 * @since 12 953 */ 954 height?: Dimension; 955 956 /** 957 * Defines the alertDialog's border width. 958 * 959 * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) } 960 * @syscap SystemCapability.ArkUI.ArkUI.Full 961 * @crossplatform 962 * @atomicservice 963 * @since 12 964 */ 965 borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths; 966 967 /** 968 * Defines the alertDialog's border color. 969 * 970 * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) } 971 * @syscap SystemCapability.ArkUI.ArkUI.Full 972 * @crossplatform 973 * @atomicservice 974 * @since 12 975 */ 976 borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors; 977 978 /** 979 * Defines the alertDialog's border style. 980 * 981 * @type { ?(BorderStyle | EdgeStyles) } 982 * @syscap SystemCapability.ArkUI.ArkUI.Full 983 * @crossplatform 984 * @atomicservice 985 * @since 12 986 */ 987 borderStyle?: BorderStyle | EdgeStyles; 988 989 /** 990 * Defines the alertDialog's shadow. 991 * 992 * @type { ?(ShadowOptions | ShadowStyle) } 993 * @syscap SystemCapability.ArkUI.ArkUI.Full 994 * @crossplatform 995 * @atomicservice 996 * @since 12 997 */ 998 shadow?: ShadowOptions | ShadowStyle; 999 1000 /** 1001 * Set the alertDialog's textStyle. 1002 * 1003 * @type { ?TextStyle } 1004 * @syscap SystemCapability.ArkUI.ArkUI.Full 1005 * @crossplatform 1006 * @atomicservice 1007 * @since 12 1008 */ 1009 textStyle?: TextStyle; 1010 1011 /** 1012 * Defines whether to respond to the hover mode. 1013 * 1014 * @type { ?boolean } 1015 * @default false 1016 * @syscap SystemCapability.ArkUI.ArkUI.Full 1017 * @crossplatform 1018 * @atomicservice 1019 * @since 13 1020 */ 1021 enableHoverMode?: boolean; 1022 1023 /** 1024 * Defines the alertDialog's display area in hover mode. 1025 * 1026 * @type { ?HoverModeAreaType } 1027 * @default HoverModeAreaType.BOTTOM_SCREEN 1028 * @syscap SystemCapability.ArkUI.ArkUI.Full 1029 * @crossplatform 1030 * @atomicservice 1031 * @since 13 1032 */ 1033 hoverModeArea?: HoverModeAreaType; 1034} 1035 1036/** 1037 * Defines the AlertDialog with confirm button. 1038 * 1039 * @interface AlertDialogParamWithConfirm 1040 * @syscap SystemCapability.ArkUI.ArkUI.Full 1041 * @since 7 1042 */ 1043/** 1044 * Defines the AlertDialog with confirm button. 1045 * 1046 * @interface AlertDialogParamWithConfirm 1047 * @syscap SystemCapability.ArkUI.ArkUI.Full 1048 * @crossplatform 1049 * @since 10 1050 */ 1051/** 1052 * Defines the AlertDialog with confirm button. 1053 * 1054 * @interface AlertDialogParamWithConfirm 1055 * @syscap SystemCapability.ArkUI.ArkUI.Full 1056 * @crossplatform 1057 * @atomicservice 1058 * @since 11 1059 */ 1060declare interface AlertDialogParamWithConfirm extends AlertDialogParam { 1061 /** 1062 * Invoke the commit function. 1063 * 1064 * @type { ?object } 1065 * @syscap SystemCapability.ArkUI.ArkUI.Full 1066 * @since 7 1067 */ 1068 /** 1069 * Invoke the commit function. 1070 * 1071 * @type { ?object } 1072 * @syscap SystemCapability.ArkUI.ArkUI.Full 1073 * @crossplatform 1074 * @since 10 1075 */ 1076 /** 1077 * Invoke the commit function. 1078 * 1079 * @type { ?object } 1080 * @syscap SystemCapability.ArkUI.ArkUI.Full 1081 * @crossplatform 1082 * @atomicservice 1083 * @since 11 1084 */ 1085 /** 1086 * Invoke the commit function. 1087 * 1088 * @type { ?AlertDialogButtonBaseOptions } 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @atomicservice 1092 * @since 13 1093 */ 1094 confirm?: AlertDialogButtonBaseOptions; 1095} 1096 1097/** 1098 * Component dialog dismiss action. 1099 * 1100 * @interface DismissDialogAction 1101 * @syscap SystemCapability.ArkUI.ArkUI.Full 1102 * @crossplatform 1103 * @atomicservice 1104 * @since 12 1105 */ 1106declare interface DismissDialogAction { 1107 /** 1108 * Defines dialog dismiss function. 1109 * 1110 * @type { Callback<void> } 1111 * @syscap SystemCapability.ArkUI.ArkUI.Full 1112 * @crossplatform 1113 * @atomicservice 1114 * @since 12 1115 */ 1116 dismiss: Callback<void>; 1117 1118 /** 1119 * Dismiss reason type. 1120 * 1121 * @type { DismissReason } 1122 * @syscap SystemCapability.ArkUI.ArkUI.Full 1123 * @crossplatform 1124 * @atomicservice 1125 * @since 12 1126 */ 1127 reason: DismissReason; 1128} 1129 1130/** 1131 * Defines the dialog param with buttons. 1132 * 1133 * @interface AlertDialogParamWithButtons 1134 * @syscap SystemCapability.ArkUI.ArkUI.Full 1135 * @since 7 1136 */ 1137/** 1138 * Defines the dialog param with buttons. 1139 * 1140 * @interface AlertDialogParamWithButtons 1141 * @syscap SystemCapability.ArkUI.ArkUI.Full 1142 * @crossplatform 1143 * @since 10 1144 */ 1145/** 1146 * Defines the dialog param with buttons. 1147 * 1148 * @interface AlertDialogParamWithButtons 1149 * @syscap SystemCapability.ArkUI.ArkUI.Full 1150 * @crossplatform 1151 * @atomicservice 1152 * @since 11 1153 */ 1154declare interface AlertDialogParamWithButtons extends AlertDialogParam { 1155 /** 1156 * First button. 1157 * 1158 * @type { object } 1159 * @syscap SystemCapability.ArkUI.ArkUI.Full 1160 * @since 7 1161 */ 1162 /** 1163 * First button. 1164 * 1165 * @type { object } 1166 * @syscap SystemCapability.ArkUI.ArkUI.Full 1167 * @crossplatform 1168 * @since 10 1169 */ 1170 /** 1171 * First button. 1172 * 1173 * @type { object } 1174 * @syscap SystemCapability.ArkUI.ArkUI.Full 1175 * @crossplatform 1176 * @atomicservice 1177 * @since 11 1178 */ 1179 /** 1180 * First button. 1181 * 1182 * @type { AlertDialogButtonBaseOptions } 1183 * @syscap SystemCapability.ArkUI.ArkUI.Full 1184 * @crossplatform 1185 * @atomicservice 1186 * @since 13 1187 */ 1188 primaryButton: AlertDialogButtonBaseOptions; 1189 1190 /** 1191 * Second button. 1192 * 1193 * @type { object } 1194 * @syscap SystemCapability.ArkUI.ArkUI.Full 1195 * @since 7 1196 */ 1197 /** 1198 * Second button. 1199 * 1200 * @type { object } 1201 * @syscap SystemCapability.ArkUI.ArkUI.Full 1202 * @crossplatform 1203 * @since 10 1204 */ 1205 /** 1206 * Second button. 1207 * 1208 * @type { object } 1209 * @syscap SystemCapability.ArkUI.ArkUI.Full 1210 * @crossplatform 1211 * @atomicservice 1212 * @since 11 1213 */ 1214 /** 1215 * Second button. 1216 * 1217 * @type { AlertDialogButtonBaseOptions } 1218 * @syscap SystemCapability.ArkUI.ArkUI.Full 1219 * @crossplatform 1220 * @atomicservice 1221 * @since 13 1222 */ 1223 secondaryButton: AlertDialogButtonBaseOptions; 1224} 1225 1226/** 1227 * Defines the dialog param with options. 1228 * 1229 * @interface AlertDialogParamWithOptions 1230 * @syscap SystemCapability.ArkUI.ArkUI.Full 1231 * @crossplatform 1232 * @since 10 1233 */ 1234/** 1235 * Defines the dialog param with options. 1236 * 1237 * @interface AlertDialogParamWithOptions 1238 * @syscap SystemCapability.ArkUI.ArkUI.Full 1239 * @crossplatform 1240 * @atomicservice 1241 * @since 11 1242 */ 1243declare interface AlertDialogParamWithOptions extends AlertDialogParam { 1244 /** 1245 * The array of buttons. 1246 * @type { Array<AlertDialogButtonOptions> } 1247 * @syscap SystemCapability.ArkUI.ArkUI.Full 1248 * @crossplatform 1249 * @since 10 1250 */ 1251 /** 1252 * The array of buttons. 1253 * @type { Array<AlertDialogButtonOptions> } 1254 * @syscap SystemCapability.ArkUI.ArkUI.Full 1255 * @crossplatform 1256 * @atomicservice 1257 * @since 11 1258 */ 1259 buttons: Array<AlertDialogButtonOptions>; 1260 1261 /** 1262 * The arrangement of buttons. 1263 * @type { ?DialogButtonDirection } 1264 * @default DialogButtonDirection.AUTO 1265 * @syscap SystemCapability.ArkUI.ArkUI.Full 1266 * @crossplatform 1267 * @since 10 1268 */ 1269 /** 1270 * The arrangement of buttons. 1271 * @type { ?DialogButtonDirection } 1272 * @default DialogButtonDirection.AUTO 1273 * @syscap SystemCapability.ArkUI.ArkUI.Full 1274 * @crossplatform 1275 * @atomicservice 1276 * @since 11 1277 */ 1278 buttonDirection?: DialogButtonDirection; 1279} 1280 1281/** 1282 * Defines AlertDialog which uses show method to show alert dialog. 1283 * 1284 * @syscap SystemCapability.ArkUI.ArkUI.Full 1285 * @since 7 1286 */ 1287/** 1288 * Defines AlertDialog which uses show method to show alert dialog. 1289 * 1290 * @syscap SystemCapability.ArkUI.ArkUI.Full 1291 * @crossplatform 1292 * @since 10 1293 */ 1294/** 1295 * Defines AlertDialog which uses show method to show alert dialog. 1296 * 1297 * @syscap SystemCapability.ArkUI.ArkUI.Full 1298 * @crossplatform 1299 * @atomicservice 1300 * @since 11 1301 */ 1302declare class AlertDialog { 1303 /** 1304 * Invoking method display. 1305 * 1306 * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons } value 1307 * @syscap SystemCapability.ArkUI.ArkUI.Full 1308 * @since 7 1309 */ 1310 /** 1311 * Invoking method display. 1312 * 1313 * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value 1314 * @syscap SystemCapability.ArkUI.ArkUI.Full 1315 * @crossplatform 1316 * @since 10 1317 */ 1318 /** 1319 * Invoking method display. 1320 * 1321 * @param { AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions} value 1322 * @syscap SystemCapability.ArkUI.ArkUI.Full 1323 * @crossplatform 1324 * @atomicservice 1325 * @since 11 1326 */ 1327 static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions); 1328} 1329 1330