-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathPath2D.res
More file actions
142 lines (127 loc) · 3.21 KB
/
Copy pathPath2D.res
File metadata and controls
142 lines (127 loc) · 3.21 KB
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
open CanvasAPI
open DOMAPI
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
*/
@new
external make: (~path: path2D=?) => path2D = "Path2D"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
*/
@new
external make2: (~path: string=?) => path2D = "Path2D"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath)
*/
@send
external closePath: path2D => unit = "closePath"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo)
*/
@send
external moveTo: (path2D, ~x: float, ~y: float) => unit = "moveTo"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo)
*/
@send
external lineTo: (path2D, ~x: float, ~y: float) => unit = "lineTo"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo)
*/
@send
external quadraticCurveTo: (path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: float) => unit =
"quadraticCurveTo"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo)
*/
@send
external bezierCurveTo: (
path2D,
~cp1x: float,
~cp1y: float,
~cp2x: float,
~cp2y: float,
~x: float,
~y: float,
) => unit = "bezierCurveTo"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo)
*/
@send
external arcTo: (path2D, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float) => unit =
"arcTo"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect)
*/
@send
external rect: (path2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect: (
path2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect2: (
path2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect3: (
path2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc)
*/
@send
external arc: (
path2D,
~x: float,
~y: float,
~radius: float,
~startAngle: float,
~endAngle: float,
~counterclockwise: bool=?,
) => unit = "arc"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/ellipse)
*/
@send
external ellipse: (
path2D,
~x: float,
~y: float,
~radiusX: float,
~radiusY: float,
~rotation: float,
~startAngle: float,
~endAngle: float,
~counterclockwise: bool=?,
) => unit = "ellipse"
/**
Adds to the path the path given by the argument.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D/addPath)
*/
@send
external addPath: (path2D, ~path: path2D, ~transform: domMatrix2DInit=?) => unit = "addPath"