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