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