@rescript/webapi 0.1.0-experimental-2a52a02 → 0.1.0-experimental-9c2a3bd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/CanvasAPI/CanvasGradient.res +12 -0
- package/src/CanvasAPI/CanvasPattern.res +11 -0
- package/src/CanvasAPI/ImageBitmapRenderingContext.res +9 -0
- package/src/CanvasAPI/OffscreenCanvas.res +48 -4
- package/src/CanvasAPI/Path2D.res +142 -0
- package/src/CanvasAPI.res +391 -0
- package/src/DOMAPI/CanvasRenderingContext2D.res +843 -0
- package/src/DOMAPI/FillStyle.res +22 -0
- package/src/DOMAPI/HTMLCanvasElement.res +41 -4
- package/src/DOMAPI.res +127 -0
- package/src/FetchAPI/FormData.res +7 -1
- package/src/Global.res +428 -0
- package/src/PictureInPicture.res +0 -18
- package/src/WebAudioAPI/AudioListener.res +0 -1
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
open DOMAPI
|
|
2
|
+
open CanvasAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/save)
|
|
6
|
+
*/
|
|
7
|
+
@send
|
|
8
|
+
external save: canvasRenderingContext2D => unit = "save"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/restore)
|
|
12
|
+
*/
|
|
13
|
+
@send
|
|
14
|
+
external restore: canvasRenderingContext2D => unit = "restore"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/reset)
|
|
18
|
+
*/
|
|
19
|
+
@send
|
|
20
|
+
external reset: canvasRenderingContext2D => unit = "reset"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isContextLost)
|
|
24
|
+
*/
|
|
25
|
+
@send
|
|
26
|
+
external isContextLost: canvasRenderingContext2D => bool = "isContextLost"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/scale)
|
|
30
|
+
*/
|
|
31
|
+
@send
|
|
32
|
+
external scale: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "scale"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rotate)
|
|
36
|
+
*/
|
|
37
|
+
@send
|
|
38
|
+
external rotate: (canvasRenderingContext2D, float) => unit = "rotate"
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/translate)
|
|
42
|
+
*/
|
|
43
|
+
@send
|
|
44
|
+
external translate: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "translate"
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/transform)
|
|
48
|
+
*/
|
|
49
|
+
@send
|
|
50
|
+
external transform: (
|
|
51
|
+
canvasRenderingContext2D,
|
|
52
|
+
~a: float,
|
|
53
|
+
~b: float,
|
|
54
|
+
~c: float,
|
|
55
|
+
~d: float,
|
|
56
|
+
~e: float,
|
|
57
|
+
~f: float,
|
|
58
|
+
) => unit = "transform"
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getTransform)
|
|
62
|
+
*/
|
|
63
|
+
@send
|
|
64
|
+
external getTransform: canvasRenderingContext2D => domMatrix = "getTransform"
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform)
|
|
68
|
+
*/
|
|
69
|
+
@send
|
|
70
|
+
external setTransform: (
|
|
71
|
+
canvasRenderingContext2D,
|
|
72
|
+
~a: float,
|
|
73
|
+
~b: float,
|
|
74
|
+
~c: float,
|
|
75
|
+
~d: float,
|
|
76
|
+
~e: float,
|
|
77
|
+
~f: float,
|
|
78
|
+
) => unit = "setTransform"
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform)
|
|
82
|
+
*/
|
|
83
|
+
@send
|
|
84
|
+
external setTransform2: (canvasRenderingContext2D, ~transform: domMatrix2DInit=?) => unit =
|
|
85
|
+
"setTransform"
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/resetTransform)
|
|
89
|
+
*/
|
|
90
|
+
@send
|
|
91
|
+
external resetTransform: canvasRenderingContext2D => unit = "resetTransform"
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createLinearGradient)
|
|
95
|
+
*/
|
|
96
|
+
@send
|
|
97
|
+
external createLinearGradient: (
|
|
98
|
+
canvasRenderingContext2D,
|
|
99
|
+
~x0: float,
|
|
100
|
+
~y0: float,
|
|
101
|
+
~x1: float,
|
|
102
|
+
~y1: float,
|
|
103
|
+
) => canvasGradient = "createLinearGradient"
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createRadialGradient)
|
|
107
|
+
*/
|
|
108
|
+
@send
|
|
109
|
+
external createRadialGradient: (
|
|
110
|
+
canvasRenderingContext2D,
|
|
111
|
+
~x0: float,
|
|
112
|
+
~y0: float,
|
|
113
|
+
~r0: float,
|
|
114
|
+
~x1: float,
|
|
115
|
+
~y1: float,
|
|
116
|
+
~r1: float,
|
|
117
|
+
) => canvasGradient = "createRadialGradient"
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createConicGradient)
|
|
121
|
+
*/
|
|
122
|
+
@send
|
|
123
|
+
external createConicGradient: (
|
|
124
|
+
canvasRenderingContext2D,
|
|
125
|
+
~startAngle: float,
|
|
126
|
+
~x: float,
|
|
127
|
+
~y: float,
|
|
128
|
+
) => canvasGradient = "createConicGradient"
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
132
|
+
*/
|
|
133
|
+
@send
|
|
134
|
+
external createPattern: (
|
|
135
|
+
canvasRenderingContext2D,
|
|
136
|
+
~image: htmlImageElement,
|
|
137
|
+
~repetition: string,
|
|
138
|
+
) => canvasPattern = "createPattern"
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
142
|
+
*/
|
|
143
|
+
@send
|
|
144
|
+
external createPattern2: (
|
|
145
|
+
canvasRenderingContext2D,
|
|
146
|
+
~image: svgImageElement,
|
|
147
|
+
~repetition: string,
|
|
148
|
+
) => canvasPattern = "createPattern"
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
152
|
+
*/
|
|
153
|
+
@send
|
|
154
|
+
external createPattern3: (
|
|
155
|
+
canvasRenderingContext2D,
|
|
156
|
+
~image: htmlVideoElement,
|
|
157
|
+
~repetition: string,
|
|
158
|
+
) => canvasPattern = "createPattern"
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
162
|
+
*/
|
|
163
|
+
@send
|
|
164
|
+
external createPattern4: (
|
|
165
|
+
canvasRenderingContext2D,
|
|
166
|
+
~image: htmlCanvasElement,
|
|
167
|
+
~repetition: string,
|
|
168
|
+
) => canvasPattern = "createPattern"
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
172
|
+
*/
|
|
173
|
+
@send
|
|
174
|
+
external createPattern5: (
|
|
175
|
+
canvasRenderingContext2D,
|
|
176
|
+
~image: imageBitmap,
|
|
177
|
+
~repetition: string,
|
|
178
|
+
) => canvasPattern = "createPattern"
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
182
|
+
*/
|
|
183
|
+
@send
|
|
184
|
+
external createPattern6: (
|
|
185
|
+
canvasRenderingContext2D,
|
|
186
|
+
~image: offscreenCanvas,
|
|
187
|
+
~repetition: string,
|
|
188
|
+
) => canvasPattern = "createPattern"
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern)
|
|
192
|
+
*/
|
|
193
|
+
@send
|
|
194
|
+
external createPattern7: (
|
|
195
|
+
canvasRenderingContext2D,
|
|
196
|
+
~image: videoFrame,
|
|
197
|
+
~repetition: string,
|
|
198
|
+
) => canvasPattern = "createPattern"
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clearRect)
|
|
202
|
+
*/
|
|
203
|
+
@send
|
|
204
|
+
external clearRect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit =
|
|
205
|
+
"clearRect"
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillRect)
|
|
209
|
+
*/
|
|
210
|
+
@send
|
|
211
|
+
external fillRect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit =
|
|
212
|
+
"fillRect"
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeRect)
|
|
216
|
+
*/
|
|
217
|
+
@send
|
|
218
|
+
external strokeRect: (
|
|
219
|
+
canvasRenderingContext2D,
|
|
220
|
+
~x: float,
|
|
221
|
+
~y: float,
|
|
222
|
+
~w: float,
|
|
223
|
+
~h: float,
|
|
224
|
+
) => unit = "strokeRect"
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/beginPath)
|
|
228
|
+
*/
|
|
229
|
+
@send
|
|
230
|
+
external beginPath: canvasRenderingContext2D => unit = "beginPath"
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill)
|
|
234
|
+
*/
|
|
235
|
+
@send
|
|
236
|
+
external fill: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit = "fill"
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill)
|
|
240
|
+
*/
|
|
241
|
+
@send
|
|
242
|
+
external fill2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
|
|
243
|
+
"fill"
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke)
|
|
247
|
+
*/
|
|
248
|
+
@send
|
|
249
|
+
external stroke: canvasRenderingContext2D => unit = "stroke"
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke)
|
|
253
|
+
*/
|
|
254
|
+
@send
|
|
255
|
+
external stroke2: (canvasRenderingContext2D, path2D) => unit = "stroke"
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
|
|
259
|
+
*/
|
|
260
|
+
@send
|
|
261
|
+
external clip: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit = "clip"
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip)
|
|
265
|
+
*/
|
|
266
|
+
@send
|
|
267
|
+
external clip2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit =
|
|
268
|
+
"clip"
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath)
|
|
272
|
+
*/
|
|
273
|
+
@send
|
|
274
|
+
external isPointInPath: (
|
|
275
|
+
canvasRenderingContext2D,
|
|
276
|
+
~x: float,
|
|
277
|
+
~y: float,
|
|
278
|
+
~fillRule: canvasFillRule=?,
|
|
279
|
+
) => bool = "isPointInPath"
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath)
|
|
283
|
+
*/
|
|
284
|
+
@send
|
|
285
|
+
external isPointInPath2: (
|
|
286
|
+
canvasRenderingContext2D,
|
|
287
|
+
~path: path2D,
|
|
288
|
+
~x: float,
|
|
289
|
+
~y: float,
|
|
290
|
+
~fillRule: canvasFillRule=?,
|
|
291
|
+
) => bool = "isPointInPath"
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)
|
|
295
|
+
*/
|
|
296
|
+
@send
|
|
297
|
+
external isPointInStroke: (canvasRenderingContext2D, ~x: float, ~y: float) => bool =
|
|
298
|
+
"isPointInStroke"
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)
|
|
302
|
+
*/
|
|
303
|
+
@send
|
|
304
|
+
external isPointInStroke2: (canvasRenderingContext2D, ~path: path2D, ~x: float, ~y: float) => bool =
|
|
305
|
+
"isPointInStroke"
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)
|
|
309
|
+
*/
|
|
310
|
+
@send
|
|
311
|
+
external drawFocusIfNeeded: (canvasRenderingContext2D, element) => unit = "drawFocusIfNeeded"
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)
|
|
315
|
+
*/
|
|
316
|
+
@send
|
|
317
|
+
external drawFocusIfNeeded2: (canvasRenderingContext2D, ~path: path2D, ~element: element) => unit =
|
|
318
|
+
"drawFocusIfNeeded"
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillText)
|
|
322
|
+
*/
|
|
323
|
+
@send
|
|
324
|
+
external fillText: (
|
|
325
|
+
canvasRenderingContext2D,
|
|
326
|
+
~text: string,
|
|
327
|
+
~x: float,
|
|
328
|
+
~y: float,
|
|
329
|
+
~maxWidth: float=?,
|
|
330
|
+
) => unit = "fillText"
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeText)
|
|
334
|
+
*/
|
|
335
|
+
@send
|
|
336
|
+
external strokeText: (
|
|
337
|
+
canvasRenderingContext2D,
|
|
338
|
+
~text: string,
|
|
339
|
+
~x: float,
|
|
340
|
+
~y: float,
|
|
341
|
+
~maxWidth: float=?,
|
|
342
|
+
) => unit = "strokeText"
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/measureText)
|
|
346
|
+
*/
|
|
347
|
+
@send
|
|
348
|
+
external measureText: (canvasRenderingContext2D, string) => textMetrics = "measureText"
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
352
|
+
*/
|
|
353
|
+
@send
|
|
354
|
+
external drawImage: (
|
|
355
|
+
canvasRenderingContext2D,
|
|
356
|
+
~image: htmlImageElement,
|
|
357
|
+
~dx: float,
|
|
358
|
+
~dy: float,
|
|
359
|
+
) => unit = "drawImage"
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
363
|
+
*/
|
|
364
|
+
@send
|
|
365
|
+
external drawImage2: (
|
|
366
|
+
canvasRenderingContext2D,
|
|
367
|
+
~image: svgImageElement,
|
|
368
|
+
~dx: float,
|
|
369
|
+
~dy: float,
|
|
370
|
+
) => unit = "drawImage"
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
374
|
+
*/
|
|
375
|
+
@send
|
|
376
|
+
external drawImage3: (
|
|
377
|
+
canvasRenderingContext2D,
|
|
378
|
+
~image: htmlVideoElement,
|
|
379
|
+
~dx: float,
|
|
380
|
+
~dy: float,
|
|
381
|
+
) => unit = "drawImage"
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
385
|
+
*/
|
|
386
|
+
@send
|
|
387
|
+
external drawImage4: (
|
|
388
|
+
canvasRenderingContext2D,
|
|
389
|
+
~image: htmlCanvasElement,
|
|
390
|
+
~dx: float,
|
|
391
|
+
~dy: float,
|
|
392
|
+
) => unit = "drawImage"
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
396
|
+
*/
|
|
397
|
+
@send
|
|
398
|
+
external drawImage5: (
|
|
399
|
+
canvasRenderingContext2D,
|
|
400
|
+
~image: imageBitmap,
|
|
401
|
+
~dx: float,
|
|
402
|
+
~dy: float,
|
|
403
|
+
) => unit = "drawImage"
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
407
|
+
*/
|
|
408
|
+
@send
|
|
409
|
+
external drawImage6: (
|
|
410
|
+
canvasRenderingContext2D,
|
|
411
|
+
~image: offscreenCanvas,
|
|
412
|
+
~dx: float,
|
|
413
|
+
~dy: float,
|
|
414
|
+
) => unit = "drawImage"
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
418
|
+
*/
|
|
419
|
+
@send
|
|
420
|
+
external drawImage7: (
|
|
421
|
+
canvasRenderingContext2D,
|
|
422
|
+
~image: videoFrame,
|
|
423
|
+
~dx: float,
|
|
424
|
+
~dy: float,
|
|
425
|
+
) => unit = "drawImage"
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
429
|
+
*/
|
|
430
|
+
@send
|
|
431
|
+
external drawImage8: (
|
|
432
|
+
canvasRenderingContext2D,
|
|
433
|
+
~image: htmlImageElement,
|
|
434
|
+
~dx: float,
|
|
435
|
+
~dy: float,
|
|
436
|
+
~dw: float,
|
|
437
|
+
~dh: float,
|
|
438
|
+
) => unit = "drawImage"
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
442
|
+
*/
|
|
443
|
+
@send
|
|
444
|
+
external drawImage9: (
|
|
445
|
+
canvasRenderingContext2D,
|
|
446
|
+
~image: svgImageElement,
|
|
447
|
+
~dx: float,
|
|
448
|
+
~dy: float,
|
|
449
|
+
~dw: float,
|
|
450
|
+
~dh: float,
|
|
451
|
+
) => unit = "drawImage"
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
455
|
+
*/
|
|
456
|
+
@send
|
|
457
|
+
external drawImage10: (
|
|
458
|
+
canvasRenderingContext2D,
|
|
459
|
+
~image: htmlVideoElement,
|
|
460
|
+
~dx: float,
|
|
461
|
+
~dy: float,
|
|
462
|
+
~dw: float,
|
|
463
|
+
~dh: float,
|
|
464
|
+
) => unit = "drawImage"
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
468
|
+
*/
|
|
469
|
+
@send
|
|
470
|
+
external drawImage11: (
|
|
471
|
+
canvasRenderingContext2D,
|
|
472
|
+
~image: htmlCanvasElement,
|
|
473
|
+
~dx: float,
|
|
474
|
+
~dy: float,
|
|
475
|
+
~dw: float,
|
|
476
|
+
~dh: float,
|
|
477
|
+
) => unit = "drawImage"
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
481
|
+
*/
|
|
482
|
+
@send
|
|
483
|
+
external drawImage12: (
|
|
484
|
+
canvasRenderingContext2D,
|
|
485
|
+
~image: imageBitmap,
|
|
486
|
+
~dx: float,
|
|
487
|
+
~dy: float,
|
|
488
|
+
~dw: float,
|
|
489
|
+
~dh: float,
|
|
490
|
+
) => unit = "drawImage"
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
494
|
+
*/
|
|
495
|
+
@send
|
|
496
|
+
external drawImage13: (
|
|
497
|
+
canvasRenderingContext2D,
|
|
498
|
+
~image: offscreenCanvas,
|
|
499
|
+
~dx: float,
|
|
500
|
+
~dy: float,
|
|
501
|
+
~dw: float,
|
|
502
|
+
~dh: float,
|
|
503
|
+
) => unit = "drawImage"
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
507
|
+
*/
|
|
508
|
+
@send
|
|
509
|
+
external drawImage14: (
|
|
510
|
+
canvasRenderingContext2D,
|
|
511
|
+
~image: videoFrame,
|
|
512
|
+
~dx: float,
|
|
513
|
+
~dy: float,
|
|
514
|
+
~dw: float,
|
|
515
|
+
~dh: float,
|
|
516
|
+
) => unit = "drawImage"
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
520
|
+
*/
|
|
521
|
+
@send
|
|
522
|
+
external drawImage15: (
|
|
523
|
+
canvasRenderingContext2D,
|
|
524
|
+
~image: htmlImageElement,
|
|
525
|
+
~sx: float,
|
|
526
|
+
~sy: float,
|
|
527
|
+
~sw: float,
|
|
528
|
+
~sh: float,
|
|
529
|
+
~dx: float,
|
|
530
|
+
~dy: float,
|
|
531
|
+
~dw: float,
|
|
532
|
+
~dh: float,
|
|
533
|
+
) => unit = "drawImage"
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
537
|
+
*/
|
|
538
|
+
@send
|
|
539
|
+
external drawImage16: (
|
|
540
|
+
canvasRenderingContext2D,
|
|
541
|
+
~image: svgImageElement,
|
|
542
|
+
~sx: float,
|
|
543
|
+
~sy: float,
|
|
544
|
+
~sw: float,
|
|
545
|
+
~sh: float,
|
|
546
|
+
~dx: float,
|
|
547
|
+
~dy: float,
|
|
548
|
+
~dw: float,
|
|
549
|
+
~dh: float,
|
|
550
|
+
) => unit = "drawImage"
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
554
|
+
*/
|
|
555
|
+
@send
|
|
556
|
+
external drawImage17: (
|
|
557
|
+
canvasRenderingContext2D,
|
|
558
|
+
~image: htmlVideoElement,
|
|
559
|
+
~sx: float,
|
|
560
|
+
~sy: float,
|
|
561
|
+
~sw: float,
|
|
562
|
+
~sh: float,
|
|
563
|
+
~dx: float,
|
|
564
|
+
~dy: float,
|
|
565
|
+
~dw: float,
|
|
566
|
+
~dh: float,
|
|
567
|
+
) => unit = "drawImage"
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
571
|
+
*/
|
|
572
|
+
@send
|
|
573
|
+
external drawImage18: (
|
|
574
|
+
canvasRenderingContext2D,
|
|
575
|
+
~image: htmlCanvasElement,
|
|
576
|
+
~sx: float,
|
|
577
|
+
~sy: float,
|
|
578
|
+
~sw: float,
|
|
579
|
+
~sh: float,
|
|
580
|
+
~dx: float,
|
|
581
|
+
~dy: float,
|
|
582
|
+
~dw: float,
|
|
583
|
+
~dh: float,
|
|
584
|
+
) => unit = "drawImage"
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
588
|
+
*/
|
|
589
|
+
@send
|
|
590
|
+
external drawImage19: (
|
|
591
|
+
canvasRenderingContext2D,
|
|
592
|
+
~image: imageBitmap,
|
|
593
|
+
~sx: float,
|
|
594
|
+
~sy: float,
|
|
595
|
+
~sw: float,
|
|
596
|
+
~sh: float,
|
|
597
|
+
~dx: float,
|
|
598
|
+
~dy: float,
|
|
599
|
+
~dw: float,
|
|
600
|
+
~dh: float,
|
|
601
|
+
) => unit = "drawImage"
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
605
|
+
*/
|
|
606
|
+
@send
|
|
607
|
+
external drawImage20: (
|
|
608
|
+
canvasRenderingContext2D,
|
|
609
|
+
~image: offscreenCanvas,
|
|
610
|
+
~sx: float,
|
|
611
|
+
~sy: float,
|
|
612
|
+
~sw: float,
|
|
613
|
+
~sh: float,
|
|
614
|
+
~dx: float,
|
|
615
|
+
~dy: float,
|
|
616
|
+
~dw: float,
|
|
617
|
+
~dh: float,
|
|
618
|
+
) => unit = "drawImage"
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
622
|
+
*/
|
|
623
|
+
@send
|
|
624
|
+
external drawImage21: (
|
|
625
|
+
canvasRenderingContext2D,
|
|
626
|
+
~image: videoFrame,
|
|
627
|
+
~sx: float,
|
|
628
|
+
~sy: float,
|
|
629
|
+
~sw: float,
|
|
630
|
+
~sh: float,
|
|
631
|
+
~dx: float,
|
|
632
|
+
~dy: float,
|
|
633
|
+
~dw: float,
|
|
634
|
+
~dh: float,
|
|
635
|
+
) => unit = "drawImage"
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData)
|
|
639
|
+
*/
|
|
640
|
+
@send
|
|
641
|
+
external createImageData: (
|
|
642
|
+
canvasRenderingContext2D,
|
|
643
|
+
~sw: int,
|
|
644
|
+
~sh: int,
|
|
645
|
+
~settings: imageDataSettings=?,
|
|
646
|
+
) => imageData = "createImageData"
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData)
|
|
650
|
+
*/
|
|
651
|
+
@send
|
|
652
|
+
external createImageData2: (canvasRenderingContext2D, imageData) => imageData = "createImageData"
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData)
|
|
656
|
+
*/
|
|
657
|
+
@send
|
|
658
|
+
external getImageData: (
|
|
659
|
+
canvasRenderingContext2D,
|
|
660
|
+
~sx: int,
|
|
661
|
+
~sy: int,
|
|
662
|
+
~sw: int,
|
|
663
|
+
~sh: int,
|
|
664
|
+
~settings: imageDataSettings=?,
|
|
665
|
+
) => imageData = "getImageData"
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData)
|
|
669
|
+
*/
|
|
670
|
+
@send
|
|
671
|
+
external putImageData: (
|
|
672
|
+
canvasRenderingContext2D,
|
|
673
|
+
~imagedata: imageData,
|
|
674
|
+
~dx: int,
|
|
675
|
+
~dy: int,
|
|
676
|
+
) => unit = "putImageData"
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData)
|
|
680
|
+
*/
|
|
681
|
+
@send
|
|
682
|
+
external putImageData2: (
|
|
683
|
+
canvasRenderingContext2D,
|
|
684
|
+
~imagedata: imageData,
|
|
685
|
+
~dx: int,
|
|
686
|
+
~dy: int,
|
|
687
|
+
~dirtyX: int,
|
|
688
|
+
~dirtyY: int,
|
|
689
|
+
~dirtyWidth: int,
|
|
690
|
+
~dirtyHeight: int,
|
|
691
|
+
) => unit = "putImageData"
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash)
|
|
695
|
+
*/
|
|
696
|
+
@send
|
|
697
|
+
external setLineDash: (canvasRenderingContext2D, array<float>) => unit = "setLineDash"
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getLineDash)
|
|
701
|
+
*/
|
|
702
|
+
@send
|
|
703
|
+
external getLineDash: canvasRenderingContext2D => array<float> = "getLineDash"
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath)
|
|
707
|
+
*/
|
|
708
|
+
@send
|
|
709
|
+
external closePath: canvasRenderingContext2D => unit = "closePath"
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo)
|
|
713
|
+
*/
|
|
714
|
+
@send
|
|
715
|
+
external moveTo: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "moveTo"
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo)
|
|
719
|
+
*/
|
|
720
|
+
@send
|
|
721
|
+
external lineTo: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "lineTo"
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo)
|
|
725
|
+
*/
|
|
726
|
+
@send
|
|
727
|
+
external quadraticCurveTo: (
|
|
728
|
+
canvasRenderingContext2D,
|
|
729
|
+
~cpx: float,
|
|
730
|
+
~cpy: float,
|
|
731
|
+
~x: float,
|
|
732
|
+
~y: float,
|
|
733
|
+
) => unit = "quadraticCurveTo"
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo)
|
|
737
|
+
*/
|
|
738
|
+
@send
|
|
739
|
+
external bezierCurveTo: (
|
|
740
|
+
canvasRenderingContext2D,
|
|
741
|
+
~cp1x: float,
|
|
742
|
+
~cp1y: float,
|
|
743
|
+
~cp2x: float,
|
|
744
|
+
~cp2y: float,
|
|
745
|
+
~x: float,
|
|
746
|
+
~y: float,
|
|
747
|
+
) => unit = "bezierCurveTo"
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo)
|
|
751
|
+
*/
|
|
752
|
+
@send
|
|
753
|
+
external arcTo: (
|
|
754
|
+
canvasRenderingContext2D,
|
|
755
|
+
~x1: float,
|
|
756
|
+
~y1: float,
|
|
757
|
+
~x2: float,
|
|
758
|
+
~y2: float,
|
|
759
|
+
~radius: float,
|
|
760
|
+
) => unit = "arcTo"
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect)
|
|
764
|
+
*/
|
|
765
|
+
@send
|
|
766
|
+
external rect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit =
|
|
767
|
+
"rect"
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
|
|
771
|
+
*/
|
|
772
|
+
@send
|
|
773
|
+
external roundRect: (
|
|
774
|
+
canvasRenderingContext2D,
|
|
775
|
+
~x: float,
|
|
776
|
+
~y: float,
|
|
777
|
+
~w: float,
|
|
778
|
+
~h: float,
|
|
779
|
+
~radii_: array<float>=?,
|
|
780
|
+
) => unit = "roundRect"
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
|
|
784
|
+
*/
|
|
785
|
+
@send
|
|
786
|
+
external roundRect2: (
|
|
787
|
+
canvasRenderingContext2D,
|
|
788
|
+
~x: float,
|
|
789
|
+
~y: float,
|
|
790
|
+
~w: float,
|
|
791
|
+
~h: float,
|
|
792
|
+
~radii_: array<float>=?,
|
|
793
|
+
) => unit = "roundRect"
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
|
|
797
|
+
*/
|
|
798
|
+
@send
|
|
799
|
+
external roundRect3: (
|
|
800
|
+
canvasRenderingContext2D,
|
|
801
|
+
~x: float,
|
|
802
|
+
~y: float,
|
|
803
|
+
~w: float,
|
|
804
|
+
~h: float,
|
|
805
|
+
~radii_: array<float>=?,
|
|
806
|
+
) => unit = "roundRect"
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc)
|
|
810
|
+
*/
|
|
811
|
+
@send
|
|
812
|
+
external arc: (
|
|
813
|
+
canvasRenderingContext2D,
|
|
814
|
+
~x: float,
|
|
815
|
+
~y: float,
|
|
816
|
+
~radius: float,
|
|
817
|
+
~startAngle: float,
|
|
818
|
+
~endAngle: float,
|
|
819
|
+
~counterclockwise: bool=?,
|
|
820
|
+
) => unit = "arc"
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/ellipse)
|
|
824
|
+
*/
|
|
825
|
+
@send
|
|
826
|
+
external ellipse: (
|
|
827
|
+
canvasRenderingContext2D,
|
|
828
|
+
~x: float,
|
|
829
|
+
~y: float,
|
|
830
|
+
~radiusX: float,
|
|
831
|
+
~radiusY: float,
|
|
832
|
+
~rotation: float,
|
|
833
|
+
~startAngle: float,
|
|
834
|
+
~endAngle: float,
|
|
835
|
+
~counterclockwise: bool=?,
|
|
836
|
+
) => unit = "ellipse"
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes)
|
|
840
|
+
*/
|
|
841
|
+
@send
|
|
842
|
+
external getContextAttributes: canvasRenderingContext2D => canvasRenderingContext2DSettings =
|
|
843
|
+
"getContextAttributes"
|