1
- module type ModuleWithT = {
2
- type t
3
- }
4
-
5
1
/**
6
2
* Named parameters have 1~3 of lenght, should resemble MDN/typescript docs/types.
7
3
* This module exposes the typescript CanvasPath interface
8
4
* https://github.com/microsoft/TypeScript/blob/46410044add2e9f53cea58e445de18dcda53443f/src/lib/dom.generated.d.ts#L5455
9
5
*/
10
- module Make = (M : ModuleWithT ) => {
6
+ module Impl = (
7
+ T : {
8
+ type t
9
+ },
10
+ ) => {
11
11
// type t = M.t
12
12
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arc */
13
13
@send
14
14
external arc : (
15
- M .t ,
15
+ T .t ,
16
16
~x : float ,
17
17
~y : float ,
18
18
~r : float ,
@@ -24,12 +24,12 @@ module Make = (M: ModuleWithT) => {
24
24
25
25
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arcTo */
26
26
@send
27
- external arcTo : (M .t , ~x1 : float , ~y1 : float , ~x2 : float , ~y2 : float , ~r : float ) => unit = "arcTo"
27
+ external arcTo : (T .t , ~x1 : float , ~y1 : float , ~x2 : float , ~y2 : float , ~r : float ) => unit = "arcTo"
28
28
29
29
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo */
30
30
@send
31
31
external bezierCurveTo : (
32
- M .t ,
32
+ T .t ,
33
33
~cp1x : float ,
34
34
~cp1y : float ,
35
35
~cp2x : float ,
@@ -40,12 +40,12 @@ module Make = (M: ModuleWithT) => {
40
40
41
41
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/closePath*/
42
42
@send
43
- external closePath : M .t => unit = "closePath"
43
+ external closePath : T .t => unit = "closePath"
44
44
45
45
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/ellipse */
46
46
@send
47
47
external ellipse : (
48
- M .t ,
48
+ T .t ,
49
49
~x : float ,
50
50
~y : float ,
51
51
~rx : float ,
@@ -59,23 +59,23 @@ module Make = (M: ModuleWithT) => {
59
59
60
60
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineTo */
61
61
@send
62
- external lineTo : (M .t , ~x : float , ~y : float ) => unit = "lineTo"
62
+ external lineTo : (T .t , ~x : float , ~y : float ) => unit = "lineTo"
63
63
64
64
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/moveTo */
65
65
@send
66
- external moveTo : (M .t , ~x : float , ~y : float ) => unit = "moveTo"
66
+ external moveTo : (T .t , ~x : float , ~y : float ) => unit = "moveTo"
67
67
68
68
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo */
69
69
@send
70
- external quadraticCurveTo : (M .t , ~cpx : float , ~cpy : float , ~x : float , ~y : float ) => unit =
70
+ external quadraticCurveTo : (T .t , ~cpx : float , ~cpy : float , ~x : float , ~y : float ) => unit =
71
71
"quadraticCurveTo"
72
72
73
73
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/rect */
74
74
@send
75
- external rect : (M .t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "rect"
75
+ external rect : (T .t , ~x : float , ~y : float , ~w : float , ~h : float ) => unit = "rect"
76
76
77
77
/** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect */
78
78
@send
79
- external roundRect : (M .t , ~x : float , ~y : float , ~w : float , ~h : float , ~r : float ) => unit =
79
+ external roundRect : (T .t , ~x : float , ~y : float , ~w : float , ~h : float , ~r : float ) => unit =
80
80
"roundRect"
81
81
}
0 commit comments