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