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