@rescript/webapi 0.1.0-pre-alpha-b7f8547 → 0.1.0-pre-alpha-b330deb
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/NotificationAPI/Notification.res +21 -3
- package/src/PictureInPicture.res +5 -0
- package/src/URLAPI/URL.res +6 -4
- package/src/URLAPI/URLSearchParams.res +18 -16
- package/src/WebAudioAPI/AudioContext.res +16 -9
- package/src/WebAudioAPI/AudioDestinationNode.res +3 -1
- package/src/WebAudioAPI/AudioNode.res +4 -0
- package/src/WebAudioAPI/AudioScheduledSourceNode.res +3 -1
- package/src/WebAudioAPI/GainNode.res +5 -2
- package/src/WebAudioAPI/OscillatorNode.res +8 -4
- package/src/WebMIDI.res +4 -0
- package/src/WebSocketsAPI/CloseEvent.res +6 -3
- package/src/WebSocketsAPI/MessageEvent.res +10 -9
- package/src/WebSocketsAPI/WebSocket.res +15 -10
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
open NotificationTypes
|
|
2
2
|
|
|
3
|
+
type t = notification = {...notification}
|
|
4
|
+
|
|
5
|
+
type notificationDirection = NotificationTypes.notificationDirection
|
|
6
|
+
type notificationPermission = NotificationTypes.notificationPermission
|
|
7
|
+
type notificationAction = NotificationTypes.notificationAction = {
|
|
8
|
+
...NotificationTypes.notificationAction,
|
|
9
|
+
}
|
|
10
|
+
type notificationOptions = NotificationTypes.notificationOptions = {
|
|
11
|
+
...NotificationTypes.notificationOptions,
|
|
12
|
+
}
|
|
13
|
+
type getNotificationOptions = NotificationTypes.getNotificationOptions = {
|
|
14
|
+
...NotificationTypes.getNotificationOptions,
|
|
15
|
+
}
|
|
16
|
+
type notificationPermissionCallback = NotificationTypes.notificationPermissionCallback
|
|
17
|
+
type notificationEvent = NotificationTypes.notificationEvent = {
|
|
18
|
+
...NotificationTypes.notificationEvent,
|
|
19
|
+
}
|
|
20
|
+
|
|
3
21
|
/**
|
|
4
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification)
|
|
5
23
|
*/
|
|
6
24
|
@new
|
|
7
|
-
external make: (~title: string, ~options: notificationOptions=?) =>
|
|
25
|
+
external make: (~title: string, ~options: notificationOptions=?) => t = "Notification"
|
|
8
26
|
|
|
9
|
-
include EventTarget.Impl({type t =
|
|
27
|
+
include EventTarget.Impl({type t = t})
|
|
10
28
|
|
|
11
29
|
/**
|
|
12
30
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/requestPermission_static)
|
|
@@ -20,7 +38,7 @@ external requestPermission: (
|
|
|
20
38
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/close)
|
|
21
39
|
*/
|
|
22
40
|
@send
|
|
23
|
-
external close:
|
|
41
|
+
external close: t => unit = "close"
|
|
24
42
|
|
|
25
43
|
/**
|
|
26
44
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission_static)
|
package/src/URLAPI/URL.res
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = URLTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.url = {...Types.url}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL)
|
|
5
7
|
*/
|
|
6
8
|
@new
|
|
7
|
-
external make: (~url: string, ~base: string=?) =>
|
|
9
|
+
external make: (~url: string, ~base: string=?) => t = "URL"
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/parse_static)
|
|
11
13
|
*/
|
|
12
14
|
@scope("URL")
|
|
13
|
-
external parse: (~url: string, ~base: string=?) =>
|
|
15
|
+
external parse: (~url: string, ~base: string=?) => t = "parse"
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/canParse_static)
|
|
@@ -22,7 +24,7 @@ external canParse: (~url: string, ~base: string=?) => bool = "canParse"
|
|
|
22
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
|
23
25
|
*/
|
|
24
26
|
@send
|
|
25
|
-
external toJSON:
|
|
27
|
+
external toJSON: t => string = "toJSON"
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
|
@@ -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"
|
|
@@ -2,55 +2,62 @@ open WebAudioTypes
|
|
|
2
2
|
open DOMTypes
|
|
3
3
|
open MediaCaptureAndStreamsTypes
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type t = audioContext = {...audioContext}
|
|
6
|
+
type baseAudioContext = WebAudioTypes.baseAudioContext = {...WebAudioTypes.baseAudioContext}
|
|
7
|
+
type audioContextOptions = WebAudioTypes.audioContextOptions = {
|
|
8
|
+
...WebAudioTypes.audioContextOptions,
|
|
9
|
+
}
|
|
10
|
+
type audioTimestamp = WebAudioTypes.audioTimestamp = {...WebAudioTypes.audioTimestamp}
|
|
11
|
+
|
|
12
|
+
include BaseAudioContext.Impl({type t = t})
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext)
|
|
9
16
|
*/
|
|
10
17
|
@new
|
|
11
|
-
external make: (~contextOptions: audioContextOptions=?) =>
|
|
18
|
+
external make: (~contextOptions: audioContextOptions=?) => t = "AudioContext"
|
|
12
19
|
|
|
13
20
|
/**
|
|
14
21
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/getOutputTimestamp)
|
|
15
22
|
*/
|
|
16
23
|
@send
|
|
17
|
-
external getOutputTimestamp:
|
|
24
|
+
external getOutputTimestamp: t => audioTimestamp = "getOutputTimestamp"
|
|
18
25
|
|
|
19
26
|
/**
|
|
20
27
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/resume)
|
|
21
28
|
*/
|
|
22
29
|
@send
|
|
23
|
-
external resume:
|
|
30
|
+
external resume: t => promise<unit> = "resume"
|
|
24
31
|
|
|
25
32
|
/**
|
|
26
33
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/suspend)
|
|
27
34
|
*/
|
|
28
35
|
@send
|
|
29
|
-
external suspend:
|
|
36
|
+
external suspend: t => promise<unit> = "suspend"
|
|
30
37
|
|
|
31
38
|
/**
|
|
32
39
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/close)
|
|
33
40
|
*/
|
|
34
41
|
@send
|
|
35
|
-
external close:
|
|
42
|
+
external close: t => promise<unit> = "close"
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaElementSource)
|
|
39
46
|
*/
|
|
40
47
|
@send
|
|
41
|
-
external createMediaElementSource: (
|
|
48
|
+
external createMediaElementSource: (t, htmlMediaElement) => mediaElementAudioSourceNode =
|
|
42
49
|
"createMediaElementSource"
|
|
43
50
|
|
|
44
51
|
/**
|
|
45
52
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamSource)
|
|
46
53
|
*/
|
|
47
54
|
@send
|
|
48
|
-
external createMediaStreamSource: (
|
|
55
|
+
external createMediaStreamSource: (t, mediaStream) => mediaStreamAudioSourceNode =
|
|
49
56
|
"createMediaStreamSource"
|
|
50
57
|
|
|
51
58
|
/**
|
|
52
59
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamDestination)
|
|
53
60
|
*/
|
|
54
61
|
@send
|
|
55
|
-
external createMediaStreamDestination:
|
|
62
|
+
external createMediaStreamDestination: t => mediaStreamAudioDestinationNode =
|
|
56
63
|
"createMediaStreamDestination"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
open WebAudioTypes
|
|
2
2
|
|
|
3
|
+
type t = audioNode = {...audioNode}
|
|
4
|
+
|
|
3
5
|
module Impl = (
|
|
4
6
|
T: {
|
|
5
7
|
type t
|
|
@@ -71,3 +73,5 @@ module Impl = (
|
|
|
71
73
|
external disconnectParamOutput: (T.t, ~destinationParam: audioParam, ~output: int) => unit =
|
|
72
74
|
"disconnect"
|
|
73
75
|
}
|
|
76
|
+
|
|
77
|
+
include Impl({type t = t})
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
open WebAudioTypes
|
|
2
2
|
|
|
3
|
+
type t = audioScheduledSourceNode = {...audioScheduledSourceNode}
|
|
4
|
+
|
|
3
5
|
module Impl = (
|
|
4
6
|
T: {
|
|
5
7
|
type t
|
|
@@ -22,4 +24,4 @@ module Impl = (
|
|
|
22
24
|
external stop: (T.t, ~when_: float=?) => unit = "stop"
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
include Impl({type t =
|
|
27
|
+
include Impl({type t = t})
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
open WebAudioTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = gainNode = {...gainNode}
|
|
4
|
+
type gainOptions = WebAudioTypes.gainOptions = {...WebAudioTypes.gainOptions}
|
|
5
|
+
|
|
6
|
+
include AudioNode.Impl({type t = t})
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GainNode)
|
|
7
10
|
*/
|
|
8
11
|
@new
|
|
9
|
-
external make: (~context: baseAudioContext, ~options: gainOptions=?) =>
|
|
12
|
+
external make: (~context: baseAudioContext, ~options: gainOptions=?) => t = "GainNode"
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
open WebAudioTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = oscillatorNode = {...oscillatorNode}
|
|
4
|
+
type oscillatorOptions = WebAudioTypes.oscillatorOptions = {...WebAudioTypes.oscillatorOptions}
|
|
5
|
+
type oscillatorType = WebAudioTypes.oscillatorType
|
|
6
|
+
type periodicWave = WebAudioTypes.periodicWave = {...WebAudioTypes.periodicWave}
|
|
7
|
+
|
|
8
|
+
include AudioScheduledSourceNode.Impl({type t = t})
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OscillatorNode)
|
|
7
12
|
*/
|
|
8
13
|
@new
|
|
9
|
-
external make: (~context: baseAudioContext, ~options: oscillatorOptions=?) =>
|
|
10
|
-
"OscillatorNode"
|
|
14
|
+
external make: (~context: baseAudioContext, ~options: oscillatorOptions=?) => t = "OscillatorNode"
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OscillatorNode/setPeriodicWave)
|
|
14
18
|
*/
|
|
15
19
|
@send
|
|
16
|
-
external setPeriodicWave: (
|
|
20
|
+
external setPeriodicWave: (t, periodicWave) => unit = "setPeriodicWave"
|
package/src/WebMIDI.res
ADDED
|
@@ -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"
|