• 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 * @since 7
19 */
20/**
21 * Provides interfaces for drawing components.
22 * @form
23 * @since 9
24 */
25interface ShapeInterface {
26  /**
27   * Use the new function to create Shape.
28   * @since 7
29   */
30  new (value?: PixelMap): ShapeAttribute;
31
32  /**
33   * Called when a component is drawn.
34   * @since 7
35   */
36  (value: PixelMap): ShapeAttribute;
37
38  /**
39   * Called when a component is drawn.
40   * @form
41   * @since 9
42   */
43  (): ShapeAttribute;
44}
45
46/**
47 * @since 7
48 */
49/**
50 * @form
51 * @since 9
52 */
53declare class ShapeAttribute extends CommonMethod<ShapeAttribute> {
54  /**
55   * Viewport of shape
56   * @since 7
57   */
58  /**
59   * Viewport of shape
60   * @form
61   * @since 9
62   */
63  viewPort(value: { x?: number | string; y?: number | string; width?: number | string; height?: number | string }): ShapeAttribute;
64
65  /**
66   * Called when the border color is set.
67   * @since 7
68   */
69  /**
70   * Called when the border color is set.
71   * @form
72   * @since 9
73   */
74  stroke(value: ResourceColor): ShapeAttribute;
75
76  /**
77   * Called when the fill color is set.
78   * @since 7
79   */
80  /**
81   * Called when the fill color is set.
82   * @form
83   * @since 9
84   */
85  fill(value: ResourceColor): ShapeAttribute;
86
87  /**
88   * Called when the offset of the starting point of border drawing is set.
89   * @since 7
90   */
91  /**
92   * Called when the offset of the starting point of border drawing is set.
93   * @form
94   * @since 9
95   */
96  strokeDashOffset(value: number | string): ShapeAttribute;
97
98  /**
99   * Called when the gap of the border is set.
100   * @since 7
101   */
102  /**
103   * Called when the gap of the border is set.
104   * @form
105   * @since 9
106   */
107  strokeDashArray(value: Array<any>): ShapeAttribute;
108
109  /**
110   * Called when the path endpoint drawing style is set.
111   * @since 7
112   */
113  /**
114   * Called when the path endpoint drawing style is set.
115   * @form
116   * @since 9
117   */
118  strokeLineCap(value: LineCapStyle): ShapeAttribute;
119
120  /**
121   * Called when the border corner drawing style is set.
122   * @since 7
123   */
124  /**
125   * Called when the border corner drawing style is set.
126   * @form
127   * @since 9
128   */
129  strokeLineJoin(value: LineJoinStyle): ShapeAttribute;
130
131  /**
132   * Called when the limit value for drawing acute angles as oblique angles is set.
133   * @since 7
134   */
135  /**
136   * Called when the limit value for drawing acute angles as oblique angles is set.
137   * @form
138   * @since 9
139   */
140  strokeMiterLimit(value: number | string): ShapeAttribute;
141
142  /**
143   * Called when the opacity of the border is set.
144   * @since 7
145   */
146  /**
147   * Called when the opacity of the border is set.
148   * @form
149   * @since 9
150   */
151  strokeOpacity(value: number | string | Resource): ShapeAttribute;
152
153  /**
154   * Called when the transparency of the border is set.
155   * @since 7
156   */
157  /**
158   * Called when the transparency of the border is set.
159   * @form
160   * @since 9
161   */
162  fillOpacity(value: number | string | Resource): ShapeAttribute;
163
164  /**
165   * Called when the width of the border is set.
166   * @since 7
167   */
168  /**
169   * Called when the width of the border is set.
170   * @form
171   * @since 9
172   */
173  strokeWidth(value: number | string): ShapeAttribute;
174
175  /**
176   * Called when setting whether anti aliasing is on.
177   * @since 7
178   */
179  /**
180   * Called when setting whether anti aliasing is on.
181   * @form
182   * @since 9
183   */
184  antiAlias(value: boolean): ShapeAttribute;
185
186  /**
187   * Called when shape mesh.
188   * @since 8
189   */
190  /**
191   * Called when shape mesh.
192   * @form
193   * @since 9
194   */
195  mesh(value: Array<any>, column: number, row: number): ShapeAttribute;
196}
197
198/**
199 * Defines Shape Component.
200 * @since 7
201 */
202/**
203 * Defines Shape Component.
204 * @form
205 * @since 9
206 */
207declare const Shape: ShapeInterface;
208
209/**
210 * Defines Shape Component instance.
211 * @since 7
212 */
213/**
214 * Defines Shape Component instance.
215 * @form
216 * @since 9
217 */
218declare const ShapeInstance: ShapeAttribute;
219