-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
241 lines (196 loc) · 6.73 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
import React from "react";
import { Constructor, NativeMethods, ViewProps } from "react-native";
type ColorType = number | string;
interface ShadowProps {
shadow?: ColorType
shadowRadius?:number
shadowOffset?:number
shadowOffsetX?:number
shadowOffsetY?:number
shadowPercentageValue?:boolean
shadowRect?:{ x:number,y:number,w:number,h:number, units:'userSpaceOnUse' | 'objectBoundingBox'} //web
}
interface CommonFillProps {
fill?:ColorType
fillRule?: 'evenodd' | 'nonzero'
fillOpacity?:number
}
interface CommonStrokeProps {
stroke?: ColorType
strokeOpacity?:number
strokeWidth?:number
strokeStart?:number
strokeEnd?:number
dashArray?:number
dashClipValue?:number // WHEN strokeStart > 0 && strokeEnd < 1 useful with cap round
strokeCap?:'butt' | 'round' | 'square'
strokeJoin?: 'bevel' | 'miter' | 'round'
strokeMiter?:number
}
interface CommonPathProps extends CommonFillProps , CommonStrokeProps {
}
interface CommonTransformProps extends BaseSvgProps {
mask?:string
opacity?:number
translateZ?:number
transX?:number
transY?:number
transPercentageValue?:boolean
rot?:number
rotO?:number
rotOx?:number
rotOy?:number
rotPercentageValue?:boolean
sc?:number
scX?:number
scY?:number
scO?:number
scOx?:number
scOy?:number
scPercentageValue?:boolean
}
interface BaseSvgProps {
painterKey?:string
viewBox?:number[]
aspect?: 'meet' | 'slice' | 'none'
align?:'xMinYMin'|
'xMidYMin' |
'xMaxYMin' |
'xMinYMid' |
'xMidYMid' |
'xMaxYMid' |
'xMinYMax' |
'xMidYMax' |
'xMaxYMax' |
'none'
}
interface LayoutProps{
x?:number
y?:number
w?:number
h?:number
}
interface PainterProps extends ViewProps ,BaseSvgProps {
}
interface CommonProps extends ShadowProps, CommonPathProps ,CommonTransformProps {}
interface CommonGroupProps extends CommonTransformProps {
fillRule?: 'evenodd' | 'nonzero'
fillOpacity?:number
}
interface LineProps extends CommonProps , ViewProps{
x1?:number
y1?:number
x2?:number
y2?:number
}
interface TextProps extends CommonProps , ViewProps{
x?:number
y?:number
text?:string
fontSize?:number
fontStyle?:'normal' | 'bold' | 'italic'
font?: 'default' | string
baseline?:'ascender' | 'middle' | 'descender' | 'none' | 'center' | 'capHeight'
textAnchor?:string
verticalOffset?:number
horizontalOffset?:number
}
interface CircleProps extends CommonProps , ViewProps{
cx?:number
cy?:number
r?:number
}
interface PathProps extends CommonProps , ViewProps{ d?:string }
interface GProps extends CommonGroupProps , ViewProps{}
interface RectProps extends CommonProps , ViewProps,LayoutProps{
rtl?:number
rtr?:number
rbr?:number
rbl?:number
}
interface MaskProps extends ViewProps{
name:string
}
interface MaskGProps extends CommonGroupProps , ViewProps{
}
interface EllipseProps extends CommonProps , ViewProps{
cx?:number
cy?:number
rx?:number
ry?:number
}
interface CustomViewProps extends LayoutProps, CommonTransformProps {}
interface GradientProps extends CustomViewProps {
positions?:number[]
colors?: ColorType[]
}
interface LinearGradientProps extends GradientProps, ViewProps{
startPoint?:{ x:number,y:number }
endPoint?:{ x:number,y:number }
}
interface RadialGradientProps extends GradientProps, ViewProps{
cx?:number
cy?:number
rx?:number
ry?:number
}
interface ImageProps extends ViewProps,CustomViewProps,ShadowProps{
source?:string
// clipToBounds?:boolean
fill?:ColorType
aspectImage?: 'meet' | 'slice' | 'none'
alignImage?:'xMinYMin'|
'xMidYMin' |
'xMaxYMin' |
'xMinYMid' |
'xMidYMid' |
'xMaxYMid' |
'xMinYMax' |
'xMidYMax' |
'xMaxYMax' |
'none'
}
declare class ImageComponent extends React.Component<ImageProps> {}
declare const ImageBase: Constructor<NativeMethods> & typeof ImageComponent;
declare class RadialGradientComponent extends React.Component<RadialGradientProps> {}
declare const RadialGradientBase: Constructor<NativeMethods> & typeof RadialGradientComponent;
declare class LinearGradientComponent extends React.Component<LinearGradientProps> {}
declare const LinearGradientBase: Constructor<NativeMethods> & typeof LinearGradientComponent;
declare class EllipseComponent extends React.Component<EllipseProps> {}
declare const EllipseBase: Constructor<NativeMethods> & typeof EllipseComponent;
declare class MaskGComponent extends React.Component<MaskGProps> {}
declare const MaskGBase: Constructor<NativeMethods> & typeof MaskGComponent;
declare class MaskComponent extends React.Component<MaskProps> {}
declare const MaskBase: Constructor<NativeMethods> & typeof MaskComponent;
declare class RectComponent extends React.Component<RectProps> {}
declare const RectBase: Constructor<NativeMethods> & typeof RectComponent;
declare class CircleComponent extends React.Component<CircleProps> {}
declare const CircleBase: Constructor<NativeMethods> & typeof CircleComponent;
declare class TextComponent extends React.Component<TextProps> {}
declare const TextBase: Constructor<NativeMethods> & typeof TextComponent;
declare class LineComponent extends React.Component<LineProps> {}
declare const LineBase: Constructor<NativeMethods> & typeof LineComponent;
declare class PathComponent extends React.Component<PathProps> {}
declare const PathBase: Constructor<NativeMethods> & typeof PathComponent;
declare class GComponent extends React.Component<GProps> {}
declare const GBase: Constructor<NativeMethods> & typeof GComponent;
declare class PainterComponent extends React.Component<PainterProps> {}
declare const PainterBase: Constructor<NativeMethods> & typeof PainterComponent;
export class Image extends ImageBase {}
export class RadialGradient extends RadialGradientBase {}
export class LinearGradient extends LinearGradientBase {}
export class Ellipse extends EllipseBase {}
export class MaskG extends MaskGBase {}
export class Mask extends MaskBase {}
export class Rect extends RectBase {}
export class Circle extends CircleBase {}
export class Text extends TextBase {}
export class Line extends LineBase {}
export class Path extends PathBase {}
export class G extends GBase {}
export class GS extends GBase {}
export class GH extends GBase {}
export class Painter extends PainterBase {}
export class PainterH extends PainterBase {}
export class PainterS extends PainterBase {}
export function Color(color:number | number[] | string): number;