@rescript/webapi 0.1.0-experimental-29b94b3
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/LICENSE +21 -0
- package/README.md +14 -0
- package/package.json +38 -0
- package/rescript.json +19 -0
- package/src/CSSFontLoadingAPI/FontFace.res +34 -0
- package/src/CSSFontLoadingAPI/FontFaceSet.res +112 -0
- package/src/CSSFontLoadingAPI.res +101 -0
- package/src/CanvasAPI/ImageBitmap.res +8 -0
- package/src/CanvasAPI/OffscreenCanvas.res +123 -0
- package/src/CanvasAPI.res +55 -0
- package/src/ChannelMessagingAPI/MessagePort.res +120 -0
- package/src/ChannelMessagingAPI.res +13 -0
- package/src/ClipboardAPI/Clipboard.res +106 -0
- package/src/ClipboardAPI/ClipboardItem.res +21 -0
- package/src/ClipboardAPI.res +31 -0
- package/src/CredentialManagementAPI/CredentialsContainer.res +31 -0
- package/src/CredentialManagementAPI.res +140 -0
- package/src/DOMAPI/Animation.res +137 -0
- package/src/DOMAPI/AnimationEffect.res +19 -0
- package/src/DOMAPI/CSSRuleList.res +7 -0
- package/src/DOMAPI/CSSStyleDeclaration.res +36 -0
- package/src/DOMAPI/CSSStyleSheet.res +32 -0
- package/src/DOMAPI/CSSStyleValue.res +13 -0
- package/src/DOMAPI/CaretPosition.res +4 -0
- package/src/DOMAPI/CharacterData.res +272 -0
- package/src/DOMAPI/Comment.res +278 -0
- package/src/DOMAPI/CustomElementRegistry.res +31 -0
- package/src/DOMAPI/DOMImplementation.res +30 -0
- package/src/DOMAPI/DOMMatrix.res +169 -0
- package/src/DOMAPI/DOMMatrixReadOnly.res +103 -0
- package/src/DOMAPI/DOMPoint.res +29 -0
- package/src/DOMAPI/DOMPointReadOnly.res +24 -0
- package/src/DOMAPI/DOMRect.res +23 -0
- package/src/DOMAPI/DOMRectList.res +4 -0
- package/src/DOMAPI/DOMRectReadOnly.res +17 -0
- package/src/DOMAPI/DOMTokenList.res +72 -0
- package/src/DOMAPI/Document.res +634 -0
- package/src/DOMAPI/DocumentFragment.res +261 -0
- package/src/DOMAPI/DocumentTimeline.res +9 -0
- package/src/DOMAPI/Element.res +634 -0
- package/src/DOMAPI/ElementInternals.res +39 -0
- package/src/DOMAPI/FileList.res +8 -0
- package/src/DOMAPI/HTMLAnchorElement.res +693 -0
- package/src/DOMAPI/HTMLAreaElement.res +687 -0
- package/src/DOMAPI/HTMLAudioElement.res +750 -0
- package/src/DOMAPI/HTMLBRElement.res +686 -0
- package/src/DOMAPI/HTMLBaseElement.res +687 -0
- package/src/DOMAPI/HTMLBodyElement.res +687 -0
- package/src/DOMAPI/HTMLButtonElement.res +714 -0
- package/src/DOMAPI/HTMLCanvasElement.res +741 -0
- package/src/DOMAPI/HTMLCollection.res +15 -0
- package/src/DOMAPI/HTMLCollectionOf.res +16 -0
- package/src/DOMAPI/HTMLDListElement.res +690 -0
- package/src/DOMAPI/HTMLDataElement.res +687 -0
- package/src/DOMAPI/HTMLDataListElement.res +697 -0
- package/src/DOMAPI/HTMLDialogElement.res +715 -0
- package/src/DOMAPI/HTMLDivElement.res +686 -0
- package/src/DOMAPI/HTMLElement.res +685 -0
- package/src/DOMAPI/HTMLEmbedElement.res +693 -0
- package/src/DOMAPI/HTMLFieldSetElement.res +718 -0
- package/src/DOMAPI/HTMLFormControlsCollection.res +16 -0
- package/src/DOMAPI/HTMLFormElement.res +720 -0
- package/src/DOMAPI/HTMLFrameSetElement.res +697 -0
- package/src/DOMAPI/HTMLHRElement.res +686 -0
- package/src/DOMAPI/HTMLHeadElement.res +687 -0
- package/src/DOMAPI/HTMLHeadingElement.res +693 -0
- package/src/DOMAPI/HTMLHtmlElement.res +687 -0
- package/src/DOMAPI/HTMLIFrameElement.res +696 -0
- package/src/DOMAPI/HTMLImageElement.res +696 -0
- package/src/DOMAPI/HTMLInputElement.res +773 -0
- package/src/DOMAPI/HTMLLIElement.res +686 -0
- package/src/DOMAPI/HTMLLabelElement.res +690 -0
- package/src/DOMAPI/HTMLLegendElement.res +693 -0
- package/src/DOMAPI/HTMLLinkElement.res +687 -0
- package/src/DOMAPI/HTMLMapElement.res +686 -0
- package/src/DOMAPI/HTMLMediaElement.res +749 -0
- package/src/DOMAPI/HTMLMenuElement.res +687 -0
- package/src/DOMAPI/HTMLMetaElement.res +687 -0
- package/src/DOMAPI/HTMLMeterElement.res +690 -0
- package/src/DOMAPI/HTMLModElement.res +686 -0
- package/src/DOMAPI/HTMLOListElement.res +690 -0
- package/src/DOMAPI/HTMLObjectElement.res +717 -0
- package/src/DOMAPI/HTMLOptGroupElement.res +697 -0
- package/src/DOMAPI/HTMLOptionElement.res +693 -0
- package/src/DOMAPI/HTMLOptionsCollection.res +21 -0
- package/src/DOMAPI/HTMLOutputElement.res +711 -0
- package/src/DOMAPI/HTMLParagraphElement.res +701 -0
- package/src/DOMAPI/HTMLPictureElement.res +693 -0
- package/src/DOMAPI/HTMLPreElement.res +686 -0
- package/src/DOMAPI/HTMLProgressElement.res +697 -0
- package/src/DOMAPI/HTMLQuoteElement.res +690 -0
- package/src/DOMAPI/HTMLScriptElement.res +699 -0
- package/src/DOMAPI/HTMLSelectElement.res +762 -0
- package/src/DOMAPI/HTMLSlotElement.res +713 -0
- package/src/DOMAPI/HTMLSourceElement.res +693 -0
- package/src/DOMAPI/HTMLSpanElement.res +687 -0
- package/src/DOMAPI/HTMLStyleElement.res +690 -0
- package/src/DOMAPI/HTMLTableCaptionElement.res +714 -0
- package/src/DOMAPI/HTMLTableCellElement.res +701 -0
- package/src/DOMAPI/HTMLTableElement.res +755 -0
- package/src/DOMAPI/HTMLTableRowElement.res +713 -0
- package/src/DOMAPI/HTMLTableSectionElement.res +730 -0
- package/src/DOMAPI/HTMLTemplateElement.res +697 -0
- package/src/DOMAPI/HTMLTextAreaElement.res +758 -0
- package/src/DOMAPI/HTMLTimeElement.res +687 -0
- package/src/DOMAPI/HTMLTitleElement.res +690 -0
- package/src/DOMAPI/HTMLTrackElement.res +690 -0
- package/src/DOMAPI/HTMLUListElement.res +690 -0
- package/src/DOMAPI/HTMLVideoElement.res +778 -0
- package/src/DOMAPI/IdleDeadline.res +7 -0
- package/src/DOMAPI/ImageData.res +18 -0
- package/src/DOMAPI/Location.res +22 -0
- package/src/DOMAPI/MediaList.res +19 -0
- package/src/DOMAPI/MediaQueryList.res +82 -0
- package/src/DOMAPI/NamedNodeMap.res +45 -0
- package/src/DOMAPI/Navigator.res +114 -0
- package/src/DOMAPI/Node.res +179 -0
- package/src/DOMAPI/NodeFilter.res +4 -0
- package/src/DOMAPI/NodeIterator.res +13 -0
- package/src/DOMAPI/NodeList.res +8 -0
- package/src/DOMAPI/NodeListOf.res +9 -0
- package/src/DOMAPI/Range.res +149 -0
- package/src/DOMAPI/SVGGraphicsElement.res +675 -0
- package/src/DOMAPI/SVGLength.res +11 -0
- package/src/DOMAPI/ScreenOrientation.res +88 -0
- package/src/DOMAPI/Selection.res +103 -0
- package/src/DOMAPI/ShadowRoot.res +274 -0
- package/src/DOMAPI/StylePropertyMap.res +50 -0
- package/src/DOMAPI/StylePropertyMapReadOnly.res +13 -0
- package/src/DOMAPI/StyleSheetList.res +7 -0
- package/src/DOMAPI/Text.res +285 -0
- package/src/DOMAPI/TextTrackList.res +89 -0
- package/src/DOMAPI/TimeRanges.res +19 -0
- package/src/DOMAPI/TreeWalker.res +43 -0
- package/src/DOMAPI/VideoColorSpace.res +13 -0
- package/src/DOMAPI/VideoFrame.res +111 -0
- package/src/DOMAPI/Window.res +582 -0
- package/src/DOMAPI/XPathExpression.res +12 -0
- package/src/DOMAPI/XPathResult.res +13 -0
- package/src/DOMAPI.res +9668 -0
- package/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +132 -0
- package/src/EncryptedMediaExtensionsAPI/MediaKeyStatusMap.res +13 -0
- package/src/EncryptedMediaExtensionsAPI/MediaKeySystemAccess.res +13 -0
- package/src/EncryptedMediaExtensionsAPI/MediaKeys.res +28 -0
- package/src/EncryptedMediaExtensionsAPI.res +100 -0
- package/src/EventAPI/AbortController.res +15 -0
- package/src/EventAPI/AbortSignal.res +106 -0
- package/src/EventAPI/Event.res +35 -0
- package/src/EventAPI/EventTarget.res +86 -0
- package/src/EventAPI.res +215 -0
- package/src/FetchAPI/FormData.res +58 -0
- package/src/FetchAPI/Headers.res +50 -0
- package/src/FetchAPI/Request.res +57 -0
- package/src/FetchAPI/Response.res +105 -0
- package/src/FetchAPI/URLSearchParams.res +68 -0
- package/src/FetchAPI.res +287 -0
- package/src/FileAPI/Blob.res +37 -0
- package/src/FileAPI/File.res +42 -0
- package/src/FileAPI/FileSystemDirectoryHandle.res +46 -0
- package/src/FileAPI/FileSystemFileHandle.res +23 -0
- package/src/FileAPI/FileSystemHandle.res +7 -0
- package/src/FileAPI/FileSystemWritableFileStream.res +63 -0
- package/src/FileAPI/ReadableStream.res +61 -0
- package/src/FileAPI/WritableStream.res +29 -0
- package/src/FileAPI/WritableStreamDefaultController.res +8 -0
- package/src/FileAPI.res +218 -0
- package/src/FileAndDirectoryEntriesAPI/FileSystemDirectoryEntry.res +42 -0
- package/src/FileAndDirectoryEntriesAPI/FileSystemDirectoryReader.res +12 -0
- package/src/FileAndDirectoryEntriesAPI/FileSystemEntry.res +11 -0
- package/src/FileAndDirectoryEntriesAPI.res +87 -0
- package/src/GamepadAPI/GamepadHapticActuator.res +17 -0
- package/src/GamepadAPI.res +85 -0
- package/src/GeolocationAPI/Geolocation.res +29 -0
- package/src/GeolocationAPI/GeolocationCoordinates.res +7 -0
- package/src/GeolocationAPI/GeolocationPosition.res +7 -0
- package/src/GeolocationAPI.res +78 -0
- package/src/Global.res +302 -0
- package/src/HistoryAPI/History.res +33 -0
- package/src/HistoryAPI.res +26 -0
- package/src/IndexedDBAPI/IDBDatabase.res +135 -0
- package/src/IndexedDBAPI/IDBFactory.res +31 -0
- package/src/IndexedDBAPI/IDBIndex.res +74 -0
- package/src/IndexedDBAPI/IDBObjectStore.res +167 -0
- package/src/IndexedDBAPI/IDBTransaction.res +102 -0
- package/src/IndexedDBAPI.res +205 -0
- package/src/MediaCapabilitiesAPI/MediaCapabilities.res +19 -0
- package/src/MediaCapabilitiesAPI.res +81 -0
- package/src/MediaCaptureAndStreamsAPI/MediaDeviceInfo.res +7 -0
- package/src/MediaCaptureAndStreamsAPI/MediaDevices.res +113 -0
- package/src/MediaCaptureAndStreamsAPI/MediaStream.res +142 -0
- package/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res +122 -0
- package/src/MediaCaptureAndStreamsAPI.res +194 -0
- package/src/MediaSessionAPI/MediaMetadata.res +7 -0
- package/src/MediaSessionAPI/MediaSession.res +17 -0
- package/src/MediaSessionAPI.res +83 -0
- package/src/NotificationAPI/Notification.res +102 -0
- package/src/NotificationAPI.res +82 -0
- package/src/PerformanceAPI/Performance.res +169 -0
- package/src/PerformanceAPI/PerformanceEntry.res +7 -0
- package/src/PerformanceAPI/PerformanceMark.res +15 -0
- package/src/PerformanceAPI.res +86 -0
- package/src/PermissionsAPI/Permissions.res +7 -0
- package/src/PermissionsAPI.res +39 -0
- package/src/PictureInPicture.res +18 -0
- package/src/PictureInPictureAPI.res +18 -0
- package/src/Prelude/DOMException.res +7 -0
- package/src/Prelude/DOMStringList.res +15 -0
- package/src/Prelude.res +39 -0
- package/src/PushManagerAPI/PushManager.res +25 -0
- package/src/PushManagerAPI/PushSubscription.res +19 -0
- package/src/PushManagerAPI.res +67 -0
- package/src/RemotePlaybackAPI/RemotePlayback.res +102 -0
- package/src/RemotePlaybackAPI.res +21 -0
- package/src/ResizeObserverAPI/ResizeObserver.res +27 -0
- package/src/ResizeObserverAPI.res +58 -0
- package/src/ScreenWakeLockAPI/WakeLock.res +7 -0
- package/src/ScreenWakeLockAPI/WakeLockSentinel.res +88 -0
- package/src/ScreenWakeLockAPI.res +26 -0
- package/src/ServiceWorkerAPI/Cache.res +100 -0
- package/src/ServiceWorkerAPI/CacheStorage.res +46 -0
- package/src/ServiceWorkerAPI/NavigationPreloadManager.res +25 -0
- package/src/ServiceWorkerAPI/ServiceWorker.res +101 -0
- package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +114 -0
- package/src/ServiceWorkerAPI/ServiceWorkerRegistration.res +114 -0
- package/src/ServiceWorkerAPI.res +134 -0
- package/src/StorageAPI/StorageManager.res +26 -0
- package/src/StorageAPI.res +10 -0
- package/src/ViewTransitionsAPI/ViewTransition.res +7 -0
- package/src/ViewTransitionsAPI.res +23 -0
- package/src/VisualViewportAPI.res +38 -0
- package/src/WebAudioAPI/AnalyserNode.res +180 -0
- package/src/WebAudioAPI/AudioBuffer.res +35 -0
- package/src/WebAudioAPI/AudioBufferSourceNode.res +183 -0
- package/src/WebAudioAPI/AudioContext.res +266 -0
- package/src/WebAudioAPI/AudioListener.res +1 -0
- package/src/WebAudioAPI/AudioNode.res +143 -0
- package/src/WebAudioAPI/AudioParam.res +56 -0
- package/src/WebAudioAPI/AudioProcessingEvent.res +38 -0
- package/src/WebAudioAPI/AudioScheduledSourceNode.res +171 -0
- package/src/WebAudioAPI/AudioWorkletNode.res +160 -0
- package/src/WebAudioAPI/BaseAudioContext.res +212 -0
- package/src/WebAudioAPI/BiquadFilterNode.res +168 -0
- package/src/WebAudioAPI/ChannelMergerNode.res +157 -0
- package/src/WebAudioAPI/ChannelSplitterNode.res +159 -0
- package/src/WebAudioAPI/ConstantSourceNode.res +172 -0
- package/src/WebAudioAPI/ConvolverNode.res +157 -0
- package/src/WebAudioAPI/DelayNode.res +150 -0
- package/src/WebAudioAPI/DynamicsCompressorNode.res +162 -0
- package/src/WebAudioAPI/GainNode.res +149 -0
- package/src/WebAudioAPI/IIRFilterNode.res +168 -0
- package/src/WebAudioAPI/MediaElementAudioSourceNode.res +168 -0
- package/src/WebAudioAPI/MediaStreamAudioDestinationNode.res +168 -0
- package/src/WebAudioAPI/MediaStreamAudioSourceNode.res +168 -0
- package/src/WebAudioAPI/OfflineAudioCompletionEvent.res +40 -0
- package/src/WebAudioAPI/OfflineAudioContext.res +246 -0
- package/src/WebAudioAPI/OscillatorNode.res +176 -0
- package/src/WebAudioAPI/PannerNode.res +150 -0
- package/src/WebAudioAPI/PeriodicWave.res +8 -0
- package/src/WebAudioAPI/StereoPannerNode.res +157 -0
- package/src/WebAudioAPI/WaveShaperNode.res +157 -0
- package/src/WebAudioAPI/Worklet.res +13 -0
- package/src/WebAudioAPI.res +1271 -0
- package/src/WebCryptoAPI/Crypto.res +13 -0
- package/src/WebCryptoAPI/SubtleCrypto.res +173 -0
- package/src/WebCryptoAPI.res +71 -0
- package/src/WebLocksAPI/LockManager.res +29 -0
- package/src/WebLocksAPI.res +47 -0
- package/src/WebMIDIAPI.res +37 -0
- package/src/WebSocketsAPI/CloseEvent.res +37 -0
- package/src/WebSocketsAPI/MessageEvent.res +38 -0
- package/src/WebSocketsAPI/WebSocket.res +130 -0
- package/src/WebSocketsAPI.res +125 -0
- package/src/WebSpeechAPI/SpeechSynthesis.res +112 -0
- package/src/WebSpeechAPI/SpeechSynthesisUtterance.res +88 -0
- package/src/WebSpeechAPI.res +82 -0
- package/src/WebStorageAPI/Storage.res +44 -0
- package/src/WebStorageAPI/StorageEvent.res +37 -0
- package/src/WebStorageAPI.res +57 -0
- package/src/WebVTTAPI/TextTrack.res +96 -0
- package/src/WebVTTAPI/TextTrackCueList.res +10 -0
- package/src/WebVTTAPI.res +122 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
open Prelude
|
|
4
|
+
|
|
5
|
+
type permissionState =
|
|
6
|
+
| @as("denied") Denied
|
|
7
|
+
| @as("granted") Granted
|
|
8
|
+
| @as("prompt") Prompt
|
|
9
|
+
|
|
10
|
+
type pushEncryptionKeyName =
|
|
11
|
+
| @as("auth") Auth
|
|
12
|
+
| @as("p256dh") P256dh
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
|
|
16
|
+
[See PushManager on MDN](https://developer.mozilla.org/docs/Web/API/PushManager)
|
|
17
|
+
*/
|
|
18
|
+
type pushManager = {
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/supportedContentEncodings_static)
|
|
21
|
+
*/
|
|
22
|
+
supportedContentEncodings: array<string>,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
[See PushSubscriptionOptions on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions)
|
|
27
|
+
*/
|
|
28
|
+
type pushSubscriptionOptions = {
|
|
29
|
+
/**
|
|
30
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/userVisibleOnly)
|
|
31
|
+
*/
|
|
32
|
+
userVisibleOnly: bool,
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey)
|
|
35
|
+
*/
|
|
36
|
+
applicationServerKey: Null.t<ArrayBuffer.t>,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service.
|
|
41
|
+
[See PushSubscription on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription)
|
|
42
|
+
*/
|
|
43
|
+
type pushSubscription = {
|
|
44
|
+
/**
|
|
45
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/endpoint)
|
|
46
|
+
*/
|
|
47
|
+
endpoint: string,
|
|
48
|
+
/**
|
|
49
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/expirationTime)
|
|
50
|
+
*/
|
|
51
|
+
expirationTime: Null.t<int>,
|
|
52
|
+
/**
|
|
53
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/options)
|
|
54
|
+
*/
|
|
55
|
+
options: pushSubscriptionOptions,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type pushSubscriptionOptionsInit = {
|
|
59
|
+
mutable userVisibleOnly?: bool,
|
|
60
|
+
mutable applicationServerKey?: Null.t<unknown>,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type pushSubscriptionJSON = {
|
|
64
|
+
mutable endpoint?: string,
|
|
65
|
+
mutable expirationTime?: Null.t<int>,
|
|
66
|
+
mutable keys?: any,
|
|
67
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
open EventAPI
|
|
2
|
+
open RemotePlaybackAPI
|
|
3
|
+
|
|
4
|
+
external asEventTarget: remotePlayback => eventTarget = "%identity"
|
|
5
|
+
/**
|
|
6
|
+
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.
|
|
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
|
+
remotePlayback,
|
|
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
|
+
remotePlayback,
|
|
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
|
+
remotePlayback,
|
|
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
|
+
remotePlayback,
|
|
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: (remotePlayback, event) => bool = "dispatchEvent"
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback/watchAvailability)
|
|
86
|
+
*/
|
|
87
|
+
@send
|
|
88
|
+
external watchAvailability: (remotePlayback, remotePlaybackAvailabilityCallback) => Promise.t<int> =
|
|
89
|
+
"watchAvailability"
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback/cancelWatchAvailability)
|
|
93
|
+
*/
|
|
94
|
+
@send
|
|
95
|
+
external cancelWatchAvailability: (remotePlayback, ~id: int=?) => Promise.t<unit> =
|
|
96
|
+
"cancelWatchAvailability"
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback/prompt)
|
|
100
|
+
*/
|
|
101
|
+
@send
|
|
102
|
+
external prompt: remotePlayback => Promise.t<unit> = "prompt"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
open EventAPI
|
|
4
|
+
|
|
5
|
+
type remotePlaybackState =
|
|
6
|
+
| @as("connected") Connected
|
|
7
|
+
| @as("connecting") Connecting
|
|
8
|
+
| @as("disconnected") Disconnected
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
[See RemotePlayback on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback)
|
|
12
|
+
*/
|
|
13
|
+
type remotePlayback = {
|
|
14
|
+
...eventTarget,
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback/state)
|
|
17
|
+
*/
|
|
18
|
+
state: remotePlaybackState,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type remotePlaybackAvailabilityCallback = bool => unit
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
open DOMAPI
|
|
2
|
+
open ResizeObserverAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver)
|
|
6
|
+
*/
|
|
7
|
+
@new
|
|
8
|
+
external make: resizeObserverCallback => resizeObserver = "ResizeObserver"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver/observe)
|
|
12
|
+
*/
|
|
13
|
+
@send
|
|
14
|
+
external observe: (resizeObserver, ~target: element, ~options: resizeObserverOptions=?) => unit =
|
|
15
|
+
"observe"
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver/unobserve)
|
|
19
|
+
*/
|
|
20
|
+
@send
|
|
21
|
+
external unobserve: (resizeObserver, element) => unit = "unobserve"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver/disconnect)
|
|
25
|
+
*/
|
|
26
|
+
@send
|
|
27
|
+
external disconnect: resizeObserver => unit = "disconnect"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
open Prelude
|
|
4
|
+
open DOMAPI
|
|
5
|
+
|
|
6
|
+
type resizeObserverBoxOptions =
|
|
7
|
+
| @as("border-box") BorderBox
|
|
8
|
+
| @as("content-box") ContentBox
|
|
9
|
+
| @as("device-pixel-content-box") DevicePixelContentBox
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[See ResizeObserverSize on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverSize)
|
|
13
|
+
*/
|
|
14
|
+
type resizeObserverSize = {
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverSize/inlineSize)
|
|
17
|
+
*/
|
|
18
|
+
inlineSize: float,
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverSize/blockSize)
|
|
21
|
+
*/
|
|
22
|
+
blockSize: float,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
[See ResizeObserverEntry on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry)
|
|
27
|
+
*/
|
|
28
|
+
type resizeObserverEntry = {
|
|
29
|
+
/**
|
|
30
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry/target)
|
|
31
|
+
*/
|
|
32
|
+
target: element,
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry/contentRect)
|
|
35
|
+
*/
|
|
36
|
+
contentRect: domRectReadOnly,
|
|
37
|
+
/**
|
|
38
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry/borderBoxSize)
|
|
39
|
+
*/
|
|
40
|
+
borderBoxSize: array<resizeObserverSize>,
|
|
41
|
+
/**
|
|
42
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry/contentBoxSize)
|
|
43
|
+
*/
|
|
44
|
+
contentBoxSize: array<resizeObserverSize>,
|
|
45
|
+
/**
|
|
46
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize)
|
|
47
|
+
*/
|
|
48
|
+
devicePixelContentBoxSize: array<resizeObserverSize>,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
[See ResizeObserver on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver)
|
|
53
|
+
*/
|
|
54
|
+
type resizeObserver = {}
|
|
55
|
+
|
|
56
|
+
type resizeObserverOptions = {mutable box?: resizeObserverBoxOptions}
|
|
57
|
+
|
|
58
|
+
type resizeObserverCallback = array<resizeObserverEntry> => resizeObserver => unit
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
open EventAPI
|
|
2
|
+
open ScreenWakeLockAPI
|
|
3
|
+
|
|
4
|
+
external asEventTarget: wakeLockSentinel => eventTarget = "%identity"
|
|
5
|
+
/**
|
|
6
|
+
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.
|
|
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
|
+
wakeLockSentinel,
|
|
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
|
+
wakeLockSentinel,
|
|
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
|
+
wakeLockSentinel,
|
|
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
|
+
wakeLockSentinel,
|
|
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: (wakeLockSentinel, event) => bool = "dispatchEvent"
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/release)
|
|
86
|
+
*/
|
|
87
|
+
@send
|
|
88
|
+
external release: wakeLockSentinel => Promise.t<unit> = "release"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
open EventAPI
|
|
4
|
+
|
|
5
|
+
type wakeLockType = | @as("screen") Screen
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
[See WakeLock on MDN](https://developer.mozilla.org/docs/Web/API/WakeLock)
|
|
9
|
+
*/
|
|
10
|
+
type wakeLock = {}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
[See WakeLockSentinel on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel)
|
|
14
|
+
*/
|
|
15
|
+
type wakeLockSentinel = {
|
|
16
|
+
...eventTarget,
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/released)
|
|
19
|
+
*/
|
|
20
|
+
released: bool,
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/type)
|
|
23
|
+
*/
|
|
24
|
+
@as("type")
|
|
25
|
+
type_: wakeLockType,
|
|
26
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
open FetchAPI
|
|
2
|
+
open ServiceWorkerAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/match)
|
|
6
|
+
*/
|
|
7
|
+
@send
|
|
8
|
+
external match: (cache, ~request: request, ~options: cacheQueryOptions=?) => Nullable.t<response> =
|
|
9
|
+
"match"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/match)
|
|
13
|
+
*/
|
|
14
|
+
@send
|
|
15
|
+
external match2: (cache, ~request: string, ~options: cacheQueryOptions=?) => Nullable.t<response> =
|
|
16
|
+
"match"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/matchAll)
|
|
20
|
+
*/
|
|
21
|
+
@send
|
|
22
|
+
external matchAll: (
|
|
23
|
+
cache,
|
|
24
|
+
~request: request=?,
|
|
25
|
+
~options: cacheQueryOptions=?,
|
|
26
|
+
) => Promise.t<array<response>> = "matchAll"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/matchAll)
|
|
30
|
+
*/
|
|
31
|
+
@send
|
|
32
|
+
external matchAll2: (
|
|
33
|
+
cache,
|
|
34
|
+
~request: string=?,
|
|
35
|
+
~options: cacheQueryOptions=?,
|
|
36
|
+
) => Promise.t<array<response>> = "matchAll"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/add)
|
|
40
|
+
*/
|
|
41
|
+
@send
|
|
42
|
+
external add: (cache, request) => Promise.t<unit> = "add"
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/add)
|
|
46
|
+
*/
|
|
47
|
+
@send
|
|
48
|
+
external add2: (cache, string) => Promise.t<unit> = "add"
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/addAll)
|
|
52
|
+
*/
|
|
53
|
+
@send
|
|
54
|
+
external addAll: (cache, array<requestInfo>) => Promise.t<unit> = "addAll"
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/put)
|
|
58
|
+
*/
|
|
59
|
+
@send
|
|
60
|
+
external put: (cache, ~request: request, ~response: response) => Promise.t<unit> = "put"
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/put)
|
|
64
|
+
*/
|
|
65
|
+
@send
|
|
66
|
+
external put2: (cache, ~request: string, ~response: response) => Promise.t<unit> = "put"
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/delete)
|
|
70
|
+
*/
|
|
71
|
+
@send
|
|
72
|
+
external delete: (cache, ~request: request, ~options: cacheQueryOptions=?) => Promise.t<bool> =
|
|
73
|
+
"delete"
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/delete)
|
|
77
|
+
*/
|
|
78
|
+
@send
|
|
79
|
+
external delete2: (cache, ~request: string, ~options: cacheQueryOptions=?) => Promise.t<bool> =
|
|
80
|
+
"delete"
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/keys)
|
|
84
|
+
*/
|
|
85
|
+
@send
|
|
86
|
+
external keys: (
|
|
87
|
+
cache,
|
|
88
|
+
~request: request=?,
|
|
89
|
+
~options: cacheQueryOptions=?,
|
|
90
|
+
) => Promise.t<array<request>> = "keys"
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/keys)
|
|
94
|
+
*/
|
|
95
|
+
@send
|
|
96
|
+
external keys2: (
|
|
97
|
+
cache,
|
|
98
|
+
~request: string=?,
|
|
99
|
+
~options: cacheQueryOptions=?,
|
|
100
|
+
) => Promise.t<array<request>> = "keys"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
open FetchAPI
|
|
2
|
+
open ServiceWorkerAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/match)
|
|
6
|
+
*/
|
|
7
|
+
@send
|
|
8
|
+
external match: (
|
|
9
|
+
cacheStorage,
|
|
10
|
+
~request: request,
|
|
11
|
+
~options: multiCacheQueryOptions=?,
|
|
12
|
+
) => Nullable.t<response> = "match"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/match)
|
|
16
|
+
*/
|
|
17
|
+
@send
|
|
18
|
+
external match2: (
|
|
19
|
+
cacheStorage,
|
|
20
|
+
~request: string,
|
|
21
|
+
~options: multiCacheQueryOptions=?,
|
|
22
|
+
) => Nullable.t<response> = "match"
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/has)
|
|
26
|
+
*/
|
|
27
|
+
@send
|
|
28
|
+
external has: (cacheStorage, string) => Promise.t<bool> = "has"
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
|
|
32
|
+
*/
|
|
33
|
+
@send
|
|
34
|
+
external open_: (cacheStorage, string) => Promise.t<cache> = "open"
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/delete)
|
|
38
|
+
*/
|
|
39
|
+
@send
|
|
40
|
+
external delete: (cacheStorage, string) => Promise.t<bool> = "delete"
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/keys)
|
|
44
|
+
*/
|
|
45
|
+
@send
|
|
46
|
+
external keys: cacheStorage => Promise.t<array<string>> = "keys"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
open ServiceWorkerAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NavigationPreloadManager/enable)
|
|
5
|
+
*/
|
|
6
|
+
@send
|
|
7
|
+
external enable: navigationPreloadManager => Promise.t<unit> = "enable"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NavigationPreloadManager/disable)
|
|
11
|
+
*/
|
|
12
|
+
@send
|
|
13
|
+
external disable: navigationPreloadManager => Promise.t<unit> = "disable"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NavigationPreloadManager/setHeaderValue)
|
|
17
|
+
*/
|
|
18
|
+
@send
|
|
19
|
+
external setHeaderValue: (navigationPreloadManager, string) => Promise.t<unit> = "setHeaderValue"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NavigationPreloadManager/getState)
|
|
23
|
+
*/
|
|
24
|
+
@send
|
|
25
|
+
external getState: navigationPreloadManager => Promise.t<navigationPreloadState> = "getState"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
open EventAPI
|
|
2
|
+
open ServiceWorkerAPI
|
|
3
|
+
open Prelude
|
|
4
|
+
open ChannelMessagingAPI
|
|
5
|
+
|
|
6
|
+
external asEventTarget: serviceWorker => eventTarget = "%identity"
|
|
7
|
+
/**
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
17
|
+
|
|
18
|
+
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
19
|
+
|
|
20
|
+
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
21
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
22
|
+
*/
|
|
23
|
+
@send
|
|
24
|
+
external addEventListener: (
|
|
25
|
+
serviceWorker,
|
|
26
|
+
~type_: eventType,
|
|
27
|
+
~callback: eventListener<'event>,
|
|
28
|
+
~options: addEventListenerOptions=?,
|
|
29
|
+
) => unit = "addEventListener"
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
41
|
+
|
|
42
|
+
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
43
|
+
|
|
44
|
+
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
45
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
46
|
+
*/
|
|
47
|
+
@send
|
|
48
|
+
external addEventListener2: (
|
|
49
|
+
serviceWorker,
|
|
50
|
+
~type_: eventType,
|
|
51
|
+
~callback: eventListener<'event>,
|
|
52
|
+
~options: bool=?,
|
|
53
|
+
) => unit = "addEventListener"
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
57
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
58
|
+
*/
|
|
59
|
+
@send
|
|
60
|
+
external removeEventListener: (
|
|
61
|
+
serviceWorker,
|
|
62
|
+
~type_: eventType,
|
|
63
|
+
~callback: eventListener<'event>,
|
|
64
|
+
~options: eventListenerOptions=?,
|
|
65
|
+
) => unit = "removeEventListener"
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
69
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
70
|
+
*/
|
|
71
|
+
@send
|
|
72
|
+
external removeEventListener2: (
|
|
73
|
+
serviceWorker,
|
|
74
|
+
~type_: eventType,
|
|
75
|
+
~callback: eventListener<'event>,
|
|
76
|
+
~options: bool=?,
|
|
77
|
+
) => unit = "removeEventListener"
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
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.
|
|
81
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
82
|
+
*/
|
|
83
|
+
@send
|
|
84
|
+
external dispatchEvent: (serviceWorker, event) => bool = "dispatchEvent"
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorker/postMessage)
|
|
88
|
+
*/
|
|
89
|
+
@send
|
|
90
|
+
external postMessage: (serviceWorker, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
|
|
91
|
+
"postMessage"
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorker/postMessage)
|
|
95
|
+
*/
|
|
96
|
+
@send
|
|
97
|
+
external postMessage2: (
|
|
98
|
+
serviceWorker,
|
|
99
|
+
~message: JSON.t,
|
|
100
|
+
~options: structuredSerializeOptions=?,
|
|
101
|
+
) => unit = "postMessage"
|