• 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 * Define options used to construct a rectangle.
23 *
24 * @interface RectOptions
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @crossplatform
27 * @form
28 * @atomicservice
29 * @since 18
30 */
31declare interface RectOptions {
32  /**
33   * Rectangle width.
34   *
35   * @type { ?(number | string) }
36   * @syscap SystemCapability.ArkUI.ArkUI.Full
37   * @since 7
38   */
39  /**
40   * Rectangle width.
41   *
42   * @type { ?(number | string) }
43   * @syscap SystemCapability.ArkUI.ArkUI.Full
44   * @form
45   * @since 9
46   */
47  /**
48   * Rectangle width.
49   *
50   * @type { ?(number | string) }
51   * @syscap SystemCapability.ArkUI.ArkUI.Full
52   * @crossplatform
53   * @form
54   * @since 10
55   */
56  /**
57   * Rectangle width.
58   *
59   * @type { ?(number | string) }
60   * @syscap SystemCapability.ArkUI.ArkUI.Full
61   * @crossplatform
62   * @form
63   * @atomicservice
64   * @since 11
65   */
66  /**
67   * Rectangle width.
68   * Anonymous Object Rectification.
69   *
70   * @type { ?(number | string) }
71   * @syscap SystemCapability.ArkUI.ArkUI.Full
72   * @crossplatform
73   * @form
74   * @atomicservice
75   * @since 18
76   */
77  width?: number | string;
78
79  /**
80   * Rectangle height.
81   *
82   * @type { ?(number | string) }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @since 7
85   */
86  /**
87   * Rectangle height.
88   *
89   * @type { ?(number | string) }
90   * @syscap SystemCapability.ArkUI.ArkUI.Full
91   * @form
92   * @since 9
93   */
94  /**
95   * Rectangle height.
96   *
97   * @type { ?(number | string) }
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @crossplatform
100   * @form
101   * @since 10
102   */
103  /**
104   * Rectangle height.
105   *
106   * @type { ?(number | string) }
107   * @syscap SystemCapability.ArkUI.ArkUI.Full
108   * @crossplatform
109   * @form
110   * @atomicservice
111   * @since 11
112   */
113  /**
114   * Rectangle height.
115   * Anonymous Object Rectification.
116   *
117   * @type { ?(number | string) }
118   * @syscap SystemCapability.ArkUI.ArkUI.Full
119   * @crossplatform
120   * @form
121   * @atomicservice
122   * @since 18
123   */
124  height?: number | string;
125
126  /**
127   * Corner radius of the rectangle.
128   *
129   * @type { ?(number | string | Array<any>) }
130   * @syscap SystemCapability.ArkUI.ArkUI.Full
131   * @since 7
132   */
133  /**
134   * Corner radius of the rectangle.
135   *
136   * @type { ?(number | string | Array<any>) }
137   * @syscap SystemCapability.ArkUI.ArkUI.Full
138   * @form
139   * @since 9
140   */
141  /**
142   * Corner radius of the rectangle.
143   *
144   * @type { ?(number | string | Array<any>) }
145   * @syscap SystemCapability.ArkUI.ArkUI.Full
146   * @crossplatform
147   * @form
148   * @since 10
149   */
150  /**
151   * Corner radius of the rectangle.
152   *
153   * @type { ?(number | string | Array<any>) }
154   * @syscap SystemCapability.ArkUI.ArkUI.Full
155   * @crossplatform
156   * @form
157   * @atomicservice
158   * @since 11
159   */
160  /**
161   * Corner radius of the rectangle.
162   * Anonymous Object Rectification.
163   *
164   * @type { ?(number | string | Array<any>) }
165   * @syscap SystemCapability.ArkUI.ArkUI.Full
166   * @crossplatform
167   * @form
168   * @atomicservice
169   * @since 18
170   */
171  radius?: number | string | Array<any>;
172}
173
174/**
175 * Define options used to construct a rectangle with rounded corners.
176 *
177 * @interface RoundedRectOptions
178 * @syscap SystemCapability.ArkUI.ArkUI.Full
179 * @crossplatform
180 * @form
181 * @atomicservice
182 * @since 18
183 */
184declare interface RoundedRectOptions {
185  /**
186   * Rectangle width.
187   *
188   * @type { ?(number | string) }
189   * @syscap SystemCapability.ArkUI.ArkUI.Full
190   * @since 7
191   */
192  /**
193   * Rectangle width.
194   *
195   * @type { ?(number | string) }
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @form
198   * @since 9
199   */
200  /**
201   * Rectangle width.
202   *
203   * @type { ?(number | string) }
204   * @syscap SystemCapability.ArkUI.ArkUI.Full
205   * @crossplatform
206   * @form
207   * @since 10
208   */
209  /**
210   * Rectangle width.
211   *
212   * @type { ?(number | string) }
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @crossplatform
215   * @form
216   * @atomicservice
217   * @since 11
218   */
219  /**
220   * Rectangle width.
221   * Anonymous Object Rectification.
222   *
223   * @type { ?(number | string) }
224   * @syscap SystemCapability.ArkUI.ArkUI.Full
225   * @crossplatform
226   * @form
227   * @atomicservice
228   * @since 18
229   */
230  width?: number | string;
231
232  /**
233   * Rectangle height.
234   *
235   * @type { ?(number | string) }
236   * @syscap SystemCapability.ArkUI.ArkUI.Full
237   * @since 7
238   */
239  /**
240   * Rectangle height.
241   *
242   * @type { ?(number | string) }
243   * @syscap SystemCapability.ArkUI.ArkUI.Full
244   * @form
245   * @since 9
246   */
247  /**
248   * Rectangle height.
249   *
250   * @type { ?(number | string) }
251   * @syscap SystemCapability.ArkUI.ArkUI.Full
252   * @crossplatform
253   * @form
254   * @since 10
255   */
256  /**
257   * Rectangle height.
258   *
259   * @type { ?(number | string) }
260   * @syscap SystemCapability.ArkUI.ArkUI.Full
261   * @crossplatform
262   * @form
263   * @atomicservice
264   * @since 11
265   */
266  /**
267   * Rectangle height.
268   * Anonymous Object Rectification.
269   *
270   * @type { ?(number | string) }
271   * @syscap SystemCapability.ArkUI.ArkUI.Full
272   * @crossplatform
273   * @form
274   * @atomicservice
275   * @since 18
276   */
277  height?: number | string;
278
279  /**
280   * Width of the corner radius.
281   *
282   * @type { ?(number | string) }
283   * @syscap SystemCapability.ArkUI.ArkUI.Full
284   * @since 7
285   */
286  /**
287   * Width of the corner radius.
288   *
289   * @type { ?(number | string) }
290   * @syscap SystemCapability.ArkUI.ArkUI.Full
291   * @form
292   * @since 9
293   */
294  /**
295   * Width of the corner radius.
296   *
297   * @type { ?(number | string) }
298   * @syscap SystemCapability.ArkUI.ArkUI.Full
299   * @crossplatform
300   * @form
301   * @since 10
302   */
303  /**
304   * Width of the corner radius.
305   *
306   * @type { ?(number | string) }
307   * @syscap SystemCapability.ArkUI.ArkUI.Full
308   * @crossplatform
309   * @form
310   * @atomicservice
311   * @since 11
312   */
313  /**
314   * Width of the corner radius.
315   * Anonymous Object Rectification.
316   *
317   * @type { ?(number | string) }
318   * @syscap SystemCapability.ArkUI.ArkUI.Full
319   * @crossplatform
320   * @form
321   * @atomicservice
322   * @since 18
323   */
324  radiusWidth?: number | string;
325
326  /**
327   * Height of the corner radius.
328   *
329   * @type { ?(number | string) }
330   * @syscap SystemCapability.ArkUI.ArkUI.Full
331   * @since 7
332   */
333  /**
334   * Height of the corner radius.
335   *
336   * @type { ?(number | string) }
337   * @syscap SystemCapability.ArkUI.ArkUI.Full
338   * @form
339   * @since 9
340   */
341  /**
342   * Height of the corner radius.
343   *
344   * @type { ?(number | string) }
345   * @syscap SystemCapability.ArkUI.ArkUI.Full
346   * @crossplatform
347   * @form
348   * @since 10
349   */
350  /**
351   * Height of the corner radius.
352   *
353   * @type { ?(number | string) }
354   * @syscap SystemCapability.ArkUI.ArkUI.Full
355   * @crossplatform
356   * @form
357   * @atomicservice
358   * @since 11
359   */
360  /**
361   * Height of the corner radius.
362   * Anonymous Object Rectification.
363   *
364   * @type { ?(number | string) }
365   * @syscap SystemCapability.ArkUI.ArkUI.Full
366   * @crossplatform
367   * @form
368   * @atomicservice
369   * @since 18
370   */
371  radiusHeight?: number | string;
372}
373
374/**
375 * Provides an interface for drawing rectangles.
376 *
377 * @interface RectInterface
378 * @syscap SystemCapability.ArkUI.ArkUI.Full
379 * @since 7
380 */
381/**
382 * Provides an interface for drawing rectangles.
383 *
384 * @interface RectInterface
385 * @syscap SystemCapability.ArkUI.ArkUI.Full
386 * @form
387 * @since 9
388 */
389/**
390 * Provides an interface for drawing rectangles.
391 *
392 * @interface RectInterface
393 * @syscap SystemCapability.ArkUI.ArkUI.Full
394 * @crossplatform
395 * @form
396 * @since 10
397 */
398/**
399 * Provides an interface for drawing rectangles.
400 *
401 * @interface RectInterface
402 * @syscap SystemCapability.ArkUI.ArkUI.Full
403 * @crossplatform
404 * @form
405 * @atomicservice
406 * @since 11
407 */
408interface RectInterface {
409  /**
410   * Use new function to create Rect.
411   *
412   * @param { object } value
413   * @returns { RectAttribute }
414   * @syscap SystemCapability.ArkUI.ArkUI.Full
415   * @since 7
416   */
417  /**
418   * Use new function to create Rect.
419   *
420   * @param { object } value
421   * @returns { RectAttribute }
422   * @syscap SystemCapability.ArkUI.ArkUI.Full
423   * @form
424   * @since 9
425   */
426  /**
427   * Use new function to create Rect.
428   *
429   * @param { object } value
430   * @returns { RectAttribute }
431   * @syscap SystemCapability.ArkUI.ArkUI.Full
432   * @crossplatform
433   * @form
434   * @since 10
435   */
436  /**
437   * Use new function to create Rect.
438   *
439   * @param { object } value
440   * @returns { RectAttribute }
441   * @syscap SystemCapability.ArkUI.ArkUI.Full
442   * @crossplatform
443   * @form
444   * @atomicservice
445   * @since 11
446   */
447  /**
448   * Use new function to create Rect.
449   * Anonymous Object Rectification.
450   *
451   * @param { RectOptions | RoundedRectOptions } [options] - Rect options
452   * @returns { RectAttribute }
453   * @syscap SystemCapability.ArkUI.ArkUI.Full
454   * @crossplatform
455   * @form
456   * @atomicservice
457   * @since 18
458   */
459  new (
460    options?: RectOptions | RoundedRectOptions,
461  ): RectAttribute;
462
463  /**
464   * Called when a rectangle is created.
465   *
466   * @param { {width?: number | string;height?: number | string;radius?: number | string | Array<any>;} |
467  *  {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value
468   * @returns { RectAttribute }
469   * @syscap SystemCapability.ArkUI.ArkUI.Full
470   * @since 7
471   */
472  /**
473   * Called when a rectangle is created.
474   *
475   * @param { {width?: number | string;height?: number | string;radius?: number | string | Array<any>;} |
476  *  {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value
477   * @returns { RectAttribute }
478   * @syscap SystemCapability.ArkUI.ArkUI.Full
479   * @form
480   * @since 9
481   */
482  /**
483   * Called when a rectangle is created.
484   *
485   * @param { {width?: number | string;height?: number | string;radius?: number | string | Array<any>;} |
486   *  {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value
487   * @returns { RectAttribute }
488   * @syscap SystemCapability.ArkUI.ArkUI.Full
489   * @crossplatform
490   * @form
491   * @since 10
492   */
493  /**
494   * Called when a rectangle is created.
495   *
496   * @param { {width?: number | string;height?: number | string;radius?: number | string | Array<any>;} |
497   *  {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value
498   * @returns { RectAttribute }
499   * @syscap SystemCapability.ArkUI.ArkUI.Full
500   * @crossplatform
501   * @form
502   * @atomicservice
503   * @since 11
504   */
505  /**
506   * Called when a rectangle is created.
507   * Anonymous Object Rectification.
508   *
509   * @param { RectOptions | RoundedRectOptions } [options] - Rect options
510   * @returns { RectAttribute }
511   * @syscap SystemCapability.ArkUI.ArkUI.Full
512   * @crossplatform
513   * @form
514   * @atomicservice
515   * @since 18
516   */
517  (
518    options?: RectOptions | RoundedRectOptions,
519  ): RectAttribute;
520}
521
522/**
523 * rect attribute declaration.
524 *
525 * @extends CommonShapeMethod<RectAttribute>
526 * @syscap SystemCapability.ArkUI.ArkUI.Full
527 * @since 7
528 */
529/**
530 * rect attribute declaration.
531 *
532 * @extends CommonShapeMethod<RectAttribute>
533 * @syscap SystemCapability.ArkUI.ArkUI.Full
534 * @form
535 * @since 9
536 */
537/**
538 * rect attribute declaration.
539 *
540 * @extends CommonShapeMethod<RectAttribute>
541 * @syscap SystemCapability.ArkUI.ArkUI.Full
542 * @crossplatform
543 * @form
544 * @since 10
545 */
546/**
547 * rect attribute declaration.
548 *
549 * @extends CommonShapeMethod<RectAttribute>
550 * @syscap SystemCapability.ArkUI.ArkUI.Full
551 * @crossplatform
552 * @form
553 * @atomicservice
554 * @since 11
555 */
556declare class RectAttribute extends CommonShapeMethod<RectAttribute> {
557  /**
558   * Called when the fillet width is set.
559   *
560   * @param { number | string } value
561   * @returns { RectAttribute }
562   * @syscap SystemCapability.ArkUI.ArkUI.Full
563   * @since 7
564   */
565  /**
566   * Called when the fillet width is set.
567   *
568   * @param { number | string } value
569   * @returns { RectAttribute }
570   * @syscap SystemCapability.ArkUI.ArkUI.Full
571   * @form
572   * @since 9
573   */
574  /**
575   * Called when the fillet width is set.
576   *
577   * @param { number | string } value
578   * @returns { RectAttribute }
579   * @syscap SystemCapability.ArkUI.ArkUI.Full
580   * @crossplatform
581   * @form
582   * @since 10
583   */
584  /**
585   * Called when the fillet width is set.
586   *
587   * @param { number | string } value
588   * @returns { RectAttribute }
589   * @syscap SystemCapability.ArkUI.ArkUI.Full
590   * @crossplatform
591   * @form
592   * @atomicservice
593   * @since 11
594   */
595  radiusWidth(value: number | string): RectAttribute;
596
597  /**
598   * Called when the fillet height is set.
599   *
600   * @param { number | string } value
601   * @returns { RectAttribute }
602   * @syscap SystemCapability.ArkUI.ArkUI.Full
603   * @since 7
604   */
605  /**
606   * Called when the fillet height is set.
607   *
608   * @param { number | string } value
609   * @returns { RectAttribute }
610   * @syscap SystemCapability.ArkUI.ArkUI.Full
611   * @form
612   * @since 9
613   */
614  /**
615   * Called when the fillet height is set.
616   *
617   * @param { number | string } value
618   * @returns { RectAttribute }
619   * @syscap SystemCapability.ArkUI.ArkUI.Full
620   * @crossplatform
621   * @form
622   * @since 10
623   */
624  /**
625   * Called when the fillet height is set.
626   *
627   * @param { number | string } value
628   * @returns { RectAttribute }
629   * @syscap SystemCapability.ArkUI.ArkUI.Full
630   * @crossplatform
631   * @form
632   * @atomicservice
633   * @since 11
634   */
635  radiusHeight(value: number | string): RectAttribute;
636
637  /**
638   * Called when the fillet size is set.
639   *
640   * @param { number | string | Array<any> } value
641   * @returns { RectAttribute }
642   * @syscap SystemCapability.ArkUI.ArkUI.Full
643   * @since 7
644   */
645  /**
646   * Called when the fillet size is set.
647   *
648   * @param { number | string | Array<any> } value
649   * @returns { RectAttribute }
650   * @syscap SystemCapability.ArkUI.ArkUI.Full
651   * @form
652   * @since 9
653   */
654  /**
655   * Called when the fillet size is set.
656   *
657   * @param { number | string | Array<any> } value
658   * @returns { RectAttribute }
659   * @syscap SystemCapability.ArkUI.ArkUI.Full
660   * @crossplatform
661   * @form
662   * @since 10
663   */
664  /**
665   * Called when the fillet size is set.
666   *
667   * @param { number | string | Array<any> } value
668   * @returns { RectAttribute }
669   * @syscap SystemCapability.ArkUI.ArkUI.Full
670   * @crossplatform
671   * @form
672   * @atomicservice
673   * @since 11
674   */
675  radius(value: number | string | Array<any>): RectAttribute;
676}
677
678/**
679 * Defines Rect Component.
680 *
681 * @syscap SystemCapability.ArkUI.ArkUI.Full
682 * @form
683 * @since 9
684 */
685/**
686 * Defines Rect Component.
687 *
688 * @syscap SystemCapability.ArkUI.ArkUI.Full
689 * @crossplatform
690 * @form
691 * @since 10
692 */
693/**
694 * Defines Rect Component.
695 *
696 * @syscap SystemCapability.ArkUI.ArkUI.Full
697 * @crossplatform
698 * @form
699 * @atomicservice
700 * @since 11
701 */
702declare const Rect: RectInterface;
703
704/**
705 * Rect attribute.
706 *
707 * @syscap SystemCapability.ArkUI.ArkUI.Full
708 * @since 7
709 * @deprecated since 9
710 */
711declare const RectInStance: RectAttribute;
712
713/**
714 * Rect attribute.
715 *
716 * @syscap SystemCapability.ArkUI.ArkUI.Full
717 * @form
718 * @since 9
719 */
720/**
721 * @syscap SystemCapability.ArkUI.ArkUI.Full
722 * @crossplatform
723 * @form
724 * @since 10
725 */
726/**
727 * @syscap SystemCapability.ArkUI.ArkUI.Full
728 * @crossplatform
729 * @form
730 * @atomicservice
731 * @since 11
732 */
733declare const RectInstance: RectAttribute;
734