@rescript/webapi 0.1.0-pre-alpha-b7f8547 → 0.1.0-pre-alpha-4542085
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/CSSFontLoadingAPI/FontFace.res +10 -5
- package/src/CSSFontLoadingAPI/FontFaceSet.res +11 -7
- package/src/CanvasAPI/CanvasGradient.res +4 -2
- package/src/CanvasAPI/CanvasPattern.res +4 -3
- package/src/CanvasAPI/FillStyle.res +15 -10
- package/src/CanvasAPI/ImageBitmap.res +4 -2
- package/src/CanvasAPI/ImageBitmapRenderingContext.res +5 -3
- package/src/CanvasAPI/OffscreenCanvas.res +27 -15
- package/src/CanvasAPI/Path2D.res +16 -15
- package/src/ChannelMessagingAPI/MessagePort.res +11 -6
- package/src/FetchAPI/BodyInit.res +12 -12
- package/src/FetchAPI/FormData.res +18 -15
- package/src/FetchAPI/FormDataEntryValue.res +11 -9
- package/src/FetchAPI/Headers.res +14 -12
- package/src/FetchAPI/HeadersInit.res +6 -4
- package/src/FetchAPI/Request.res +16 -12
- package/src/FetchAPI/Response.res +27 -24
- package/src/FileAPI/Blob.res +10 -5
- package/src/FileAPI/File.res +8 -7
- package/src/FileAPI/FileSystemDirectoryHandle.res +18 -13
- package/src/FileAPI/FileSystemFileHandle.res +15 -5
- package/src/FileAPI/FileSystemHandle.res +4 -2
- package/src/FileAPI/ReadableStream.res +20 -10
- package/src/FileAPI/WritableStream.res +11 -8
- package/src/FileAPI/WritableStreamDefaultController.res +4 -2
- package/src/URLAPI/URL.res +6 -4
- package/src/URLAPI/URLSearchParams.res +18 -16
- package/src/WebSocketsAPI/CloseEvent.res +6 -3
- package/src/WebSocketsAPI/MessageEvent.res +10 -9
- package/src/WebSocketsAPI/WebSocket.res +15 -10
|
@@ -1,101 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = URLTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.urlSearchParams = {...Types.urlSearchParams}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
5
7
|
*/
|
|
6
8
|
@new
|
|
7
|
-
external make: unit =>
|
|
9
|
+
external make: unit => t = "URLSearchParams"
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
11
13
|
*/
|
|
12
14
|
@new
|
|
13
|
-
external fromKeyValueArray: array<(string, string)> =>
|
|
15
|
+
external fromKeyValueArray: array<(string, string)> => t = "URLSearchParams"
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
17
19
|
*/
|
|
18
20
|
@new
|
|
19
|
-
external fromDict: dict<string> =>
|
|
21
|
+
external fromDict: dict<string> => t = "URLSearchParams"
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
23
25
|
*/
|
|
24
26
|
@new
|
|
25
|
-
external fromString: string =>
|
|
27
|
+
external fromString: string => t = "URLSearchParams"
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
Appends a specified key/value pair as a new search parameter.
|
|
29
31
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
30
32
|
*/
|
|
31
33
|
@send
|
|
32
|
-
external append: (
|
|
34
|
+
external append: (t, ~name: string, ~value: string) => unit = "append"
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
36
38
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
37
39
|
*/
|
|
38
40
|
@send
|
|
39
|
-
external delete: (
|
|
41
|
+
external delete: (t, ~name: string, ~value: string=?) => unit = "delete"
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
Returns key/value pairs in the same order as they appear in the query string.
|
|
43
45
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/entries)
|
|
44
46
|
*/
|
|
45
47
|
@send
|
|
46
|
-
external entries:
|
|
48
|
+
external entries: t => Iterator.t<(string, string)> = "entries"
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
Returns the first value associated to the given search parameter.
|
|
50
52
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
51
53
|
*/
|
|
52
54
|
@send
|
|
53
|
-
external get: (
|
|
55
|
+
external get: (t, string) => null<string> = "get"
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
Returns all the values association with a given search parameter.
|
|
57
59
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
58
60
|
*/
|
|
59
61
|
@send
|
|
60
|
-
external getAll: (
|
|
62
|
+
external getAll: (t, string) => array<string> = "getAll"
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
Returns a Boolean indicating if such a search parameter exists.
|
|
64
66
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
65
67
|
*/
|
|
66
68
|
@send
|
|
67
|
-
external has: (
|
|
69
|
+
external has: (t, ~name: string, ~value: string=?) => bool = "has"
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
Returns an iterator allowing iteration through all keys contained in this object.
|
|
71
73
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/keys)
|
|
72
74
|
*/
|
|
73
75
|
@send
|
|
74
|
-
external keys:
|
|
76
|
+
external keys: t => Iterator.t<string> = "keys"
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
79
|
Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
78
80
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
79
81
|
*/
|
|
80
82
|
@send
|
|
81
|
-
external set: (
|
|
83
|
+
external set: (t, ~name: string, ~value: string) => unit = "set"
|
|
82
84
|
|
|
83
85
|
/**
|
|
84
86
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
|
85
87
|
*/
|
|
86
88
|
@send
|
|
87
|
-
external sort:
|
|
89
|
+
external sort: t => unit = "sort"
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
Returns the query string suitable for use in a URL, without the question mark.
|
|
91
93
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/toString)
|
|
92
94
|
*/
|
|
93
95
|
@send
|
|
94
|
-
external toString:
|
|
96
|
+
external toString: t => string = "toString"
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
99
|
Returns an iterator allowing iteration through all values contained in this object.
|
|
98
100
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/values)
|
|
99
101
|
*/
|
|
100
102
|
@send
|
|
101
|
-
external values:
|
|
103
|
+
external values: t => Iterator.t<string> = "values"
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = WebSocketsTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = Types.closeEvent = {...Types.closeEvent}
|
|
4
|
+
type closeEventInit = Types.closeEventInit = {...Types.closeEventInit}
|
|
5
|
+
|
|
6
|
+
include Event.Impl({type t = t})
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
7
10
|
*/
|
|
8
11
|
@new
|
|
9
|
-
external make: (~type_: string, ~eventInitDict: closeEventInit=?) =>
|
|
12
|
+
external make: (~type_: string, ~eventInitDict: closeEventInit=?) => t = "CloseEvent"
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
module Types = WebSocketsTypes
|
|
2
|
+
|
|
3
|
+
type t<'t> = Types.messageEvent<'t> = {...Types.messageEvent<'t>}
|
|
4
|
+
type messageEventInit<'t> = Types.messageEventInit<'t> = {...Types.messageEventInit<'t>}
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
6
8
|
*/
|
|
7
9
|
@new
|
|
8
|
-
external make: (~type_: string, ~eventInitDict: messageEventInit<'t>=?) =>
|
|
9
|
-
"MessageEvent"
|
|
10
|
+
external make: (~type_: string, ~eventInitDict: messageEventInit<'t>=?) => t<'t> = "MessageEvent"
|
|
10
11
|
|
|
11
|
-
external asEvent:
|
|
12
|
+
external asEvent: t<'t> => EventTypes.event = "%identity"
|
|
12
13
|
/**
|
|
13
14
|
Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
|
|
14
15
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
15
16
|
*/
|
|
16
17
|
@send
|
|
17
|
-
external composedPath:
|
|
18
|
+
external composedPath: t<'t> => array<EventTypes.eventTarget> = "composedPath"
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
21
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
22
23
|
*/
|
|
23
24
|
@send
|
|
24
|
-
external stopPropagation:
|
|
25
|
+
external stopPropagation: t<'t> => unit = "stopPropagation"
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
|
|
28
29
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
29
30
|
*/
|
|
30
31
|
@send
|
|
31
|
-
external stopImmediatePropagation:
|
|
32
|
+
external stopImmediatePropagation: t<'t> => unit = "stopImmediatePropagation"
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
|
|
35
36
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
36
37
|
*/
|
|
37
38
|
@send
|
|
38
|
-
external preventDefault:
|
|
39
|
+
external preventDefault: t<'t> => unit = "preventDefault"
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
module Types = WebSocketsTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.webSocket = {...Types.webSocket}
|
|
4
|
+
type binaryType = Types.binaryType
|
|
5
|
+
type messageEvent<'t> = Types.messageEvent<'t> = {...Types.messageEvent<'t>}
|
|
6
|
+
type closeEvent = Types.closeEvent = {...Types.closeEvent}
|
|
7
|
+
type messageEventSource = Types.messageEventSource
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
6
11
|
*/
|
|
7
12
|
@new
|
|
8
|
-
external make: (~url: string, ~protocols: string=?) =>
|
|
13
|
+
external make: (~url: string, ~protocols: string=?) => t = "WebSocket"
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
12
17
|
*/
|
|
13
18
|
@new
|
|
14
|
-
external makeWithProtocols: (~url: string, ~protocols: array<string>=?) =>
|
|
19
|
+
external makeWithProtocols: (~url: string, ~protocols: array<string>=?) => t = "WebSocket"
|
|
15
20
|
|
|
16
|
-
include EventTarget.Impl({type t =
|
|
21
|
+
include EventTarget.Impl({type t = t})
|
|
17
22
|
|
|
18
23
|
/**
|
|
19
24
|
Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
|
|
20
25
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
21
26
|
*/
|
|
22
27
|
@send
|
|
23
|
-
external close: (
|
|
28
|
+
external close: (t, ~code: int=?, ~reason: string=?) => unit = "close"
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
31
|
Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
27
32
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
28
33
|
*/
|
|
29
34
|
@send
|
|
30
|
-
external send: (
|
|
35
|
+
external send: (t, DataView.t) => unit = "send"
|
|
31
36
|
|
|
32
37
|
/**
|
|
33
38
|
Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
34
39
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
35
40
|
*/
|
|
36
41
|
@send
|
|
37
|
-
external sendArrayBuffer: (
|
|
42
|
+
external sendArrayBuffer: (t, ArrayBuffer.t) => unit = "send"
|
|
38
43
|
|
|
39
44
|
/**
|
|
40
45
|
Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
41
46
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
42
47
|
*/
|
|
43
48
|
@send
|
|
44
|
-
external sendBlob: (
|
|
49
|
+
external sendBlob: (t, FileTypes.blob) => unit = "send"
|
|
45
50
|
|
|
46
51
|
/**
|
|
47
52
|
Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
48
53
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
49
54
|
*/
|
|
50
55
|
@send
|
|
51
|
-
external sendString: (
|
|
56
|
+
external sendString: (t, string) => unit = "send"
|