@rescript/webapi 0.1.0-pre-alpha-4542085 → 0.1.0-pre-alpha-58ebc59

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescript/webapi",
3
- "version": "0.1.0-pre-alpha-4542085",
3
+ "version": "0.1.0-pre-alpha-58ebc59",
4
4
  "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5
5
  "keywords": [
6
6
  "dom",
@@ -1,12 +1,13 @@
1
1
  module Types = CanvasTypes
2
2
 
3
3
  type t = Types.canvasPattern = {...Types.canvasPattern}
4
+ type domMatrix2DInit = DOMTypes.domMatrix2DInit = {...DOMTypes.domMatrix2DInit}
4
5
 
5
6
  /**
6
7
  Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.
7
8
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform)
8
9
  */
9
10
  @send
10
- external setTransform: (t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "setTransform"
11
+ external setTransform: (t, ~transform: domMatrix2DInit=?) => unit = "setTransform"
11
12
 
12
13
  let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasPattern`)
@@ -95,5 +95,4 @@ The argument, if provided, is a dictionary that controls the encoding options of
95
95
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/convertToBlob)
96
96
  */
97
97
  @send
98
- external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<FileTypes.blob> =
99
- "convertToBlob"
98
+ external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<Blob.t> = "convertToBlob"
@@ -1,6 +1,7 @@
1
1
  module Types = CanvasTypes
2
2
 
3
3
  type t = Types.path2D = {...Types.path2D}
4
+ type domMatrix2DInit = DOMTypes.domMatrix2DInit = {...DOMTypes.domMatrix2DInit}
4
5
 
5
6
  /**
6
7
  [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.
114
115
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D/addPath)
115
116
  */
116
117
  @send
117
- external addPath: (t, ~path: t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "addPath"
118
+ external addPath: (t, ~path: t, ~transform: domMatrix2DInit=?) => unit = "addPath"
@@ -1,5 +1,7 @@
1
1
  open DOMTypes
2
2
 
3
+ type t = htmlFormElement = {...htmlFormElement}
4
+
3
5
  include HTMLElement.Impl({type t = htmlFormElement})
4
6
 
5
7
  /**
@@ -25,24 +25,24 @@ external fromDataView: DataView.t => t = "%identity"
25
25
  /**
26
26
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
27
27
  */
28
- external fromBlob: FileTypes.blob => t = "%identity"
28
+ external fromBlob: Blob.t => t = "%identity"
29
29
 
30
30
  /**
31
31
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
32
32
  */
33
- external fromFile: FileTypes.file => t = "%identity"
33
+ external fromFile: File.t => t = "%identity"
34
34
 
35
35
  /**
36
36
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
37
37
  */
38
- external fromURLSearchParams: URLTypes.urlSearchParams => t = "%identity"
38
+ external fromURLSearchParams: URLSearchParams.t => t = "%identity"
39
39
 
40
40
  /**
41
41
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
42
42
  */
43
- external fromFormData: Types.formData => t = "%identity"
43
+ external fromFormData: FormData.t => t = "%identity"
44
44
 
45
45
  /**
46
46
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
47
47
  */
48
- external fromReadableStream: FileTypes.readableStream<'t> => t = "%identity"
48
+ external fromReadableStream: ReadableStream.t<'t> => t = "%identity"
@@ -5,10 +5,11 @@ module Types = FetchTypes
5
5
  */
6
6
  @new
7
7
  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
9
11
 
10
- external make: (~form: DOMTypes.htmlFormElement=?, ~submitter: DOMTypes.htmlElement=?) => t =
11
- "FormData"
12
+ external make: (~form: htmlFormElement=?, ~submitter: htmlElement=?) => t = "FormData"
12
13
 
13
14
  /**
14
15
  [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"
20
21
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/append)
21
22
  */
22
23
  @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"
25
25
 
26
26
  /**
27
27
  [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"
69
69
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/set)
70
70
  */
71
71
  @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"
@@ -5,7 +5,7 @@ module Types = FetchTypes
5
5
  type t = Types.formDataEntryValue
6
6
 
7
7
  external fromString: string => t = "%identity"
8
- external fromFile: FileTypes.file => t = "%identity"
8
+ external fromFile: File.t => t = "%identity"
9
9
 
10
10
  /**
11
11
  Represents a decoded version of the abstract `formDataEntryValue` type.
@@ -13,7 +13,7 @@ A FormData entry value is either a string or a File.
13
13
  */
14
14
  type decoded =
15
15
  | String(string)
16
- | File(FileTypes.file)
16
+ | File(File.t)
17
17
 
18
18
  let decode = (value: t): decoded => {
19
19
  if File.isInstanceOf(value) {
@@ -2,8 +2,8 @@ module Types = FetchTypes
2
2
 
3
3
  type t = Types.request = {...Types.request}
4
4
  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
7
7
 
8
8
  /**
9
9
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request)
@@ -27,7 +27,7 @@ external arrayBuffer: t => promise<ArrayBuffer.t> = "arrayBuffer"
27
27
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/blob)
28
28
  */
29
29
  @send
30
- external blob: t => promise<FileTypes.blob> = "blob"
30
+ external blob: t => promise<Blob.t> = "blob"
31
31
 
32
32
  /**
33
33
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bytes)
@@ -39,7 +39,7 @@ external bytes: t => promise<array<int>> = "bytes"
39
39
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/formData)
40
40
  */
41
41
  @send
42
- external formData: t => promise<Types.formData> = "formData"
42
+ external formData: t => promise<FormData.t> = "formData"
43
43
 
44
44
  /**
45
45
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)
@@ -2,8 +2,8 @@ module Types = FetchTypes
2
2
 
3
3
  type t = Types.response = {...Types.response}
4
4
  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
7
7
 
8
8
  /**
9
9
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
@@ -39,31 +39,31 @@ external fromDataView: (DataView.t, ~init: responseInit=?) => t = "Response"
39
39
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
40
40
  */
41
41
  @new
42
- external fromBlob: (FileTypes.blob, ~init: responseInit=?) => t = "Response"
42
+ external fromBlob: (Blob.t, ~init: responseInit=?) => t = "Response"
43
43
 
44
44
  /**
45
45
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
46
46
  */
47
47
  @new
48
- external fromFile: (FileTypes.file, ~init: responseInit=?) => t = "Response"
48
+ external fromFile: (File.t, ~init: responseInit=?) => t = "Response"
49
49
 
50
50
  /**
51
51
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
52
52
  */
53
53
  @new
54
- external fromURLSearchParams: (URLTypes.urlSearchParams, ~init: responseInit=?) => t = "Response"
54
+ external fromURLSearchParams: (URLSearchParams.t, ~init: responseInit=?) => t = "Response"
55
55
 
56
56
  /**
57
57
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
58
58
  */
59
59
  @new
60
- external fromFormData: (Types.formData, ~init: responseInit=?) => t = "Response"
60
+ external fromFormData: (FormData.t, ~init: responseInit=?) => t = "Response"
61
61
 
62
62
  /**
63
63
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
64
64
  */
65
65
  @new
66
- external fromReadableStream: (FileTypes.readableStream<'t>, ~init: responseInit=?) => t = "Response"
66
+ external fromReadableStream: (ReadableStream.t<'t>, ~init: responseInit=?) => t = "Response"
67
67
 
68
68
  /**
69
69
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer)
@@ -75,7 +75,7 @@ external arrayBuffer: t => promise<ArrayBuffer.t> = "arrayBuffer"
75
75
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/blob)
76
76
  */
77
77
  @send
78
- external blob: t => promise<FileTypes.blob> = "blob"
78
+ external blob: t => promise<Blob.t> = "blob"
79
79
 
80
80
  /**
81
81
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bytes)
@@ -87,7 +87,7 @@ external bytes: t => promise<array<int>> = "bytes"
87
87
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/formData)
88
88
  */
89
89
  @send
90
- external formData: t => promise<Types.formData> = "formData"
90
+ external formData: t => promise<FormData.t> = "formData"
91
91
 
92
92
  /**
93
93
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/json)
@@ -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=?) => notification = "Notification"
25
+ external make: (~title: string, ~options: notificationOptions=?) => t = "Notification"
8
26
 
9
- include EventTarget.Impl({type t = notification})
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: notification => unit = "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)
@@ -0,0 +1,5 @@
1
+ open PictureInPictureTypes
2
+
3
+ type t = pictureInPictureWindow = {...pictureInPictureWindow}
4
+
5
+ include EventTarget.Impl({type t = t})
@@ -1,3 +1,5 @@
1
1
  open PushTypes
2
2
 
3
- include ExtendableEvent.Impl({type t = pushEvent})
3
+ type t = pushEvent = {...pushEvent}
4
+
5
+ include ExtendableEvent.Impl({type t = t})
@@ -1,15 +1,17 @@
1
1
  open PushTypes
2
2
 
3
+ type t = pushMessageData
4
+
3
5
  /**
4
6
  The json() method of the PushMessageData interface extracts push message data by parsing it as a JSON string and returning the result.
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushMessageData/json)
6
8
  */
7
9
  @send
8
- external json: pushMessageData => JSON.t = "json"
10
+ external json: t => JSON.t = "json"
9
11
 
10
12
  /**
11
13
  The text() method of the PushMessageData interface extracts push message data as a plain text string.
12
14
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushMessageData/text)
13
15
  */
14
16
  @send
15
- external text: pushMessageData => string = "text"
17
+ external text: t => string = "text"
@@ -1,13 +1,14 @@
1
1
  open ServiceWorkerTypes
2
- open ChannelMessagingTypes
3
2
 
4
- include EventTarget.Impl({type t = serviceWorker})
3
+ type t = serviceWorker = {...serviceWorker}
4
+
5
+ include EventTarget.Impl({type t = t})
5
6
 
6
7
  /**
7
8
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorker/postMessage)
8
9
  */
9
10
  @send
10
- external postMessage: (serviceWorker, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
11
+ external postMessage: (t, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
11
12
  "postMessage"
12
13
 
13
14
  /**
@@ -15,7 +16,7 @@ external postMessage: (serviceWorker, ~message: JSON.t, ~transfer: array<Dict.t<
15
16
  */
16
17
  @send
17
18
  external postMessageWithOptions: (
18
- serviceWorker,
19
+ t,
19
20
  ~message: JSON.t,
20
- ~options: structuredSerializeOptions=?,
21
+ ~options: MessagePort.structuredSerializeOptions=?,
21
22
  ) => unit = "postMessage"
@@ -2,55 +2,62 @@ open WebAudioTypes
2
2
  open DOMTypes
3
3
  open MediaCaptureAndStreamsTypes
4
4
 
5
- include BaseAudioContext.Impl({type t = audioContext})
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=?) => audioContext = "AudioContext"
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: audioContext => audioTimestamp = "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: audioContext => promise<unit> = "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: audioContext => promise<unit> = "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: audioContext => promise<unit> = "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: (audioContext, htmlMediaElement) => mediaElementAudioSourceNode =
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: (audioContext, mediaStream) => mediaStreamAudioSourceNode =
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: audioContext => mediaStreamAudioDestinationNode =
62
+ external createMediaStreamDestination: t => mediaStreamAudioDestinationNode =
56
63
  "createMediaStreamDestination"
@@ -1,3 +1,5 @@
1
1
  open WebAudioTypes
2
2
 
3
- include AudioNode.Impl({type t = audioDestinationNode})
3
+ type t = audioDestinationNode = {...audioDestinationNode}
4
+
5
+ include AudioNode.Impl({type t = t})
@@ -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 = audioScheduledSourceNode})
27
+ include Impl({type t = t})
@@ -1,9 +1,12 @@
1
1
  open WebAudioTypes
2
2
 
3
- include AudioNode.Impl({type t = gainNode})
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=?) => gainNode = "GainNode"
12
+ external make: (~context: baseAudioContext, ~options: gainOptions=?) => t = "GainNode"
@@ -1,16 +1,20 @@
1
1
  open WebAudioTypes
2
2
 
3
- include AudioScheduledSourceNode.Impl({type t = oscillatorNode})
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=?) => oscillatorNode =
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: (oscillatorNode, periodicWave) => unit = "setPeriodicWave"
20
+ external setPeriodicWave: (t, periodicWave) => unit = "setPeriodicWave"
@@ -0,0 +1,4 @@
1
+ open WebMIDITypes
2
+
3
+ type t = midiAccess = {...midiAccess}
4
+ type midiOptions = WebMIDITypes.midiOptions = {...WebMIDITypes.midiOptions}
@@ -9,13 +9,13 @@ type messageEventInit<'t> = Types.messageEventInit<'t> = {...Types.messageEventI
9
9
  @new
10
10
  external make: (~type_: string, ~eventInitDict: messageEventInit<'t>=?) => t<'t> = "MessageEvent"
11
11
 
12
- external asEvent: t<'t> => EventTypes.event = "%identity"
12
+ external asEvent: t<'t> => Event.t = "%identity"
13
13
  /**
14
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.
15
15
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
16
16
  */
17
17
  @send
18
- external composedPath: t<'t> => array<EventTypes.eventTarget> = "composedPath"
18
+ external composedPath: t<'t> => array<EventTarget.t> = "composedPath"
19
19
 
20
20
  /**
21
21
  When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
@@ -46,7 +46,7 @@ Transmits data using the WebSocket connection. data can be a string, a Blob, an
46
46
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
47
47
  */
48
48
  @send
49
- external sendBlob: (t, FileTypes.blob) => unit = "send"
49
+ external sendBlob: (t, Blob.t) => unit = "send"
50
50
 
51
51
  /**
52
52
  Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
@@ -1,7 +1,10 @@
1
- open ChannelMessagingTypes
2
1
  open WebWorkersTypes
3
2
 
4
- include EventTarget.Impl({type t = sharedWorker})
3
+ type t = sharedWorker
4
+ type workerType = WebWorkersTypes.workerType
5
+ type workerOptions = WebWorkersTypes.workerOptions = {...WebWorkersTypes.workerOptions}
6
+
7
+ include EventTarget.Impl({type t = t})
5
8
 
6
9
  /**
7
10
  `make(string)`
@@ -10,13 +13,13 @@ The SharedWorker() constructor creates a SharedWorker object that executes the
10
13
  script at the specified URL. This script must obey the same-origin policy.
11
14
 
12
15
  ```res
13
- let shared: sharedWorker = SharedWorker.make("sharedworker.js")
16
+ let shared: SharedWorker.t = SharedWorker.make("sharedworker.js")
14
17
  ```
15
18
 
16
19
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/)
17
20
  */
18
21
  @new
19
- external make: string => sharedWorker = "SharedWorker"
22
+ external make: string => t = "SharedWorker"
20
23
 
21
24
  /**
22
25
  `makeWithName(string, string)`
@@ -25,13 +28,13 @@ The SharedWorker() constructor creates a SharedWorker object that executes the
25
28
  script at the specified URL. This script must obey the same-origin policy.
26
29
 
27
30
  ```res
28
- let shared: sharedWorker = SharedWorker.make("sharedworker.js", "name")
31
+ let shared: SharedWorker.t = SharedWorker.makeWithName("sharedworker.js", "name")
29
32
  ```
30
33
 
31
34
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/)
32
35
  */
33
36
  @new
34
- external makeWithName: (string, string) => sharedWorker = "SharedWorker"
37
+ external makeWithName: (string, string) => t = "SharedWorker"
35
38
 
36
39
  /**
37
40
  `makeWithOptions(string, workerOptions)`
@@ -40,16 +43,15 @@ The SharedWorker() constructor creates a SharedWorker object that executes the
40
43
  script at the specified URL. This script must obey the same-origin policy.
41
44
 
42
45
  ```res
43
- let shared: sharedWorker = SharedWorker.makeWithOptions("sharedworker.js", {
46
+ let shared: SharedWorker.t = SharedWorker.makeWithOptions("sharedworker.js", {
44
47
  name: "workerName",
45
- type_: Module
46
48
  })
47
49
  ```
48
50
 
49
51
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/)
50
52
  */
51
53
  @new
52
- external makeWithOptions: (string, workerOptions) => sharedWorker = "SharedWorker"
54
+ external makeWithOptions: (string, workerOptions) => t = "SharedWorker"
53
55
 
54
56
  /**
55
57
  `port(sharedWorker)`
@@ -58,10 +60,10 @@ The port property of the SharedWorker interface returns a MessagePort object
58
60
  used to communicate and control the shared worker.
59
61
 
60
62
  ```res
61
- let port: WebAPI.ChannelMessagingTypes.messagePort = SharedWorker.port(myWorker)
63
+ let port: MessagePort.t = SharedWorker.port(myWorker)
62
64
  ```
63
65
 
64
66
  [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/port)
65
67
  */
66
68
  @get
67
- external port: sharedWorker => messagePort = "port"
69
+ external port: t => MessagePort.t = "port"