@rescript/webapi 0.1.0-pre-alpha-4542085 → 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 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-b330deb",
4
4
  "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5
5
  "keywords": [
6
6
  "dom",
@@ -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})
@@ -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}