• 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 * The information of sheet.
18 *
19 * @interface SheetInfo
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 8
22 */
23/**
24 * The information of sheet.
25 *
26 * @interface SheetInfo
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @since 10
30 */
31/**
32 * The information of sheet.
33 *
34 * @interface SheetInfo
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @atomicservice
38 * @since 11
39 */
40interface SheetInfo {
41  /**
42   * Title Properties
43   *
44   * @type { string | Resource }
45   * @syscap SystemCapability.ArkUI.ArkUI.Full
46   * @since 8
47   */
48  /**
49   * Title Properties
50   *
51   * @type { string | Resource }
52   * @syscap SystemCapability.ArkUI.ArkUI.Full
53   * @crossplatform
54   * @since 10
55   */
56  /**
57   * Title Properties
58   *
59   * @type { string | Resource }
60   * @syscap SystemCapability.ArkUI.ArkUI.Full
61   * @crossplatform
62   * @atomicservice
63   * @since 11
64   */
65  title: string | Resource;
66
67  /**
68   * Icon Properties.
69   *
70   * @type { ?(string | Resource) }
71   * @syscap SystemCapability.ArkUI.ArkUI.Full
72   * @since 8
73   */
74  /**
75   * Icon Properties.
76   *
77   * @type { ?(string | Resource) }
78   * @syscap SystemCapability.ArkUI.ArkUI.Full
79   * @crossplatform
80   * @since 10
81   */
82  /**
83   * Icon Properties.
84   *
85   * @type { ?(string | Resource) }
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @crossplatform
88   * @atomicservice
89   * @since 11
90   */
91  icon?: string | Resource;
92
93  /**
94   * Callback method after the operation.
95   *
96   * @type { function }
97   * @syscap SystemCapability.ArkUI.ArkUI.Full
98   * @since 8
99   */
100  /**
101   * Callback method after the operation.
102   *
103   * @type { function }
104   * @syscap SystemCapability.ArkUI.ArkUI.Full
105   * @crossplatform
106   * @since 10
107   */
108  /**
109   * Callback method after the operation.
110   *
111   * @type { function }
112   * @syscap SystemCapability.ArkUI.ArkUI.Full
113   * @crossplatform
114   * @atomicservice
115   * @since 11
116   */
117  action: () => void;
118}
119
120/**
121 * The options of ActionSheet.
122 *
123 * @interface ActionSheetOptions
124 * @syscap SystemCapability.ArkUI.ArkUI.Full
125 * @since 8
126 */
127/**
128 * The options of ActionSheet.
129 *
130 * @interface ActionSheetOptions
131 * @syscap SystemCapability.ArkUI.ArkUI.Full
132 * @crossplatform
133 * @since 10
134 */
135/**
136 * The options of ActionSheet.
137 *
138 * @interface ActionSheetOptions
139 * @syscap SystemCapability.ArkUI.ArkUI.Full
140 * @crossplatform
141 * @atomicservice
142 * @since 11
143 */
144interface ActionSheetOptions
145{
146  /**
147   * Title Properties
148   *
149   * @type { string | Resource }
150   * @syscap SystemCapability.ArkUI.ArkUI.Full
151   * @since 8
152   */
153  /**
154   * Title Properties
155   *
156   * @type { string | Resource }
157   * @syscap SystemCapability.ArkUI.ArkUI.Full
158   * @crossplatform
159   * @since 10
160   */
161  /**
162   * Title Properties
163   *
164   * @type { string | Resource }
165   * @syscap SystemCapability.ArkUI.ArkUI.Full
166   * @crossplatform
167   * @atomicservice
168   * @since 11
169   */
170  title: string | Resource;
171
172  /**
173   * Subtitle Properties
174   * @type { ?ResourceStr }
175   * @syscap SystemCapability.ArkUI.ArkUI.Full
176   * @crossplatform
177   * @since 10
178   */
179  /**
180   * Subtitle Properties
181   * @type { ?ResourceStr }
182   * @syscap SystemCapability.ArkUI.ArkUI.Full
183   * @crossplatform
184   * @atomicservice
185   * @since 11
186   */
187  subtitle?: ResourceStr;
188
189  /**
190   * message Properties
191   *
192   * @type { string | Resource }
193   * @syscap SystemCapability.ArkUI.ArkUI.Full
194   * @since 8
195   */
196  /**
197   * message Properties
198   *
199   * @type { string | Resource }
200   * @syscap SystemCapability.ArkUI.ArkUI.Full
201   * @crossplatform
202   * @since 10
203   */
204  /**
205   * message Properties
206   *
207   * @type { string | Resource }
208   * @syscap SystemCapability.ArkUI.ArkUI.Full
209   * @crossplatform
210   * @atomicservice
211   * @since 11
212   */
213  message: string | Resource;
214
215  /**
216   * Invoke the commit function.
217   *
218   * @type { ?object }
219   * @syscap SystemCapability.ArkUI.ArkUI.Full
220   * @since 8
221   */
222  /**
223   * Invoke the commit function.
224   *
225   * @type { ?object }
226   * @syscap SystemCapability.ArkUI.ArkUI.Full
227   * @crossplatform
228   * @since 10
229   */
230  /**
231   * Invoke the commit function.
232   *
233   * @type { ?object }
234   * @syscap SystemCapability.ArkUI.ArkUI.Full
235   * @crossplatform
236   * @atomicservice
237   * @since 11
238   */
239  confirm?: {
240    /**
241     * Enable switch of confirmation button
242     * @type { ?boolean }
243     * @default true
244     * @syscap SystemCapability.ArkUI.ArkUI.Full
245     * @crossplatform
246     * @since 10
247     */
248    /**
249     * Enable switch of confirmation button
250     * @type { ?boolean }
251     * @default true
252     * @syscap SystemCapability.ArkUI.ArkUI.Full
253     * @crossplatform
254     * @atomicservice
255     * @since 11
256     */
257    enabled?: boolean;
258
259    /**
260     * Default focus switch of confirmation button
261     * @type { ?boolean }
262     * @default false
263     * @syscap SystemCapability.ArkUI.ArkUI.Full
264     * @crossplatform
265     * @since 10
266     */
267    /**
268     * Default focus switch of confirmation button
269     * @type { ?boolean }
270     * @default false
271     * @syscap SystemCapability.ArkUI.ArkUI.Full
272     * @crossplatform
273     * @atomicservice
274     * @since 11
275     */
276    defaultFocus?: boolean;
277
278    /**
279     * Style of confirmation button.
280     * @type { ?DialogButtonStyle }
281     * @default DialogButtonStyle.DEFAULT
282     * @syscap SystemCapability.ArkUI.ArkUI.Full
283     * @crossplatform
284     * @since 10
285     */
286    /**
287     * Style of confirmation button.
288     * @type { ?DialogButtonStyle }
289     * @default DialogButtonStyle.DEFAULT
290     * @syscap SystemCapability.ArkUI.ArkUI.Full
291     * @crossplatform
292     * @atomicservice
293     * @since 11
294     */
295    style?: DialogButtonStyle;
296
297    /**
298     * Text content of the confirmation button.
299     *
300     * @type { string | Resource }
301     * @syscap SystemCapability.ArkUI.ArkUI.Full
302     * @since 8
303     */
304    /**
305     * Text content of the confirmation button.
306     *
307     * @type { string | Resource }
308     * @syscap SystemCapability.ArkUI.ArkUI.Full
309     * @crossplatform
310     * @since 10
311     */
312    /**
313     * Text content of the confirmation button.
314     *
315     * @type { string | Resource }
316     * @syscap SystemCapability.ArkUI.ArkUI.Full
317     * @crossplatform
318     * @atomicservice
319     * @since 11
320     */
321    value: string | Resource;
322
323    /**
324     * Method executed by the callback.
325     *
326     * @type { function }
327     * @syscap SystemCapability.ArkUI.ArkUI.Full
328     * @since 8
329     */
330    /**
331     * Method executed by the callback.
332     *
333     * @type { function }
334     * @syscap SystemCapability.ArkUI.ArkUI.Full
335     * @crossplatform
336     * @since 10
337     */
338    /**
339     * Method executed by the callback.
340     *
341     * @type { function }
342     * @syscap SystemCapability.ArkUI.ArkUI.Full
343     * @crossplatform
344     * @atomicservice
345     * @since 11
346     */
347    action: () => void;
348  };
349
350  /**
351   * Execute Cancel Function.
352   *
353   * @type { ?function }
354   * @syscap SystemCapability.ArkUI.ArkUI.Full
355   * @since 8
356   */
357  /**
358   * Execute Cancel Function.
359   *
360   * @type { ?function }
361   * @syscap SystemCapability.ArkUI.ArkUI.Full
362   * @crossplatform
363   * @since 10
364   */
365  /**
366   * Execute Cancel Function.
367   *
368   * @type { ?function }
369   * @syscap SystemCapability.ArkUI.ArkUI.Full
370   * @crossplatform
371   * @atomicservice
372   * @since 11
373   */
374  cancel?: () => void;
375
376  /**
377   * The Array of sheets
378   *
379   * @type { Array<SheetInfo> }
380   * @syscap SystemCapability.ArkUI.ArkUI.Full
381   * @since 8
382   */
383  /**
384   * The Array of sheets
385   *
386   * @type { Array<SheetInfo> }
387   * @syscap SystemCapability.ArkUI.ArkUI.Full
388   * @crossplatform
389   * @since 10
390   */
391  /**
392   * The Array of sheets
393   *
394   * @type { Array<SheetInfo> }
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @crossplatform
397   * @atomicservice
398   * @since 11
399   */
400  sheets: Array<SheetInfo>;
401
402  /**
403   * Allows users to click the mask layer to exit.
404   *
405   * @type { ?boolean }
406   * @syscap SystemCapability.ArkUI.ArkUI.Full
407   * @since 8
408   */
409  /**
410   * Allows users to click the mask layer to exit.
411   *
412   * @type { ?boolean }
413   * @syscap SystemCapability.ArkUI.ArkUI.Full
414   * @crossplatform
415   * @since 10
416   */
417  /**
418   * Allows users to click the mask layer to exit.
419   *
420   * @type { ?boolean }
421   * @syscap SystemCapability.ArkUI.ArkUI.Full
422   * @crossplatform
423   * @atomicservice
424   * @since 11
425   */
426  autoCancel?: boolean;
427
428  /**
429   * Alignment in the vertical direction.
430   *
431   * @type { ?DialogAlignment }
432   * @syscap SystemCapability.ArkUI.ArkUI.Full
433   * @since 8
434   */
435  /**
436   * Alignment in the vertical direction.
437   *
438   * @type { ?DialogAlignment }
439   * @syscap SystemCapability.ArkUI.ArkUI.Full
440   * @crossplatform
441   * @since 10
442   */
443  /**
444   * Alignment in the vertical direction.
445   *
446   * @type { ?DialogAlignment }
447   * @syscap SystemCapability.ArkUI.ArkUI.Full
448   * @crossplatform
449   * @atomicservice
450   * @since 11
451   */
452  alignment?: DialogAlignment;
453
454  /**
455   * Offset of the pop-up window relative to the alignment position.
456   *
457   * @type { ?object }
458   * @syscap SystemCapability.ArkUI.ArkUI.Full
459   * @since 8
460   */
461  /**
462   * Offset of the pop-up window relative to the alignment position.
463   *
464   * @type { ?object }
465   * @syscap SystemCapability.ArkUI.ArkUI.Full
466   * @crossplatform
467   * @since 10
468   */
469  /**
470   * Offset of the pop-up window relative to the alignment position.
471   *
472   * @type { ?object }
473   * @syscap SystemCapability.ArkUI.ArkUI.Full
474   * @crossplatform
475   * @atomicservice
476   * @since 11
477   */
478  offset?: { dx: number | string | Resource; dy: number | string | Resource };
479
480  /**
481   * Mask Region of dialog. The size cannot exceed the main window.
482   *
483   * @type { ?Rectangle }
484   * @syscap SystemCapability.ArkUI.ArkUI.Full
485   * @crossplatform
486   * @since 10
487   */
488  /**
489   * Mask Region of dialog. The size cannot exceed the main window.
490   *
491   * @type { ?Rectangle }
492   * @syscap SystemCapability.ArkUI.ArkUI.Full
493   * @crossplatform
494   * @atomicservice
495   * @since 11
496   */
497  maskRect?: Rectangle;
498
499  /**
500   * Whether to display in the sub window.
501   *
502   * @type { ?boolean }
503   * @default false
504   * @syscap SystemCapability.ArkUI.ArkUI.Full
505   * @crossplatform
506   * @since 11
507   */
508  showInSubWindow?: boolean;
509
510  /**
511   * Whether it is a modal dialog
512   * @type { ?boolean }
513   * @default true
514   * @syscap SystemCapability.ArkUI.ArkUI.Full
515   * @crossplatform
516   * @since 11
517   */
518  isModal?: boolean;
519
520  /**
521   * Defines the actionSheet's background color
522   *
523   * @type { ?ResourceColor }
524   * @default Color.Transparent
525   * @syscap SystemCapability.ArkUI.ArkUI.Full
526   * @crossplatform
527   * @since 11
528   */
529  backgroundColor?: ResourceColor;
530
531  /**
532   * Defines the actionSheet's background blur Style
533   *
534   * @type { ?BlurStyle }
535   * @default BlurStyle.COMPONENT_ULTRA_THICK
536   * @syscap SystemCapability.ArkUI.ArkUI.Full
537   * @crossplatform
538   * @since 11
539   */
540  backgroundBlurStyle?: BlurStyle;
541}
542
543/**
544 * Declare the ActionSheet
545 *
546 * @syscap SystemCapability.ArkUI.ArkUI.Full
547 * @since 8
548 */
549/**
550 * Declare the ActionSheet
551 *
552 * @syscap SystemCapability.ArkUI.ArkUI.Full
553 * @crossplatform
554 * @since 10
555 */
556/**
557 * Declare the ActionSheet
558 *
559 * @syscap SystemCapability.ArkUI.ArkUI.Full
560 * @crossplatform
561 * @atomicservice
562 * @since 11
563 */
564declare class ActionSheet {
565  /**
566   * Invoking method display.
567   *
568   * @param { ActionSheetOptions } value
569   * @syscap SystemCapability.ArkUI.ArkUI.Full
570   * @since 8
571   */
572  /**
573   * Invoking method display.
574   *
575   * @param { ActionSheetOptions } value
576   * @syscap SystemCapability.ArkUI.ArkUI.Full
577   * @crossplatform
578   * @since 10
579   */
580  /**
581   * Invoking method display.
582   *
583   * @param { ActionSheetOptions } value
584   * @syscap SystemCapability.ArkUI.ArkUI.Full
585   * @crossplatform
586   * @atomicservice
587   * @since 11
588   */
589  static show(value: ActionSheetOptions);
590}
591
592declare module "actionSheetParam" {
593  module "actionSheetParam" {
594    // @ts-ignore
595    export { ActionSheetOptions };
596  }
597}
598