• 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 * Provides interfaces for drawing components.
18 *
19 * @interface ShapeInterface
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 7
22 */
23/**
24 * Provides interfaces for drawing components.
25 *
26 * @interface ShapeInterface
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @since 9
29 * @form
30 */
31/**
32 * Provides interfaces for drawing components.
33 *
34 * @interface ShapeInterface
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @since 10
38 * @form
39 */
40interface ShapeInterface {
41  /**
42   * Use the new function to create Shape.
43   *
44   * @syscap SystemCapability.ArkUI.ArkUI.Full
45   * @since 7
46   */
47  /**
48   * Use the new function to create Shape.
49   *
50   * @syscap SystemCapability.ArkUI.ArkUI.Full
51   * @crossplatform
52   * @since 10
53   */
54  new (value?: PixelMap): ShapeAttribute;
55
56  /**
57   * Called when a component is drawn.
58   *
59   * @param { PixelMap } value
60   * @returns { ShapeAttribute }
61   * @syscap SystemCapability.ArkUI.ArkUI.Full
62   * @since 7
63   */
64  /**
65   * Called when a component is drawn.
66   *
67   * @param { PixelMap } value
68   * @returns { ShapeAttribute }
69   * @syscap SystemCapability.ArkUI.ArkUI.Full
70   * @crossplatform
71   * @since 10
72   */
73  (value: PixelMap): ShapeAttribute;
74
75  /**
76   * Called when a component is drawn.
77   *
78   * @returns { ShapeAttribute }
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @since 7
81   */
82  /**
83   * Called when a component is drawn.
84   *
85   * @returns { ShapeAttribute }
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @since 9
88   * @form
89   */
90  /**
91   * Called when a component is drawn.
92   *
93   * @returns { ShapeAttribute }
94   * @syscap SystemCapability.ArkUI.ArkUI.Full
95   * @crossplatform
96   * @since 10
97   * @form
98   */
99  (): ShapeAttribute;
100}
101
102/**
103 * @extends CommonMethod
104 * @syscap SystemCapability.ArkUI.ArkUI.Full
105 * @since 7
106 */
107/**
108 * @extends CommonMethod
109 * @syscap SystemCapability.ArkUI.ArkUI.Full
110 * @since 9
111 * @form
112 */
113/**
114 * @extends CommonMethod
115 * @syscap SystemCapability.ArkUI.ArkUI.Full
116 * @crossplatform
117 * @since 10
118 * @form
119 */
120declare class ShapeAttribute extends CommonMethod<ShapeAttribute> {
121  /**
122   * Viewport of shape
123   *
124   * @param { object } value
125   * @returns { ShapeAttribute }
126   * @syscap SystemCapability.ArkUI.ArkUI.Full
127   * @since 7
128   */
129  /**
130   * Viewport of shape
131   *
132   * @param { object } value
133   * @returns { ShapeAttribute }
134   * @syscap SystemCapability.ArkUI.ArkUI.Full
135   * @since 9
136   * @form
137   */
138  /**
139   * Viewport of shape
140   *
141   * @param { object } value
142   * @returns { ShapeAttribute }
143   * @syscap SystemCapability.ArkUI.ArkUI.Full
144   * @crossplatform
145   * @since 10
146   * @form
147   */
148  viewPort(value: { x?: number | string; y?: number | string; width?: number | string; height?: number | string }): ShapeAttribute;
149
150  /**
151   * Called when the border color is set.
152   *
153   * @param { ResourceColor } value
154   * @returns { ShapeAttribute }
155   * @syscap SystemCapability.ArkUI.ArkUI.Full
156   * @since 7
157   */
158  /**
159   * Called when the border color is set.
160   *
161   * @param { ResourceColor } value
162   * @returns { ShapeAttribute }
163   * @syscap SystemCapability.ArkUI.ArkUI.Full
164   * @since 9
165   * @form
166   */
167  /**
168   * Called when the border color is set.
169   *
170   * @param { ResourceColor } value
171   * @returns { ShapeAttribute }
172   * @syscap SystemCapability.ArkUI.ArkUI.Full
173   * @crossplatform
174   * @since 10
175   * @form
176   */
177  stroke(value: ResourceColor): ShapeAttribute;
178
179  /**
180   * Called when the fill color is set.
181   *
182   * @param { ResourceColor } value
183   * @returns { ShapeAttribute }
184   * @syscap SystemCapability.ArkUI.ArkUI.Full
185   * @since 7
186   */
187  /**
188   * Called when the fill color is set.
189   *
190   * @param { ResourceColor } value
191   * @returns { ShapeAttribute }
192   * @syscap SystemCapability.ArkUI.ArkUI.Full
193   * @since 9
194   * @form
195   */
196  /**
197   * Called when the fill color is set.
198   *
199   * @param { ResourceColor } value
200   * @returns { ShapeAttribute }
201   * @syscap SystemCapability.ArkUI.ArkUI.Full
202   * @crossplatform
203   * @since 10
204   * @form
205   */
206  fill(value: ResourceColor): ShapeAttribute;
207
208  /**
209   * Called when the offset of the starting point of border drawing is set.
210   *
211   * @param { number | string } value
212   * @returns { ShapeAttribute }
213   * @syscap SystemCapability.ArkUI.ArkUI.Full
214   * @since 7
215   */
216  /**
217   * Called when the offset of the starting point of border drawing is set.
218   *
219   * @param { number | string } value
220   * @returns { ShapeAttribute }
221   * @syscap SystemCapability.ArkUI.ArkUI.Full
222   * @since 9
223   * @form
224   */
225  /**
226   * Called when the offset of the starting point of border drawing is set.
227   *
228   * @param { number | string } value
229   * @returns { ShapeAttribute }
230   * @syscap SystemCapability.ArkUI.ArkUI.Full
231   * @crossplatform
232   * @since 10
233   * @form
234   */
235  strokeDashOffset(value: number | string): ShapeAttribute;
236
237  /**
238   * Called when the gap of the border is set.
239   *
240   * @param { Array<any> } value
241   * @returns { ShapeAttribute }
242   * @syscap SystemCapability.ArkUI.ArkUI.Full
243   * @since 7
244   */
245  /**
246   * Called when the gap of the border is set.
247   *
248   * @param { Array<any> } value
249   * @returns { ShapeAttribute }
250   * @syscap SystemCapability.ArkUI.ArkUI.Full
251   * @since 9
252   * @form
253   */
254  /**
255   * Called when the gap of the border is set.
256   *
257   * @param { Array<any> } value
258   * @returns { ShapeAttribute }
259   * @syscap SystemCapability.ArkUI.ArkUI.Full
260   * @crossplatform
261   * @since 10
262   * @form
263   */
264  strokeDashArray(value: Array<any>): ShapeAttribute;
265
266  /**
267   * Called when the path endpoint drawing style is set.
268   *
269   * @param { LineCapStyle } value
270   * @returns { ShapeAttribute }
271   * @syscap SystemCapability.ArkUI.ArkUI.Full
272   * @since 7
273   */
274  /**
275   * Called when the path endpoint drawing style is set.
276   *
277   * @param { LineCapStyle } value
278   * @returns { ShapeAttribute }
279   * @syscap SystemCapability.ArkUI.ArkUI.Full
280   * @since 9
281   * @form
282   */
283  /**
284   * Called when the path endpoint drawing style is set.
285   *
286   * @param { LineCapStyle } value
287   * @returns { ShapeAttribute }
288   * @syscap SystemCapability.ArkUI.ArkUI.Full
289   * @crossplatform
290   * @since 10
291   * @form
292   */
293  strokeLineCap(value: LineCapStyle): ShapeAttribute;
294
295  /**
296   * Called when the border corner drawing style is set.
297   *
298   * @param { LineJoinStyle } value
299   * @returns { ShapeAttribute }
300   * @syscap SystemCapability.ArkUI.ArkUI.Full
301   * @since 7
302   */
303  /**
304   * Called when the border corner drawing style is set.
305   *
306   * @param { LineJoinStyle } value
307   * @returns { ShapeAttribute }
308   * @syscap SystemCapability.ArkUI.ArkUI.Full
309   * @since 9
310   * @form
311   */
312  /**
313   * Called when the border corner drawing style is set.
314   *
315   * @param { LineJoinStyle } value
316   * @returns { ShapeAttribute }
317   * @syscap SystemCapability.ArkUI.ArkUI.Full
318   * @crossplatform
319   * @since 10
320   * @form
321   */
322  strokeLineJoin(value: LineJoinStyle): ShapeAttribute;
323
324  /**
325   * Called when the limit value for drawing acute angles as oblique angles is set.
326   *
327   * @param { number | string } value
328   * @returns { ShapeAttribute }
329   * @syscap SystemCapability.ArkUI.ArkUI.Full
330   * @since 7
331   */
332  /**
333   * Called when the limit value for drawing acute angles as oblique angles is set.
334   *
335   * @param { number | string } value
336   * @returns { ShapeAttribute }
337   * @syscap SystemCapability.ArkUI.ArkUI.Full
338   * @since 9
339   * @form
340   */
341  /**
342   * Called when the limit value for drawing acute angles as oblique angles is set.
343   *
344   * @param { number | string } value
345   * @returns { ShapeAttribute }
346   * @syscap SystemCapability.ArkUI.ArkUI.Full
347   * @crossplatform
348   * @since 10
349   * @form
350   */
351  strokeMiterLimit(value: number | string): ShapeAttribute;
352
353  /**
354   * Called when the opacity of the border is set.
355   *
356   * @param { number | string | Resource } value
357   * @returns { ShapeAttribute }
358   * @syscap SystemCapability.ArkUI.ArkUI.Full
359   * @since 7
360   */
361  /**
362   * Called when the opacity of the border is set.
363   *
364   * @param { number | string | Resource } value
365   * @returns { ShapeAttribute }
366   * @syscap SystemCapability.ArkUI.ArkUI.Full
367   * @since 9
368   * @form
369   */
370  /**
371   * Called when the opacity of the border is set.
372   *
373   * @param { number | string | Resource } value
374   * @returns { ShapeAttribute }
375   * @syscap SystemCapability.ArkUI.ArkUI.Full
376   * @crossplatform
377   * @since 10
378   * @form
379   */
380  strokeOpacity(value: number | string | Resource): ShapeAttribute;
381
382  /**
383   * Called when the transparency of the border is set.
384   *
385   * @param { number | string | Resource } value
386   * @returns { ShapeAttribute }
387   * @syscap SystemCapability.ArkUI.ArkUI.Full
388   * @since 7
389   */
390  /**
391   * Called when the transparency of the border is set.
392   *
393   * @param { number | string | Resource } value
394   * @returns { ShapeAttribute }
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @since 9
397   * @form
398   */
399  /**
400   * Called when the transparency of the border is set.
401   *
402   * @param { number | string | Resource } value
403   * @returns { ShapeAttribute }
404   * @syscap SystemCapability.ArkUI.ArkUI.Full
405   * @crossplatform
406   * @since 10
407   * @form
408   */
409  fillOpacity(value: number | string | Resource): ShapeAttribute;
410
411  /**
412   * Called when the width of the border is set.
413   *
414   * @param { number | string } value
415   * @returns { ShapeAttribute }
416   * @syscap SystemCapability.ArkUI.ArkUI.Full
417   * @since 7
418   */
419  /**
420   * Called when the width of the border is set.
421   *
422   * @param { number | string } value
423   * @returns { ShapeAttribute }
424   * @syscap SystemCapability.ArkUI.ArkUI.Full
425   * @since 9
426   * @form
427   */
428  /**
429   * Called when the width of the border is set.
430   *
431   * @param { number | string } value
432   * @returns { ShapeAttribute }
433   * @syscap SystemCapability.ArkUI.ArkUI.Full
434   * @crossplatform
435   * @since 10
436   * @form
437   */
438  strokeWidth(value: number | string): ShapeAttribute;
439
440  /**
441   * Called when setting whether anti aliasing is on.
442   *
443   * @param { boolean } value
444   * @returns { ShapeAttribute }
445   * @syscap SystemCapability.ArkUI.ArkUI.Full
446   * @since 7
447   */
448  /**
449   * Called when setting whether anti aliasing is on.
450   *
451   * @param { boolean } value
452   * @returns { ShapeAttribute }
453   * @syscap SystemCapability.ArkUI.ArkUI.Full
454   * @since 9
455   * @form
456   */
457  /**
458   * Called when setting whether anti aliasing is on.
459   *
460   * @param { boolean } value
461   * @returns { ShapeAttribute }
462   * @syscap SystemCapability.ArkUI.ArkUI.Full
463   * @crossplatform
464   * @since 10
465   * @form
466   */
467  antiAlias(value: boolean): ShapeAttribute;
468
469  /**
470   * Called when shape mesh.
471   *
472   * @param { Array<any> } value
473   * @param { number } column
474   * @param { number } row
475   * @returns { ShapeAttribute }
476   * @syscap SystemCapability.ArkUI.ArkUI.Full
477   * @since 8
478   */
479  /**
480   * Called when shape mesh.
481   *
482   * @param { Array<any> } value
483   * @param { number } column
484   * @param { number } row
485   * @returns { ShapeAttribute }
486   * @syscap SystemCapability.ArkUI.ArkUI.Full
487   * @since 9
488   * @form
489   */
490  /**
491   * Called when shape mesh.
492   *
493   * @param { Array<any> } value
494   * @param { number } column
495   * @param { number } row
496   * @returns { ShapeAttribute }
497   * @syscap SystemCapability.ArkUI.ArkUI.Full
498   * @crossplatform
499   * @since 10
500   * @form
501   */
502  mesh(value: Array<any>, column: number, row: number): ShapeAttribute;
503}
504
505/**
506 * Defines Shape Component.
507 *
508 * @syscap SystemCapability.ArkUI.ArkUI.Full
509 * @since 7
510 */
511/**
512 * Defines Shape Component.
513 *
514 * @syscap SystemCapability.ArkUI.ArkUI.Full
515 * @since 9
516 * @form
517 */
518/**
519 * Defines Shape Component.
520 *
521 * @syscap SystemCapability.ArkUI.ArkUI.Full
522 * @crossplatform
523 * @since 10
524 * @form
525 */
526declare const Shape: ShapeInterface;
527
528/**
529 * Defines Shape Component instance.
530 *
531 * @syscap SystemCapability.ArkUI.ArkUI.Full
532 * @since 7
533 */
534/**
535 * Defines Shape Component instance.
536 *
537 * @syscap SystemCapability.ArkUI.ArkUI.Full
538 * @since 9
539 * @form
540 */
541/**
542 * Defines Shape Component instance.
543 *
544 * @syscap SystemCapability.ArkUI.ArkUI.Full
545 * @crossplatform
546 * @since 10
547 * @form
548 */
549declare const ShapeInstance: ShapeAttribute;
550