-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.d.ts
109 lines (88 loc) · 1.72 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
declare module "svg-points" {
interface CurveArc {
type: "arc";
rx: number;
ry: number;
xAxisRotation: number;
largeArcFlag: number;
sweepFlag: number;
}
interface CurveCubic {
type: "cubic";
x1: number;
y1: number;
x2: number;
y2: number;
}
interface CurveQuadratic {
type: "quadratic";
x1: number;
y1: number;
}
type Curve = CurveArc | CurveCubic | CurveQuadratic;
interface Point {
x: number;
y: number;
moveTo?: true;
curve?: Curve;
}
interface CycleAttrs {
cx: number;
cy: number;
r: number;
}
interface Circle extends CycleAttrs {
type: "circle";
}
interface EllipseAttrs {
cx: number;
cy: number;
rx: number;
ry: number;
}
interface Ellipse extends EllipseAttrs {
type: "ellipse";
}
interface LineAttrs {
x1: number;
x2: number;
y1: number;
y2: number;
}
interface Line extends LineAttrs {
type: "line";
}
interface PathAttrs {
d: string;
}
interface Path extends PathAttrs {
type: "path";
}
interface WithPoints {
points: string[];
}
interface Polygon extends WithPoints {
type: "polygon";
}
interface Polyline extends WithPoints {
type: "polyline";
}
interface RectAttrs {
height: number;
width: number;
x: number;
y: number;
rx?: number;
ry?: number;
}
interface Rect extends RectAttrs {
type: "rect";
}
interface Group {
type: "g";
shapes: ShapeType[];
}
type ShapeType = Group | Circle | Ellipse | Line | Rect | Polygon | Polyline | Path;
export function toPath(shapeOrPoints: ShapeType | Point[]): string;
export function toPoints(shape: ShapeType): Point[];
}