Skip to content

Commit 58ebc59

Browse files
authored
Merge pull request #251 from rescript-lang/issue-242-final-integration
refactor: complete final integration cleanup
2 parents b330deb + 8ef02ed commit 58ebc59

19 files changed

Lines changed: 72 additions & 64 deletions

src/CanvasAPI/CanvasPattern.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module Types = CanvasTypes
22

33
type t = Types.canvasPattern = {...Types.canvasPattern}
4+
type domMatrix2DInit = DOMTypes.domMatrix2DInit = {...DOMTypes.domMatrix2DInit}
45

56
/**
67
Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.
78
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform)
89
*/
910
@send
10-
external setTransform: (t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "setTransform"
11+
external setTransform: (t, ~transform: domMatrix2DInit=?) => unit = "setTransform"
1112

1213
let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasPattern`)

src/CanvasAPI/OffscreenCanvas.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,4 @@ The argument, if provided, is a dictionary that controls the encoding options of
9595
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/convertToBlob)
9696
*/
9797
@send
98-
external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<FileTypes.blob> =
99-
"convertToBlob"
98+
external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<Blob.t> = "convertToBlob"

src/CanvasAPI/Path2D.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Types = CanvasTypes
22

33
type t = Types.path2D = {...Types.path2D}
4+
type domMatrix2DInit = DOMTypes.domMatrix2DInit = {...DOMTypes.domMatrix2DInit}
45

56
/**
67
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
@@ -114,4 +115,4 @@ Adds to the path the path given by the argument.
114115
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D/addPath)
115116
*/
116117
@send
117-
external addPath: (t, ~path: t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "addPath"
118+
external addPath: (t, ~path: t, ~transform: domMatrix2DInit=?) => unit = "addPath"

src/DOMAPI/HTMLFormElement.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
open DOMTypes
22

3+
type t = htmlFormElement = {...htmlFormElement}
4+
35
include HTMLElement.Impl({type t = htmlFormElement})
46

57
/**

src/FetchAPI/BodyInit.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ external fromDataView: DataView.t => t = "%identity"
2525
/**
2626
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
2727
*/
28-
external fromBlob: FileTypes.blob => t = "%identity"
28+
external fromBlob: Blob.t => t = "%identity"
2929

3030
/**
3131
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
3232
*/
33-
external fromFile: FileTypes.file => t = "%identity"
33+
external fromFile: File.t => t = "%identity"
3434

3535
/**
3636
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
3737
*/
38-
external fromURLSearchParams: URLTypes.urlSearchParams => t = "%identity"
38+
external fromURLSearchParams: URLSearchParams.t => t = "%identity"
3939

4040
/**
4141
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
4242
*/
43-
external fromFormData: Types.formData => t = "%identity"
43+
external fromFormData: FormData.t => t = "%identity"
4444

4545
/**
4646
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
4747
*/
48-
external fromReadableStream: FileTypes.readableStream<'t> => t = "%identity"
48+
external fromReadableStream: ReadableStream.t<'t> => t = "%identity"

src/FetchAPI/FormData.res

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ module Types = FetchTypes
55
*/
66
@new
77
type t = Types.formData = {...Types.formData}
8-
type formDataEntryValue = Types.formDataEntryValue
8+
type formDataEntryValue = FormDataEntryValue.t
9+
type htmlFormElement = HTMLFormElement.t
10+
type htmlElement = HTMLElement.t
911

10-
external make: (~form: DOMTypes.htmlFormElement=?, ~submitter: DOMTypes.htmlElement=?) => t =
11-
"FormData"
12+
external make: (~form: htmlFormElement=?, ~submitter: htmlElement=?) => t = "FormData"
1213

1314
/**
1415
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/append)
@@ -20,8 +21,7 @@ external append: (t, ~name: string, ~value: string) => unit = "append"
2021
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/append)
2122
*/
2223
@send
23-
external appendBlob: (t, ~name: string, ~blobValue: FileTypes.blob, ~filename: string=?) => unit =
24-
"append"
24+
external appendBlob: (t, ~name: string, ~blobValue: Blob.t, ~filename: string=?) => unit = "append"
2525

2626
/**
2727
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/delete)
@@ -69,5 +69,4 @@ external set: (t, ~name: string, ~value: string) => unit = "set"
6969
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/set)
7070
*/
7171
@send
72-
external setBlob: (t, ~name: string, ~blobValue: FileTypes.blob, ~filename: string=?) => unit =
73-
"set"
72+
external setBlob: (t, ~name: string, ~blobValue: Blob.t, ~filename: string=?) => unit = "set"

src/FetchAPI/FormDataEntryValue.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ module Types = FetchTypes
55
type t = Types.formDataEntryValue
66

77
external fromString: string => t = "%identity"
8-
external fromFile: FileTypes.file => t = "%identity"
8+
external fromFile: File.t => t = "%identity"
99

1010
/**
1111
Represents a decoded version of the abstract `formDataEntryValue` type.
1212
A FormData entry value is either a string or a File.
1313
*/
1414
type decoded =
1515
| String(string)
16-
| File(FileTypes.file)
16+
| File(File.t)
1717

1818
let decode = (value: t): decoded => {
1919
if File.isInstanceOf(value) {

src/FetchAPI/Request.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Types = FetchTypes
22

33
type t = Types.request = {...Types.request}
44
type requestInit = Types.requestInit = {...Types.requestInit}
5-
type bodyInit = Types.bodyInit
6-
type headersInit = Types.headersInit
5+
type bodyInit = BodyInit.t
6+
type headersInit = HeadersInit.t
77

88
/**
99
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request)
@@ -27,7 +27,7 @@ external arrayBuffer: t => promise<ArrayBuffer.t> = "arrayBuffer"
2727
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/blob)
2828
*/
2929
@send
30-
external blob: t => promise<FileTypes.blob> = "blob"
30+
external blob: t => promise<Blob.t> = "blob"
3131

3232
/**
3333
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bytes)
@@ -39,7 +39,7 @@ external bytes: t => promise<array<int>> = "bytes"
3939
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/formData)
4040
*/
4141
@send
42-
external formData: t => promise<Types.formData> = "formData"
42+
external formData: t => promise<FormData.t> = "formData"
4343

4444
/**
4545
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)

src/FetchAPI/Response.res

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Types = FetchTypes
22

33
type t = Types.response = {...Types.response}
44
type responseInit = Types.responseInit = {...Types.responseInit}
5-
type bodyInit = Types.bodyInit
6-
type headersInit = Types.headersInit
5+
type bodyInit = BodyInit.t
6+
type headersInit = HeadersInit.t
77

88
/**
99
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
@@ -39,31 +39,31 @@ external fromDataView: (DataView.t, ~init: responseInit=?) => t = "Response"
3939
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
4040
*/
4141
@new
42-
external fromBlob: (FileTypes.blob, ~init: responseInit=?) => t = "Response"
42+
external fromBlob: (Blob.t, ~init: responseInit=?) => t = "Response"
4343

4444
/**
4545
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
4646
*/
4747
@new
48-
external fromFile: (FileTypes.file, ~init: responseInit=?) => t = "Response"
48+
external fromFile: (File.t, ~init: responseInit=?) => t = "Response"
4949

5050
/**
5151
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
5252
*/
5353
@new
54-
external fromURLSearchParams: (URLTypes.urlSearchParams, ~init: responseInit=?) => t = "Response"
54+
external fromURLSearchParams: (URLSearchParams.t, ~init: responseInit=?) => t = "Response"
5555

5656
/**
5757
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
5858
*/
5959
@new
60-
external fromFormData: (Types.formData, ~init: responseInit=?) => t = "Response"
60+
external fromFormData: (FormData.t, ~init: responseInit=?) => t = "Response"
6161

6262
/**
6363
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
6464
*/
6565
@new
66-
external fromReadableStream: (FileTypes.readableStream<'t>, ~init: responseInit=?) => t = "Response"
66+
external fromReadableStream: (ReadableStream.t<'t>, ~init: responseInit=?) => t = "Response"
6767

6868
/**
6969
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer)
@@ -75,7 +75,7 @@ external arrayBuffer: t => promise<ArrayBuffer.t> = "arrayBuffer"
7575
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/blob)
7676
*/
7777
@send
78-
external blob: t => promise<FileTypes.blob> = "blob"
78+
external blob: t => promise<Blob.t> = "blob"
7979

8080
/**
8181
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bytes)
@@ -87,7 +87,7 @@ external bytes: t => promise<array<int>> = "bytes"
8787
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/formData)
8888
*/
8989
@send
90-
external formData: t => promise<Types.formData> = "formData"
90+
external formData: t => promise<FormData.t> = "formData"
9191

9292
/**
9393
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)

src/PushAPI/PushEvent.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
open PushTypes
22

3-
include ExtendableEvent.Impl({type t = pushEvent})
3+
type t = pushEvent = {...pushEvent}
4+
5+
include ExtendableEvent.Impl({type t = t})

0 commit comments

Comments
 (0)