• 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/**
22 * The information of sheet.
23 *
24 * @interface SheetInfo
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @since 8
27 */
28/**
29 * The information of sheet.
30 *
31 * @interface SheetInfo
32 * @syscap SystemCapability.ArkUI.ArkUI.Full
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * The information of sheet.
38 *
39 * @interface SheetInfo
40 * @syscap SystemCapability.ArkUI.ArkUI.Full
41 * @crossplatform
42 * @atomicservice
43 * @since 11
44 */
45interface SheetInfo {
46  /**
47   * Title Properties
48   *
49   * @type { string | Resource }
50   * @syscap SystemCapability.ArkUI.ArkUI.Full
51   * @since 8
52   */
53  /**
54   * Title Properties
55   *
56   * @type { string | Resource }
57   * @syscap SystemCapability.ArkUI.ArkUI.Full
58   * @crossplatform
59   * @since 10
60   */
61  /**
62   * Title Properties
63   *
64   * @type { string | Resource }
65   * @syscap SystemCapability.ArkUI.ArkUI.Full
66   * @crossplatform
67   * @atomicservice
68   * @since 11
69   */
70  title: string | Resource;
71
72  /**
73   * Icon Properties.
74   *
75   * @type { ?(string | Resource) }
76   * @syscap SystemCapability.ArkUI.ArkUI.Full
77   * @since 8
78   */
79  /**
80   * Icon Properties.
81   *
82   * @type { ?(string | Resource) }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @crossplatform
85   * @since 10
86   */
87  /**
88   * Icon Properties.
89   *
90   * @type { ?(string | Resource) }
91   * @syscap SystemCapability.ArkUI.ArkUI.Full
92   * @crossplatform
93   * @atomicservice
94   * @since 11
95   */
96  icon?: string | Resource;
97
98  /**
99   * Callback method after the operation.
100   *
101   * @type { function }
102   * @syscap SystemCapability.ArkUI.ArkUI.Full
103   * @since 8
104   */
105  /**
106   * Callback method after the operation.
107   *
108   * @type { function }
109   * @syscap SystemCapability.ArkUI.ArkUI.Full
110   * @crossplatform
111   * @since 10
112   */
113  /**
114   * Callback method after the operation.
115   *
116   * @type { function }
117   * @syscap SystemCapability.ArkUI.ArkUI.Full
118   * @crossplatform
119   * @atomicservice
120   * @since 11
121   */
122  action: () => void;
123}
124
125/**
126 * Component dialog dismiss action.
127 *
128 * @interface DismissDialogAction
129 * @syscap SystemCapability.ArkUI.ArkUI.Full
130 * @crossplatform
131 * @atomicservice
132 * @since 12
133 */
134declare interface DismissDialogAction {
135  /**
136   * Defines dialog dismiss function.
137   *
138   * @type { Callback<void> }
139   * @syscap SystemCapability.ArkUI.ArkUI.Full
140   * @crossplatform
141   * @atomicservice
142   * @since 12
143   */
144  dismiss: Callback<void>;
145
146  /**
147   * Dismiss reason type.
148   *
149   * @type { DismissReason }
150   * @syscap SystemCapability.ArkUI.ArkUI.Full
151   * @crossplatform
152   * @atomicservice
153   * @since 12
154   */
155  reason: DismissReason;
156}
157
158/**
159 * The options of ActionSheet.
160 *
161 * @interface ActionSheetOptions
162 * @syscap SystemCapability.ArkUI.ArkUI.Full
163 * @since 8
164 */
165/**
166 * The options of ActionSheet.
167 *
168 * @interface ActionSheetOptions
169 * @syscap SystemCapability.ArkUI.ArkUI.Full
170 * @crossplatform
171 * @since 10
172 */
173/**
174 * The options of ActionSheet.
175 *
176 * @interface ActionSheetOptions
177 * @syscap SystemCapability.ArkUI.ArkUI.Full
178 * @crossplatform
179 * @atomicservice
180 * @since 11
181 */
182interface ActionSheetOptions
183{
184  /**
185   * Title Properties
186   *
187   * @type { string | Resource }
188   * @syscap SystemCapability.ArkUI.ArkUI.Full
189   * @since 8
190   */
191  /**
192   * Title Properties
193   *
194   * @type { string | Resource }
195   * @syscap SystemCapability.ArkUI.ArkUI.Full
196   * @crossplatform
197   * @since 10
198   */
199  /**
200   * Title Properties
201   *
202   * @type { string | Resource }
203   * @syscap SystemCapability.ArkUI.ArkUI.Full
204   * @crossplatform
205   * @atomicservice
206   * @since 11
207   */
208  title: string | Resource;
209
210  /**
211   * Subtitle Properties
212   * @type { ?ResourceStr }
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @crossplatform
215   * @since 10
216   */
217  /**
218   * Subtitle Properties
219   * @type { ?ResourceStr }
220   * @syscap SystemCapability.ArkUI.ArkUI.Full
221   * @crossplatform
222   * @atomicservice
223   * @since 11
224   */
225  subtitle?: ResourceStr;
226
227  /**
228   * message Properties
229   *
230   * @type { string | Resource }
231   * @syscap SystemCapability.ArkUI.ArkUI.Full
232   * @since 8
233   */
234  /**
235   * message Properties
236   *
237   * @type { string | Resource }
238   * @syscap SystemCapability.ArkUI.ArkUI.Full
239   * @crossplatform
240   * @since 10
241   */
242  /**
243   * message Properties
244   *
245   * @type { string | Resource }
246   * @syscap SystemCapability.ArkUI.ArkUI.Full
247   * @crossplatform
248   * @atomicservice
249   * @since 11
250   */
251  message: string | Resource;
252
253  /**
254   * Invoke the commit function.
255   *
256   * @type { ?object }
257   * @syscap SystemCapability.ArkUI.ArkUI.Full
258   * @since 8
259   */
260  /**
261   * Invoke the commit function.
262   *
263   * @type { ?object }
264   * @syscap SystemCapability.ArkUI.ArkUI.Full
265   * @crossplatform
266   * @since 10
267   */
268  /**
269   * Invoke the commit function.
270   *
271   * @type { ?object }
272   * @syscap SystemCapability.ArkUI.ArkUI.Full
273   * @crossplatform
274   * @atomicservice
275   * @since 11
276   */
277  confirm?: {
278    /**
279     * Enable switch of confirmation button
280     * @type { ?boolean }
281     * @default true
282     * @syscap SystemCapability.ArkUI.ArkUI.Full
283     * @crossplatform
284     * @since 10
285     */
286    /**
287     * Enable switch of confirmation button
288     * @type { ?boolean }
289     * @default true
290     * @syscap SystemCapability.ArkUI.ArkUI.Full
291     * @crossplatform
292     * @atomicservice
293     * @since 11
294     */
295    enabled?: boolean;
296
297    /**
298     * Default focus switch of confirmation button
299     * @type { ?boolean }
300     * @default false
301     * @syscap SystemCapability.ArkUI.ArkUI.Full
302     * @crossplatform
303     * @since 10
304     */
305    /**
306     * Default focus switch of confirmation button
307     * @type { ?boolean }
308     * @default false
309     * @syscap SystemCapability.ArkUI.ArkUI.Full
310     * @crossplatform
311     * @atomicservice
312     * @since 11
313     */
314    defaultFocus?: boolean;
315
316    /**
317     * Style of confirmation button.
318     * @type { ?DialogButtonStyle }
319     * @default DialogButtonStyle.DEFAULT
320     * @syscap SystemCapability.ArkUI.ArkUI.Full
321     * @crossplatform
322     * @since 10
323     */
324    /**
325     * Style of confirmation button.
326     * @type { ?DialogButtonStyle }
327     * @default DialogButtonStyle.DEFAULT
328     * @syscap SystemCapability.ArkUI.ArkUI.Full
329     * @crossplatform
330     * @atomicservice
331     * @since 11
332     */
333    style?: DialogButtonStyle;
334
335    /**
336     * Text content of the confirmation button.
337     *
338     * @type { string | Resource }
339     * @syscap SystemCapability.ArkUI.ArkUI.Full
340     * @since 8
341     */
342    /**
343     * Text content of the confirmation button.
344     *
345     * @type { string | Resource }
346     * @syscap SystemCapability.ArkUI.ArkUI.Full
347     * @crossplatform
348     * @since 10
349     */
350    /**
351     * Text content of the confirmation button.
352     *
353     * @type { string | Resource }
354     * @syscap SystemCapability.ArkUI.ArkUI.Full
355     * @crossplatform
356     * @atomicservice
357     * @since 11
358     */
359    value: string | Resource;
360
361    /**
362     * Method executed by the callback.
363     *
364     * @type { function }
365     * @syscap SystemCapability.ArkUI.ArkUI.Full
366     * @since 8
367     */
368    /**
369     * Method executed by the callback.
370     *
371     * @type { function }
372     * @syscap SystemCapability.ArkUI.ArkUI.Full
373     * @crossplatform
374     * @since 10
375     */
376    /**
377     * Method executed by the callback.
378     *
379     * @type { function }
380     * @syscap SystemCapability.ArkUI.ArkUI.Full
381     * @crossplatform
382     * @atomicservice
383     * @since 11
384     */
385    action: () => void;
386  };
387
388  /**
389   * Execute Cancel Function.
390   *
391   * @type { ?function }
392   * @syscap SystemCapability.ArkUI.ArkUI.Full
393   * @since 8
394   */
395  /**
396   * Execute Cancel Function.
397   *
398   * @type { ?function }
399   * @syscap SystemCapability.ArkUI.ArkUI.Full
400   * @crossplatform
401   * @since 10
402   */
403  /**
404   * Execute Cancel Function.
405   *
406   * @type { ?function }
407   * @syscap SystemCapability.ArkUI.ArkUI.Full
408   * @crossplatform
409   * @atomicservice
410   * @since 11
411   */
412  cancel?: () => void;
413
414  /**
415   * The Array of sheets
416   *
417   * @type { Array<SheetInfo> }
418   * @syscap SystemCapability.ArkUI.ArkUI.Full
419   * @since 8
420   */
421  /**
422   * The Array of sheets
423   *
424   * @type { Array<SheetInfo> }
425   * @syscap SystemCapability.ArkUI.ArkUI.Full
426   * @crossplatform
427   * @since 10
428   */
429  /**
430   * The Array of sheets
431   *
432   * @type { Array<SheetInfo> }
433   * @syscap SystemCapability.ArkUI.ArkUI.Full
434   * @crossplatform
435   * @atomicservice
436   * @since 11
437   */
438  sheets: Array<SheetInfo>;
439
440  /**
441   * Allows users to click the mask layer to exit.
442   *
443   * @type { ?boolean }
444   * @syscap SystemCapability.ArkUI.ArkUI.Full
445   * @since 8
446   */
447  /**
448   * Allows users to click the mask layer to exit.
449   *
450   * @type { ?boolean }
451   * @syscap SystemCapability.ArkUI.ArkUI.Full
452   * @crossplatform
453   * @since 10
454   */
455  /**
456   * Allows users to click the mask layer to exit.
457   *
458   * @type { ?boolean }
459   * @syscap SystemCapability.ArkUI.ArkUI.Full
460   * @crossplatform
461   * @atomicservice
462   * @since 11
463   */
464  autoCancel?: boolean;
465
466  /**
467   * Alignment in the vertical direction.
468   *
469   * @type { ?DialogAlignment }
470   * @syscap SystemCapability.ArkUI.ArkUI.Full
471   * @since 8
472   */
473  /**
474   * Alignment in the vertical direction.
475   *
476   * @type { ?DialogAlignment }
477   * @syscap SystemCapability.ArkUI.ArkUI.Full
478   * @crossplatform
479   * @since 10
480   */
481  /**
482   * Alignment in the vertical direction.
483   *
484   * @type { ?DialogAlignment }
485   * @syscap SystemCapability.ArkUI.ArkUI.Full
486   * @crossplatform
487   * @atomicservice
488   * @since 11
489   */
490  alignment?: DialogAlignment;
491
492  /**
493   * Offset of the pop-up window relative to the alignment position.
494   *
495   * @type { ?object }
496   * @syscap SystemCapability.ArkUI.ArkUI.Full
497   * @since 8
498   */
499  /**
500   * Offset of the pop-up window relative to the alignment position.
501   *
502   * @type { ?object }
503   * @syscap SystemCapability.ArkUI.ArkUI.Full
504   * @crossplatform
505   * @since 10
506   */
507  /**
508   * Offset of the pop-up window relative to the alignment position.
509   *
510   * @type { ?object }
511   * @syscap SystemCapability.ArkUI.ArkUI.Full
512   * @crossplatform
513   * @atomicservice
514   * @since 11
515   */
516  offset?: { dx: number | string | Resource; dy: number | string | Resource };
517
518  /**
519   * Mask Region of dialog. The size cannot exceed the main window.
520   *
521   * @type { ?Rectangle }
522   * @syscap SystemCapability.ArkUI.ArkUI.Full
523   * @crossplatform
524   * @since 10
525   */
526  /**
527   * Mask Region of dialog. The size cannot exceed the main window.
528   *
529   * @type { ?Rectangle }
530   * @syscap SystemCapability.ArkUI.ArkUI.Full
531   * @crossplatform
532   * @atomicservice
533   * @since 11
534   */
535  maskRect?: Rectangle;
536
537  /**
538   * Whether to display in the sub window.
539   *
540   * @type { ?boolean }
541   * @default false
542   * @syscap SystemCapability.ArkUI.ArkUI.Full
543   * @crossplatform
544   * @since 11
545   */
546  /**
547   * Whether to display in the sub window.
548   *
549   * @type { ?boolean }
550   * @default false
551   * @syscap SystemCapability.ArkUI.ArkUI.Full
552   * @crossplatform
553   * @atomicservice
554   * @since 12
555   */
556  showInSubWindow?: boolean;
557
558  /**
559   * Whether it is a modal dialog
560   * @type { ?boolean }
561   * @default true
562   * @syscap SystemCapability.ArkUI.ArkUI.Full
563   * @crossplatform
564   * @since 11
565   */
566  /**
567   * Whether it is a modal dialog
568   * @type { ?boolean }
569   * @default true
570   * @syscap SystemCapability.ArkUI.ArkUI.Full
571   * @crossplatform
572   * @atomicservice
573   * @since 12
574   */
575  isModal?: boolean;
576
577  /**
578   * Defines the actionSheet's background color
579   *
580   * @type { ?ResourceColor }
581   * @default Color.Transparent
582   * @syscap SystemCapability.ArkUI.ArkUI.Full
583   * @crossplatform
584   * @since 11
585   */
586  /**
587   * Defines the actionSheet's background color
588   *
589   * @type { ?ResourceColor }
590   * @default Color.Transparent
591   * @syscap SystemCapability.ArkUI.ArkUI.Full
592   * @crossplatform
593   * @atomicservice
594   * @since 12
595   */
596  backgroundColor?: ResourceColor;
597
598  /**
599   * Defines the actionSheet's background blur Style
600   *
601   * @type { ?BlurStyle }
602   * @default BlurStyle.COMPONENT_ULTRA_THICK
603   * @syscap SystemCapability.ArkUI.ArkUI.Full
604   * @crossplatform
605   * @since 11
606   */
607  /**
608   * Defines the actionSheet's background blur Style
609   *
610   * @type { ?BlurStyle }
611   * @default BlurStyle.COMPONENT_ULTRA_THICK
612   * @syscap SystemCapability.ArkUI.ArkUI.Full
613   * @crossplatform
614   * @atomicservice
615   * @since 12
616   */
617  backgroundBlurStyle?: BlurStyle;
618
619  /**
620   * Callback function when the actionSheet interactive dismiss
621   *
622   * @type { ?Callback<DismissDialogAction> }
623   * @syscap SystemCapability.ArkUI.ArkUI.Full
624   * @crossplatform
625   * @atomicservice
626   * @since 12
627   */
628  onWillDismiss?: Callback<DismissDialogAction>;
629
630  /**
631   * Transition parameters of opening/closing ActionSheet.
632   *
633   * @type { ?TransitionEffect }
634   * @syscap SystemCapability.ArkUI.ArkUI.Full
635   * @crossplatform
636   * @atomicservice
637   * @since 12
638   */
639  transition?: TransitionEffect;
640
641  /**
642   * Defines the actionSheet's corner radius.
643   *
644   * @type { ?(Dimension | BorderRadiuses | LocalizedBorderRadiuses) }
645   * @syscap SystemCapability.ArkUI.ArkUI.Full
646   * @crossplatform
647   * @atomicservice
648   * @since 12
649   */
650  cornerRadius?: Dimension | BorderRadiuses | LocalizedBorderRadiuses;
651
652  /**
653   * Defines the actionSheet's width.
654   *
655   * @type { ?Dimension }
656   * @syscap SystemCapability.ArkUI.ArkUI.Full
657   * @crossplatform
658   * @atomicservice
659   * @since 12
660   */
661  width?: Dimension;
662
663  /**
664   * Defines the actionSheet's height.
665   *
666   * @type { ?Dimension }
667   * @syscap SystemCapability.ArkUI.ArkUI.Full
668   * @crossplatform
669   * @atomicservice
670   * @since 12
671   */
672  height?: Dimension;
673
674  /**
675   * Defines the actionSheet's border width.
676   *
677   * @type { ?(Dimension | EdgeWidths | LocalizedEdgeWidths) }
678   * @syscap SystemCapability.ArkUI.ArkUI.Full
679   * @crossplatform
680   * @atomicservice
681   * @since 12
682   */
683  borderWidth?: Dimension | EdgeWidths | LocalizedEdgeWidths;
684
685  /**
686   * Defines the actionSheet's border color.
687   *
688   * @type { ?(ResourceColor | EdgeColors | LocalizedEdgeColors) }
689   * @syscap SystemCapability.ArkUI.ArkUI.Full
690   * @crossplatform
691   * @atomicservice
692   * @since 12
693   */
694  borderColor?: ResourceColor | EdgeColors | LocalizedEdgeColors;
695
696  /**
697   * Defines the actionSheet's border style.
698   *
699   * @type { ?(BorderStyle | EdgeStyles) }
700   * @syscap SystemCapability.ArkUI.ArkUI.Full
701   * @crossplatform
702   * @atomicservice
703   * @since 12
704   */
705  borderStyle?: BorderStyle | EdgeStyles;
706
707  /**
708   * Defines the actionSheet's shadow.
709   *
710   * @type { ?(ShadowOptions | ShadowStyle) }
711   * @syscap SystemCapability.ArkUI.ArkUI.Full
712   * @crossplatform
713   * @atomicservice
714   * @since 12
715   */
716  shadow?: ShadowOptions | ShadowStyle;
717
718  /**
719   * Defines whether to respond to the hover mode.
720   *
721   * @type { ?boolean }
722   * @default false
723   * @syscap SystemCapability.ArkUI.ArkUI.Full
724   * @crossplatform
725   * @atomicservice
726   * @since 14
727   */
728  enableHoverMode?: boolean;
729
730  /**
731   * Defines the actionSheet's display area in hover mode.
732   *
733   * @type { ?HoverModeAreaType }
734   * @default HoverModeAreaType.BOTTOM_SCREEN
735   * @syscap SystemCapability.ArkUI.ArkUI.Full
736   * @crossplatform
737   * @atomicservice
738   * @since 14
739   */
740  hoverModeArea?: HoverModeAreaType;
741}
742
743/**
744 * Declare the ActionSheet
745 *
746 * @syscap SystemCapability.ArkUI.ArkUI.Full
747 * @since 8
748 */
749/**
750 * Declare the ActionSheet
751 *
752 * @syscap SystemCapability.ArkUI.ArkUI.Full
753 * @crossplatform
754 * @since 10
755 */
756/**
757 * Declare the ActionSheet
758 *
759 * @syscap SystemCapability.ArkUI.ArkUI.Full
760 * @crossplatform
761 * @atomicservice
762 * @since 11
763 */
764declare class ActionSheet {
765  /**
766   * Invoking method display.
767   *
768   * @param { ActionSheetOptions } value
769   * @syscap SystemCapability.ArkUI.ArkUI.Full
770   * @since 8
771   */
772  /**
773   * Invoking method display.
774   *
775   * @param { ActionSheetOptions } value
776   * @syscap SystemCapability.ArkUI.ArkUI.Full
777   * @crossplatform
778   * @since 10
779   */
780  /**
781   * Invoking method display.
782   *
783   * @param { ActionSheetOptions } value
784   * @syscap SystemCapability.ArkUI.ArkUI.Full
785   * @crossplatform
786   * @atomicservice
787   * @since 11
788   */
789  static show(value: ActionSheetOptions);
790}
791