• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.2 */
22import { Resource } from '../../global/resource';
23import {
24  VoidCallback, ResourceStr, ResourceColor, Dimension, BorderRadiuses, LocalizedEdgeColors, EdgeColors,
25  EdgeWidths, LocalizedEdgeWidths, EdgeStyles, LocalizedBorderRadiuses
26} from './units';
27import { Callback, DismissReason, Rectangle, BlurStyle, TransitionEffect, ShadowOptions, HoverModeAreaType,
28  ShadowStyle, BackgroundBlurStyleOptions, BackgroundEffectOptions } from './common';
29import { DialogButtonStyle, BorderStyle } from './enums';
30import { DialogAlignment } from './alertDialog';
31import { LevelOrder, LevelMode, ImmersiveMode } from '../../@ohos.promptAction';
32/*** endif */
33
34/**
35 * The information of sheet.
36 *
37 * @interface SheetInfo
38 * @syscap SystemCapability.ArkUI.ArkUI.Full
39 * @since 8
40 */
41/**
42 * The information of sheet.
43 *
44 * @interface SheetInfo
45 * @syscap SystemCapability.ArkUI.ArkUI.Full
46 * @crossplatform
47 * @since 10
48 */
49/**
50 * The information of sheet.
51 *
52 * @interface SheetInfo
53 * @syscap SystemCapability.ArkUI.ArkUI.Full
54 * @crossplatform
55 * @atomicservice
56 * @since arkts {'1.1':'11','1.2':'20'}
57 * @arkts 1.1&1.2
58 */
59interface SheetInfo {
60  /**
61   * Title Properties
62   *
63   * @type { string | Resource }
64   * @syscap SystemCapability.ArkUI.ArkUI.Full
65   * @since 8
66   */
67  /**
68   * Title Properties
69   *
70   * @type { string | Resource }
71   * @syscap SystemCapability.ArkUI.ArkUI.Full
72   * @crossplatform
73   * @since 10
74   */
75  /**
76   * Sheet text.
77   *
78   * @type { string | Resource }
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @crossplatform
81   * @atomicservice
82   * @since arkts {'1.1':'11','1.2':'20'}
83   * @arkts 1.1&1.2
84   */
85  title: string | Resource;
86
87  /**
88   * Icon Properties.
89   *
90   * @type { ?(string | Resource) }
91   * @syscap SystemCapability.ArkUI.ArkUI.Full
92   * @since 8
93   */
94  /**
95   * Icon Properties.
96   *
97   * @type { ?(string | Resource) }
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @crossplatform
100   * @since 10
101   */
102  /**
103   * Sheet icon. By default, no icon is displayed.
104   *
105   * @type { ?(string | Resource) }
106   * @syscap SystemCapability.ArkUI.ArkUI.Full
107   * @crossplatform
108   * @atomicservice
109   * @since arkts {'1.1':'11','1.2':'20'}
110   * @arkts 1.1&1.2
111   */
112  icon?: string | Resource;
113
114  /**
115   * Callback method after the operation.
116   *
117   * @type { function }
118   * @syscap SystemCapability.ArkUI.ArkUI.Full
119   * @since 8
120   */
121  /**
122   * Callback method after the operation.
123   *
124   * @type { function }
125   * @syscap SystemCapability.ArkUI.ArkUI.Full
126   * @crossplatform
127   * @since 10
128   */
129  /**
130   * Callback method after the operation.
131   *
132   * @type { function }
133   * @syscap SystemCapability.ArkUI.ArkUI.Full
134   * @crossplatform
135   * @atomicservice
136   * @since 11
137   */
138  /**
139   * Callback when the sheet is selected.
140   * Anonymous Object Rectification.
141   *
142   * @type { VoidCallback }
143   * @syscap SystemCapability.ArkUI.ArkUI.Full
144   * @crossplatform
145   * @atomicservice
146   * @since arkts {'1.1':'18','1.2':'20'}
147   * @arkts 1.1&1.2
148   */
149  action: VoidCallback;
150}
151
152/**
153 * Provides information about the action to dismiss the dialog box.
154 *
155 * @interface DismissDialogAction
156 * @syscap SystemCapability.ArkUI.ArkUI.Full
157 * @crossplatform
158 * @atomicservice
159 * @since arkts {'1.1':'12','1.2':'20'}
160 * @arkts 1.1&1.2
161 */
162declare interface DismissDialogAction {
163  /**
164   * Callback for dismissing the dialog box. This API is called only when the dialog box needs to be exited.
165   *
166   * @type { Callback<void> }
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @crossplatform
169   * @atomicservice
170   * @since arkts {'1.1':'12','1.2':'20'}
171   * @arkts 1.1&1.2
172   */
173  dismiss: Callback<void>;
174
175  /**
176   * Dismiss reason type.
177   *
178   * @type { DismissReason }
179   * @syscap SystemCapability.ArkUI.ArkUI.Full
180   * @crossplatform
181   * @atomicservice
182   * @since arkts {'1.1':'12','1.2':'20'}
183   * @arkts 1.1&1.2
184   */
185  reason: DismissReason;
186}
187
188/**
189 * Base button params used for ActionSheet.
190 *
191 * @interface ActionSheetButtonOptions
192 * @syscap SystemCapability.ArkUI.ArkUI.Full
193 * @crossplatform
194 * @atomicservice
195 * @since arkts {'1.1':'18','1.2':'20'}
196 * @arkts 1.1&1.2
197 */
198interface ActionSheetButtonOptions {
199  /**
200   * Enable switch of confirmation button
201   * @type { ?boolean }
202   * @default true
203   * @syscap SystemCapability.ArkUI.ArkUI.Full
204   * @crossplatform
205   * @since 10
206   */
207  /**
208   * Enable switch of confirmation button
209   * @type { ?boolean }
210   * @default true
211   * @syscap SystemCapability.ArkUI.ArkUI.Full
212   * @crossplatform
213   * @atomicservice
214   * @since 11
215   */
216  /**
217   * Whether to respond when the button is clicked. The value true means to respond when the button is clicked,
218   * and false means the opposite.
219   * Anonymous Object Rectification.
220   *
221   * @type { ?boolean }
222   * @default true
223   * @syscap SystemCapability.ArkUI.ArkUI.Full
224   * @crossplatform
225   * @atomicservice
226   * @since arkts {'1.1':'18','1.2':'20'}
227   * @arkts 1.1&1.2
228   */
229  enabled?: boolean;
230
231  /**
232   * Default focus switch of confirmation button
233   * @type { ?boolean }
234   * @default false
235   * @syscap SystemCapability.ArkUI.ArkUI.Full
236   * @crossplatform
237   * @since 10
238   */
239  /**
240   * Default focus switch of confirmation button
241   * @type { ?boolean }
242   * @default false
243   * @syscap SystemCapability.ArkUI.ArkUI.Full
244   * @crossplatform
245   * @atomicservice
246   * @since 11
247   */
248  /**
249   * Whether the button is the default focus. The value true means that the button is the default focus,
250   * and false means the opposite.
251   * Anonymous Object Rectification.
252   *
253   * @type { ?boolean }
254   * @default false
255   * @syscap SystemCapability.ArkUI.ArkUI.Full
256   * @crossplatform
257   * @atomicservice
258   * @since arkts {'1.1':'18','1.2':'20'}
259   * @arkts 1.1&1.2
260   */
261  defaultFocus?: boolean;
262
263  /**
264   * Style of confirmation button.
265   * @type { ?DialogButtonStyle }
266   * @default DialogButtonStyle.DEFAULT
267   * @syscap SystemCapability.ArkUI.ArkUI.Full
268   * @crossplatform
269   * @since 10
270   */
271  /**
272   * Style of confirmation button.
273   * @type { ?DialogButtonStyle }
274   * @default DialogButtonStyle.DEFAULT
275   * @syscap SystemCapability.ArkUI.ArkUI.Full
276   * @crossplatform
277   * @atomicservice
278   * @since 11
279   */
280  /**
281   * Button style.
282   * Anonymous Object Rectification.
283   *
284   * @type { ?DialogButtonStyle }
285   * @default DialogButtonStyle.DEFAULT
286   * @syscap SystemCapability.ArkUI.ArkUI.Full
287   * @crossplatform
288   * @atomicservice
289   * @since arkts {'1.1':'18','1.2':'20'}
290   * @arkts 1.1&1.2
291   */
292  style?: DialogButtonStyle;
293
294  /**
295   * Text content of the confirmation button.
296   *
297   * @type { string | Resource }
298   * @syscap SystemCapability.ArkUI.ArkUI.Full
299   * @since 8
300   */
301  /**
302   * Text content of the confirmation button.
303   *
304   * @type { string | Resource }
305   * @syscap SystemCapability.ArkUI.ArkUI.Full
306   * @crossplatform
307   * @since 10
308   */
309  /**
310   * Text content of the confirmation button.
311   *
312   * @type { string | Resource }
313   * @syscap SystemCapability.ArkUI.ArkUI.Full
314   * @crossplatform
315   * @atomicservice
316   * @since 11
317   */
318  /**
319   * Button text.
320   * Anonymous Object Rectification.
321   *
322   * @type { string | Resource }
323   * @syscap SystemCapability.ArkUI.ArkUI.Full
324   * @crossplatform
325   * @atomicservice
326   * @since arkts {'1.1':'18','1.2':'20'}
327   * @arkts 1.1&1.2
328   */
329  value: string | Resource;
330
331  /**
332   * Method executed by the callback.
333   *
334   * @type { function }
335   * @syscap SystemCapability.ArkUI.ArkUI.Full
336   * @since 8
337   */
338  /**
339   * Method executed by the callback.
340   *
341   * @type { function }
342   * @syscap SystemCapability.ArkUI.ArkUI.Full
343   * @crossplatform
344   * @since 10
345   */
346  /**
347   * Method executed by the callback.
348   *
349   * @type { function }
350   * @syscap SystemCapability.ArkUI.ArkUI.Full
351   * @crossplatform
352   * @atomicservice
353   * @since 11
354   */
355  /**
356   * Callback invoked when the button is selected.
357   * Anonymous Object Rectification.
358   *
359   * @type { VoidCallback }
360   * @syscap SystemCapability.ArkUI.ArkUI.Full
361   * @crossplatform
362   * @atomicservice
363   * @since arkts {'1.1':'18','1.2':'20'}
364   * @arkts 1.1&1.2
365   */
366  action: VoidCallback;
367}
368
369/**
370 * ActionSheet offset.
371 *
372 * @interface ActionSheetOffset
373 * @syscap SystemCapability.ArkUI.ArkUI.Full
374 * @crossplatform
375 * @atomicservice
376 * @since arkts {'1.1':'18','1.2':'20'}
377 * @arkts 1.1&1.2
378 */
379interface ActionSheetOffset {
380  /**
381   * Offset of the action sheet along the x-axis relative to the alignment position.
382   * Anonymous Object Rectification.
383   *
384   * @type { number | string | Resource }
385   * @syscap SystemCapability.ArkUI.ArkUI.Full
386   * @crossplatform
387   * @atomicservice
388   * @since arkts {'1.1':'18','1.2':'20'}
389   * @arkts 1.1&1.2
390   */
391  dx: number | string | Resource;
392  /**
393   * Offset of the action sheet along the y-axis relative to the alignment position.
394   * Anonymous Object Rectification.
395   *
396   * @type { number | string | Resource }
397   * @syscap SystemCapability.ArkUI.ArkUI.Full
398   * @crossplatform
399   * @atomicservice
400   * @since arkts {'1.1':'18','1.2':'20'}
401   * @arkts 1.1&1.2
402   */
403  dy: number | string | Resource;
404}
405
406/**
407 * Import the LevelMode type from promptAction.
408 *
409 * @typedef { import('../api/@ohos.promptAction').LevelMode } LevelMode
410 * @syscap SystemCapability.ArkUI.ArkUI.Full
411 * @crossplatform
412 * @atomicservice
413 * @since 15
414 */
415declare type LevelMode = import('../api/@ohos.promptAction').LevelMode;
416
417/**
418 * Import the ImmersiveMode type from promptAction.
419 *
420 * @typedef { import('../api/@ohos.promptAction').ImmersiveMode } ImmersiveMode
421 * @syscap SystemCapability.ArkUI.ArkUI.Full
422 * @crossplatform
423 * @atomicservice
424 * @since 15
425 */
426declare type ImmersiveMode = import('../api/@ohos.promptAction').ImmersiveMode;
427
428/**
429 * The options of ActionSheet.
430 *
431 * @interface ActionSheetOptions
432 * @syscap SystemCapability.ArkUI.ArkUI.Full
433 * @since 8
434 */
435/**
436 * The options of ActionSheet.
437 *
438 * @interface ActionSheetOptions
439 * @syscap SystemCapability.ArkUI.ArkUI.Full
440 * @crossplatform
441 * @since 10
442 */
443/**
444 * The options of ActionSheet.
445 *
446 * @interface ActionSheetOptions
447 * @syscap SystemCapability.ArkUI.ArkUI.Full
448 * @crossplatform
449 * @atomicservice
450 * @since arkts {'1.1':'11','1.2':'20'}
451 * @arkts 1.1&1.2
452 */
453interface ActionSheetOptions
454{
455  /**
456   * Title Properties
457   *
458   * @type { string | Resource }
459   * @syscap SystemCapability.ArkUI.ArkUI.Full
460   * @since 8
461   */
462  /**
463   * Title Properties
464   *
465   * @type { string | Resource }
466   * @syscap SystemCapability.ArkUI.ArkUI.Full
467   * @crossplatform
468   * @since 10
469   */
470  /**
471   * Title of the dialog box.
472   *
473   * @type { string | Resource }
474   * @syscap SystemCapability.ArkUI.ArkUI.Full
475   * @crossplatform
476   * @atomicservice
477   * @since arkts {'1.1':'11','1.2':'20'}
478   * @arkts 1.1&1.2
479   */
480  title: string | Resource;
481
482  /**
483   * Subtitle Properties
484   * @type { ?ResourceStr }
485   * @syscap SystemCapability.ArkUI.ArkUI.Full
486   * @crossplatform
487   * @since 10
488   */
489  /**
490   * Subtitle of the dialog box.
491   * @type { ?ResourceStr }
492   * @syscap SystemCapability.ArkUI.ArkUI.Full
493   * @crossplatform
494   * @atomicservice
495   * @since arkts {'1.1':'11','1.2':'20'}
496   * @arkts 1.1&1.2
497   */
498  subtitle?: ResourceStr;
499
500  /**
501   * message Properties
502   *
503   * @type { string | Resource }
504   * @syscap SystemCapability.ArkUI.ArkUI.Full
505   * @since 8
506   */
507  /**
508   * message Properties
509   *
510   * @type { string | Resource }
511   * @syscap SystemCapability.ArkUI.ArkUI.Full
512   * @crossplatform
513   * @since 10
514   */
515  /**
516   * Content of the dialog box.
517   *
518   * @type { string | Resource }
519   * @syscap SystemCapability.ArkUI.ArkUI.Full
520   * @crossplatform
521   * @atomicservice
522   * @since arkts {'1.1':'11','1.2':'20'}
523   * @arkts 1.1&1.2
524   */
525  message: string | Resource;
526
527  /**
528   * Invoke the commit function.
529   *
530   * @type { ?object }
531   * @syscap SystemCapability.ArkUI.ArkUI.Full
532   * @since 8
533   */
534  /**
535   * Invoke the commit function.
536   *
537   * @type { ?object }
538   * @syscap SystemCapability.ArkUI.ArkUI.Full
539   * @crossplatform
540   * @since 10
541   */
542  /**
543   * Invoke the commit function.
544   *
545   * @type { ?object }
546   * @syscap SystemCapability.ArkUI.ArkUI.Full
547   * @crossplatform
548   * @atomicservice
549   * @since 11
550   */
551  /**
552   * Information about the confirm button. When the dialog box has focus and focus has not been shifted using the Tab
553   * key, the button responds to the Enter key by default, and multiple dialog boxes can gain focus consecutively
554   * to respond automatically. The default response to the Enter key does not work when defaultFocus is set to true.
555   *
556   * @type { ?ActionSheetButtonOptions }
557   * @syscap SystemCapability.ArkUI.ArkUI.Full
558   * @crossplatform
559   * @atomicservice
560   * @since arkts {'1.1':'18','1.2':'20'}
561   * @arkts 1.1&1.2
562   */
563  confirm?: ActionSheetButtonOptions;
564
565  /**
566   * Execute Cancel Function.
567   *
568   * @type { ?function }
569   * @syscap SystemCapability.ArkUI.ArkUI.Full
570   * @since 8
571   */
572  /**
573   * Execute Cancel Function.
574   *
575   * @type { ?function }
576   * @syscap SystemCapability.ArkUI.ArkUI.Full
577   * @crossplatform
578   * @since 10
579   */
580  /**
581   * Execute Cancel Function.
582   *
583   * @type { ?function }
584   * @syscap SystemCapability.ArkUI.ArkUI.Full
585   * @crossplatform
586   * @atomicservice
587   * @since 11
588   */
589  /**
590   * Callback invoked when the dialog box is closed after the overlay is clicked.
591   * Anonymous Object Rectification.
592   *
593   * @type { ?VoidCallback }
594   * @syscap SystemCapability.ArkUI.ArkUI.Full
595   * @crossplatform
596   * @atomicservice
597   * @since arkts {'1.1':'18','1.2':'20'}
598   * @arkts 1.1&1.2
599   */
600  cancel?: VoidCallback;
601
602  /**
603   * The Array of sheets
604   *
605   * @type { Array<SheetInfo> }
606   * @syscap SystemCapability.ArkUI.ArkUI.Full
607   * @since 8
608   */
609  /**
610   * The Array of sheets
611   *
612   * @type { Array<SheetInfo> }
613   * @syscap SystemCapability.ArkUI.ArkUI.Full
614   * @crossplatform
615   * @since 10
616   */
617  /**
618   * Options in the dialog box. Each option supports the image, text, and callback.
619   *
620   * @type { Array<SheetInfo> }
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  sheets: Array<SheetInfo>;
628
629  /**
630   * Allows users to click the mask layer to exit.
631   *
632   * @type { ?boolean }
633   * @syscap SystemCapability.ArkUI.ArkUI.Full
634   * @since 8
635   */
636  /**
637   * Allows users to click the mask layer to exit.
638   *
639   * @type { ?boolean }
640   * @syscap SystemCapability.ArkUI.ArkUI.Full
641   * @crossplatform
642   * @since 10
643   */
644  /**
645   * Whether to close the dialog box when the overlay is clicked.
646   *
647   * @type { ?boolean }
648   * @default true - The value true means to close the dialog box when the overlay is clicked, and false means
649   * the opposite.
650   * @syscap SystemCapability.ArkUI.ArkUI.Full
651   * @crossplatform
652   * @atomicservice
653   * @since arkts {'1.1':'11','1.2':'20'}
654   * @arkts 1.1&1.2
655   */
656  autoCancel?: boolean;
657
658  /**
659   * Alignment in the vertical direction.
660   *
661   * @type { ?DialogAlignment }
662   * @syscap SystemCapability.ArkUI.ArkUI.Full
663   * @since 8
664   */
665  /**
666   * Alignment in the vertical direction.
667   *
668   * @type { ?DialogAlignment }
669   * @syscap SystemCapability.ArkUI.ArkUI.Full
670   * @crossplatform
671   * @since 10
672   */
673  /**
674   * Alignment mode of the dialog box in the vertical direction.
675   * <p><strong>NOTE</strong>:
676   * <br>If showInSubWindow is set to true in UIExtension, the dialog box is aligned with the host window based
677   * on UIExtension.
678   * </p>
679   *
680   * @type { ?DialogAlignment }
681   * @default DialogAlignment.Bottom
682   * @syscap SystemCapability.ArkUI.ArkUI.Full
683   * @crossplatform
684   * @atomicservice
685   * @since arkts {'1.1':'11','1.2':'20'}
686   * @arkts 1.1&1.2
687   */
688  alignment?: DialogAlignment;
689
690  /**
691   * Offset of the pop-up window relative to the alignment position.
692   *
693   * @type { ?object }
694   * @syscap SystemCapability.ArkUI.ArkUI.Full
695   * @since 8
696   */
697  /**
698   * Offset of the pop-up window relative to the alignment position.
699   *
700   * @type { ?object }
701   * @syscap SystemCapability.ArkUI.ArkUI.Full
702   * @crossplatform
703   * @since 10
704   */
705  /**
706   * Offset of the pop-up window relative to the alignment position.
707   *
708   * @type { ?object }
709   * @syscap SystemCapability.ArkUI.ArkUI.Full
710   * @crossplatform
711   * @atomicservice
712   * @since 11
713   */
714  /**
715   * Offset of the dialog box relative to the alignment position.
716   * <br>When alignment is set to Top, TopStart, or TopEnd: {dx: 0,dy: "40vp"}
717   * <br>When alignment is set to any other value: {dx: 0,dy: "-40vp"}
718   *
719   * @type { ?ActionSheetOffset }
720   * @syscap SystemCapability.ArkUI.ArkUI.Full
721   * @crossplatform
722   * @atomicservice
723   * @since arkts {'1.1':'18','1.2':'20'}
724   * @arkts 1.1&1.2
725   */
726  offset?: ActionSheetOffset;
727
728  /**
729   * Mask Region of dialog. The size cannot exceed the main window.
730   *
731   * @type { ?Rectangle }
732   * @syscap SystemCapability.ArkUI.ArkUI.Full
733   * @crossplatform
734   * @since 10
735   */
736  /**
737   * Mask area of the dialog box. Events outside the mask area are transparently transmitted,
738   * and events within the mask area are not.
739   * <p><strong>NOTE</strong>:
740   * <br>maskRect does not take effect when showInSubWindow is set to true.
741   * </p>
742   *
743   * @type { ?Rectangle }
744   * @default - {x:0,y:0, width:'100%', height:'100%'}
745   * @syscap SystemCapability.ArkUI.ArkUI.Full
746   * @crossplatform
747   * @atomicservice
748   * @since arkts {'1.1':'11','1.2':'20'}
749   * @arkts 1.1&1.2
750   */
751  maskRect?: Rectangle;
752
753  /**
754   * Whether to display in the sub window.
755   *
756   * @type { ?boolean }
757   * @default false
758   * @syscap SystemCapability.ArkUI.ArkUI.Full
759   * @crossplatform
760   * @since 11
761   */
762  /**
763   * Whether to show the dialog box in a subwindow when the dialog box needs to be displayed outside the main window.
764   * <p><strong>NOTE</strong>:
765   * <br>A dialog box whose showInSubWindow attribute is true cannot trigger the display of another dialog box whose
766   * showInSubWindow attribute is also true.
767   * </p>
768   *
769   * @type { ?boolean }
770   * @default false
771   * @syscap SystemCapability.ArkUI.ArkUI.Full
772   * @crossplatform
773   * @atomicservice
774   * @since arkts {'1.1':'12','1.2':'20'}
775   * @arkts 1.1&1.2
776   */
777  showInSubWindow?: boolean;
778
779  /**
780   * Whether it is a modal dialog
781   * @type { ?boolean }
782   * @default true
783   * @syscap SystemCapability.ArkUI.ArkUI.Full
784   * @crossplatform
785   * @since 11
786   */
787  /**
788   * Whether the dialog box is a modal. A modal dialog box has a mask applied, while a non-modal dialog box does not.
789   * @type { ?boolean }
790   * @default true
791   * @syscap SystemCapability.ArkUI.ArkUI.Full
792   * @crossplatform
793   * @atomicservice
794   * @since arkts {'1.1':'12','1.2':'20'}
795   * @arkts 1.1&1.2
796   */
797  isModal?: boolean;
798
799  /**
800   * Defines the actionSheet's background color
801   *
802   * @type { ?ResourceColor }
803   * @default Color.Transparent
804   * @syscap SystemCapability.ArkUI.ArkUI.Full
805   * @crossplatform
806   * @since 11
807   */
808  /**
809   * Background color of the dialog box.
810   * <p><strong>NOTE</strong>:
811   * <br>When backgroundColor is set to a non-transparent color, backgroundBlurStyle must be set to BlurStyle.NONE;
812   * otherwise, the color display may not meet the expected effect.
813   * </p>
814   *
815   * @type { ?ResourceColor }
816   * @default Color.Transparent
817   * @syscap SystemCapability.ArkUI.ArkUI.Full
818   * @crossplatform
819   * @atomicservice
820   * @since arkts {'1.1':'12','1.2':'20'}
821   * @arkts 1.1&1.2
822   */
823  backgroundColor?: ResourceColor;
824
825  /**
826   * Defines the actionSheet's background blur Style
827   *
828   * @type { ?BlurStyle }
829   * @default BlurStyle.COMPONENT_ULTRA_THICK
830   * @syscap SystemCapability.ArkUI.ArkUI.Full
831   * @crossplatform
832   * @since 11
833   */
834  /**
835   * Background blur style of the dialog box.
836   * <p><strong>NOTE</strong>:
837   * <br>Setting this parameter to BlurStyle.NONE disables the background blur. When backgroundBlurStyle is set to a
838   * value other than NONE, do not set backgroundColor. If you do, the color display may not produce the expected
839   * visual effect.
840   * </p>
841   *
842   * @type { ?BlurStyle }
843   * @default BlurStyle.COMPONENT_ULTRA_THICK
844   * @syscap SystemCapability.ArkUI.ArkUI.Full
845   * @crossplatform
846   * @atomicservice
847   * @since arkts {'1.1':'12','1.2':'20'}
848   * @arkts 1.1&1.2
849   */
850  backgroundBlurStyle?: BlurStyle;
851
852  /**
853   * Defines the actionSheet's background blur style with options
854   *
855   * @type { ?BackgroundBlurStyleOptions }
856   * @syscap SystemCapability.ArkUI.ArkUI.Full
857   * @crossplatform
858   * @atomicservice
859   * @since arkts {'1.1':'19','1.2':'20'}
860   * @arkts 1.1&1.2
861   */
862  backgroundBlurStyleOptions?: BackgroundBlurStyleOptions;
863
864  /**
865   * Defines the actionSheet's background effect with options
866   *
867   * @type { ?BackgroundEffectOptions }
868   * @syscap SystemCapability.ArkUI.ArkUI.Full
869   * @crossplatform
870   * @atomicservice
871   * @since arkts {'1.1':'19','1.2':'20'}
872   * @arkts 1.1&1.2
873   */
874  backgroundEffect?: BackgroundEffectOptions;
875
876  /**
877   * Callback for interactive closure of the dialog box.
878   * <p><strong>NOTE</strong>:
879   * 1. If this callback is registered, the dialog box will not be closed immediately after the user touches the
880   * mask or the Back button, presses the Esc key, or swipes left or right on the screen. The reason parameter in
881   * the callback is used to determine whether the dialog box can be closed. The reason returned by the component
882   * does not support the value CLOSE_BUTTON.
883   * 2. In the onWillDismiss callback, another onWillDismiss callback is not allowed.
884   * </p>
885   *
886   * @type { ?Callback<DismissDialogAction> }
887   * @syscap SystemCapability.ArkUI.ArkUI.Full
888   * @crossplatform
889   * @atomicservice
890   * @since arkts {'1.1':'12','1.2':'20'}
891   * @arkts 1.1&1.2
892   */
893  onWillDismiss?: Callback<DismissDialogAction>;
894
895  /**
896   * Transition effect for the entrance and exit of the dialog box.
897   * <p><strong>NOTE</strong>:
898   * 1. If this parameter is not set, the default effect is used.
899   * 2. Touching the Back button during the entrance animation pauses the entrance animation and starts the exit
900   * animation. The final effect is one obtained after the curves of the entrance and exit animations are combined.
901   * 3. Touching the Back button during the exit animation does not affect the animation playback. Touching the
902   * Back button again closes the application.
903   * </p>
904   *
905   * @type { ?TransitionEffect }
906   * @syscap SystemCapability.ArkUI.ArkUI.Full
907   * @crossplatform
908   * @atomicservice
909   * @since arkts {'1.1':'12','1.2':'20'}
910   * @arkts 1.1&1.2
911   */
912  transition?: TransitionEffect;
913
914  /**
915   * Corner radius of the background. You can set the radius for each of the four corners individually.
916   *
917   * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) }
918   * @default - {topLeft:'32vp', topRight:'32vp', bottomLeft:'32vp', bottomRight:'32vp'}, The corner radius is subject
919   * to the component size, with the maximum value being half of the component width or height. If the value is
920   * negative, the default value is used. When set to a percentage, the value defines the radius as a percentage of the
921   * parent component's width or height.
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  cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses;
929
930  /**
931   * Width of the dialog box.
932   *
933   * @type { ?Dimension }
934   * @default - Default maximum width of the dialog box: 400 vp,
935   * When this parameter is set to a percentage, the reference width of the dialog box is the width of the window
936   * where the dialog box is located. You can decrease or increase the width as needed.
937   * @syscap SystemCapability.ArkUI.ArkUI.Full
938   * @crossplatform
939   * @atomicservice
940   * @since arkts {'1.1':'12','1.2':'20'}
941   * @arkts 1.1&1.2
942   */
943  width?: Dimension;
944
945  /**
946   * Height of the dialog box.
947   *
948   * @type { ?Dimension }
949   * @default - Default maximum height of the dialog box: 0.9 x (Window height – Safe area)
950   * <br>When this parameter is set to a percentage, the reference height of the dialog box is the height of the
951   * window where the dialog box is located minus the safe area. You can decrease or increase the height as needed.
952   * @syscap SystemCapability.ArkUI.ArkUI.Full
953   * @crossplatform
954   * @atomicservice
955   * @since arkts {'1.1':'12','1.2':'20'}
956   * @arkts 1.1&1.2
957   */
958  height?: Dimension;
959
960  /**
961   * Border width of the dialog box.
962   * You can set the width for all four sides or set separate widths for individual sides.
963   *
964   * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) }
965   * @default 0 - When set to a percentage, the value defines the border width as a percentage of the parent dialog
966   * box's width. If the left and right borders are greater than its width, or the top and bottom borders are greater
967   * than its height, the dialog box may not display as expected.
968   * @syscap SystemCapability.ArkUI.ArkUI.Full
969   * @crossplatform
970   * @atomicservice
971   * @since arkts {'1.1':'12','1.2':'20'}
972   * @arkts 1.1&1.2
973   */
974  borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths;
975
976  /**
977   * Border color of the dialog box.
978   * <p><strong>NOTE</strong>:
979   * <br>When borderColor is of type LocalizedEdgeColors, the layout order can be dynamically adjusted based on the
980   * user's language settings.
981   * </p>
982   *
983   * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) }
984   * @default Color.Black - borderColor must be used with borderWidth in pairs.
985   * @syscap SystemCapability.ArkUI.ArkUI.Full
986   * @crossplatform
987   * @atomicservice
988   * @since arkts {'1.1':'12','1.2':'20'}
989   * @arkts 1.1&1.2
990   */
991  borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors;
992
993  /**
994   * Border style of the dialog box.
995   *
996   * @type { ?(BorderStyle | EdgeStyles) }
997   * @default BorderStyle.Solid - borderStyle must be used with borderWidth in pairs.
998   * @syscap SystemCapability.ArkUI.ArkUI.Full
999   * @crossplatform
1000   * @atomicservice
1001   * @since arkts {'1.1':'12','1.2':'20'}
1002   * @arkts 1.1&1.2
1003   */
1004  borderStyle?: BorderStyle | EdgeStyles;
1005
1006  /**
1007   * Shadow of the dialog box.
1008   *
1009   * @type { ?(ShadowOptions | ShadowStyle) }
1010   * @default - Default value on 2-in-1 devices: ShadowStyle.OUTER_FLOATING_MD when the dialog box is focused and
1011   * ShadowStyle.OUTER_FLOATING_SM otherwise.
1012   * @syscap SystemCapability.ArkUI.ArkUI.Full
1013   * @crossplatform
1014   * @atomicservice
1015   * @since arkts {'1.1':'12','1.2':'20'}
1016   * @arkts 1.1&1.2
1017   */
1018  shadow?: ShadowOptions | ShadowStyle;
1019
1020  /**
1021   * Whether to enable the hover mode.
1022   *
1023   * @type { ?boolean }
1024   * @default false - meaning not to enable the hover mode.
1025   * @syscap SystemCapability.ArkUI.ArkUI.Full
1026   * @crossplatform
1027   * @atomicservice
1028   * @since arkts {'1.1':'14','1.2':'20'}
1029   * @arkts 1.1&1.2
1030   */
1031  enableHoverMode?: boolean;
1032
1033  /**
1034   * Display area of the dialog box in hover mode.
1035   *
1036   * @type { ?HoverModeAreaType }
1037   * @default HoverModeAreaType.BOTTOM_SCREEN
1038   * @syscap SystemCapability.ArkUI.ArkUI.Full
1039   * @crossplatform
1040   * @atomicservice
1041   * @since arkts {'1.1':'14','1.2':'20'}
1042   * @arkts 1.1&1.2
1043   */
1044  hoverModeArea?: HoverModeAreaType;
1045
1046  /**
1047   * Callback function when the dialog appears.
1048   *
1049   * @type { ?Callback<void> }
1050   * @syscap SystemCapability.ArkUI.ArkUI.Full
1051   * @crossplatform
1052   * @atomicservice
1053   * @since arkts {'1.1':'19','1.2':'20'}
1054   * @arkts 1.1&1.2
1055   */
1056  onDidAppear?: Callback<void>;
1057
1058  /**
1059   * Callback function when the dialog disappears.
1060   *
1061   * @type { ?Callback<void> }
1062   * @syscap SystemCapability.ArkUI.ArkUI.Full
1063   * @crossplatform
1064   * @atomicservice
1065   * @since arkts {'1.1':'19','1.2':'20'}
1066   * @arkts 1.1&1.2
1067   */
1068  onDidDisappear?: Callback<void>;
1069
1070  /**
1071   * Callback function before the dialog openAnimation starts.
1072   *
1073   * @type { ?Callback<void> }
1074   * @syscap SystemCapability.ArkUI.ArkUI.Full
1075   * @crossplatform
1076   * @atomicservice
1077   * @since arkts {'1.1':'19','1.2':'20'}
1078   * @arkts 1.1&1.2
1079   */
1080  onWillAppear?: Callback<void>;
1081
1082  /**
1083   * Callback function before the dialog closeAnimation starts.
1084   *
1085   * @type { ?Callback<void> }
1086   * @syscap SystemCapability.ArkUI.ArkUI.Full
1087   * @crossplatform
1088   * @atomicservice
1089   * @since arkts {'1.1':'19','1.2':'20'}
1090   * @arkts 1.1&1.2
1091   */
1092  onWillDisappear?: Callback<void>;
1093
1094  /**
1095   * Display level of the dialog box.
1096   *
1097   * @type { ?LevelMode }
1098   * @default LevelMode.OVERLAY - This parameter takes effect only when showInSubWindow is set to false.
1099   * @syscap SystemCapability.ArkUI.ArkUI.Full
1100   * @crossplatform
1101   * @atomicservice
1102   * @since arkts {'1.1':'15','1.2':'20'}
1103   * @arkts 1.1&1.2
1104   */
1105  levelMode?: LevelMode;
1106
1107  /**
1108   * Unique ID of the node under the display level for the page-level dialog box.
1109   * <p><strong>NOTE</strong>:
1110   * <br>This parameter takes effect only when levelMode is set to LevelMode.EMBEDDED.
1111   * </p>
1112   *
1113   * @type { ?number }
1114   * @syscap SystemCapability.ArkUI.ArkUI.Full
1115   * @crossplatform
1116   * @atomicservice
1117   * @since arkts {'1.1':'15','1.2':'20'}
1118   * @arkts 1.1&1.2
1119   */
1120  levelUniqueId?: number;
1121
1122  /**
1123   * Overlay effect for the page-level dialog box.
1124   *
1125   * @type { ?ImmersiveMode }
1126   * @default ImmersiveMode.DEFAULT - This parameter takes effect only when levelMode is set to LevelMode.EMBEDDED.
1127   * @syscap SystemCapability.ArkUI.ArkUI.Full
1128   * @crossplatform
1129   * @atomicservice
1130   * @since arkts {'1.1':'15','1.2':'20'}
1131   * @arkts 1.1&1.2
1132   */
1133  immersiveMode?: ImmersiveMode;
1134
1135  /**
1136   * Determine the display order of the dialog.
1137   *
1138   * @type { ?LevelOrder }
1139   * @default The value returns by LevelOrder.clamp(0)
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  levelOrder?: LevelOrder;
1147}
1148
1149/**
1150 * Declare the ActionSheet
1151 *
1152 * @syscap SystemCapability.ArkUI.ArkUI.Full
1153 * @since 8
1154 */
1155/**
1156 * Declare the ActionSheet
1157 *
1158 * @syscap SystemCapability.ArkUI.ArkUI.Full
1159 * @crossplatform
1160 * @since 10
1161 */
1162/**
1163 * Declare the ActionSheet
1164 *
1165 * @syscap SystemCapability.ArkUI.ArkUI.Full
1166 * @crossplatform
1167 * @atomicservice
1168 * @since 11
1169 */
1170declare class ActionSheet {
1171  /**
1172   * Invoking method display.
1173   *
1174   * @param { ActionSheetOptions } value
1175   * @syscap SystemCapability.ArkUI.ArkUI.Full
1176   * @since 8
1177   */
1178  /**
1179   * Invoking method display.
1180   *
1181   * @param { ActionSheetOptions } value
1182   * @syscap SystemCapability.ArkUI.ArkUI.Full
1183   * @crossplatform
1184   * @since 10
1185   */
1186  /**
1187   * Invoking method display.
1188   *
1189   * @param { ActionSheetOptions } value
1190   * @syscap SystemCapability.ArkUI.ArkUI.Full
1191   * @crossplatform
1192   * @atomicservice
1193   * @since 11
1194   * @deprecated since 18
1195   * @useinstead ohos.arkui.UIContext.UIContext#showActionSheet
1196   */
1197  static show(value: ActionSheetOptions);
1198}
1199