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/*** if arkts 1.1 */ 22import { AsyncCallback } from './@ohos.base'; 23/*** endif */ 24 25/*** if arkts 1.2 */ 26import { ResourceColor, Offset, Dimension, EdgeStyles, EdgeColors,EdgeWidths, BorderRadiuses } from './arkui/component/units'; 27import { AsyncCallback, Callback } from './@ohos.base'; 28import { BlurStyle, ShadowOptions, ShadowStyle, HoverModeAreaType, Rectangle, TransitionEffect, KeyboardAvoidMode, DismissReason, 29 BackgroundBlurStyleOptions, BackgroundEffectOptions } from './arkui/component/common'; 30import { CustomBuilder } from './arkui/component/builder'; 31import { DialogAlignment } from './arkui/component/alertDialog'; 32import { BorderStyle,Alignment } from './arkui/component/enums'; 33import { Resource } from './global/resource'; 34import { LengthMetrics } from './arkui/Graphics'; 35/*** endif */ 36 37/** 38 * Define the display mode of all kind of dialog 39 * 40 * @enum { number } 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @atomicservice 44 * @since arkts {'1.1':'15','1.2':'20'} 45 * @arkts 1.1&1.2 46 */ 47export enum LevelMode { 48 /** 49 * Display above all page levels. 50 * 51 * @syscap SystemCapability.ArkUI.ArkUI.Full 52 * @crossplatform 53 * @atomicservice 54 * @since arkts {'1.1':'15','1.2':'20'} 55 * @arkts 1.1&1.2 56 */ 57 OVERLAY = 0, 58 59 /** 60 * Display within the current page. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since arkts {'1.1':'15','1.2':'20'} 66 * @arkts 1.1&1.2 67 */ 68 EMBEDDED = 1, 69} 70 71/** 72 * Define the immersive mode of all kind of dialog 73 * 74 * @enum { number } 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @atomicservice 78 * @since arkts {'1.1':'15','1.2':'20'} 79 * @arkts 1.1&1.2 80 */ 81export enum ImmersiveMode { 82 /** 83 * Mask covering the parent node. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since arkts {'1.1':'15','1.2':'20'} 89 * @arkts 1.1&1.2 90 */ 91 DEFAULT = 0, 92 93 /** 94 * Mask extend safe area includes status bar and navigation bar. 95 * 96 * @syscap SystemCapability.ArkUI.ArkUI.Full 97 * @crossplatform 98 * @atomicservice 99 * @since arkts {'1.1':'15','1.2':'20'} 100 * @arkts 1.1&1.2 101 */ 102 EXTEND = 1, 103} 104 105/** 106 * Defines level order. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since arkts {'1.1':'18','1.2':'20'} 112 * @arkts 1.1&1.2 113 */ 114export declare class LevelOrder { 115 /** 116 * Generate valid level order. 117 * 118 * @param { number } order - Clamp order with mininum number -100000 and maximum number 100000. 119 * @returns { LevelOrder } the order object. 120 * @static 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @crossplatform 123 * @atomicservice 124 * @since arkts {'1.1':'18','1.2':'20'} 125 * @arkts 1.1&1.2 126 */ 127 static clamp(order: number): LevelOrder; 128 129 /** 130 * Get the order from LevelOrder object. 131 * 132 * @returns { number } the order number. 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @crossplatform 135 * @atomicservice 136 * @since arkts {'1.1':'18','1.2':'20'} 137 * @arkts 1.1&1.2 138 */ 139 getOrder(): number; 140} 141 142/** 143 * @namespace promptAction 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @since 9 146 */ 147/** 148 * @namespace promptAction 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @crossplatform 151 * @since 10 152 */ 153/** 154 * @namespace promptAction 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @crossplatform 157 * @atomicservice 158 * @since arkts {'1.1':'11','1.2':'20'} 159 * @arkts 1.1&1.2 160 */ 161declare namespace promptAction { 162 /** 163 * @typedef ShowToastOptions 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @since 9 166 */ 167 /** 168 * @typedef ShowToastOptions 169 * @syscap SystemCapability.ArkUI.ArkUI.Full 170 * @crossplatform 171 * @since 10 172 */ 173 /** 174 * @typedef ShowToastOptions 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @atomicservice 178 * @since arkts {'1.1':'11','1.2':'20'} 179 * @arkts 1.1&1.2 180 */ 181 export interface ShowToastOptions { 182 183 /** 184 * Text to display. 185 * 186 * @type { string | Resource } 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @since 9 189 */ 190 /** 191 * Text to display. 192 * 193 * @type { string | Resource } 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @crossplatform 196 * @since 10 197 */ 198 /** 199 * Text to display. 200 * 201 * @type { string | Resource } 202 * @syscap SystemCapability.ArkUI.ArkUI.Full 203 * @crossplatform 204 * @atomicservice 205 * @since arkts {'1.1':'11','1.2':'20'} 206 * @arkts 1.1&1.2 207 */ 208 message: string | Resource; 209 210 /** 211 * Duration of toast dialog box. The default value is 1500. 212 * The recommended value ranges from 1500ms to 10000ms. 213 * NOTE: A value less than 1500 is automatically changed to 1500. The maximum value is 10000ms. 214 * 215 * @type { ?number } 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @since 9 218 */ 219 /** 220 * Duration of toast dialog box. The default value is 1500. 221 * The recommended value ranges from 1500ms to 10000ms. 222 * NOTE: A value less than 1500 is automatically changed to 1500. The maximum value is 10000ms. 223 * 224 * @type { ?number } 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @crossplatform 227 * @since 10 228 */ 229 /** 230 * Duration of toast dialog box. The default value is 1500. 231 * The recommended value ranges from 1500ms to 10000ms. 232 * NOTE: A value less than 1500 is automatically changed to 1500. The maximum value is 10000ms. 233 * 234 * @type { ?number } 235 * @syscap SystemCapability.ArkUI.ArkUI.Full 236 * @crossplatform 237 * @atomicservice 238 * @since arkts {'1.1':'11','1.2':'20'} 239 * @arkts 1.1&1.2 240 */ 241 duration?: number; 242 243 /** 244 * The distance between toast dialog box and the bottom of screen. 245 * 246 * @type { ?(string | number) } 247 * @syscap SystemCapability.ArkUI.ArkUI.Full 248 * @since 9 249 */ 250 /** 251 * The distance between toast dialog box and the bottom of screen. 252 * 253 * @type { ?(string | number) } 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @crossplatform 256 * @since 10 257 */ 258 /** 259 * The distance between toast dialog box and the bottom of screen. 260 * 261 * @type { ?(string | number) } 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @atomicservice 265 * @since arkts {'1.1':'11','1.2':'20'} 266 * @arkts 1.1&1.2 267 */ 268 bottom?: string | number; 269 270 /** 271 * Determine the show mode of the toast. 272 * 273 * @type { ?ToastShowMode } 274 * @default ToastShowMode.DEFAULT 275 * @syscap SystemCapability.ArkUI.ArkUI.Full 276 * @since 11 277 */ 278 /** 279 * Determine the show mode of the toast. 280 * 281 * @type { ?ToastShowMode } 282 * @default ToastShowMode.DEFAULT 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @crossplatform 285 * @atomicservice 286 * @since arkts {'1.1':'12','1.2':'20'} 287 * @arkts 1.1&1.2 288 */ 289 showMode?: ToastShowMode; 290 /** 291 * Defines the toast alignment of the screen. 292 * 293 * @type { ?Alignment } 294 * @syscap SystemCapability.ArkUI.ArkUI.Full 295 * @crossplatform 296 * @atomicservice 297 * @since arkts {'1.1':'12','1.2':'20'} 298 * @arkts 1.1&1.2 299 */ 300 alignment?: Alignment; 301 /** 302 * Defines the toast offset. 303 * 304 * @type { ?Offset } 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @crossplatform 307 * @atomicservice 308 * @since arkts {'1.1':'12','1.2':'20'} 309 * @arkts 1.1&1.2 310 */ 311 offset?: Offset; 312 /** 313 * Background color of toast. 314 * 315 * @type { ?ResourceColor } 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @crossplatform 318 * @atomicservice 319 * @since arkts {'1.1':'12','1.2':'20'} 320 * @arkts 1.1&1.2 321 */ 322 backgroundColor?: ResourceColor; 323 /** 324 * Text color of toast. 325 * 326 * @type { ?ResourceColor } 327 * @syscap SystemCapability.ArkUI.ArkUI.Full 328 * @crossplatform 329 * @atomicservice 330 * @since arkts {'1.1':'12','1.2':'20'} 331 * @arkts 1.1&1.2 332 */ 333 textColor?: ResourceColor; 334 /** 335 * Background blur Style of toast. 336 * 337 * @type { ?BlurStyle } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @atomicservice 341 * @since arkts {'1.1':'12','1.2':'20'} 342 * @arkts 1.1&1.2 343 */ 344 backgroundBlurStyle?: BlurStyle; 345 /** 346 * Shadow of toast. 347 * 348 * @type { ?(ShadowOptions | ShadowStyle) } 349 * @syscap SystemCapability.ArkUI.ArkUI.Full 350 * @crossplatform 351 * @atomicservice 352 * @since arkts {'1.1':'12','1.2':'20'} 353 * @arkts 1.1&1.2 354 */ 355 shadow?: ShadowOptions | ShadowStyle; 356 357 /** 358 * Define whether to respond to the hover mode. 359 * 360 * @type { ?boolean } 361 * @default false 362 * @syscap SystemCapability.ArkUI.ArkUI.Full 363 * @crossplatform 364 * @atomicservice 365 * @since arkts {'1.1':'14','1.2':'20'} 366 * @arkts 1.1&1.2 367 */ 368 enableHoverMode?: boolean; 369 370 /** 371 * Defines the toast's display area in hover mode. 372 * 373 * @type { ?HoverModeAreaType } 374 * @default HoverModeAreaType.BOTTOM_SCREEN 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @crossplatform 377 * @atomicservice 378 * @since arkts {'1.1':'14','1.2':'20'} 379 * @arkts 1.1&1.2 380 */ 381 hoverModeArea?: HoverModeAreaType; 382 } 383 384 /** 385 * Enum for the toast showMode. 386 * 387 * @enum { number } 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @since 11 390 */ 391 /** 392 * Enum for the toast showMode. 393 * 394 * @enum { number } 395 * @syscap SystemCapability.ArkUI.ArkUI.Full 396 * @crossplatform 397 * @atomicservice 398 * @since arkts {'1.1':'12','1.2':'20'} 399 * @arkts 1.1&1.2 400 */ 401 export enum ToastShowMode { 402 /** 403 * Toast shows in app. 404 * 405 * @syscap SystemCapability.ArkUI.ArkUI.Full 406 * @since 11 407 */ 408 /** 409 * Toast shows in app. 410 * 411 * @syscap SystemCapability.ArkUI.ArkUI.Full 412 * @crossplatform 413 * @atomicservice 414 * @since arkts {'1.1':'12','1.2':'20'} 415 * @arkts 1.1&1.2 416 */ 417 DEFAULT = 0, 418 419 /** 420 * Toast shows at the top. 421 * 422 * @syscap SystemCapability.ArkUI.ArkUI.Full 423 * @since 11 424 */ 425 /** 426 * Toast shows at the top. 427 * 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @crossplatform 430 * @atomicservice 431 * @since arkts {'1.1':'12','1.2':'20'} 432 * @arkts 1.1&1.2 433 */ 434 TOP_MOST = 1, 435 436 /** 437 * Toast shows in SYSTEM_TOAST window. 438 * 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @systemapi 441 * @since arkts {'1.1':'12','1.2':'20'} 442 * @arkts 1.1&1.2 443 */ 444 SYSTEM_TOP_MOST = 2 445 } 446 447 /** 448 * @typedef Button 449 * @syscap SystemCapability.ArkUI.ArkUI.Full 450 * @since 9 451 */ 452 /** 453 * @typedef Button 454 * @syscap SystemCapability.ArkUI.ArkUI.Full 455 * @crossplatform 456 * @since 10 457 */ 458 /** 459 * @typedef Button 460 * @syscap SystemCapability.ArkUI.ArkUI.Full 461 * @crossplatform 462 * @atomicservice 463 * @since arkts {'1.1':'11','1.2':'20'} 464 * @arkts 1.1&1.2 465 */ 466 export interface Button { 467 468 /** 469 * The text displayed in the button. 470 * 471 * @type { string | Resource } 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @since 9 474 */ 475 /** 476 * The text displayed in the button. 477 * 478 * @type { string | Resource } 479 * @syscap SystemCapability.ArkUI.ArkUI.Full 480 * @crossplatform 481 * @since 10 482 */ 483 /** 484 * The text displayed in the button. 485 * 486 * @type { string | Resource } 487 * @syscap SystemCapability.ArkUI.ArkUI.Full 488 * @crossplatform 489 * @atomicservice 490 * @since arkts {'1.1':'11','1.2':'20'} 491 * @arkts 1.1&1.2 492 */ 493 text: string | Resource; 494 495 /** 496 * The foreground color of button. 497 * 498 * @type { string | Resource } 499 * @syscap SystemCapability.ArkUI.ArkUI.Full 500 * @since 9 501 */ 502 /** 503 * The foreground color of button. 504 * 505 * @type { string | Resource } 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @crossplatform 508 * @since 10 509 */ 510 /** 511 * The foreground color of button. 512 * 513 * @type { string | Resource } 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @crossplatform 516 * @atomicservice 517 * @since arkts {'1.1':'11','1.2':'20'} 518 * @arkts 1.1&1.2 519 */ 520 color: string | Resource; 521 /** 522 * Define whether the button responds to Enter/Space key by default. 523 * 524 * @type { ?boolean } 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @crossplatform 527 * @atomicservice 528 * @since arkts {'1.1':'12','1.2':'20'} 529 * @arkts 1.1&1.2 530 */ 531 primary?: boolean; 532 } 533 534 /** 535 * Defines the one-button array. 536 * 537 * @typedef { [Button] } PromptActionSingleButton 538 * @syscap SystemCapability.ArkUI.ArkUI.Full 539 * @crossplatform 540 * @atomicservice 541 * @since 20 542 * @arkts 1.2 543 */ 544 export type PromptActionSingleButton = [Button]; 545 546 /** 547 * Defines the two-buttons array. 548 * 549 * @typedef { [Button, Button | undefined] } PromptActionDoubleButtons 550 * @syscap SystemCapability.ArkUI.ArkUI.Full 551 * @crossplatform 552 * @atomicservice 553 * @since 20 554 * @arkts 1.2 555 */ 556 export type PromptActionDoubleButtons = [Button, Button | undefined]; 557 558 /** 559 * Defines the three-buttons array. 560 * 561 * @typedef { [Button, Button | undefined, Button | undefined] } PromptActionTripleButtons 562 * @syscap SystemCapability.ArkUI.ArkUI.Full 563 * @crossplatform 564 * @atomicservice 565 * @since 20 566 * @arkts 1.2 567 */ 568 export type PromptActionTripleButtons = [Button, Button | undefined, Button | undefined]; 569 570 /** 571 * Defines the four-buttons array. 572 * 573 * @typedef { [Button, Button | undefined, Button | undefined, Button | undefined] } PromptActionQuadrupleButtons 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @atomicservice 577 * @since 20 578 * @arkts 1.2 579 */ 580 export type PromptActionQuadrupleButtons = [Button, Button | undefined, Button | undefined, Button | undefined]; 581 582 /** 583 * Defines the five-buttons array. 584 * 585 * @typedef { [Button, Button | undefined, Button | undefined, Button | undefined, Button | undefined] } PromptActionQuintupleButtons 586 * @syscap SystemCapability.ArkUI.ArkUI.Full 587 * @crossplatform 588 * @atomicservice 589 * @since 20 590 * @arkts 1.2 591 */ 592 export type PromptActionQuintupleButtons = [Button, Button | undefined, Button | undefined, Button | undefined, Button | undefined]; 593 594 /** 595 * Defines the six-buttons array. 596 * 597 * @typedef { [Button, Button | undefined, Button | undefined, Button | undefined, Button | undefined, Button | undefined] } PromptActionSextupleButtons 598 * @syscap SystemCapability.ArkUI.ArkUI.Full 599 * @crossplatform 600 * @atomicservice 601 * @since 20 602 * @arkts 1.2 603 */ 604 export type PromptActionSextupleButtons = [Button, Button | undefined, Button | undefined, Button | undefined, Button | undefined, Button | undefined]; 605 606 /** 607 * Defines success response of show dialog. 608 * 609 * @typedef ShowDialogSuccessResponse 610 * @syscap SystemCapability.ArkUI.ArkUI.Full 611 * @since 9 612 */ 613 /** 614 * @typedef ShowDialogSuccessResponse 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @crossplatform 617 * @since 10 618 */ 619 /** 620 * @typedef ShowDialogSuccessResponse 621 * @syscap SystemCapability.ArkUI.ArkUI.Full 622 * @crossplatform 623 * @atomicservice 624 * @since arkts {'1.1':'11','1.2':'20'} 625 * @arkts 1.1&1.2 626 */ 627 export interface ShowDialogSuccessResponse { 628 629 /** 630 * Index of the selected button, starting from 0. 631 * 632 * @type { number } 633 * @syscap SystemCapability.ArkUI.ArkUI.Full 634 * @since 9 635 */ 636 /** 637 * Index of the selected button, starting from 0. 638 * 639 * @type { number } 640 * @syscap SystemCapability.ArkUI.ArkUI.Full 641 * @crossplatform 642 * @since 10 643 */ 644 /** 645 * Index of the selected button, starting from 0. 646 * 647 * @type { number } 648 * @syscap SystemCapability.ArkUI.ArkUI.Full 649 * @crossplatform 650 * @atomicservice 651 * @since arkts {'1.1':'11','1.2':'20'} 652 * @arkts 1.1&1.2 653 */ 654 index: number; 655 } 656 657 /** 658 * @typedef ShowDialogOptions 659 * @syscap SystemCapability.ArkUI.ArkUI.Full 660 * @since 9 661 */ 662 /** 663 * @typedef ShowDialogOptions 664 * @syscap SystemCapability.ArkUI.ArkUI.Full 665 * @crossplatform 666 * @since 10 667 */ 668 /** 669 * @typedef ShowDialogOptions 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @crossplatform 672 * @atomicservice 673 * @since arkts {'1.1':'11','1.2':'20'} 674 * @arkts 1.1&1.2 675 */ 676 export interface ShowDialogOptions { 677 678 /** 679 * Title of the text to display. 680 * 681 * @type { ?(string | Resource) } 682 * @syscap SystemCapability.ArkUI.ArkUI.Full 683 * @since 9 684 */ 685 /** 686 * Title of the text to display. 687 * 688 * @type { ?(string | Resource) } 689 * @syscap SystemCapability.ArkUI.ArkUI.Full 690 * @crossplatform 691 * @since 10 692 */ 693 /** 694 * Title of the text to display. 695 * 696 * @type { ?(string | Resource) } 697 * @syscap SystemCapability.ArkUI.ArkUI.Full 698 * @crossplatform 699 * @atomicservice 700 * @since arkts {'1.1':'11','1.2':'20'} 701 * @arkts 1.1&1.2 702 */ 703 title?: string | Resource; 704 705 /** 706 * Text body. 707 * 708 * @type { ?(string | Resource) } 709 * @syscap SystemCapability.ArkUI.ArkUI.Full 710 * @since 9 711 */ 712 /** 713 * Text body. 714 * 715 * @type { ?(string | Resource) } 716 * @syscap SystemCapability.ArkUI.ArkUI.Full 717 * @crossplatform 718 * @since 10 719 */ 720 /** 721 * Text body. 722 * 723 * @type { ?(string | Resource) } 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @atomicservice 727 * @since arkts {'1.1':'11','1.2':'20'} 728 * @arkts 1.1&1.2 729 */ 730 message?: string | Resource; 731 732 /** 733 * Array of buttons in the dialog box. 734 * The array structure is {text:'button', color: '#666666'}. 735 * One to three buttons are supported. 736 * The first button is of the positiveButton type, the second is of the negativeButton type, and the third is of the neutralButton type. 737 * 738 * @type { ?Array<Button> } 739 * @syscap SystemCapability.ArkUI.ArkUI.Full 740 * @since 9 741 */ 742 /** 743 * Array of buttons in the dialog box. 744 * The array structure is {text:'button', color: '#666666'}. 745 * More than one buttons are supported. 746 * 747 * @type { ?Array<Button> } 748 * @syscap SystemCapability.ArkUI.ArkUI.Full 749 * @crossplatform 750 * @since 10 751 */ 752 /** 753 * Array of buttons in the dialog box. 754 * The array structure is {text:'button', color: '#666666'}. 755 * More than one buttons are supported. 756 * 757 * @type { ?Array<Button> } 758 * @syscap SystemCapability.ArkUI.ArkUI.Full 759 * @crossplatform 760 * @atomicservice 761 * @since arkts {'1.1':'11','1.2':'20'} 762 * @arkts 1.1&1.2 763 */ 764 buttons?: Array<Button>; 765 766 /** 767 * Mask Region of dialog. The size can't exceed the main window. 768 * 769 * @type { ?Rectangle } 770 * @syscap SystemCapability.ArkUI.ArkUI.Full 771 * @crossplatform 772 * @since 10 773 */ 774 /** 775 * Mask Region of dialog. The size can't exceed the main window. 776 * 777 * @type { ?Rectangle } 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @crossplatform 780 * @atomicservice 781 * @since arkts {'1.1':'11','1.2':'20'} 782 * @arkts 1.1&1.2 783 */ 784 maskRect?: Rectangle; 785 786 /** 787 * Defines the dialog alignment of the screen. 788 * 789 * @type { ?DialogAlignment } 790 * @syscap SystemCapability.ArkUI.ArkUI.Full 791 * @crossplatform 792 * @since 10 793 */ 794 /** 795 * Defines the dialog alignment of the screen. 796 * 797 * @type { ?DialogAlignment } 798 * @syscap SystemCapability.ArkUI.ArkUI.Full 799 * @crossplatform 800 * @atomicservice 801 * @since arkts {'1.1':'11','1.2':'20'} 802 * @arkts 1.1&1.2 803 */ 804 alignment?: DialogAlignment; 805 806 /** 807 * Defines the dialog offset. 808 * 809 * @type { ?Offset } 810 * @syscap SystemCapability.ArkUI.ArkUI.Full 811 * @crossplatform 812 * @since 10 813 */ 814 /** 815 * Defines the dialog offset. 816 * 817 * @type { ?Offset } 818 * @syscap SystemCapability.ArkUI.ArkUI.Full 819 * @crossplatform 820 * @atomicservice 821 * @since arkts {'1.1':'11','1.2':'20'} 822 * @arkts 1.1&1.2 823 */ 824 offset?: Offset; 825 826 /** 827 * Whether to display in the sub window. 828 * 829 * @type { ?boolean } 830 * @default false 831 * @syscap SystemCapability.ArkUI.ArkUI.Full 832 * @crossplatform 833 * @since 11 834 */ 835 /** 836 * Whether to display in the sub window. 837 * 838 * @type { ?boolean } 839 * @default false 840 * @syscap SystemCapability.ArkUI.ArkUI.Full 841 * @crossplatform 842 * @atomicservice 843 * @since arkts {'1.1':'12','1.2':'20'} 844 * @arkts 1.1&1.2 845 */ 846 showInSubWindow?: boolean; 847 848 /** 849 * Whether it is a modal dialog 850 * @type { ?boolean } 851 * @default true 852 * @syscap SystemCapability.ArkUI.ArkUI.Full 853 * @crossplatform 854 * @since 11 855 */ 856 /** 857 * Whether it is a modal dialog 858 * @type { ?boolean } 859 * @default true 860 * @syscap SystemCapability.ArkUI.ArkUI.Full 861 * @crossplatform 862 * @atomicservice 863 * @since arkts {'1.1':'12','1.2':'20'} 864 * @arkts 1.1&1.2 865 */ 866 isModal?: boolean; 867 868 /** 869 * Defines the dialog's background color. 870 * 871 * @type { ?ResourceColor } 872 * @default Color.Transparent 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @atomicservice 876 * @since arkts {'1.1':'12','1.2':'20'} 877 * @arkts 1.1&1.2 878 */ 879 backgroundColor?: ResourceColor; 880 881 /** 882 * Defines the dialog's background blur Style 883 * 884 * @type { ?BlurStyle } 885 * @default BlurStyle.COMPONENT_ULTRA_THICK 886 * @syscap SystemCapability.ArkUI.ArkUI.Full 887 * @crossplatform 888 * @atomicservice 889 * @since arkts {'1.1':'12','1.2':'20'} 890 * @arkts 1.1&1.2 891 */ 892 backgroundBlurStyle?: BlurStyle; 893 894 /** 895 * Defines the dialog's background blur style with options 896 * 897 * @type { ?BackgroundBlurStyleOptions } 898 * @syscap SystemCapability.ArkUI.ArkUI.Full 899 * @crossplatform 900 * @atomicservice 901 * @since arkts {'1.1':'19','1.2':'20'} 902 * @arkts 1.1&1.2 903 */ 904 backgroundBlurStyleOptions?: BackgroundBlurStyleOptions; 905 906 /** 907 * Defines the dialog's background effect with options 908 * 909 * @type { ?BackgroundEffectOptions } 910 * @syscap SystemCapability.ArkUI.ArkUI.Full 911 * @crossplatform 912 * @atomicservice 913 * @since arkts {'1.1':'19','1.2':'20'} 914 * @arkts 1.1&1.2 915 */ 916 backgroundEffect?: BackgroundEffectOptions; 917 918 /** 919 * Defines the dialog's shadow. 920 * 921 * @type { ?(ShadowOptions | ShadowStyle) } 922 * @syscap SystemCapability.ArkUI.ArkUI.Full 923 * @crossplatform 924 * @atomicservice 925 * @since arkts {'1.1':'12','1.2':'20'} 926 * @arkts 1.1&1.2 927 */ 928 shadow?: ShadowOptions | ShadowStyle; 929 930 /** 931 * Defines whether to respond to the hover mode. 932 * 933 * @type { ?boolean } 934 * @default false 935 * @syscap SystemCapability.ArkUI.ArkUI.Full 936 * @crossplatform 937 * @atomicservice 938 * @since arkts {'1.1':'14','1.2':'20'} 939 * @arkts 1.1&1.2 940 */ 941 enableHoverMode?: boolean; 942 943 /** 944 * Defines the dialog's display area in hover mode. 945 * 946 * @type { ?HoverModeAreaType } 947 * @default HoverModeAreaType.BOTTOM_SCREEN 948 * @syscap SystemCapability.ArkUI.ArkUI.Full 949 * @crossplatform 950 * @atomicservice 951 * @since arkts {'1.1':'14','1.2':'20'} 952 * @arkts 1.1&1.2 953 */ 954 hoverModeArea?: HoverModeAreaType; 955 956 /** 957 * Callback function when the dialog appears. 958 * 959 * @type { ?Callback<void> } 960 * @syscap SystemCapability.ArkUI.ArkUI.Full 961 * @crossplatform 962 * @atomicservice 963 * @since arkts {'1.1':'19','1.2':'20'} 964 * @arkts 1.1&1.2 965 */ 966 onDidAppear?: Callback<void>; 967 968 /** 969 * Callback function when the dialog disappears. 970 * 971 * @type { ?Callback<void> } 972 * @syscap SystemCapability.ArkUI.ArkUI.Full 973 * @crossplatform 974 * @atomicservice 975 * @since arkts {'1.1':'19','1.2':'20'} 976 * @arkts 1.1&1.2 977 */ 978 onDidDisappear?: Callback<void>; 979 980 /** 981 * Callback function before the dialog openAnimation starts. 982 * 983 * @type { ?Callback<void> } 984 * @syscap SystemCapability.ArkUI.ArkUI.Full 985 * @crossplatform 986 * @atomicservice 987 * @since arkts {'1.1':'19','1.2':'20'} 988 * @arkts 1.1&1.2 989 */ 990 onWillAppear?: Callback<void>; 991 992 /** 993 * Callback function before the dialog closeAnimation starts. 994 * 995 * @type { ?Callback<void> } 996 * @syscap SystemCapability.ArkUI.ArkUI.Full 997 * @crossplatform 998 * @atomicservice 999 * @since arkts {'1.1':'19','1.2':'20'} 1000 * @arkts 1.1&1.2 1001 */ 1002 onWillDisappear?: Callback<void>; 1003 1004 /** 1005 * Determine the display level of the dialog. 1006 * 1007 * @type { ?LevelMode } 1008 * @default LevelMode.OVERLAY 1009 * @syscap SystemCapability.ArkUI.ArkUI.Full 1010 * @crossplatform 1011 * @atomicservice 1012 * @since arkts {'1.1':'15','1.2':'20'} 1013 * @arkts 1.1&1.2 1014 */ 1015 levelMode?: LevelMode; 1016 1017 /** 1018 * The uniqueId of any node in the router or navigation page. 1019 * 1020 * @type { ?number } 1021 * @syscap SystemCapability.ArkUI.ArkUI.Full 1022 * @crossplatform 1023 * @atomicservice 1024 * @since arkts {'1.1':'15','1.2':'20'} 1025 * @arkts 1.1&1.2 1026 */ 1027 levelUniqueId?: number; 1028 1029 /** 1030 * Determine the immersive mode of the dialog. 1031 * 1032 * @type { ?ImmersiveMode } 1033 * @default ImmersiveMode.DEFAULT 1034 * @syscap SystemCapability.ArkUI.ArkUI.Full 1035 * @crossplatform 1036 * @atomicservice 1037 * @since arkts {'1.1':'15','1.2':'20'} 1038 * @arkts 1.1&1.2 1039 */ 1040 immersiveMode?: ImmersiveMode; 1041 1042 /** 1043 * Determine the display order of the dialog. 1044 * 1045 * @type { ?LevelOrder } 1046 * @default The value returns by LevelOrder.clamp(0) 1047 * @syscap SystemCapability.ArkUI.ArkUI.Full 1048 * @crossplatform 1049 * @atomicservice 1050 * @since arkts {'1.1':'18','1.2':'20'} 1051 * @arkts 1.1&1.2 1052 */ 1053 levelOrder?: LevelOrder; 1054 } 1055 1056 /** 1057 * Enum for state. 1058 * 1059 * @enum { number } 1060 * @syscap SystemCapability.ArkUI.ArkUI.Full 1061 * @crossplatform 1062 * @atomicservice 1063 * @since 20 1064 */ 1065 enum CommonState { 1066 /** 1067 * Indicates it is uninitialized. 1068 * 1069 * @syscap SystemCapability.ArkUI.ArkUI.Full 1070 * @crossplatform 1071 * @atomicservice 1072 * @since 20 1073 */ 1074 UNINITIALIZED = 0, 1075 1076 /** 1077 * Indicates it is initialized. 1078 * 1079 * @syscap SystemCapability.ArkUI.ArkUI.Full 1080 * @crossplatform 1081 * @atomicservice 1082 * @since 20 1083 */ 1084 INITIALIZED = 1, 1085 1086 /** 1087 * Indicates it is appearig. 1088 * 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @atomicservice 1092 * @since 20 1093 */ 1094 APPEARING = 2, 1095 1096 /** 1097 * Indicates it is appeared. 1098 * 1099 * @syscap SystemCapability.ArkUI.ArkUI.Full 1100 * @crossplatform 1101 * @atomicservice 1102 * @since 20 1103 */ 1104 APPEARED = 3, 1105 1106 /** 1107 * Indicates it is disappearing. 1108 * 1109 * @syscap SystemCapability.ArkUI.ArkUI.Full 1110 * @crossplatform 1111 * @atomicservice 1112 * @since 20 1113 */ 1114 DISAPPEARING = 4, 1115 1116 /** 1117 * Indicates it is disappeared. 1118 * 1119 * @syscap SystemCapability.ArkUI.ArkUI.Full 1120 * @crossplatform 1121 * @atomicservice 1122 * @since 20 1123 */ 1124 DISAPPEARED = 5, 1125 } 1126 1127 /** 1128 * The class used to control common dialog. 1129 * 1130 * @syscap SystemCapability.ArkUI.ArkUI.Full 1131 * @crossplatform 1132 * @atomicservice 1133 * @since arkts {'1.1':'18','1.2':'20'} 1134 * @arkts 1.1&1.2 1135 */ 1136 export class CommonController { 1137 /** 1138 * The constructor. 1139 * 1140 * @syscap SystemCapability.ArkUI.ArkUI.Full 1141 * @crossplatform 1142 * @atomicservice 1143 * @since arkts {'1.1':'18','1.2':'20'} 1144 * @arkts 1.1&1.2 1145 */ 1146 constructor(); 1147 1148 /** 1149 * Close the corresponding common dialog. 1150 * 1151 * @syscap SystemCapability.ArkUI.ArkUI.Full 1152 * @crossplatform 1153 * @atomicservice 1154 * @since arkts {'1.1':'18','1.2':'20'} 1155 * @arkts 1.1&1.2 1156 */ 1157 close(): void; 1158 1159 /** 1160 * Get the state. 1161 * 1162 * @returns { CommonState } return the state. 1163 * @syscap SystemCapability.ArkUI.ArkUI.Full 1164 * @crossplatform 1165 * @atomicservice 1166 * @since 20 1167 */ 1168 getState(): CommonState; 1169 } 1170 1171 /** 1172 * The class used to control dialog. 1173 * 1174 * @extends CommonController 1175 * @syscap SystemCapability.ArkUI.ArkUI.Full 1176 * @crossplatform 1177 * @atomicservice 1178 * @since arkts {'1.1':'18','1.2':'20'} 1179 * @arkts 1.1&1.2 1180 */ 1181 export class DialogController extends CommonController {} 1182 1183 /** 1184 * Dialog base options 1185 * 1186 * @typedef BaseDialogOptions 1187 * @syscap SystemCapability.ArkUI.ArkUI.Full 1188 * @crossplatform 1189 * @since 11 1190 */ 1191 /** 1192 * Dialog base options 1193 * 1194 * @typedef BaseDialogOptions 1195 * @syscap SystemCapability.ArkUI.ArkUI.Full 1196 * @crossplatform 1197 * @atomicservice 1198 * @since arkts {'1.1':'12','1.2':'20'} 1199 * @arkts 1.1&1.2 1200 */ 1201 export interface BaseDialogOptions { 1202 /** 1203 * Mask Region of dialog. The size can't exceed the main window. 1204 * 1205 * @type { ?Rectangle } 1206 * @syscap SystemCapability.ArkUI.ArkUI.Full 1207 * @crossplatform 1208 * @since 11 1209 */ 1210 /** 1211 * Mask Region of dialog. The size can't exceed the main window. 1212 * 1213 * @type { ?Rectangle } 1214 * @syscap SystemCapability.ArkUI.ArkUI.Full 1215 * @crossplatform 1216 * @atomicservice 1217 * @since arkts {'1.1':'12','1.2':'20'} 1218 * @arkts 1.1&1.2 1219 */ 1220 maskRect?: Rectangle; 1221 1222 /** 1223 * Defines the dialog alignment of the screen. 1224 * 1225 * @type { ?DialogAlignment } 1226 * @syscap SystemCapability.ArkUI.ArkUI.Full 1227 * @crossplatform 1228 * @since 11 1229 */ 1230 /** 1231 * Defines the dialog alignment of the screen. 1232 * 1233 * @type { ?DialogAlignment } 1234 * @syscap SystemCapability.ArkUI.ArkUI.Full 1235 * @crossplatform 1236 * @atomicservice 1237 * @since arkts {'1.1':'12','1.2':'20'} 1238 * @arkts 1.1&1.2 1239 */ 1240 alignment?: DialogAlignment; 1241 1242 /** 1243 * Defines the dialog offset. 1244 * 1245 * @type { ?Offset } 1246 * @syscap SystemCapability.ArkUI.ArkUI.Full 1247 * @crossplatform 1248 * @since 11 1249 */ 1250 /** 1251 * Defines the dialog offset. 1252 * 1253 * @type { ?Offset } 1254 * @syscap SystemCapability.ArkUI.ArkUI.Full 1255 * @crossplatform 1256 * @atomicservice 1257 * @since arkts {'1.1':'12','1.2':'20'} 1258 * @arkts 1.1&1.2 1259 */ 1260 offset?: Offset; 1261 1262 /** 1263 * Whether to display in the sub window. 1264 * 1265 * @type { ?boolean } 1266 * @default false 1267 * @syscap SystemCapability.ArkUI.ArkUI.Full 1268 * @crossplatform 1269 * @since 11 1270 */ 1271 /** 1272 * Whether to display in the sub window. 1273 * 1274 * @type { ?boolean } 1275 * @default false 1276 * @syscap SystemCapability.ArkUI.ArkUI.Full 1277 * @crossplatform 1278 * @atomicservice 1279 * @since arkts {'1.1':'12','1.2':'20'} 1280 * @arkts 1.1&1.2 1281 */ 1282 showInSubWindow?: boolean; 1283 1284 /** 1285 * Whether it is a modal dialog 1286 * @type { ?boolean } 1287 * @default true 1288 * @syscap SystemCapability.ArkUI.ArkUI.Full 1289 * @crossplatform 1290 * @since 11 1291 */ 1292 /** 1293 * Whether it is a modal dialog 1294 * @type { ?boolean } 1295 * @default true 1296 * @syscap SystemCapability.ArkUI.ArkUI.Full 1297 * @crossplatform 1298 * @atomicservice 1299 * @since arkts {'1.1':'12','1.2':'20'} 1300 * @arkts 1.1&1.2 1301 */ 1302 isModal?: boolean; 1303 1304 /** 1305 * Allows users to click the mask layer to exit. 1306 * 1307 * @type { ?boolean } 1308 * @default true 1309 * @syscap SystemCapability.ArkUI.ArkUI.Full 1310 * @crossplatform 1311 * @atomicservice 1312 * @since arkts {'1.1':'12','1.2':'20'} 1313 * @arkts 1.1&1.2 1314 */ 1315 autoCancel?: boolean; 1316 1317 /** 1318 * Transition parameters of opening/closing custom dialog. 1319 * 1320 * @type { ?TransitionEffect } 1321 * @syscap SystemCapability.ArkUI.ArkUI.Full 1322 * @crossplatform 1323 * @atomicservice 1324 * @since arkts {'1.1':'12','1.2':'20'} 1325 * @arkts 1.1&1.2 1326 */ 1327 transition?: TransitionEffect; 1328 1329 /** 1330 * Dialog transition parameters of opening/closing custom dialog. 1331 * 1332 * @type { ?TransitionEffect } 1333 * @syscap SystemCapability.ArkUI.ArkUI.Full 1334 * @crossplatform 1335 * @atomicservice 1336 * @since arkts {'1.1':'19','1.2':'20'} 1337 * @arkts 1.1&1.2 1338 */ 1339 dialogTransition?: TransitionEffect; 1340 1341 /** 1342 * Mask transition parameters of opening/closing custom dialog. 1343 * 1344 * @type { ?TransitionEffect } 1345 * @syscap SystemCapability.ArkUI.ArkUI.Full 1346 * @crossplatform 1347 * @atomicservice 1348 * @since arkts {'1.1':'19','1.2':'20'} 1349 * @arkts 1.1&1.2 1350 */ 1351 maskTransition?: TransitionEffect; 1352 1353 /** 1354 * Defines custom dialog maskColor 1355 * 1356 * @type { ?ResourceColor } 1357 * @syscap SystemCapability.ArkUI.ArkUI.Full 1358 * @crossplatform 1359 * @atomicservice 1360 * @since arkts {'1.1':'12','1.2':'20'} 1361 * @arkts 1.1&1.2 1362 */ 1363 maskColor?: ResourceColor; 1364 1365 /** 1366 * Callback function when the CustomDialog interactive dismiss. 1367 * 1368 * @type { ?Callback<DismissDialogAction> } 1369 * @syscap SystemCapability.ArkUI.ArkUI.Full 1370 * @crossplatform 1371 * @atomicservice 1372 * @since arkts {'1.1':'12','1.2':'20'} 1373 * @arkts 1.1&1.2 1374 */ 1375 onWillDismiss?: Callback<DismissDialogAction>; 1376 1377 /** 1378 * Callback function when the dialog appears. 1379 * 1380 * @type { ?function } 1381 * @syscap SystemCapability.ArkUI.ArkUI.Full 1382 * @crossplatform 1383 * @atomicservice 1384 * @since arkts {'1.1':'12','1.2':'20'} 1385 * @arkts 1.1&1.2 1386 */ 1387 onDidAppear?: () => void; 1388 1389 /** 1390 * Callback function when the dialog disappears. 1391 * 1392 * @type { ?function } 1393 * @syscap SystemCapability.ArkUI.ArkUI.Full 1394 * @crossplatform 1395 * @atomicservice 1396 * @since arkts {'1.1':'12','1.2':'20'} 1397 * @arkts 1.1&1.2 1398 */ 1399 onDidDisappear?: () => void; 1400 1401 /** 1402 * Callback function before the dialog openAnimation starts. 1403 * 1404 * @type { ?function } 1405 * @syscap SystemCapability.ArkUI.ArkUI.Full 1406 * @crossplatform 1407 * @atomicservice 1408 * @since arkts {'1.1':'12','1.2':'20'} 1409 * @arkts 1.1&1.2 1410 */ 1411 onWillAppear?: () => void; 1412 1413 /** 1414 * Callback function before the dialog closeAnimation starts. 1415 * 1416 * @type { ?function } 1417 * @syscap SystemCapability.ArkUI.ArkUI.Full 1418 * @crossplatform 1419 * @atomicservice 1420 * @since arkts {'1.1':'12','1.2':'20'} 1421 * @arkts 1.1&1.2 1422 */ 1423 onWillDisappear?: () => void; 1424 1425 /** 1426 * Defines the customDialog's keyboard avoid mode 1427 * 1428 * @type { ?KeyboardAvoidMode } 1429 * @default KeyboardAvoidMode.DEFAULT 1430 * @syscap SystemCapability.ArkUI.ArkUI.Full 1431 * @crossplatform 1432 * @atomicservice 1433 * @since arkts {'1.1':'12','1.2':'20'} 1434 * @arkts 1.1&1.2 1435 */ 1436 keyboardAvoidMode?: KeyboardAvoidMode; 1437 1438 /** 1439 * Defines whether to respond to the hover mode. 1440 * 1441 * @type { ?boolean } 1442 * @default false 1443 * @syscap SystemCapability.ArkUI.ArkUI.Full 1444 * @crossplatform 1445 * @atomicservice 1446 * @since arkts {'1.1':'14','1.2':'20'} 1447 * @arkts 1.1&1.2 1448 */ 1449 enableHoverMode?: boolean; 1450 1451 /** 1452 * Defines the dialog's display area in hover mode. 1453 * 1454 * @type { ?HoverModeAreaType } 1455 * @default HoverModeAreaType.BOTTOM_SCREEN 1456 * @syscap SystemCapability.ArkUI.ArkUI.Full 1457 * @crossplatform 1458 * @atomicservice 1459 * @since arkts {'1.1':'14','1.2':'20'} 1460 * @arkts 1.1&1.2 1461 */ 1462 hoverModeArea?: HoverModeAreaType; 1463 1464 /** 1465 * Defines the customDialog's background blur style with options 1466 * 1467 * @type { ?BackgroundBlurStyleOptions } 1468 * @syscap SystemCapability.ArkUI.ArkUI.Full 1469 * @crossplatform 1470 * @atomicservice 1471 * @since arkts {'1.1':'19','1.2':'20'} 1472 * @arkts 1.1&1.2 1473 */ 1474 backgroundBlurStyleOptions?: BackgroundBlurStyleOptions; 1475 1476 /** 1477 * Defines the customDialog's background effect with options 1478 * 1479 * @type { ?BackgroundEffectOptions } 1480 * @syscap SystemCapability.ArkUI.ArkUI.Full 1481 * @crossplatform 1482 * @atomicservice 1483 * @since arkts {'1.1':'19','1.2':'20'} 1484 * @arkts 1.1&1.2 1485 */ 1486 backgroundEffect?: BackgroundEffectOptions; 1487 1488 /** 1489 * Defines the distance between the customDialog and system keyboard. 1490 * 1491 * @type { ?LengthMetrics } 1492 * @syscap SystemCapability.ArkUI.ArkUI.Full 1493 * @crossplatform 1494 * @atomicservice 1495 * @since arkts {'1.1':'15','1.2':'20'} 1496 * @arkts 1.1&1.2 1497 */ 1498 keyboardAvoidDistance?: LengthMetrics; 1499 1500 /** 1501 * Determine the display level of the dialog. 1502 * 1503 * @type { ?LevelMode } 1504 * @default LevelMode.OVERLAY 1505 * @syscap SystemCapability.ArkUI.ArkUI.Full 1506 * @crossplatform 1507 * @atomicservice 1508 * @since arkts {'1.1':'15','1.2':'20'} 1509 * @arkts 1.1&1.2 1510 */ 1511 levelMode?: LevelMode; 1512 1513 /** 1514 * The uniqueId of any node in the router or navigation page. 1515 * 1516 * @type { ?number } 1517 * @syscap SystemCapability.ArkUI.ArkUI.Full 1518 * @crossplatform 1519 * @atomicservice 1520 * @since arkts {'1.1':'15','1.2':'20'} 1521 * @arkts 1.1&1.2 1522 */ 1523 levelUniqueId?: number; 1524 1525 /** 1526 * Determine the immersive mode of the dialog. 1527 * 1528 * @type { ?ImmersiveMode } 1529 * @default ImmersiveMode.DEFAULT 1530 * @syscap SystemCapability.ArkUI.ArkUI.Full 1531 * @crossplatform 1532 * @atomicservice 1533 * @since arkts {'1.1':'15','1.2':'20'} 1534 * @arkts 1.1&1.2 1535 */ 1536 immersiveMode?: ImmersiveMode; 1537 1538 /** 1539 * Determine the display order of the dialog. 1540 * 1541 * @type { ?LevelOrder } 1542 * @default The value returns by LevelOrder.clamp(0) 1543 * @syscap SystemCapability.ArkUI.ArkUI.Full 1544 * @crossplatform 1545 * @atomicservice 1546 * @since arkts {'1.1':'18','1.2':'20'} 1547 * @arkts 1.1&1.2 1548 */ 1549 levelOrder?: LevelOrder; 1550 1551 /** 1552 * Specifies whether to get focus when the custom dialog is displayed. 1553 * 1554 * @type { ?boolean } 1555 * @default true 1556 * @syscap SystemCapability.ArkUI.ArkUI.Full 1557 * @crossplatform 1558 * @atomicservice 1559 * @since arkts {'1.1':'19','1.2':'20'} 1560 * @arkts 1.1&1.2 1561 */ 1562 focusable?: boolean; 1563 } 1564 1565 /** 1566 * Dialog's custom content options 1567 * 1568 * @extends BaseDialogOptions 1569 * @interface CustomDialogOptions 1570 * @syscap SystemCapability.ArkUI.ArkUI.Full 1571 * @crossplatform 1572 * @since 11 1573 */ 1574 /** 1575 * Dialog's custom content options 1576 * 1577 * @extends BaseDialogOptions 1578 * @interface CustomDialogOptions 1579 * @syscap SystemCapability.ArkUI.ArkUI.Full 1580 * @crossplatform 1581 * @atomicservice 1582 * @since arkts {'1.1':'12','1.2':'20'} 1583 * @arkts 1.1&1.2 1584 */ 1585 export interface CustomDialogOptions extends BaseDialogOptions { 1586 /** 1587 * Allow developer custom dialog's content. 1588 * 1589 * @type { CustomBuilder } 1590 * @syscap SystemCapability.ArkUI.ArkUI.Full 1591 * @crossplatform 1592 * @since 11 1593 */ 1594 /** 1595 * Allow developer custom dialog's content. 1596 * 1597 * @type { CustomBuilder } 1598 * @syscap SystemCapability.ArkUI.ArkUI.Full 1599 * @crossplatform 1600 * @atomicservice 1601 * @since arkts {'1.1':'12','1.2':'20'} 1602 * @arkts 1.1&1.2 1603 */ 1604 builder: CustomBuilder; 1605 1606 /** 1607 * Defines the custom dialog's background color. 1608 * 1609 * @type { ?ResourceColor } 1610 * @syscap SystemCapability.ArkUI.ArkUI.Full 1611 * @crossplatform 1612 * @atomicservice 1613 * @since arkts {'1.1':'12','1.2':'20'} 1614 * @arkts 1.1&1.2 1615 */ 1616 backgroundColor?: ResourceColor; 1617 1618 /** 1619 * Defines the custom dialog's corner radius. 1620 * 1621 * @type { ?(Dimension | BorderRadiuses) } 1622 * @syscap SystemCapability.ArkUI.ArkUI.Full 1623 * @crossplatform 1624 * @atomicservice 1625 * @since arkts {'1.1':'12','1.2':'20'} 1626 * @arkts 1.1&1.2 1627 */ 1628 cornerRadius?: Dimension | BorderRadiuses; 1629 1630 /** 1631 * Defines the custom dialog's width. 1632 * 1633 * @type { ?Dimension } 1634 * @syscap SystemCapability.ArkUI.ArkUI.Full 1635 * @crossplatform 1636 * @atomicservice 1637 * @since arkts {'1.1':'12','1.2':'20'} 1638 * @arkts 1.1&1.2 1639 */ 1640 width?: Dimension; 1641 1642 /** 1643 * Defines the custom dialog's height. 1644 * 1645 * @type { ?Dimension } 1646 * @syscap SystemCapability.ArkUI.ArkUI.Full 1647 * @crossplatform 1648 * @atomicservice 1649 * @since arkts {'1.1':'12','1.2':'20'} 1650 * @arkts 1.1&1.2 1651 */ 1652 height?: Dimension; 1653 1654 /** 1655 * Defines the custom dialog's border width. 1656 * 1657 * @type { ?(Dimension | EdgeWidths) } 1658 * @syscap SystemCapability.ArkUI.ArkUI.Full 1659 * @crossplatform 1660 * @atomicservice 1661 * @since arkts {'1.1':'12','1.2':'20'} 1662 * @arkts 1.1&1.2 1663 */ 1664 borderWidth?: Dimension | EdgeWidths; 1665 1666 /** 1667 * Defines the custom dialog's border color. 1668 * 1669 * @type { ?(ResourceColor | EdgeColors) } 1670 * @syscap SystemCapability.ArkUI.ArkUI.Full 1671 * @crossplatform 1672 * @atomicservice 1673 * @since arkts {'1.1':'12','1.2':'20'} 1674 * @arkts 1.1&1.2 1675 */ 1676 borderColor?: ResourceColor | EdgeColors; 1677 1678 /** 1679 * Defines the custom dialog's border style. 1680 * 1681 * @type { ?(BorderStyle | EdgeStyles) } 1682 * @syscap SystemCapability.ArkUI.ArkUI.Full 1683 * @crossplatform 1684 * @atomicservice 1685 * @since arkts {'1.1':'12','1.2':'20'} 1686 * @arkts 1.1&1.2 1687 */ 1688 borderStyle?: BorderStyle | EdgeStyles; 1689 1690 /** 1691 * Defines the custom dialog's shadow. 1692 * 1693 * @type { ?(ShadowOptions | ShadowStyle) } 1694 * @syscap SystemCapability.ArkUI.ArkUI.Full 1695 * @crossplatform 1696 * @atomicservice 1697 * @since arkts {'1.1':'12','1.2':'20'} 1698 * @arkts 1.1&1.2 1699 */ 1700 shadow?: ShadowOptions | ShadowStyle; 1701 1702 /** 1703 * Defines the customDialog's background blur Style 1704 * 1705 * @type { ?BlurStyle } 1706 * @default BlurStyle.COMPONENT_ULTRA_THICK 1707 * @syscap SystemCapability.ArkUI.ArkUI.Full 1708 * @crossplatform 1709 * @atomicservice 1710 * @since arkts {'1.1':'12','1.2':'20'} 1711 * @arkts 1.1&1.2 1712 */ 1713 backgroundBlurStyle?: BlurStyle; 1714 } 1715 1716 /** 1717 * Corner radius type of DialogOptions. 1718 * 1719 * @typedef { Dimension | BorderRadiuses } DialogOptionsCornerRadius 1720 * @syscap SystemCapability.ArkUI.ArkUI.Full 1721 * @crossplatform 1722 * @atomicservice 1723 * @since arkts {'1.1':'18','1.2':'20'} 1724 * @arkts 1.1&1.2 1725 */ 1726 export type DialogOptionsCornerRadius = Dimension | BorderRadiuses; 1727 1728 /** 1729 * Border width type of DialogOptions. 1730 * 1731 * @typedef { Dimension | EdgeWidths } DialogOptionsBorderWidth 1732 * @syscap SystemCapability.ArkUI.ArkUI.Full 1733 * @crossplatform 1734 * @atomicservice 1735 * @since arkts {'1.1':'18','1.2':'20'} 1736 * @arkts 1.1&1.2 1737 */ 1738 export type DialogOptionsBorderWidth = Dimension | EdgeWidths; 1739 1740 /** 1741 * Border color type of DialogOptions. 1742 * 1743 * @typedef { ResourceColor | EdgeColors } DialogOptionsBorderColor 1744 * @syscap SystemCapability.ArkUI.ArkUI.Full 1745 * @crossplatform 1746 * @atomicservice 1747 * @since arkts {'1.1':'18','1.2':'20'} 1748 * @arkts 1.1&1.2 1749 */ 1750 export type DialogOptionsBorderColor = ResourceColor | EdgeColors; 1751 1752 /** 1753 * Border style type of DialogOptions. 1754 * 1755 * @typedef { BorderStyle | EdgeStyles } DialogOptionsBorderStyle 1756 * @syscap SystemCapability.ArkUI.ArkUI.Full 1757 * @crossplatform 1758 * @atomicservice 1759 * @since arkts {'1.1':'18','1.2':'20'} 1760 * @arkts 1.1&1.2 1761 */ 1762 export type DialogOptionsBorderStyle = BorderStyle | EdgeStyles; 1763 1764 /** 1765 * Shadow type of DialogOptions. 1766 * 1767 * @typedef { ShadowOptions | ShadowStyle } DialogOptionsShadow 1768 * @syscap SystemCapability.ArkUI.ArkUI.Full 1769 * @crossplatform 1770 * @atomicservice 1771 * @since arkts {'1.1':'18','1.2':'20'} 1772 * @arkts 1.1&1.2 1773 */ 1774 export type DialogOptionsShadow = ShadowOptions | ShadowStyle; 1775 1776 /** 1777 * Dialog options 1778 * 1779 * @extends BaseDialogOptions 1780 * @typedef DialogOptions 1781 * @syscap SystemCapability.ArkUI.ArkUI.Full 1782 * @crossplatform 1783 * @atomicservice 1784 * @since arkts {'1.1':'18','1.2':'20'} 1785 * @arkts 1.1&1.2 1786 */ 1787 export interface DialogOptions extends BaseDialogOptions { 1788 /** 1789 * Defines the dialog's background color. 1790 * 1791 * @type { ?ResourceColor } 1792 * @syscap SystemCapability.ArkUI.ArkUI.Full 1793 * @crossplatform 1794 * @atomicservice 1795 * @since arkts {'1.1':'18','1.2':'20'} 1796 * @arkts 1.1&1.2 1797 */ 1798 backgroundColor?: ResourceColor; 1799 1800 /** 1801 * Defines the dialog's corner radius. 1802 * 1803 * @type { ?DialogOptionsCornerRadius } 1804 * @syscap SystemCapability.ArkUI.ArkUI.Full 1805 * @crossplatform 1806 * @atomicservice 1807 * @since arkts {'1.1':'18','1.2':'20'} 1808 * @arkts 1.1&1.2 1809 */ 1810 cornerRadius?: DialogOptionsCornerRadius; 1811 1812 /** 1813 * Defines the dialog's width. 1814 * 1815 * @type { ?Dimension } 1816 * @syscap SystemCapability.ArkUI.ArkUI.Full 1817 * @crossplatform 1818 * @atomicservice 1819 * @since arkts {'1.1':'18','1.2':'20'} 1820 * @arkts 1.1&1.2 1821 */ 1822 width?: Dimension; 1823 1824 /** 1825 * Defines the dialog's height. 1826 * 1827 * @type { ?Dimension } 1828 * @syscap SystemCapability.ArkUI.ArkUI.Full 1829 * @crossplatform 1830 * @atomicservice 1831 * @since arkts {'1.1':'18','1.2':'20'} 1832 * @arkts 1.1&1.2 1833 */ 1834 height?: Dimension; 1835 1836 /** 1837 * Defines the dialog's border width. 1838 * 1839 * @type { ?DialogOptionsBorderWidth } 1840 * @syscap SystemCapability.ArkUI.ArkUI.Full 1841 * @crossplatform 1842 * @atomicservice 1843 * @since arkts {'1.1':'18','1.2':'20'} 1844 * @arkts 1.1&1.2 1845 */ 1846 borderWidth?: DialogOptionsBorderWidth; 1847 1848 /** 1849 * Defines the dialog's border color. 1850 * 1851 * @type { ?DialogOptionsBorderColor } 1852 * @syscap SystemCapability.ArkUI.ArkUI.Full 1853 * @crossplatform 1854 * @atomicservice 1855 * @since arkts {'1.1':'18','1.2':'20'} 1856 * @arkts 1.1&1.2 1857 */ 1858 borderColor?: DialogOptionsBorderColor; 1859 1860 /** 1861 * Defines the dialog's border style. 1862 * 1863 * @type { ?DialogOptionsBorderStyle } 1864 * @syscap SystemCapability.ArkUI.ArkUI.Full 1865 * @crossplatform 1866 * @atomicservice 1867 * @since arkts {'1.1':'18','1.2':'20'} 1868 * @arkts 1.1&1.2 1869 */ 1870 borderStyle?: DialogOptionsBorderStyle; 1871 1872 /** 1873 * Defines the dialog's shadow. 1874 * 1875 * @type { ?DialogOptionsShadow } 1876 * @syscap SystemCapability.ArkUI.ArkUI.Full 1877 * @crossplatform 1878 * @atomicservice 1879 * @since arkts {'1.1':'18','1.2':'20'} 1880 * @arkts 1.1&1.2 1881 */ 1882 shadow?: DialogOptionsShadow; 1883 1884 /** 1885 * Defines the dialog's background blur Style 1886 * 1887 * @type { ?BlurStyle } 1888 * @default BlurStyle.COMPONENT_ULTRA_THICK 1889 * @syscap SystemCapability.ArkUI.ArkUI.Full 1890 * @crossplatform 1891 * @atomicservice 1892 * @since arkts {'1.1':'18','1.2':'20'} 1893 * @arkts 1.1&1.2 1894 */ 1895 backgroundBlurStyle?: BlurStyle; 1896 } 1897 1898 /** 1899 * @typedef ActionMenuSuccessResponse 1900 * @syscap SystemCapability.ArkUI.ArkUI.Full 1901 * @since 9 1902 */ 1903 /** 1904 * @typedef ActionMenuSuccessResponse 1905 * @syscap SystemCapability.ArkUI.ArkUI.Full 1906 * @crossplatform 1907 * @since 10 1908 */ 1909 /** 1910 * @typedef ActionMenuSuccessResponse 1911 * @syscap SystemCapability.ArkUI.ArkUI.Full 1912 * @crossplatform 1913 * @atomicservice 1914 * @since arkts {'1.1':'11','1.2':'20'} 1915 * @arkts 1.1&1.2 1916 */ 1917 export interface ActionMenuSuccessResponse { 1918 /** 1919 * Index of the selected button, starting from 0. 1920 * 1921 * @type { number } 1922 * @syscap SystemCapability.ArkUI.ArkUI.Full 1923 * @since 9 1924 */ 1925 /** 1926 * Index of the selected button, starting from 0. 1927 * 1928 * @type { number } 1929 * @syscap SystemCapability.ArkUI.ArkUI.Full 1930 * @crossplatform 1931 * @since 10 1932 */ 1933 /** 1934 * Index of the selected button, starting from 0. 1935 * 1936 * @type { number } 1937 * @syscap SystemCapability.ArkUI.ArkUI.Full 1938 * @crossplatform 1939 * @atomicservice 1940 * @since arkts {'1.1':'11','1.2':'20'} 1941 * @arkts 1.1&1.2 1942 */ 1943 index: number; 1944 } 1945 1946 /** 1947 * @typedef ActionMenuOptions 1948 * @syscap SystemCapability.ArkUI.ArkUI.Full 1949 * @since 9 1950 */ 1951 /** 1952 * @typedef ActionMenuOptions 1953 * @syscap SystemCapability.ArkUI.ArkUI.Full 1954 * @crossplatform 1955 * @since 10 1956 */ 1957 /** 1958 * @typedef ActionMenuOptions 1959 * @syscap SystemCapability.ArkUI.ArkUI.Full 1960 * @crossplatform 1961 * @atomicservice 1962 * @since arkts {'1.1':'11','1.2':'20'} 1963 * @arkts 1.1&1.2 1964 */ 1965 export interface ActionMenuOptions { 1966 /** 1967 * Title of the text to display. 1968 * 1969 * @type { ?(string | Resource) } 1970 * @syscap SystemCapability.ArkUI.ArkUI.Full 1971 * @since 9 1972 */ 1973 /** 1974 * Title of the text to display. 1975 * 1976 * @type { ?(string | Resource) } 1977 * @syscap SystemCapability.ArkUI.ArkUI.Full 1978 * @crossplatform 1979 * @since 10 1980 */ 1981 /** 1982 * Title of the text to display. 1983 * 1984 * @type { ?(string | Resource) } 1985 * @syscap SystemCapability.ArkUI.ArkUI.Full 1986 * @crossplatform 1987 * @atomicservice 1988 * @since arkts {'1.1':'11','1.2':'20'} 1989 * @arkts 1.1&1.2 1990 */ 1991 title?: string | Resource; 1992 1993 /** 1994 * Array of buttons in the dialog box. 1995 * The array structure is {text:'button', color: '#666666'}. 1996 * One to six buttons are supported. 1997 * 1998 * @type { [Button, Button?, Button?, Button?, Button?, Button?] } 1999 * @syscap SystemCapability.ArkUI.ArkUI.Full 2000 * @since 9 2001 */ 2002 /** 2003 * Array of buttons in the dialog box. 2004 * The array structure is {text:'button', color: '#666666'}. 2005 * One to six buttons are supported. 2006 * 2007 * @type { [Button, Button?, Button?, Button?, Button?, Button?] } 2008 * @syscap SystemCapability.ArkUI.ArkUI.Full 2009 * @crossplatform 2010 * @since 10 2011 */ 2012 /** 2013 * Array of buttons in the dialog box. 2014 * The array structure is {text:'button', color: '#666666'}. 2015 * One to six buttons are supported. 2016 * 2017 * @type { [Button, Button?, Button?, Button?, Button?, Button?] } 2018 * @syscap SystemCapability.ArkUI.ArkUI.Full 2019 * @crossplatform 2020 * @atomicservice 2021 * @since 11 2022 */ 2023 buttons: [Button, Button?, Button?, Button?, Button?, Button?]; 2024 2025 /** 2026 * Array of buttons in the dialog box. 2027 * The array structure is {text:'button', color: '#666666'}. 2028 * One to six buttons are supported. 2029 * 2030 * @type { PromptActionSingleButton | PromptActionDoubleButtons | PromptActionTripleButtons | PromptActionQuadrupleButtons | PromptActionQuintupleButtons | PromptActionSextupleButtons } 2031 * @syscap SystemCapability.ArkUI.ArkUI.Full 2032 * @crossplatform 2033 * @atomicservice 2034 * @since 20 2035 * @arkts 1.2 2036 */ 2037 buttons: PromptActionSingleButton | PromptActionDoubleButtons | PromptActionTripleButtons | PromptActionQuadrupleButtons | PromptActionQuintupleButtons | PromptActionSextupleButtons; 2038 2039 /** 2040 * Whether to display in the sub window. 2041 * 2042 * @type { ?boolean } 2043 * @default false 2044 * @syscap SystemCapability.ArkUI.ArkUI.Full 2045 * @crossplatform 2046 * @since 11 2047 */ 2048 /** 2049 * Whether to display in the sub window. 2050 * 2051 * @type { ?boolean } 2052 * @default false 2053 * @syscap SystemCapability.ArkUI.ArkUI.Full 2054 * @crossplatform 2055 * @atomicservice 2056 * @since arkts {'1.1':'12','1.2':'20'} 2057 * @arkts 1.1&1.2 2058 */ 2059 showInSubWindow?: boolean; 2060 2061 /** 2062 * Whether it is a modal dialog 2063 * @type { ?boolean } 2064 * @default true 2065 * @syscap SystemCapability.ArkUI.ArkUI.Full 2066 * @crossplatform 2067 * @since 11 2068 */ 2069 /** 2070 * Whether it is a modal dialog 2071 * @type { ?boolean } 2072 * @default true 2073 * @syscap SystemCapability.ArkUI.ArkUI.Full 2074 * @crossplatform 2075 * @atomicservice 2076 * @since arkts {'1.1':'12','1.2':'20'} 2077 * @arkts 1.1&1.2 2078 */ 2079 isModal?: boolean; 2080 2081 /** 2082 * Determine the display level of the dialog. 2083 * 2084 * @type { ?LevelMode } 2085 * @default LevelMode.OVERLAY 2086 * @syscap SystemCapability.ArkUI.ArkUI.Full 2087 * @crossplatform 2088 * @atomicservice 2089 * @since arkts {'1.1':'15','1.2':'20'} 2090 * @arkts 1.1&1.2 2091 */ 2092 levelMode?: LevelMode; 2093 2094 /** 2095 * The uniqueId of any node in the router or navigation page. 2096 * 2097 * @type { ?number } 2098 * @syscap SystemCapability.ArkUI.ArkUI.Full 2099 * @crossplatform 2100 * @atomicservice 2101 * @since arkts {'1.1':'15','1.2':'20'} 2102 * @arkts 1.1&1.2 2103 */ 2104 levelUniqueId?: number; 2105 2106 /** 2107 * Determine the immersive mode of the dialog. 2108 * 2109 * @type { ?ImmersiveMode } 2110 * @default ImmersiveMode.DEFAULT 2111 * @syscap SystemCapability.ArkUI.ArkUI.Full 2112 * @crossplatform 2113 * @atomicservice 2114 * @since arkts {'1.1':'15','1.2':'20'} 2115 * @arkts 1.1&1.2 2116 */ 2117 immersiveMode?: ImmersiveMode; 2118 2119 /** 2120 * Callback function when the menu appears. 2121 * 2122 * @type { ?Callback<void> } 2123 * @syscap SystemCapability.ArkUI.ArkUI.Full 2124 * @crossplatform 2125 * @atomicservice 2126 * @since 20 2127 */ 2128 onDidAppear?: Callback<void>; 2129 2130 /** 2131 * Callback function when the menu disappears. 2132 * 2133 * @type { ?Callback<void> } 2134 * @syscap SystemCapability.ArkUI.ArkUI.Full 2135 * @crossplatform 2136 * @atomicservice 2137 * @since 20 2138 */ 2139 onDidDisappear?: Callback<void>; 2140 2141 /** 2142 * Callback function before the menu openAnimation starts. 2143 * 2144 * @type { ?Callback<void> } 2145 * @syscap SystemCapability.ArkUI.ArkUI.Full 2146 * @crossplatform 2147 * @atomicservice 2148 * @since 20 2149 */ 2150 onWillAppear?: Callback<void>; 2151 2152 /** 2153 * Callback function before the menu closeAnimation starts. 2154 * 2155 * @type { ?Callback<void> } 2156 * @syscap SystemCapability.ArkUI.ArkUI.Full 2157 * @crossplatform 2158 * @atomicservice 2159 * @since 20 2160 */ 2161 onWillDisappear?: Callback<void>; 2162 } 2163 2164 /** 2165 * Displays the notification text. 2166 * 2167 * @param { ShowToastOptions } options - Options. 2168 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2169 * <br> 1. Mandatory parameters are left unspecified. 2170 * <br> 2. Incorrect parameters types. 2171 * <br> 3. Parameter verification failed. 2172 * @throws { BusinessError } 100001 - Internal error. 2173 * @syscap SystemCapability.ArkUI.ArkUI.Full 2174 * @since 9 2175 */ 2176 /** 2177 * Displays the notification text. 2178 * 2179 * @param { ShowToastOptions } options - Options. 2180 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2181 * <br> 1. Mandatory parameters are left unspecified. 2182 * <br> 2. Incorrect parameters types. 2183 * <br> 3. Parameter verification failed. 2184 * @throws { BusinessError } 100001 - Internal error. 2185 * @syscap SystemCapability.ArkUI.ArkUI.Full 2186 * @crossplatform 2187 * @since 10 2188 */ 2189 /** 2190 * Displays the notification text. 2191 * 2192 * @param { ShowToastOptions } options - Options. 2193 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2194 * <br> 1. Mandatory parameters are left unspecified. 2195 * <br> 2. Incorrect parameters types. 2196 * <br> 3. Parameter verification failed. 2197 * @throws { BusinessError } 100001 - Internal error. 2198 * @syscap SystemCapability.ArkUI.ArkUI.Full 2199 * @crossplatform 2200 * @atomicservice 2201 * @since 11 2202 * @deprecated since 18 2203 * @useinstead ohos.arkui.UIContext.PromptAction#showToast 2204 */ 2205 function showToast(options: ShowToastOptions): void; 2206 2207 /** 2208 * Displays the notification text. 2209 * 2210 * @param { ShowToastOptions } options - Options. 2211 * @returns { Promise<number> } return the toast id that will be used by closeToast. 2212 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2213 * <br> 1. Mandatory parameters are left unspecified. 2214 * <br> 2. Incorrect parameters types. 2215 * <br> 3. Parameter verification failed. 2216 * @throws { BusinessError } 100001 - Internal error. 2217 * @syscap SystemCapability.ArkUI.ArkUI.Full 2218 * @crossplatform 2219 * @atomicservice 2220 * @since arkts {'1.1':'18','1.2':'20'} 2221 * @arkts 1.1&1.2 2222 */ 2223 export function openToast(options: ShowToastOptions): Promise<number>; 2224 2225 /** 2226 * Close the notification text. 2227 * 2228 * @param { number } toastId - the toast id that returned by openToast. 2229 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2230 * <br> 1. Mandatory parameters are left unspecified. 2231 * <br> 2. Incorrect parameters types. 2232 * <br> 3. Parameter verification failed. 2233 * @throws { BusinessError } 100001 - Internal error. 2234 * @throws { BusinessError } 103401 - Cannot find the toast. 2235 * @syscap SystemCapability.ArkUI.ArkUI.Full 2236 * @crossplatform 2237 * @atomicservice 2238 * @since arkts {'1.1':'18','1.2':'20'} 2239 * @arkts 1.1&1.2 2240 */ 2241 export function closeToast(toastId: number): void; 2242 2243 /** 2244 * Displays the dialog box. 2245 * 2246 * @param { ShowDialogOptions } options - Options. 2247 * @param { AsyncCallback<ShowDialogSuccessResponse> } callback - the callback of showDialog. 2248 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2249 * <br> 1. Mandatory parameters are left unspecified. 2250 * <br> 2. Incorrect parameters types. 2251 * <br> 3. Parameter verification failed. 2252 * @throws { BusinessError } 100001 - Internal error. 2253 * @syscap SystemCapability.ArkUI.ArkUI.Full 2254 * @since 9 2255 */ 2256 /** 2257 * Displays the dialog box. 2258 * 2259 * @param { ShowDialogOptions } options - Options. 2260 * @param { AsyncCallback<ShowDialogSuccessResponse> } callback - the callback of showDialog. 2261 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2262 * <br> 1. Mandatory parameters are left unspecified. 2263 * <br> 2. Incorrect parameters types. 2264 * <br> 3. Parameter verification failed. 2265 * @throws { BusinessError } 100001 - Internal error. 2266 * @syscap SystemCapability.ArkUI.ArkUI.Full 2267 * @crossplatform 2268 * @since 10 2269 */ 2270 /** 2271 * Displays the dialog box. 2272 * 2273 * @param { ShowDialogOptions } options - Options. 2274 * @param { AsyncCallback<ShowDialogSuccessResponse> } callback - the callback of showDialog. 2275 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2276 * <br> 1. Mandatory parameters are left unspecified. 2277 * <br> 2. Incorrect parameters types. 2278 * <br> 3. Parameter verification failed. 2279 * @throws { BusinessError } 100001 - Internal error. 2280 * @syscap SystemCapability.ArkUI.ArkUI.Full 2281 * @crossplatform 2282 * @atomicservice 2283 * @since 11 2284 * @deprecated since 18 2285 * @useinstead ohos.arkui.UIContext.PromptAction#showDialog 2286 */ 2287 function showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSuccessResponse>): void; 2288 2289 /** 2290 * Displays the dialog box. 2291 * 2292 * @param { ShowDialogOptions } options - Options. 2293 * @returns { Promise<ShowDialogSuccessResponse> } the promise returned by the function. 2294 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2295 * <br> 1. Mandatory parameters are left unspecified. 2296 * <br> 2. Incorrect parameters types. 2297 * <br> 3. Parameter verification failed. 2298 * @throws { BusinessError } 100001 - Internal error. 2299 * @syscap SystemCapability.ArkUI.ArkUI.Full 2300 * @since 9 2301 */ 2302 /** 2303 * Displays the dialog box. 2304 * 2305 * @param { ShowDialogOptions } options - Options. 2306 * @returns { Promise<ShowDialogSuccessResponse> } the promise returned by the function. 2307 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2308 * <br> 1. Mandatory parameters are left unspecified. 2309 * <br> 2. Incorrect parameters types. 2310 * <br> 3. Parameter verification failed. 2311 * @throws { BusinessError } 100001 - Internal error. 2312 * @syscap SystemCapability.ArkUI.ArkUI.Full 2313 * @crossplatform 2314 * @since 10 2315 */ 2316 /** 2317 * Displays the dialog box. 2318 * 2319 * @param { ShowDialogOptions } options - Options. 2320 * @returns { Promise<ShowDialogSuccessResponse> } the promise returned by the function. 2321 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2322 * <br> 1. Mandatory parameters are left unspecified. 2323 * <br> 2. Incorrect parameters types. 2324 * <br> 3. Parameter verification failed. 2325 * @throws { BusinessError } 100001 - Internal error. 2326 * @syscap SystemCapability.ArkUI.ArkUI.Full 2327 * @crossplatform 2328 * @atomicservice 2329 * @since 11 2330 * @deprecated since 18 2331 * @useinstead ohos.arkui.UIContext.PromptAction#showDialog 2332 */ 2333 function showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>; 2334 2335 /** 2336 * Open the custom dialog. 2337 * 2338 * @param { CustomDialogOptions } options - Options. 2339 * @returns { Promise<number> } return the dialog id that will be used by closeCustomDialog. 2340 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2341 * <br> 1. Mandatory parameters are left unspecified. 2342 * <br> 2. Incorrect parameters types. 2343 * <br> 3. Parameter verification failed. 2344 * @throws { BusinessError } 100001 - Internal error. 2345 * @syscap SystemCapability.ArkUI.ArkUI.Full 2346 * @crossplatform 2347 * @since 11 2348 */ 2349 /** 2350 * Open the custom dialog. 2351 * 2352 * @param { CustomDialogOptions } options - Options. 2353 * @returns { Promise<number> } return the dialog id that will be used by closeCustomDialog. 2354 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2355 * <br> 1. Mandatory parameters are left unspecified. 2356 * <br> 2. Incorrect parameters types. 2357 * <br> 3. Parameter verification failed. 2358 * @throws { BusinessError } 100001 - Internal error. 2359 * @syscap SystemCapability.ArkUI.ArkUI.Full 2360 * @crossplatform 2361 * @atomicservice 2362 * @since 12 2363 * @deprecated since 18 2364 * @useinstead ohos.arkui.UIContext.PromptAction#openCustomDialog 2365 */ 2366 function openCustomDialog(options: CustomDialogOptions): Promise<number>; 2367 2368 /** 2369 * Close the custom dialog. 2370 * 2371 * @param { number } dialogId - the dialog id that returned by openCustomDialog. 2372 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2373 * <br> 1. Mandatory parameters are left unspecified. 2374 * <br> 2. Incorrect parameters types. 2375 * <br> 3. Parameter verification failed. 2376 * @throws { BusinessError } 100001 - Internal error. 2377 * @syscap SystemCapability.ArkUI.ArkUI.Full 2378 * @crossplatform 2379 * @since 11 2380 */ 2381 /** 2382 * Close the custom dialog. 2383 * 2384 * @param { number } dialogId - the dialog id that returned by openCustomDialog. 2385 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2386 * <br> 1. Mandatory parameters are left unspecified. 2387 * <br> 2. Incorrect parameters types. 2388 * <br> 3. Parameter verification failed. 2389 * @throws { BusinessError } 100001 - Internal error. 2390 * @syscap SystemCapability.ArkUI.ArkUI.Full 2391 * @crossplatform 2392 * @atomicservice 2393 * @since 12 2394 * @deprecated since 18 2395 * @useinstead ohos.arkui.UIContext.PromptAction#closeCustomDialog 2396 */ 2397 function closeCustomDialog(dialogId: number): void; 2398 2399 /** 2400 * Displays the menu. 2401 * 2402 * @param { ActionMenuOptions } options - Options. 2403 * @param { AsyncCallback<ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 2404 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2405 * <br> 1. Mandatory parameters are left unspecified. 2406 * <br> 2. Incorrect parameters types. 2407 * <br> 3. Parameter verification failed. 2408 * @throws { BusinessError } 100001 - Internal error. 2409 * @syscap SystemCapability.ArkUI.ArkUI.Full 2410 * @since 9 2411 */ 2412 /** 2413 * Displays the menu. 2414 * 2415 * @param { ActionMenuOptions } options - Options. 2416 * @param { AsyncCallback<ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 2417 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2418 * <br> 1. Mandatory parameters are left unspecified. 2419 * <br> 2. Incorrect parameters types. 2420 * <br> 3. Parameter verification failed. 2421 * @throws { BusinessError } 100001 - Internal error. 2422 * @syscap SystemCapability.ArkUI.ArkUI.Full 2423 * @crossplatform 2424 * @since 10 2425 */ 2426 /** 2427 * Displays the menu. 2428 * 2429 * @param { ActionMenuOptions } options - Options. 2430 * @param { AsyncCallback<ActionMenuSuccessResponse> } callback - the callback of showActionMenu. 2431 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2432 * <br> 1. Mandatory parameters are left unspecified. 2433 * <br> 2. Incorrect parameters types. 2434 * <br> 3. Parameter verification failed. 2435 * @throws { BusinessError } 100001 - Internal error. 2436 * @syscap SystemCapability.ArkUI.ArkUI.Full 2437 * @crossplatform 2438 * @atomicservice 2439 * @since 11 2440 * @deprecated since 18 2441 * @useinstead ohos.arkui.UIContext.PromptAction#showActionMenu 2442 */ 2443 function showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenuSuccessResponse>): void; 2444 2445 /** 2446 * Displays the dialog box. 2447 * 2448 * @param { ActionMenuOptions } options - Options. 2449 * @returns { Promise<ActionMenuSuccessResponse> } the promise returned by the function. 2450 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2451 * <br> 1. Mandatory parameters are left unspecified. 2452 * <br> 2. Incorrect parameters types. 2453 * <br> 3. Parameter verification failed. 2454 * @throws { BusinessError } 100001 - Internal error. 2455 * @syscap SystemCapability.ArkUI.ArkUI.Full 2456 * @since 9 2457 */ 2458 /** 2459 * Displays the dialog box. 2460 * 2461 * @param { ActionMenuOptions } options - Options. 2462 * @returns { Promise<ActionMenuSuccessResponse> } the promise returned by the function. 2463 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2464 * <br> 1. Mandatory parameters are left unspecified. 2465 * <br> 2. Incorrect parameters types. 2466 * <br> 3. Parameter verification failed. 2467 * @throws { BusinessError } 100001 - Internal error. 2468 * @syscap SystemCapability.ArkUI.ArkUI.Full 2469 * @crossplatform 2470 * @since 10 2471 */ 2472 /** 2473 * Displays the dialog box. 2474 * 2475 * @param { ActionMenuOptions } options - Options. 2476 * @returns { Promise<ActionMenuSuccessResponse> } the promise returned by the function. 2477 * @throws { BusinessError } 401 - Parameter error. Possible causes: 2478 * <br> 1. Mandatory parameters are left unspecified. 2479 * <br> 2. Incorrect parameters types. 2480 * <br> 3. Parameter verification failed. 2481 * @throws { BusinessError } 100001 - Internal error. 2482 * @syscap SystemCapability.ArkUI.ArkUI.Full 2483 * @crossplatform 2484 * @atomicservice 2485 * @since 11 2486 * @deprecated since 18 2487 * @useinstead ohos.arkui.UIContext.PromptAction#showActionMenu 2488 */ 2489 function showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>; 2490} 2491 2492/** 2493 * Component dialog dismiss action. 2494 * 2495 * @interface DismissDialogAction 2496 * @syscap SystemCapability.ArkUI.ArkUI.Full 2497 * @crossplatform 2498 * @atomicservice 2499 * @since arkts {'1.1':'12','1.2':'20'} 2500 * @arkts 1.1&1.2 2501 */ 2502declare interface DismissDialogAction { 2503 /** 2504 * Defines dialog dismiss function. 2505 * 2506 * @type { Callback<void> } 2507 * @syscap SystemCapability.ArkUI.ArkUI.Full 2508 * @crossplatform 2509 * @atomicservice 2510 * @since arkts {'1.1':'12','1.2':'20'} 2511 * @arkts 1.1&1.2 2512 */ 2513 dismiss: Callback<void>; 2514 2515 /** 2516 * Dismiss reason type. 2517 * 2518 * @type { DismissReason } 2519 * @syscap SystemCapability.ArkUI.ArkUI.Full 2520 * @crossplatform 2521 * @atomicservice 2522 * @since arkts {'1.1':'12','1.2':'20'} 2523 * @arkts 1.1&1.2 2524 */ 2525 reason: DismissReason; 2526} 2527 2528export default promptAction; 2529