• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (C) 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 * Defines the popup text options
23 * @syscap SystemCapability.ArkUI.ArkUI.Full
24 * @crossplatform
25 * @since 11
26 */
27 /**
28 * Defines the popup text options
29 * @syscap SystemCapability.ArkUI.ArkUI.Full
30 * @crossplatform
31 * @atomicservice
32 * @since 12
33 */
34
35
36export interface PopupTextOptions {
37  /**
38   * Set the text display content.
39   * @type { ResourceStr }.
40   * @syscap SystemCapability.ArkUI.ArkUI.Full
41   * @crossplatform
42   * @since 11
43   */
44   /**
45   * Set the text display content.
46   * @type { ResourceStr }.
47   * @syscap SystemCapability.ArkUI.ArkUI.Full
48   * @crossplatform
49   * @atomicservice
50   * @since 12
51   */
52  text: ResourceStr;
53
54  /**
55   * Set the text font size.
56   * @type { ?(number | string | Resource) }.
57   * @syscap SystemCapability.ArkUI.ArkUI.Full
58   * @crossplatform
59   * @since 11
60   */
61   /**
62   * Set the text font size.
63   * @type { ?(number | string | Resource) }.
64   * @syscap SystemCapability.ArkUI.ArkUI.Full
65   * @crossplatform
66   * @atomicservice
67   * @since 12
68   */
69  fontSize?: number | string | Resource;
70
71  /**
72   * Set the text font color.
73   * @type { ?ResourceColor }.
74   * @syscap SystemCapability.ArkUI.ArkUI.Full
75   * @crossplatform
76   * @since 11
77   */
78   /**
79   * Set the text font color.
80   * @type { ?ResourceColor }.
81   * @syscap SystemCapability.ArkUI.ArkUI.Full
82   * @crossplatform
83   * @atomicservice
84   * @since 12
85   */
86  fontColor?: ResourceColor;
87
88  /**
89   * Set the text font weight.
90   * @type { ?(number | FontWeight | string) }.
91   * @syscap SystemCapability.ArkUI.ArkUI.Full
92   * @crossplatform
93   * @since 11
94   */
95   /**
96   * Set the text font weight.
97   * @type { ?(number | FontWeight | string) }.
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @crossplatform
100   * @atomicservice
101   * @since 12
102   */
103  fontWeight?: number | FontWeight | string;
104}
105
106/**
107 * Defines the popup button options
108 * @syscap SystemCapability.ArkUI.ArkUI.Full
109 * @crossplatform
110 * @since 11
111 */
112 /**
113 * Defines the popup button options
114 * @syscap SystemCapability.ArkUI.ArkUI.Full
115 * @crossplatform
116 * @atomicservice
117 * @since 12
118 */
119export interface PopupButtonOptions {
120  /**
121   * Set the button display content.
122   * @type { ResourceStr }.
123   * @syscap SystemCapability.ArkUI.ArkUI.Full
124   * @crossplatform
125   * @since 11
126   */
127   /**
128   * Set the button display content.
129   * @type { ResourceStr }.
130   * @syscap SystemCapability.ArkUI.ArkUI.Full
131   * @crossplatform
132   * @atomicservice
133   * @since 12
134   */
135  text: ResourceStr;
136
137  /**
138   * Set the button callback.
139   * @type { ?function }
140   * @syscap SystemCapability.ArkUI.ArkUI.Full
141   * @crossplatform
142   * @since 11
143   */
144   /**
145   * Set the button callback.
146   * @type { ?function }
147   * @syscap SystemCapability.ArkUI.ArkUI.Full
148   * @crossplatform
149   * @atomicservice
150   * @since 12
151   */
152  action?: () => void;
153
154  /**
155   * Set the button font size.
156   * @type { ?(number | string | Resource) }.
157   * @syscap SystemCapability.ArkUI.ArkUI.Full
158   * @crossplatform
159   * @since 11
160   */
161   /**
162   * Set the button font size.
163   * @type { ?(number | string | Resource) }.
164   * @syscap SystemCapability.ArkUI.ArkUI.Full
165   * @crossplatform
166   * @atomicservice
167   * @since 12
168   */
169  fontSize?: number | string | Resource;
170
171  /**
172   * Set the button font color.
173   * @type { ?ResourceColor }.
174   * @syscap SystemCapability.ArkUI.ArkUI.Full
175   * @crossplatform
176   * @since 11
177   */
178   /**
179   * Set the button font color.
180   * @type { ?ResourceColor }.
181   * @syscap SystemCapability.ArkUI.ArkUI.Full
182   * @crossplatform
183   * @atomicservice
184   * @since 12
185   */
186  fontColor?: ResourceColor;
187}
188
189/**
190 * Defines the popup icon options
191 * @syscap SystemCapability.ArkUI.ArkUI.Full
192 * @crossplatform
193 * @since 11
194 */
195 /**
196 * Defines the popup icon options
197 * @syscap SystemCapability.ArkUI.ArkUI.Full
198 * @crossplatform
199 * @atomicservice
200 * @since 12
201 */
202export interface PopupIconOptions {
203  /**
204   * Set the icon image.
205   * @type { ResourceStr }.
206   * @syscap SystemCapability.ArkUI.ArkUI.Full
207   * @crossplatform
208   * @since 11
209   */
210   /**
211   * Set the icon image.
212   * @type { ResourceStr }.
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @crossplatform
215   * @atomicservice
216   * @since 12
217   */
218  image: ResourceStr;
219
220  /**
221   * Set the icon width.
222   * @type { ?Dimension }.
223   * @syscap SystemCapability.ArkUI.ArkUI.Full
224   * @crossplatform
225   * @since 11
226   */
227   /**
228   * Set the icon width.
229   * @type { ?Dimension }.
230   * @syscap SystemCapability.ArkUI.ArkUI.Full
231   * @crossplatform
232   * @atomicservice
233   * @since 12
234   */
235  width?: Dimension;
236
237  /**
238   * Set the icon height.
239   * @type { ?Dimension }.
240   * @syscap SystemCapability.ArkUI.ArkUI.Full
241   * @crossplatform
242   * @since 11
243   */
244   /**
245   * Set the icon height.
246   * @type { ?Dimension }.
247   * @syscap SystemCapability.ArkUI.ArkUI.Full
248   * @crossplatform
249   * @atomicservice
250   * @since 12
251   */
252  height?: Dimension;
253
254  /**
255   * Set the icon fill color.
256   * @type { ?ResourceColor }.
257   * @syscap SystemCapability.ArkUI.ArkUI.Full
258   * @crossplatform
259   * @since 11
260   */
261   /**
262   * Set the icon fill color.
263   * @type { ?ResourceColor }.
264   * @syscap SystemCapability.ArkUI.ArkUI.Full
265   * @crossplatform
266   * @atomicservice
267   * @since 12
268   */
269  fillColor?: ResourceColor;
270
271  /**
272   * Set the icon border radius.
273   * @type { ?(Length | BorderRadiuses) }.
274   * @syscap SystemCapability.ArkUI.ArkUI.Full
275   * @crossplatform
276   * @since 11
277   */
278   /**
279   * Set the icon border radius.
280   * @type { ?(Length | BorderRadiuses) }.
281   * @syscap SystemCapability.ArkUI.ArkUI.Full
282   * @crossplatform
283   * @atomicservice
284   * @since 12
285   */
286  borderRadius?: Length | BorderRadiuses;
287}
288
289/**
290 * Defines the popup options.
291 * @syscap SystemCapability.ArkUI.ArkUI.Full
292 * @crossplatform
293 * @since 11
294 */
295 /**
296 * Defines the popup options.
297 * @syscap SystemCapability.ArkUI.ArkUI.Full
298 * @crossplatform
299 * @atomicservice
300 * @since 12
301 */
302export interface PopupOptions {
303  /**
304   * The icon of Popup.
305   *
306   * @type { ?PopupIconOptions }
307   * @syscap SystemCapability.ArkUI.ArkUI.Full
308   * @crossplatform
309   * @since 11
310   */
311   /**
312   * The icon of Popup.
313   *
314   * @type { ?PopupIconOptions }
315   * @syscap SystemCapability.ArkUI.ArkUI.Full
316   * @crossplatform
317   * @atomicservice
318   * @since 12
319   */
320  icon?: PopupIconOptions;
321
322  /**
323   * The title of Popup.
324   *
325   * @type { ?PopupTextOptions }
326   * @syscap SystemCapability.ArkUI.ArkUI.Full
327   * @crossplatform
328   * @since 11
329   */
330   /**
331   * The title of Popup.
332   *
333   * @type { ?PopupTextOptions }
334   * @syscap SystemCapability.ArkUI.ArkUI.Full
335   * @crossplatform
336   * @atomicservice
337   * @since 12
338   */
339  title?: PopupTextOptions;
340
341  /**
342   * The message of Popup.
343   *
344   * @type { PopupTextOptions }
345   * @syscap SystemCapability.ArkUI.ArkUI.Full
346   * @crossplatform
347   * @since 11
348   */
349   /**
350   * The message of Popup.
351   *
352   * @type { PopupTextOptions }
353   * @syscap SystemCapability.ArkUI.ArkUI.Full
354   * @crossplatform
355   * @atomicservice
356   * @since 12
357   */
358  message: PopupTextOptions;
359
360  /**
361   * The show close of Popup.
362   *
363   * @type { ?(boolean | Resource) }
364   * @syscap SystemCapability.ArkUI.ArkUI.Full
365   * @crossplatform
366   * @since 11
367   */
368   /**
369   * The show close of Popup.
370   *
371   * @type { ?(boolean | Resource) }
372   * @syscap SystemCapability.ArkUI.ArkUI.Full
373   * @crossplatform
374   * @atomicservice
375   * @since 12
376   */
377  showClose?: boolean | Resource;
378
379  /**
380   * The close button callback of Popup.
381   *
382   * @type { ?() => void }
383   * @syscap SystemCapability.ArkUI.ArkUI.Full
384   * @crossplatform
385   * @since 11
386   */
387   /**
388   * The close button callback of Popup.
389   *
390   * @type { ?() => void }
391   * @syscap SystemCapability.ArkUI.ArkUI.Full
392   * @crossplatform
393   * @atomicservice
394   * @since 12
395   */
396  onClose?: () => void;
397
398  /**
399   * The buttons of Popup.
400   *
401   * @type { ?[PopupButtonOptions?, PopupButtonOptions?] }
402   * @syscap SystemCapability.ArkUI.ArkUI.Full
403   * @crossplatform
404   * @since 11
405   */
406   /**
407   * The buttons of Popup.
408   *
409   * @type { ?[PopupButtonOptions?, PopupButtonOptions?] }
410   * @syscap SystemCapability.ArkUI.ArkUI.Full
411   * @crossplatform
412   * @atomicservice
413   * @since 12
414   */
415  buttons?: [PopupButtonOptions?, PopupButtonOptions?];
416
417  /**
418   * Indicates the attribute of the current popup direction.
419   *
420   * @type { ?Direction }
421   * @syscap SystemCapability.ArkUI.ArkUI.Full
422   * @crossplatform
423   * @atomicservice
424   * @since 12
425   */
426   direction?: Direction;
427
428  /**
429   * Set the max width of the popup.
430   *
431   * @type { ?Dimension }
432   * @syscap SystemCapability.ArkUI.ArkUI.Full
433   * @crossplatform
434   * @atomicservice
435   * @since 18
436   */
437  maxWidth?: Dimension;
438}
439
440/**
441 * Build function of popup.
442 *
443 * @param { PopupOptions } options - popup option.
444 * @syscap SystemCapability.ArkUI.ArkUI.Full
445 * @crossplatform
446 * @since 11
447 */
448 /**
449 * Build function of popup.
450 *
451 * @param { PopupOptions } options - popup option.
452 * @syscap SystemCapability.ArkUI.ArkUI.Full
453 * @crossplatform
454 * @atomicservice
455 * @since 12
456 */
457@Builder
458export declare function Popup(options: PopupOptions): void;
459