@rescript/webapi 0.1.0-experimental-d3d4b5f → 0.1.0-experimental-fb395c3
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 +2 -2
- package/src/CSSFontLoadingAPI/FontFaceSet.res +3 -79
- package/src/CanvasAPI/OffscreenCanvas.res +3 -79
- package/src/ChannelMessagingAPI/MessagePort.res +3 -81
- package/src/ClipboardAPI/Clipboard.res +3 -80
- package/src/DOMAPI/Animation.res +3 -80
- package/src/DOMAPI/CharacterData.res +68 -231
- package/src/DOMAPI/Comment.res +4 -271
- package/src/DOMAPI/Document.res +4 -178
- package/src/DOMAPI/DocumentFragment.res +58 -220
- package/src/DOMAPI/Element.res +313 -477
- package/src/DOMAPI/HTMLAnchorElement.res +3 -691
- package/src/DOMAPI/HTMLAreaElement.res +3 -685
- package/src/DOMAPI/HTMLAudioElement.res +3 -748
- package/src/DOMAPI/HTMLBRElement.res +3 -684
- package/src/DOMAPI/HTMLBaseElement.res +3 -685
- package/src/DOMAPI/HTMLBodyElement.res +3 -685
- package/src/DOMAPI/HTMLButtonElement.res +3 -691
- package/src/DOMAPI/HTMLCanvasElement.res +3 -691
- package/src/DOMAPI/HTMLDListElement.res +3 -688
- package/src/DOMAPI/HTMLDataElement.res +3 -685
- package/src/DOMAPI/HTMLDataListElement.res +3 -695
- package/src/DOMAPI/HTMLDialogElement.res +3 -691
- package/src/DOMAPI/HTMLDivElement.res +3 -684
- package/src/DOMAPI/HTMLElement.res +40 -666
- package/src/DOMAPI/HTMLEmbedElement.res +3 -688
- package/src/DOMAPI/HTMLFieldSetElement.res +3 -695
- package/src/DOMAPI/HTMLFormElement.res +3 -685
- package/src/DOMAPI/HTMLFrameSetElement.res +3 -695
- package/src/DOMAPI/HTMLHRElement.res +3 -684
- package/src/DOMAPI/HTMLHeadElement.res +3 -685
- package/src/DOMAPI/HTMLHeadingElement.res +3 -691
- package/src/DOMAPI/HTMLHtmlElement.res +3 -685
- package/src/DOMAPI/HTMLIFrameElement.res +3 -691
- package/src/DOMAPI/HTMLImageElement.res +3 -688
- package/src/DOMAPI/HTMLInputElement.res +3 -688
- package/src/DOMAPI/HTMLLIElement.res +3 -684
- package/src/DOMAPI/HTMLLabelElement.res +3 -688
- package/src/DOMAPI/HTMLLegendElement.res +3 -691
- package/src/DOMAPI/HTMLLinkElement.res +3 -685
- package/src/DOMAPI/HTMLMapElement.res +3 -684
- package/src/DOMAPI/HTMLMediaElement.res +49 -722
- package/src/DOMAPI/HTMLMenuElement.res +3 -685
- package/src/DOMAPI/HTMLMetaElement.res +3 -685
- package/src/DOMAPI/HTMLMeterElement.res +3 -688
- package/src/DOMAPI/HTMLModElement.res +3 -684
- package/src/DOMAPI/HTMLOListElement.res +3 -688
- package/src/DOMAPI/HTMLObjectElement.res +3 -691
- package/src/DOMAPI/HTMLOptGroupElement.res +3 -695
- package/src/DOMAPI/HTMLOptionElement.res +3 -691
- package/src/DOMAPI/HTMLOutputElement.res +3 -691
- package/src/DOMAPI/HTMLParagraphElement.res +3 -699
- package/src/DOMAPI/HTMLPictureElement.res +3 -691
- package/src/DOMAPI/HTMLPreElement.res +3 -684
- package/src/DOMAPI/HTMLProgressElement.res +3 -695
- package/src/DOMAPI/HTMLQuoteElement.res +3 -688
- package/src/DOMAPI/HTMLScriptElement.res +3 -691
- package/src/DOMAPI/HTMLSelectElement.res +4 -692
- package/src/DOMAPI/HTMLSlotElement.res +3 -685
- package/src/DOMAPI/HTMLSourceElement.res +3 -691
- package/src/DOMAPI/HTMLSpanElement.res +3 -685
- package/src/DOMAPI/HTMLStyleElement.res +3 -688
- package/src/DOMAPI/HTMLTableCaptionElement.res +3 -712
- package/src/DOMAPI/HTMLTableCellElement.res +3 -699
- package/src/DOMAPI/HTMLTableElement.res +3 -688
- package/src/DOMAPI/HTMLTableRowElement.res +3 -695
- package/src/DOMAPI/HTMLTableSectionElement.res +3 -712
- package/src/DOMAPI/HTMLTemplateElement.res +3 -695
- package/src/DOMAPI/HTMLTextAreaElement.res +3 -695
- package/src/DOMAPI/HTMLTimeElement.res +3 -685
- package/src/DOMAPI/HTMLTitleElement.res +3 -688
- package/src/DOMAPI/HTMLTrackElement.res +3 -688
- package/src/DOMAPI/HTMLUListElement.res +3 -688
- package/src/DOMAPI/HTMLVideoElement.res +3 -748
- package/src/DOMAPI/MediaQueryList.res +3 -80
- package/src/DOMAPI/Node.res +59 -124
- package/src/DOMAPI/SVGGraphicsElement.res +4 -660
- package/src/DOMAPI/ScreenOrientation.res +3 -79
- package/src/DOMAPI/ShadowRoot.res +4 -255
- package/src/DOMAPI/Text.res +4 -271
- package/src/DOMAPI/TextTrackList.res +3 -79
- package/src/DOMAPI/Window.res +4 -80
- package/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +3 -80
- package/src/EventAPI/AbortSignal.res +3 -80
- package/src/EventAPI/Event.res +28 -16
- package/src/EventAPI/EventTarget.res +51 -39
- package/src/FileAPI/Blob.res +26 -15
- package/src/FileAPI/File.res +4 -31
- package/src/IndexedDBAPI/IDBDatabase.res +3 -79
- package/src/IndexedDBAPI/IDBTransaction.res +3 -80
- package/src/MediaCaptureAndStreamsAPI/MediaDevices.res +3 -79
- package/src/MediaCaptureAndStreamsAPI/MediaStream.res +3 -80
- package/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res +3 -81
- package/src/NotificationAPI/Notification.res +3 -80
- package/src/PerformanceAPI/Performance.res +3 -79
- package/src/RemotePlaybackAPI/RemotePlayback.res +3 -80
- package/src/ScreenWakeLockAPI/WakeLockSentinel.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorker.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorkerRegistration.res +3 -79
- package/src/WebAudioAPI/AnalyserNode.res +4 -148
- package/src/WebAudioAPI/AudioBufferSourceNode.res +4 -162
- package/src/WebAudioAPI/AudioContext.res +4 -212
- package/src/WebAudioAPI/AudioNode.res +39 -113
- package/src/WebAudioAPI/AudioProcessingEvent.res +4 -30
- package/src/WebAudioAPI/AudioScheduledSourceNode.res +20 -162
- package/src/WebAudioAPI/AudioWorkletNode.res +4 -149
- package/src/WebAudioAPI/BaseAudioContext.res +85 -155
- package/src/WebAudioAPI/BiquadFilterNode.res +4 -149
- package/src/WebAudioAPI/ChannelMergerNode.res +4 -149
- package/src/WebAudioAPI/ChannelSplitterNode.res +4 -149
- package/src/WebAudioAPI/ConstantSourceNode.res +4 -162
- package/src/WebAudioAPI/ConvolverNode.res +4 -149
- package/src/WebAudioAPI/DelayNode.res +4 -143
- package/src/WebAudioAPI/DynamicsCompressorNode.res +4 -152
- package/src/WebAudioAPI/GainNode.res +4 -142
- package/src/WebAudioAPI/IIRFilterNode.res +4 -149
- package/src/WebAudioAPI/MediaElementAudioSourceNode.res +4 -158
- package/src/WebAudioAPI/MediaStreamAudioDestinationNode.res +4 -158
- package/src/WebAudioAPI/MediaStreamAudioSourceNode.res +4 -158
- package/src/WebAudioAPI/OfflineAudioCompletionEvent.res +4 -30
- package/src/WebAudioAPI/OfflineAudioContext.res +4 -214
- package/src/WebAudioAPI/OscillatorNode.res +4 -162
- package/src/WebAudioAPI/PannerNode.res +4 -143
- package/src/WebAudioAPI/StereoPannerNode.res +4 -149
- package/src/WebAudioAPI/WaveShaperNode.res +4 -149
- package/src/WebSocketsAPI/CloseEvent.res +4 -30
- package/src/WebSocketsAPI/WebSocket.res +3 -79
- package/src/WebSpeechAPI/SpeechSynthesis.res +3 -79
- package/src/WebSpeechAPI/SpeechSynthesisUtterance.res +4 -81
- package/src/WebStorageAPI/StorageEvent.res +4 -30
- package/src/WebVTTAPI/TextTrack.res +3 -79
|
@@ -2,85 +2,9 @@ open EventAPI
|
|
|
2
2
|
open DOMAPI
|
|
3
3
|
open WebVTTAPI
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
10
|
-
|
|
11
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
12
|
-
|
|
13
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
14
|
-
|
|
15
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
16
|
-
|
|
17
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
18
|
-
|
|
19
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
20
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
21
|
-
*/
|
|
22
|
-
@send
|
|
23
|
-
external addEventListener: (
|
|
24
|
-
textTrackList,
|
|
25
|
-
~type_: eventType,
|
|
26
|
-
~callback: eventListener<'event>,
|
|
27
|
-
~options: addEventListenerOptions=?,
|
|
28
|
-
) => unit = "addEventListener"
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
32
|
-
|
|
33
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
34
|
-
|
|
35
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
36
|
-
|
|
37
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
38
|
-
|
|
39
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
40
|
-
|
|
41
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
42
|
-
|
|
43
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
44
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
45
|
-
*/
|
|
46
|
-
@send
|
|
47
|
-
external addEventListener2: (
|
|
48
|
-
textTrackList,
|
|
49
|
-
~type_: eventType,
|
|
50
|
-
~callback: eventListener<'event>,
|
|
51
|
-
~options: bool=?,
|
|
52
|
-
) => unit = "addEventListener"
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
56
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
57
|
-
*/
|
|
58
|
-
@send
|
|
59
|
-
external removeEventListener: (
|
|
60
|
-
textTrackList,
|
|
61
|
-
~type_: eventType,
|
|
62
|
-
~callback: eventListener<'event>,
|
|
63
|
-
~options: eventListenerOptions=?,
|
|
64
|
-
) => unit = "removeEventListener"
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
68
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
69
|
-
*/
|
|
70
|
-
@send
|
|
71
|
-
external removeEventListener2: (
|
|
72
|
-
textTrackList,
|
|
73
|
-
~type_: eventType,
|
|
74
|
-
~callback: eventListener<'event>,
|
|
75
|
-
~options: bool=?,
|
|
76
|
-
) => unit = "removeEventListener"
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
80
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
81
|
-
*/
|
|
82
|
-
@send
|
|
83
|
-
external dispatchEvent: (textTrackList, event) => bool = "dispatchEvent"
|
|
5
|
+
include EventTarget.Impl({
|
|
6
|
+
type t = textTrackList
|
|
7
|
+
})
|
|
84
8
|
|
|
85
9
|
/**
|
|
86
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackList/getTrackById)
|
package/src/DOMAPI/Window.res
CHANGED
|
@@ -6,7 +6,10 @@ open ChannelMessagingAPI
|
|
|
6
6
|
open FetchAPI
|
|
7
7
|
open EventAPI
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
include EventTarget.Impl({
|
|
10
|
+
type t = window
|
|
11
|
+
})
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/reportError)
|
|
12
15
|
*/
|
|
@@ -314,85 +317,6 @@ external requestAnimationFrame: (window, frameRequestCallback) => int = "request
|
|
|
314
317
|
@send
|
|
315
318
|
external cancelAnimationFrame: (window, int) => unit = "cancelAnimationFrame"
|
|
316
319
|
|
|
317
|
-
/**
|
|
318
|
-
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
319
|
-
|
|
320
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
321
|
-
|
|
322
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
323
|
-
|
|
324
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
325
|
-
|
|
326
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
327
|
-
|
|
328
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
329
|
-
|
|
330
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
331
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
332
|
-
*/
|
|
333
|
-
@send
|
|
334
|
-
external addEventListener: (
|
|
335
|
-
window,
|
|
336
|
-
~type_: eventType,
|
|
337
|
-
~callback: eventListener<'event>,
|
|
338
|
-
~options: addEventListenerOptions=?,
|
|
339
|
-
) => unit = "addEventListener"
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
343
|
-
|
|
344
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
345
|
-
|
|
346
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
347
|
-
|
|
348
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
349
|
-
|
|
350
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
351
|
-
|
|
352
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
353
|
-
|
|
354
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
355
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
356
|
-
*/
|
|
357
|
-
@send
|
|
358
|
-
external addEventListener2: (
|
|
359
|
-
window,
|
|
360
|
-
~type_: eventType,
|
|
361
|
-
~callback: eventListener<'event>,
|
|
362
|
-
~options: bool=?,
|
|
363
|
-
) => unit = "addEventListener"
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
367
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
368
|
-
*/
|
|
369
|
-
@send
|
|
370
|
-
external removeEventListener: (
|
|
371
|
-
window,
|
|
372
|
-
~type_: eventType,
|
|
373
|
-
~callback: eventListener<'event>,
|
|
374
|
-
~options: eventListenerOptions=?,
|
|
375
|
-
) => unit = "removeEventListener"
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
379
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
380
|
-
*/
|
|
381
|
-
@send
|
|
382
|
-
external removeEventListener2: (
|
|
383
|
-
window,
|
|
384
|
-
~type_: eventType,
|
|
385
|
-
~callback: eventListener<'event>,
|
|
386
|
-
~options: bool=?,
|
|
387
|
-
) => unit = "removeEventListener"
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
391
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
392
|
-
*/
|
|
393
|
-
@send
|
|
394
|
-
external dispatchEvent: (window, event) => bool = "dispatchEvent"
|
|
395
|
-
|
|
396
320
|
/**
|
|
397
321
|
Closes the window.
|
|
398
322
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/close)
|
|
@@ -1,85 +1,8 @@
|
|
|
1
|
-
open EventAPI
|
|
2
1
|
open EncryptedMediaExtensionsAPI
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
9
|
-
|
|
10
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
11
|
-
|
|
12
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
13
|
-
|
|
14
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
15
|
-
|
|
16
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
17
|
-
|
|
18
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
19
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
20
|
-
*/
|
|
21
|
-
@send
|
|
22
|
-
external addEventListener: (
|
|
23
|
-
mediaKeySession,
|
|
24
|
-
~type_: eventType,
|
|
25
|
-
~callback: eventListener<'event>,
|
|
26
|
-
~options: addEventListenerOptions=?,
|
|
27
|
-
) => unit = "addEventListener"
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
31
|
-
|
|
32
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
33
|
-
|
|
34
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
35
|
-
|
|
36
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
37
|
-
|
|
38
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
39
|
-
|
|
40
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
41
|
-
|
|
42
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
43
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
44
|
-
*/
|
|
45
|
-
@send
|
|
46
|
-
external addEventListener2: (
|
|
47
|
-
mediaKeySession,
|
|
48
|
-
~type_: eventType,
|
|
49
|
-
~callback: eventListener<'event>,
|
|
50
|
-
~options: bool=?,
|
|
51
|
-
) => unit = "addEventListener"
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
55
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
56
|
-
*/
|
|
57
|
-
@send
|
|
58
|
-
external removeEventListener: (
|
|
59
|
-
mediaKeySession,
|
|
60
|
-
~type_: eventType,
|
|
61
|
-
~callback: eventListener<'event>,
|
|
62
|
-
~options: eventListenerOptions=?,
|
|
63
|
-
) => unit = "removeEventListener"
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
67
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
68
|
-
*/
|
|
69
|
-
@send
|
|
70
|
-
external removeEventListener2: (
|
|
71
|
-
mediaKeySession,
|
|
72
|
-
~type_: eventType,
|
|
73
|
-
~callback: eventListener<'event>,
|
|
74
|
-
~options: bool=?,
|
|
75
|
-
) => unit = "removeEventListener"
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
79
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
80
|
-
*/
|
|
81
|
-
@send
|
|
82
|
-
external dispatchEvent: (mediaKeySession, event) => bool = "dispatchEvent"
|
|
3
|
+
include EventTarget.Impl({
|
|
4
|
+
type t = mediaKeySession
|
|
5
|
+
})
|
|
83
6
|
|
|
84
7
|
/**
|
|
85
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaKeySession/generateRequest)
|
|
@@ -1,85 +1,8 @@
|
|
|
1
1
|
open EventAPI
|
|
2
|
-
open Prelude
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
9
|
-
|
|
10
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
11
|
-
|
|
12
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
13
|
-
|
|
14
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
15
|
-
|
|
16
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
17
|
-
|
|
18
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
19
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
20
|
-
*/
|
|
21
|
-
@send
|
|
22
|
-
external addEventListener: (
|
|
23
|
-
abortSignal,
|
|
24
|
-
~type_: eventType,
|
|
25
|
-
~callback: eventListener<'event>,
|
|
26
|
-
~options: addEventListenerOptions=?,
|
|
27
|
-
) => unit = "addEventListener"
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
31
|
-
|
|
32
|
-
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
33
|
-
|
|
34
|
-
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
35
|
-
|
|
36
|
-
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
37
|
-
|
|
38
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
39
|
-
|
|
40
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
41
|
-
|
|
42
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
43
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
44
|
-
*/
|
|
45
|
-
@send
|
|
46
|
-
external addEventListener2: (
|
|
47
|
-
abortSignal,
|
|
48
|
-
~type_: eventType,
|
|
49
|
-
~callback: eventListener<'event>,
|
|
50
|
-
~options: bool=?,
|
|
51
|
-
) => unit = "addEventListener"
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
55
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
56
|
-
*/
|
|
57
|
-
@send
|
|
58
|
-
external removeEventListener: (
|
|
59
|
-
abortSignal,
|
|
60
|
-
~type_: eventType,
|
|
61
|
-
~callback: eventListener<'event>,
|
|
62
|
-
~options: eventListenerOptions=?,
|
|
63
|
-
) => unit = "removeEventListener"
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
67
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
68
|
-
*/
|
|
69
|
-
@send
|
|
70
|
-
external removeEventListener2: (
|
|
71
|
-
abortSignal,
|
|
72
|
-
~type_: eventType,
|
|
73
|
-
~callback: eventListener<'event>,
|
|
74
|
-
~options: bool=?,
|
|
75
|
-
) => unit = "removeEventListener"
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
79
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
80
|
-
*/
|
|
81
|
-
@send
|
|
82
|
-
external dispatchEvent: (abortSignal, event) => bool = "dispatchEvent"
|
|
3
|
+
include EventTarget.Impl({
|
|
4
|
+
type t = abortSignal
|
|
5
|
+
})
|
|
83
6
|
|
|
84
7
|
/**
|
|
85
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
package/src/EventAPI/Event.res
CHANGED
|
@@ -6,30 +6,42 @@ open EventAPI
|
|
|
6
6
|
@new
|
|
7
7
|
external make: (~type_: string, ~eventInitDict: eventInit=?) => event = "Event"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
module Impl = (
|
|
10
|
+
T: {
|
|
11
|
+
type t
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
14
|
+
external asEvent: T.t => event = "%identity"
|
|
15
|
+
|
|
16
|
+
/**
|
|
10
17
|
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.
|
|
11
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
12
19
|
*/
|
|
13
|
-
@send
|
|
14
|
-
external composedPath:
|
|
20
|
+
@send
|
|
21
|
+
external composedPath: T.t => array<eventTarget> = "composedPath"
|
|
15
22
|
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/
|
|
23
|
+
/**
|
|
24
|
+
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.
|
|
25
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
19
26
|
*/
|
|
20
|
-
@send
|
|
21
|
-
external
|
|
27
|
+
@send
|
|
28
|
+
external preventDefault: T.t => unit = "preventDefault"
|
|
22
29
|
|
|
23
|
-
/**
|
|
30
|
+
/**
|
|
24
31
|
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.
|
|
25
32
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
26
33
|
*/
|
|
27
|
-
@send
|
|
28
|
-
external stopImmediatePropagation:
|
|
34
|
+
@send
|
|
35
|
+
external stopImmediatePropagation: T.t => unit = "stopImmediatePropagation"
|
|
29
36
|
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/
|
|
37
|
+
/**
|
|
38
|
+
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
39
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
33
40
|
*/
|
|
34
|
-
@send
|
|
35
|
-
external
|
|
41
|
+
@send
|
|
42
|
+
external stopPropagation: T.t => unit = "stopPropagation"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
include Impl({
|
|
46
|
+
type t = event
|
|
47
|
+
})
|
|
@@ -6,7 +6,14 @@ open EventAPI
|
|
|
6
6
|
@new
|
|
7
7
|
external make: unit => eventTarget = "EventTarget"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
module Impl = (
|
|
10
|
+
T: {
|
|
11
|
+
type t
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
14
|
+
external asEventTarget: T.t => eventTarget = "%identity"
|
|
15
|
+
|
|
16
|
+
/**
|
|
10
17
|
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
11
18
|
|
|
12
19
|
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
@@ -22,15 +29,15 @@ If an AbortSignal is passed for options's signal, then the event listener will b
|
|
|
22
29
|
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
23
30
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
24
31
|
*/
|
|
25
|
-
@send
|
|
26
|
-
external addEventListener: (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
) => unit = "addEventListener"
|
|
32
|
-
|
|
33
|
-
/**
|
|
32
|
+
@send
|
|
33
|
+
external addEventListener: (
|
|
34
|
+
T.t,
|
|
35
|
+
~type_: eventType,
|
|
36
|
+
~callback: eventListener<'event>,
|
|
37
|
+
~options: addEventListenerOptions=?,
|
|
38
|
+
) => unit = "addEventListener"
|
|
39
|
+
|
|
40
|
+
/**
|
|
34
41
|
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
35
42
|
|
|
36
43
|
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
@@ -46,41 +53,46 @@ If an AbortSignal is passed for options's signal, then the event listener will b
|
|
|
46
53
|
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
47
54
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
48
55
|
*/
|
|
49
|
-
@send
|
|
50
|
-
external
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
) => unit = "addEventListener"
|
|
56
|
-
|
|
57
|
-
/**
|
|
56
|
+
@send
|
|
57
|
+
external addEventListener_useCapture: (
|
|
58
|
+
T.t,
|
|
59
|
+
~type_: eventType,
|
|
60
|
+
~callback: eventListener<'event>,
|
|
61
|
+
@as(json`true`) _,
|
|
62
|
+
) => unit = "addEventListener"
|
|
63
|
+
|
|
64
|
+
/**
|
|
58
65
|
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
59
66
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
60
67
|
*/
|
|
61
|
-
@send
|
|
62
|
-
external removeEventListener: (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
) => unit = "removeEventListener"
|
|
68
|
-
|
|
69
|
-
/**
|
|
68
|
+
@send
|
|
69
|
+
external removeEventListener: (
|
|
70
|
+
T.t,
|
|
71
|
+
~type_: eventType,
|
|
72
|
+
~callback: eventListener<'event>,
|
|
73
|
+
~options: eventListenerOptions=?,
|
|
74
|
+
) => unit = "removeEventListener"
|
|
75
|
+
|
|
76
|
+
/**
|
|
70
77
|
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
71
78
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
72
79
|
*/
|
|
73
|
-
@send
|
|
74
|
-
external
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
) => unit = "removeEventListener"
|
|
80
|
-
|
|
81
|
-
/**
|
|
80
|
+
@send
|
|
81
|
+
external removeEventListener_useCapture: (
|
|
82
|
+
T.t,
|
|
83
|
+
~type_: eventType,
|
|
84
|
+
~callback: eventListener<'event>,
|
|
85
|
+
@as(json`true`) _,
|
|
86
|
+
) => unit = "removeEventListener"
|
|
87
|
+
|
|
88
|
+
/**
|
|
82
89
|
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
83
90
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
84
91
|
*/
|
|
85
|
-
@send
|
|
86
|
-
external dispatchEvent: (
|
|
92
|
+
@send
|
|
93
|
+
external dispatchEvent: (T.t, event) => bool = "dispatchEvent"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
include Impl({
|
|
97
|
+
type t = eventTarget
|
|
98
|
+
})
|
package/src/FileAPI/Blob.res
CHANGED
|
@@ -6,32 +6,43 @@ open FileAPI
|
|
|
6
6
|
@new
|
|
7
7
|
external make: (~blobParts: array<blobPart>=?, ~options: blobPropertyBag=?) => blob = "Blob"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
module Impl = (
|
|
10
|
+
T: {
|
|
11
|
+
type t
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
14
|
+
external asBlob: T.t => blob = "%identity"
|
|
15
|
+
/**
|
|
10
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
|
11
17
|
*/
|
|
12
|
-
@send
|
|
13
|
-
external slice: (
|
|
18
|
+
@send
|
|
19
|
+
external slice: (T.t, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice"
|
|
14
20
|
|
|
15
|
-
/**
|
|
21
|
+
/**
|
|
16
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
|
17
23
|
*/
|
|
18
|
-
@send
|
|
19
|
-
external stream:
|
|
24
|
+
@send
|
|
25
|
+
external stream: T.t => readableStream<array<int>> = "stream"
|
|
20
26
|
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
22
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
|
23
29
|
*/
|
|
24
|
-
@send
|
|
25
|
-
external text:
|
|
30
|
+
@send
|
|
31
|
+
external text: T.t => Promise.t<string> = "text"
|
|
26
32
|
|
|
27
|
-
/**
|
|
33
|
+
/**
|
|
28
34
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
|
|
29
35
|
*/
|
|
30
|
-
@send
|
|
31
|
-
external arrayBuffer:
|
|
36
|
+
@send
|
|
37
|
+
external arrayBuffer: T.t => Promise.t<ArrayBuffer.t> = "arrayBuffer"
|
|
32
38
|
|
|
33
|
-
/**
|
|
39
|
+
/**
|
|
34
40
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
|
|
35
41
|
*/
|
|
36
|
-
@send
|
|
37
|
-
external bytes:
|
|
42
|
+
@send
|
|
43
|
+
external bytes: T.t => Promise.t<array<int>> = "bytes"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
include Impl({
|
|
47
|
+
type t = blob
|
|
48
|
+
})
|
package/src/FileAPI/File.res
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
open FileAPI
|
|
2
2
|
|
|
3
|
+
include Blob.Impl({
|
|
4
|
+
type t = file
|
|
5
|
+
})
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File)
|
|
5
9
|
*/
|
|
@@ -9,34 +13,3 @@ external make: (
|
|
|
9
13
|
~fileName: string,
|
|
10
14
|
~options: filePropertyBag=?,
|
|
11
15
|
) => file = "File"
|
|
12
|
-
|
|
13
|
-
external asBlob: file => blob = "%identity"
|
|
14
|
-
/**
|
|
15
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
|
16
|
-
*/
|
|
17
|
-
@send
|
|
18
|
-
external slice: (file, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice"
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
|
22
|
-
*/
|
|
23
|
-
@send
|
|
24
|
-
external stream: file => readableStream<array<int>> = "stream"
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
|
28
|
-
*/
|
|
29
|
-
@send
|
|
30
|
-
external text: file => Promise.t<string> = "text"
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
|
|
34
|
-
*/
|
|
35
|
-
@send
|
|
36
|
-
external arrayBuffer: file => Promise.t<ArrayBuffer.t> = "arrayBuffer"
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
|
|
40
|
-
*/
|
|
41
|
-
@send
|
|
42
|
-
external bytes: file => Promise.t<array<int>> = "bytes"
|