@@ -78,13 +78,13 @@ type rec style<_> =
7878 | Pattern : style <pattern >
7979
8080/* 2d Canvas API, following https://simon.html5.org/dump/html5-canvas-cheat-sheet.html */
81- @send external save : t => unit = ""
82- @send external restore : t => unit = ""
81+ @send external save : t => unit = "save "
82+ @send external restore : t => unit = "restore "
8383
8484/* Transformation */
85- @send external scale : (t , ~x : float , ~y : float ) => unit = ""
86- @send external rotate : (t , float ) => unit = ""
87- @send external translate : (t , ~x : float , ~y : float ) => unit = ""
85+ @send external scale : (t , ~x : float , ~y : float ) => unit = "scale "
86+ @send external rotate : (t , float ) => unit = "rotate "
87+ @send external translate : (t , ~x : float , ~y : float ) => unit = "translate "
8888@send
8989external transform : (
9090 t ,
@@ -94,7 +94,7 @@ external transform: (
9494 ~m22 : float ,
9595 ~dx : float ,
9696 ~dy : float ,
97- ) => unit = ""
97+ ) => unit = "transform "
9898@send
9999external setTransform : (
100100 t ,
@@ -104,17 +104,17 @@ external setTransform: (
104104 ~m22 : float ,
105105 ~dx : float ,
106106 ~dy : float ,
107- ) => unit = ""
107+ ) => unit = "setTransform "
108108
109109/* Compositing */
110- @set external globalAlpha : (t , float ) => unit = ""
111- @set external globalCompositeOperation : (t , Composite .t ) => unit = ""
110+ @set external globalAlpha : (t , float ) => unit = "globalAlpha "
111+ @set external globalCompositeOperation : (t , Composite .t ) => unit = "globalCompositeOperation "
112112
113113/* Line Styles */
114- @set external lineWidth : (t , float ) => unit = ""
115- @set external lineCap : (t , LineCap .t ) => unit = ""
116- @set external lineJoin : (t , LineJoin .t ) => unit = ""
117- @set external miterLimit : (t , float ) => unit = ""
114+ @set external lineWidth : (t , float ) => unit = "lineWidth "
115+ @set external lineCap : (t , LineCap .t ) => unit = "lineCap "
116+ @set external lineJoin : (t , LineJoin .t ) => unit = "lineJoin "
117+ @set external miterLimit : (t , float ) => unit = "miterLimit "
118118
119119/* Colors, Styles, and Shadows */
120120@set external setFillStyle : (t , @ignore style <'a >, 'a ) => unit = "fillStyle"
@@ -145,21 +145,21 @@ let reifyStyle = (type a, x: 'a): (style<a>, a) => {
145145 )
146146}
147147
148- @get external fillStyle : t => 'a = ""
149- @get external strokeStyle : t => 'a = ""
148+ @get external fillStyle : t => 'a = "fillStyle "
149+ @get external strokeStyle : t => 'a = "strokeStyle "
150150
151151let fillStyle = (ctx : t ) => ctx -> fillStyle -> reifyStyle
152152
153153let strokeStyle = (ctx : t ) => ctx -> strokeStyle -> reifyStyle
154154
155- @set external shadowOffsetX : (t , float ) => unit = ""
156- @set external shadowOffsetY : (t , float ) => unit = ""
157- @set external shadowBlur : (t , float ) => unit = ""
158- @set external shadowColor : (t , string ) => unit = ""
155+ @set external shadowOffsetX : (t , float ) => unit = "shadowOffsetX "
156+ @set external shadowOffsetY : (t , float ) => unit = "shadowOffsetY "
157+ @set external shadowBlur : (t , float ) => unit = "shadowBlur "
158+ @set external shadowColor : (t , string ) => unit = "shadowColor "
159159
160160/* Gradients */
161161@send
162- external createLinearGradient : (t , ~x0 : float , ~y0 : float , ~x1 : float , ~y1 : float ) => gradient = ""
162+ external createLinearGradient : (t , ~x0 : float , ~y0 : float , ~x1 : float , ~y1 : float ) => gradient = "createLinearGradient "
163163@send
164164external createRadialGradient : (
165165 t ,
@@ -169,8 +169,8 @@ external createRadialGradient: (
169169 ~y1 : float ,
170170 ~r0 : float ,
171171 ~r1 : float ,
172- ) => gradient = ""
173- @send external addColorStop : (gradient , float , string ) => unit = ""
172+ ) => gradient = "createRadialGradient "
173+ @send external addColorStop : (gradient , float , string ) => unit = "addColorStop "
174174@val
175175external createPattern : (
176176 t ,
@@ -182,17 +182,17 @@ external createPattern: (
182182 | @as ("repeat-y" ) #repeatY
183183 | @as ("no-repeat" ) #noRepeat
184184 ],
185- ) => pattern = ""
185+ ) => pattern = "createPattern "
186186
187187/* Paths */
188- @send external beginPath : t => unit = ""
189- @send external closePath : t => unit = ""
190- @send external fill : t => unit = ""
191- @send external stroke : t => unit = ""
192- @send external clip : t => unit = ""
193- @send external moveTo : (t , ~x : float , ~y : float ) => unit = ""
194- @send external lineTo : (t , ~x : float , ~y : float ) => unit = ""
195- @send external quadraticCurveTo : (t , ~cp1x : float , ~cp1y : float , ~x : float , ~y : float ) => unit = ""
188+ @send external beginPath : t => unit = "beginPath "
189+ @send external closePath : t => unit = "closePath "
190+ @send external fill : t => unit = "fill "
191+ @send external stroke : t => unit = "stroke "
192+ @send external clip : t => unit = "clip "
193+ @send external moveTo : (t , ~x : float , ~y : float ) => unit = "moveTo "
194+ @send external lineTo : (t , ~x : float , ~y : float ) => unit = "lineTo "
195+ @send external quadraticCurveTo : (t , ~cp1x : float , ~cp1y : float , ~x : float , ~y : float ) => unit = "quadraticCurveTo "
196196@send
197197external bezierCurveTo : (
198198 t ,
@@ -202,8 +202,8 @@ external bezierCurveTo: (
202202 ~cp2y : float ,
203203 ~x : float ,
204204 ~y : float ,
205- ) => unit = ""
206- @send external arcTo : (t , ~x1 : float , ~y1 : float , ~x2 : float , ~y2 : float , ~r : float ) => unit = ""
205+ ) => unit = "bezierCurveTo "
206+ @send external arcTo : (t , ~x1 : float , ~y1 : float , ~x2 : float , ~y2 : float , ~r : float ) => unit = "arcTo "
207207@send
208208external arc : (
209209 t ,
@@ -213,26 +213,25 @@ external arc: (
213213 ~startAngle : float ,
214214 ~endAngle : float ,
215215 ~anticw : bool ,
216- ) => unit = ""
217- @send external rect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = ""
218- @send external isPointInPath : (t , ~x : float , ~y : float ) => bool = ""
216+ ) => unit = "arc "
217+ @send external rect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "rect "
218+ @send external isPointInPath : (t , ~x : float , ~y : float ) => bool = "isPointInPath "
219219
220220/* Text */
221- @set external font : (t , string ) => unit = ""
222- @set external textAlign : (t , string ) => unit = ""
223- @set external textBaseline : (t , string ) => unit = ""
221+ @set external font : (t , string ) => unit = "font "
222+ @set external textAlign : (t , string ) => unit = "textAlign "
223+ @set external textBaseline : (t , string ) => unit = "textBaseline "
224224@send
225- external fillText : (t , string , ~x : float , ~y : float , ~maxWidth : float = ?, @ignore unit ) => unit = ""
225+ external fillText : (t , string , ~x : float , ~y : float , ~maxWidth : float = ?, @ignore unit ) => unit = "fillText "
226226@send
227- external strokeText : (t , string , ~x : float , ~y : float , ~maxWidth : float = ?, @ignore unit ) => unit =
228- ""
229- @send external measureText : (t , string ) => measureText = ""
230- @get external width : measureText => float = ""
227+ external strokeText : (t , string , ~x : float , ~y : float , ~maxWidth : float = ?, @ignore unit ) => unit = "strokeText"
228+ @send external measureText : (t , string ) => measureText = "measureText"
229+ @get external width : measureText => float = "width"
231230
232231/* Rectangles */
233- @send external fillRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = ""
234- @send external strokeRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = ""
235- @send external clearRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = ""
232+ @send external fillRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "fillRect "
233+ @send external strokeRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "strokeRect "
234+ @send external clearRect : (t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "clearRect "
236235
237236@send
238237external createImageDataCoords : (t , ~width : float , ~height : float ) => Webapi__Dom__Image .t =
@@ -242,11 +241,10 @@ external createImageDataFromImage: (t, Webapi__Dom__Image.t) => Webapi__Dom__Ima
242241 "createImageData"
243242
244243@send
245- external getImageData : (t , ~sx : float , ~sy : float , ~sw : float , ~sh : float ) => Webapi__Dom__Image .t =
246- ""
244+ external getImageData : (t , ~sx : float , ~sy : float , ~sw : float , ~sh : float ) => Webapi__Dom__Image .t = "getImageData"
247245
248246@send
249- external putImageData : (t , ~imageData : Webapi__Dom__Image .t , ~dx : float , ~dy : float ) => unit = ""
247+ external putImageData : (t , ~imageData : Webapi__Dom__Image .t , ~dx : float , ~dy : float ) => unit = "putImageData "
250248
251249@send
252250external putImageDataWithDirtyRect : (
0 commit comments