1 | import * as React from 'react';
|
2 | import * as ReactNative from 'react-native';
|
3 |
|
4 |
|
5 | type NumberProp = string | number;
|
6 |
|
7 | export type FillRule = 'evenodd' | 'nonzero';
|
8 | export type Units = 'userSpaceOnUse' | 'objectBoundingBox';
|
9 |
|
10 | export type TextAnchor = 'start' | 'middle' | 'end';
|
11 | export type FontStyle = 'normal' | 'italic' | 'oblique';
|
12 | export type FontVariant = 'normal' | 'small-caps';
|
13 | export type FontWeight =
|
14 | | 'normal'
|
15 | | 'bold'
|
16 | | 'bolder'
|
17 | | 'lighter'
|
18 | | '100'
|
19 | | '200'
|
20 | | '300'
|
21 | | '400'
|
22 | | '500'
|
23 | | '600'
|
24 | | '700'
|
25 | | '800'
|
26 | | '900'
|
27 | ;
|
28 | export type FontStretch =
|
29 | | 'normal'
|
30 | | 'wider'
|
31 | | 'narrower'
|
32 | | 'ultra-condensed'
|
33 | | 'extra-condensed'
|
34 | | 'condensed'
|
35 | | 'semi-condensed'
|
36 | | 'semi-expanded'
|
37 | | 'expanded'
|
38 | | 'extra-expanded'
|
39 | | 'ultra-expanded'
|
40 | ;
|
41 | export type TextDecoration = 'none' | 'underline' | 'overline' | 'line-through' | 'blink';
|
42 | export type FontVariantLigatures = 'normal' | 'none';
|
43 | export type AlignmentBaseline =
|
44 | | 'baseline'
|
45 | | 'text-bottom'
|
46 | | 'alphabetic'
|
47 | | 'ideographic'
|
48 | | 'middle'
|
49 | | 'central'
|
50 | | 'mathematical'
|
51 | | 'text-top'
|
52 | | 'bottom'
|
53 | | 'center'
|
54 | | 'top'
|
55 | | 'text-before-edge'
|
56 | | 'text-after-edge'
|
57 | | 'before-edge'
|
58 | | 'after-edge'
|
59 | | 'hanging'
|
60 | ;
|
61 | export type BaselineShift = 'sub' | 'super' | 'baseline' | ReadonlyArray<NumberProp> | NumberProp;
|
62 | export type LengthAdjust = 'spacing' | 'spacingAndGlyphs';
|
63 |
|
64 | export type TextPathMethod = 'align' | 'stretch';
|
65 | export type TextPathSpacing = 'auto' | 'exact';
|
66 | export type TextPathMidLine = 'sharp' | 'smooth';
|
67 |
|
68 | export type Linecap = 'butt' | 'square' | 'round';
|
69 | export type Linejoin = 'miter' | 'bevel' | 'round';
|
70 |
|
71 | export interface TouchableProps {
|
72 | disabled?: boolean,
|
73 | onPress?: (event: any) => any,
|
74 | onPressIn?: (event: any) => any,
|
75 | onPressOut?: (event: any) => any,
|
76 | onLongPress?: (event: any) => any,
|
77 | delayPressIn?: number,
|
78 | delayPressOut?: number,
|
79 | delayLongPress?: number
|
80 | }
|
81 |
|
82 | export interface ResponderProps extends ReactNative.GestureResponderHandlers {
|
83 | pointerEvents?: "box-none" | "none" | "box-only" | "auto",
|
84 | }
|
85 |
|
86 |
|
87 |
|
88 | type rgbaArray = ReadonlyArray<number>
|
89 |
|
90 |
|
91 |
|
92 | type int32ARGBColor = number
|
93 |
|
94 | export interface FillProps {
|
95 | fill?: int32ARGBColor | rgbaArray | string,
|
96 | fillOpacity?: NumberProp,
|
97 | fillRule?: FillRule,
|
98 | }
|
99 |
|
100 | export interface ClipProps {
|
101 | clipRule?: FillRule,
|
102 | clipPath?: string
|
103 | }
|
104 |
|
105 | interface VectorEffectProps {
|
106 | vectorEffect?: "none" | "non-scaling-stroke" | "nonScalingStroke" | "default" | "inherit" | "uri";
|
107 | }
|
108 |
|
109 | export interface DefinitionProps {
|
110 | id?: string,
|
111 | }
|
112 |
|
113 | export interface StrokeProps {
|
114 | stroke?: int32ARGBColor | rgbaArray | string,
|
115 | strokeWidth?: NumberProp,
|
116 | strokeOpacity?: NumberProp,
|
117 | strokeDasharray?: ReadonlyArray<NumberProp> | NumberProp,
|
118 | strokeDashoffset?: NumberProp,
|
119 | strokeLinecap?: Linecap,
|
120 | strokeLinejoin?: Linejoin,
|
121 | strokeMiterlimit?: NumberProp,
|
122 | }
|
123 |
|
124 | export interface FontObject {
|
125 | fontStyle?: FontStyle,
|
126 | fontVariant?: FontVariant,
|
127 | fontWeight?: FontWeight,
|
128 | fontStretch?: FontStretch,
|
129 | fontSize?: NumberProp,
|
130 | fontFamily?: string,
|
131 | textAnchor?: TextAnchor,
|
132 | textDecoration?: TextDecoration,
|
133 | letterSpacing?: NumberProp,
|
134 | wordSpacing?: NumberProp,
|
135 | kerning?: NumberProp,
|
136 | fontVariantLigatures?: FontVariantLigatures,
|
137 | }
|
138 |
|
139 | export interface FontProps extends FontObject {
|
140 | font?: FontObject,
|
141 | }
|
142 |
|
143 | export interface TransformObject {
|
144 | scale?: NumberProp,
|
145 | scaleX?: NumberProp,
|
146 | scaleY?: NumberProp,
|
147 | rotate?: NumberProp,
|
148 | rotation?: NumberProp,
|
149 | translate?: NumberProp,
|
150 | translateX?: NumberProp,
|
151 | translateY?: NumberProp,
|
152 | x?: NumberProp,
|
153 | y?: NumberProp,
|
154 | origin?: NumberProp,
|
155 | originX?: NumberProp,
|
156 | originY?: NumberProp,
|
157 | skew?: NumberProp,
|
158 | skewX?: NumberProp,
|
159 | skewY?: NumberProp,
|
160 | }
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 | type ColumnMajorTransformMatrix = ReadonlyArray<number>;
|
178 |
|
179 | export interface TransformProps extends TransformObject {
|
180 | transform?: ColumnMajorTransformMatrix | string | TransformObject,
|
181 | }
|
182 |
|
183 | export interface CommonMaskProps {
|
184 | mask?: string;
|
185 | }
|
186 |
|
187 | export interface CommonPathProps extends FillProps, StrokeProps, ClipProps, TransformProps, VectorEffectProps, ResponderProps, TouchableProps, DefinitionProps, CommonMaskProps {}
|
188 |
|
189 |
|
190 | export interface CircleProps extends CommonPathProps {
|
191 | cx?: NumberProp,
|
192 | cy?: NumberProp,
|
193 | opacity?: NumberProp,
|
194 | r?: NumberProp,
|
195 | }
|
196 | export const Circle: React.ComponentClass<CircleProps>;
|
197 |
|
198 | export interface ClipPathProps {
|
199 | id: string,
|
200 | }
|
201 | export const ClipPath: React.ComponentClass<ClipPathProps>;
|
202 |
|
203 | export const Defs: React.ComponentClass<{}>;
|
204 |
|
205 | export interface EllipseProps extends CommonPathProps {
|
206 | cx?: NumberProp,
|
207 | cy?: NumberProp,
|
208 | opacity?: NumberProp,
|
209 | rx?: NumberProp,
|
210 | ry?: NumberProp,
|
211 | }
|
212 | export const Ellipse: React.ComponentClass<EllipseProps>;
|
213 |
|
214 | export interface GProps extends CommonPathProps {
|
215 | opacity?: NumberProp,
|
216 | }
|
217 | export const G: React.ComponentClass<GProps>;
|
218 |
|
219 | export interface ImageProps extends ResponderProps, CommonMaskProps, ClipProps, TouchableProps {
|
220 | x?: NumberProp,
|
221 | y?: NumberProp,
|
222 | width?: NumberProp,
|
223 | height?: NumberProp,
|
224 | xlinkHref?: ReactNative.ImageProperties['source'],
|
225 | href: ReactNative.ImageProperties['source'],
|
226 | preserveAspectRatio?: string,
|
227 | opacity?: NumberProp,
|
228 | }
|
229 | export const Image: React.ComponentClass<ImageProps>;
|
230 |
|
231 | export interface LineProps extends CommonPathProps {
|
232 | opacity?: NumberProp,
|
233 | x1?: NumberProp,
|
234 | x2?: NumberProp,
|
235 | y1?: NumberProp,
|
236 | y2?: NumberProp,
|
237 | }
|
238 | export const Line: React.ComponentClass<LineProps>;
|
239 |
|
240 | export interface LinearGradientProps {
|
241 | x1?: NumberProp,
|
242 | x2?: NumberProp,
|
243 | y1?: NumberProp,
|
244 | y2?: NumberProp,
|
245 | gradientUnits?: Units,
|
246 | id: string,
|
247 | }
|
248 | export const LinearGradient: React.ComponentClass<LinearGradientProps>;
|
249 |
|
250 | export interface PathProps extends CommonPathProps {
|
251 | d: string,
|
252 | opacity?: NumberProp,
|
253 | }
|
254 | export const Path: React.ComponentClass<PathProps>;
|
255 |
|
256 | export interface PatternProps {
|
257 | id: string,
|
258 | x?: NumberProp,
|
259 | y?: NumberProp,
|
260 | width?: NumberProp,
|
261 | height?: NumberProp,
|
262 | patternTransform?: ColumnMajorTransformMatrix | string,
|
263 | patternUnits?: Units,
|
264 | patternContentUnits?: Units,
|
265 | viewBox?: string,
|
266 | preserveAspectRatio?: string
|
267 | }
|
268 | export const Pattern: React.ComponentClass<PatternProps>;
|
269 |
|
270 | export interface PolygonProps extends CommonPathProps {
|
271 | opacity?: NumberProp,
|
272 | points: string | ReadonlyArray<NumberProp>,
|
273 | }
|
274 | export const Polygon: React.ComponentClass<PolygonProps>;
|
275 |
|
276 | export interface PolylineProps extends CommonPathProps {
|
277 | opacity?: NumberProp,
|
278 | points: string | ReadonlyArray<NumberProp>,
|
279 | }
|
280 | export const Polyline: React.ComponentClass<PolylineProps>;
|
281 |
|
282 | export interface RadialGradientProps {
|
283 | fx?: NumberProp,
|
284 | fy?: NumberProp,
|
285 | rx?: NumberProp,
|
286 | ry?: NumberProp,
|
287 | cx?: NumberProp,
|
288 | cy?: NumberProp,
|
289 | r?: NumberProp,
|
290 | gradientUnits?: Units,
|
291 | id: string,
|
292 | }
|
293 | export const RadialGradient: React.ComponentClass<RadialGradientProps>;
|
294 |
|
295 | export interface RectProps extends CommonPathProps {
|
296 | x?: NumberProp,
|
297 | y?: NumberProp,
|
298 | width?: NumberProp,
|
299 | height?: NumberProp,
|
300 | rx?: NumberProp,
|
301 | ry?: NumberProp,
|
302 | opacity?: NumberProp,
|
303 | }
|
304 | export const Rect: React.ComponentClass<RectProps>;
|
305 |
|
306 | export interface StopProps {
|
307 | stopColor?: int32ARGBColor | rgbaArray | string,
|
308 | stopOpacity?: NumberProp,
|
309 | offset?: NumberProp,
|
310 | }
|
311 | export const Stop: React.ComponentClass<StopProps>;
|
312 |
|
313 | export interface SvgProps extends GProps, ReactNative.ViewProperties {
|
314 | width?: NumberProp,
|
315 | height?: NumberProp,
|
316 | viewBox?: string,
|
317 | preserveAspectRatio?: string,
|
318 | color?: int32ARGBColor | rgbaArray | string,
|
319 | title?: string,
|
320 | }
|
321 |
|
322 |
|
323 | export const Svg: React.ComponentClass<SvgProps>;
|
324 | export default Svg;
|
325 |
|
326 | export interface SymbolProps {
|
327 | id: string,
|
328 | viewBox?: string,
|
329 | preserveAspectRatio?: string,
|
330 | opacity?: NumberProp,
|
331 | }
|
332 | export const Symbol: React.ComponentClass<SymbolProps>;
|
333 |
|
334 | export interface TSpanProps extends CommonPathProps, FontProps {
|
335 | dx?: NumberProp,
|
336 | dy?: NumberProp,
|
337 | }
|
338 | export const TSpan: React.ComponentClass<TSpanProps>;
|
339 |
|
340 | export interface TextSpecificProps extends CommonPathProps, FontProps {
|
341 | alignmentBaseline?: AlignmentBaseline,
|
342 | baselineShift?: BaselineShift,
|
343 | verticalAlign?: NumberProp,
|
344 | lengthAdjust?: LengthAdjust,
|
345 | textLength?: NumberProp,
|
346 | fontData?: null | { [name: string]: any },
|
347 | fontFeatureSettings?: string,
|
348 | }
|
349 |
|
350 | export interface TextProps extends TextSpecificProps {
|
351 | dx?: NumberProp,
|
352 | dy?: NumberProp,
|
353 | opacity?: NumberProp,
|
354 | }
|
355 | export const Text: React.ComponentClass<TextProps>;
|
356 |
|
357 | export interface TextPathProps extends TextSpecificProps {
|
358 | xlinkHref?: string,
|
359 | href: string,
|
360 | startOffset?: NumberProp,
|
361 | method?: TextPathMethod,
|
362 | spacing?: TextPathSpacing,
|
363 | midLine: TextPathMidLine,
|
364 | }
|
365 | export const TextPath: React.ComponentClass<TextPathProps>;
|
366 |
|
367 | export interface UseProps extends CommonPathProps {
|
368 | xlinkHref?: string,
|
369 | href: string,
|
370 | width?: NumberProp,
|
371 | height?: NumberProp,
|
372 | x?: NumberProp,
|
373 | y?: NumberProp,
|
374 | opacity?: NumberProp,
|
375 | }
|
376 | export const Use: React.ComponentClass<UseProps>;
|
377 |
|
378 |
|
379 | export enum EMaskUnits {
|
380 | USER_SPACE_ON_USE = 'userSpaceOnUse',
|
381 | OBJECT_BOUNDING_BOX = 'objectBoundingBox',
|
382 | }
|
383 |
|
384 | export type TMaskUnits =
|
385 | | EMaskUnits.USER_SPACE_ON_USE
|
386 | | EMaskUnits.OBJECT_BOUNDING_BOX;
|
387 |
|
388 | export interface MaskProps extends CommonPathProps {
|
389 | id: string,
|
390 | x?: NumberProp,
|
391 | y?: NumberProp,
|
392 | width?: NumberProp,
|
393 | height?: NumberProp,
|
394 | maskTransform?: ColumnMajorTransformMatrix | string,
|
395 | maskUnits?: TMaskUnits,
|
396 | maskContentUnits?: TMaskUnits,
|
397 | }
|
398 | export const Mask: React.ComponentClass<MaskProps>;
|