@rescript/webapi 0.1.0-alpha-b1d58f9
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 +35 -0
- package/package.json +61 -0
- package/rescript.json +557 -0
- package/src/animation/Animation.res +149 -0
- package/src/animation/AnimationEffect.res +71 -0
- package/src/animation/DocumentTimeline.res +8 -0
- package/src/canvas/Canvas.res +179 -0
- package/src/canvas/CanvasGradient.res +11 -0
- package/src/canvas/CanvasPattern.res +11 -0
- package/src/canvas/CanvasRenderingContext2D.res +868 -0
- package/src/canvas/CanvasTypes.res +452 -0
- package/src/canvas/FillStyle.res +25 -0
- package/src/canvas/HTMLCanvasElement.res +101 -0
- package/src/canvas/ImageBitmap.res +6 -0
- package/src/canvas/ImageBitmapRenderingContext.res +9 -0
- package/src/canvas/ImageData.res +17 -0
- package/src/canvas/OffscreenCanvas.res +87 -0
- package/src/canvas/Path2D.res +186 -0
- package/src/canvas/VideoColorSpace.res +11 -0
- package/src/canvas/VideoFrame.res +217 -0
- package/src/core/ArrayBufferTypedArrayOrDataView.res +4 -0
- package/src/core/DOM.res +1026 -0
- package/src/core/EventType.res +108 -0
- package/src/crypto/Crypto.res +11 -0
- package/src/crypto/SubtleCrypto.res +173 -0
- package/src/crypto/WebCryptoTypes.res +71 -0
- package/src/css-font-loading/BaseCSSFontLoading.res +24 -0
- package/src/css-font-loading/CssFontLoadingTypes.res +92 -0
- package/src/css-font-loading/FontFace.res +62 -0
- package/src/css-font-loading/FontFaceSet.res +38 -0
- package/src/cssom/CSSRuleList.res +5 -0
- package/src/cssom/CSSStyleDeclaration.res +1734 -0
- package/src/cssom/CSSStyleValue.res +17 -0
- package/src/cssom/MediaList.res +29 -0
- package/src/cssom/MediaQueryList.res +18 -0
- package/src/cssom/StylePropertyMap.res +56 -0
- package/src/cssom/StylePropertyMapReadOnly.res +22 -0
- package/src/cssom/StyleSheet.res +152 -0
- package/src/cssom/StyleSheetList.res +17 -0
- package/src/device/GamepadHapticActuator.res +16 -0
- package/src/device/GamepadTypes.res +86 -0
- package/src/device/Geolocation.res +31 -0
- package/src/device/GeolocationCoordinates.res +5 -0
- package/src/device/GeolocationPosition.res +5 -0
- package/src/device/GeolocationTypes.res +81 -0
- package/src/device/LockManager.res +26 -0
- package/src/device/ScreenOrientation.res +7 -0
- package/src/device/ScreenWakeLockTypes.res +26 -0
- package/src/device/WakeLock.res +8 -0
- package/src/device/WakeLockSentinel.res +7 -0
- package/src/device/WebLocksTypes.res +45 -0
- package/src/device/WebMIDI.res +7 -0
- package/src/device/WebMidiTypes.res +36 -0
- package/src/dom-nodes/AbstractRange.res +30 -0
- package/src/dom-nodes/Attr.res +101 -0
- package/src/dom-nodes/CDATASection.res +7 -0
- package/src/dom-nodes/CaretPosition.res +2 -0
- package/src/dom-nodes/CharacterData.res +199 -0
- package/src/dom-nodes/Comment.res +15 -0
- package/src/dom-nodes/DOMImplementation.res +131 -0
- package/src/dom-nodes/DOMTree.res +1653 -0
- package/src/dom-nodes/DocumentFragment.res +96 -0
- package/src/dom-nodes/Element.res +509 -0
- package/src/dom-nodes/ElementInternals.res +39 -0
- package/src/dom-nodes/HTML.res +11 -0
- package/src/dom-nodes/HTMLCollection.res +25 -0
- package/src/dom-nodes/NamedNodeMap.res +46 -0
- package/src/dom-nodes/Node.res +114 -0
- package/src/dom-nodes/NodeFilter.res +4 -0
- package/src/dom-nodes/NodeIterator.res +38 -0
- package/src/dom-nodes/NodeList.res +6 -0
- package/src/dom-nodes/ProcessingInstruction.res +15 -0
- package/src/dom-nodes/Range.res +156 -0
- package/src/dom-nodes/Selection.res +137 -0
- package/src/dom-nodes/ShadowRoot.res +23 -0
- package/src/dom-nodes/StaticRange.res +6 -0
- package/src/dom-nodes/Text.res +31 -0
- package/src/dom-nodes/TreeWalker.res +65 -0
- package/src/dom-platform/DOMException.res +7 -0
- package/src/dom-platform/DOMStringList.res +15 -0
- package/src/dom-platform/DOMStringMap.res +5 -0
- package/src/dom-platform/DOMTokenList.res +70 -0
- package/src/event/AbortController.res +9 -0
- package/src/event/AbortSignal.res +25 -0
- package/src/event/Event.res +76 -0
- package/src/event/EventTarget.res +91 -0
- package/src/event/ExtendableEvent.res +14 -0
- package/src/fetch/BodyInit.res +46 -0
- package/src/fetch/Fetch.res +12 -0
- package/src/fetch/FetchTypes.res +282 -0
- package/src/fetch/FormData.res +71 -0
- package/src/fetch/FormDataEntryValue.res +2 -0
- package/src/fetch/Headers.res +59 -0
- package/src/fetch/HeadersInit.res +16 -0
- package/src/fetch/Request.res +61 -0
- package/src/fetch/Response.res +127 -0
- package/src/file/BaseFileAndDirectoryEntries.res +72 -0
- package/src/file/Blob.res +48 -0
- package/src/file/File.res +15 -0
- package/src/file/FileAndDirectoryEntriesTypes.res +35 -0
- package/src/file/FileList.res +16 -0
- package/src/file/FileSystemDirectoryEntry.res +42 -0
- package/src/file/FileSystemDirectoryHandle.res +49 -0
- package/src/file/FileSystemDirectoryReader.res +9 -0
- package/src/file/FileSystemEntry.res +9 -0
- package/src/file/FileSystemFileHandle.res +25 -0
- package/src/file/FileSystemHandle.res +6 -0
- package/src/file/FileSystemWritableFileStream.res +65 -0
- package/src/file/FileTypes.res +225 -0
- package/src/file/ReadableStream.res +79 -0
- package/src/file/WritableStream.res +27 -0
- package/src/file/WritableStreamDefaultController.res +5 -0
- package/src/geometry/DOMMatrix.res +206 -0
- package/src/geometry/DOMMatrixReadOnly.res +140 -0
- package/src/geometry/DOMPoint.res +28 -0
- package/src/geometry/DOMPointReadOnly.res +22 -0
- package/src/geometry/DOMRect.res +22 -0
- package/src/geometry/DOMRectList.res +2 -0
- package/src/geometry/DOMRectReadOnly.res +19 -0
- package/src/html/HTMLAnchorElement.res +373 -0
- package/src/html/HTMLAreaElement.res +353 -0
- package/src/html/HTMLBRElement.res +9 -0
- package/src/html/HTMLBaseElement.res +20 -0
- package/src/html/HTMLBodyElement.res +9 -0
- package/src/html/HTMLButtonElement.res +98 -0
- package/src/html/HTMLDListElement.res +9 -0
- package/src/html/HTMLDataElement.res +14 -0
- package/src/html/HTMLDataListElement.res +14 -0
- package/src/html/HTMLDialogElement.res +40 -0
- package/src/html/HTMLDivElement.res +9 -0
- package/src/html/HTMLElement.res +108 -0
- package/src/html/HTMLEmbedElement.res +275 -0
- package/src/html/HTMLFieldSetElement.res +70 -0
- package/src/html/HTMLFormControlsCollection.res +21 -0
- package/src/html/HTMLFormElement.res +39 -0
- package/src/html/HTMLFrameSetElement.res +9 -0
- package/src/html/HTMLHRElement.res +9 -0
- package/src/html/HTMLHeadElement.res +256 -0
- package/src/html/HTMLHeadingElement.res +9 -0
- package/src/html/HTMLHtmlElement.res +9 -0
- package/src/html/HTMLIFrameElement.res +69 -0
- package/src/html/HTMLImageElement.res +349 -0
- package/src/html/HTMLInputElement.res +310 -0
- package/src/html/HTMLLIElement.res +9 -0
- package/src/html/HTMLLabelElement.res +25 -0
- package/src/html/HTMLLegendElement.res +14 -0
- package/src/html/HTMLLinkElement.res +69 -0
- package/src/html/HTMLMapElement.res +20 -0
- package/src/html/HTMLMenuElement.res +8 -0
- package/src/html/HTMLMetaElement.res +29 -0
- package/src/html/HTMLMeterElement.res +38 -0
- package/src/html/HTMLModElement.res +9 -0
- package/src/html/HTMLOListElement.res +24 -0
- package/src/html/HTMLObjectElement.res +89 -0
- package/src/html/HTMLOptGroupElement.res +19 -0
- package/src/html/HTMLOptionElement.res +49 -0
- package/src/html/HTMLOptionsCollection.res +35 -0
- package/src/html/HTMLOutputElement.res +73 -0
- package/src/html/HTMLParagraphElement.res +9 -0
- package/src/html/HTMLPictureElement.res +9 -0
- package/src/html/HTMLPreElement.res +9 -0
- package/src/html/HTMLProgressElement.res +29 -0
- package/src/html/HTMLQuoteElement.res +9 -0
- package/src/html/HTMLScriptElement.res +310 -0
- package/src/html/HTMLSelectElement.res +157 -0
- package/src/html/HTMLSlotElement.res +34 -0
- package/src/html/HTMLSourceElement.res +18 -0
- package/src/html/HTMLSpanElement.res +9 -0
- package/src/html/HTMLStyleElement.res +24 -0
- package/src/html/HTMLTableCaptionElement.res +9 -0
- package/src/html/HTMLTableCellElement.res +40 -0
- package/src/html/HTMLTableElement.res +100 -0
- package/src/html/HTMLTableRowElement.res +40 -0
- package/src/html/HTMLTableSectionElement.res +30 -0
- package/src/html/HTMLTemplateElement.res +31 -0
- package/src/html/HTMLTextAreaElement.res +177 -0
- package/src/html/HTMLTimeElement.res +14 -0
- package/src/html/HTMLTitleElement.res +15 -0
- package/src/html/HTMLUListElement.res +9 -0
- package/src/html/HTMLUnknownElement.res +9 -0
- package/src/media/BaseEncryptedMediaExtensions.res +97 -0
- package/src/media/DomHTMLMediaElement.res +206 -0
- package/src/media/EncryptedMediaExtensionsHTMLMediaElement.res +15 -0
- package/src/media/EncryptedMediaExtensionsTypes.res +43 -0
- package/src/media/HTMLAudioElement.res +9 -0
- package/src/media/HTMLTrackElement.res +14 -0
- package/src/media/HTMLVideoElement.res +78 -0
- package/src/media/MediaCapabilities.res +19 -0
- package/src/media/MediaCapabilitiesTypes.res +83 -0
- package/src/media/MediaCaptureAndStreamsTypes.res +197 -0
- package/src/media/MediaDeviceInfo.res +9 -0
- package/src/media/MediaDevices.res +40 -0
- package/src/media/MediaError.res +14 -0
- package/src/media/MediaKeySession.res +53 -0
- package/src/media/MediaKeyStatusMap.res +11 -0
- package/src/media/MediaKeySystemAccess.res +14 -0
- package/src/media/MediaKeys.res +35 -0
- package/src/media/MediaMetadata.res +10 -0
- package/src/media/MediaSession.res +25 -0
- package/src/media/MediaSessionTypes.res +85 -0
- package/src/media/MediaStream.res +89 -0
- package/src/media/MediaStreamTrack.res +51 -0
- package/src/media/PictureInPicture.res +7 -0
- package/src/media/PictureInPictureTypes.res +17 -0
- package/src/media/RemotePlayback.res +25 -0
- package/src/media/RemotePlaybackTypes.res +20 -0
- package/src/media/SpeechSynthesis.res +33 -0
- package/src/media/SpeechSynthesisUtterance.res +8 -0
- package/src/media/TextTrack.res +15 -0
- package/src/media/TextTrackCueList.res +9 -0
- package/src/media/TextTrackList.res +17 -0
- package/src/media/TimeRanges.res +29 -0
- package/src/media/VideoPlaybackQuality.res +18 -0
- package/src/media/WebSpeechTypes.res +83 -0
- package/src/media/WebVttTypes.res +123 -0
- package/src/messaging/ApplicationServerKey.res +2 -0
- package/src/messaging/ChannelMessagingTypes.res +12 -0
- package/src/messaging/CloseEvent.res +10 -0
- package/src/messaging/MessageEvent.res +43 -0
- package/src/messaging/MessagePort.res +38 -0
- package/src/messaging/Notification.res +46 -0
- package/src/messaging/NotificationTypes.res +107 -0
- package/src/messaging/PushEvent.res +3 -0
- package/src/messaging/PushManager.res +24 -0
- package/src/messaging/PushMessageData.res +15 -0
- package/src/messaging/PushSubscription.res +20 -0
- package/src/messaging/PushTypes.res +88 -0
- package/src/messaging/WebSocket.res +74 -0
- package/src/messaging/WebSocketsTypes.res +124 -0
- package/src/navigator/Clipboard.res +29 -0
- package/src/navigator/ClipboardItem.res +20 -0
- package/src/navigator/ClipboardTypes.res +31 -0
- package/src/navigator/CredentialManagementTypes.res +138 -0
- package/src/navigator/CredentialsContainer.res +33 -0
- package/src/navigator/Navigator.res +166 -0
- package/src/navigator/Permissions.res +10 -0
- package/src/navigator/PermissionsTypes.res +38 -0
- package/src/observers/IntersectionObserver.res +36 -0
- package/src/observers/IntersectionObserverRoot.res +23 -0
- package/src/observers/IntersectionObserverTypes.res +67 -0
- package/src/observers/MutationObserver.res +94 -0
- package/src/observers/ResizeObserver.res +30 -0
- package/src/observers/ResizeObserverTypes.res +56 -0
- package/src/performance/Performance.res +101 -0
- package/src/performance/PerformanceEntry.res +5 -0
- package/src/performance/PerformanceMark.res +16 -0
- package/src/performance/PerformanceTypes.res +86 -0
- package/src/storage/Cache.res +117 -0
- package/src/storage/CacheStorage.res +43 -0
- package/src/storage/CacheTypes.res +24 -0
- package/src/storage/IDBDatabase.res +54 -0
- package/src/storage/IDBFactory.res +34 -0
- package/src/storage/IDBIndex.res +83 -0
- package/src/storage/IDBObjectStore.res +183 -0
- package/src/storage/IDBTransaction.res +22 -0
- package/src/storage/IndexedDbTypes.res +213 -0
- package/src/storage/Storage.res +42 -0
- package/src/storage/StorageEvent.res +10 -0
- package/src/storage/StorageManager.res +24 -0
- package/src/storage/StorageTypes.res +11 -0
- package/src/storage/WebStorageTypes.res +57 -0
- package/src/svg/SVGElement.res +115 -0
- package/src/svg/SVGGraphicsElement.res +16 -0
- package/src/svg/SVGLength.res +9 -0
- package/src/ui-events/CompositionEvent.res +10 -0
- package/src/ui-events/DataTransfer.res +38 -0
- package/src/ui-events/DataTransferItem.res +21 -0
- package/src/ui-events/DataTransferItemList.res +34 -0
- package/src/ui-events/FocusEvent.res +10 -0
- package/src/ui-events/InputEvent.res +16 -0
- package/src/ui-events/KeyboardEvent.res +16 -0
- package/src/ui-events/MouseEvent.res +26 -0
- package/src/ui-events/PointerEvent.res +24 -0
- package/src/ui-events/Touch.res +5 -0
- package/src/ui-events/TouchEvent.res +10 -0
- package/src/ui-events/TouchList.res +5 -0
- package/src/ui-events/UIEvent.res +20 -0
- package/src/ui-events/UiEventsTypes.res +590 -0
- package/src/ui-events/WheelEvent.res +10 -0
- package/src/url/URL.res +38 -0
- package/src/url/URLSearchParams.res +104 -0
- package/src/url/UrlTypes.res +69 -0
- package/src/view-transitions/ViewTransition.res +5 -0
- package/src/view-transitions/ViewTransitionsTypes.res +22 -0
- package/src/web-audio/AnalyserNode.res +38 -0
- package/src/web-audio/AudioBuffer.res +33 -0
- package/src/web-audio/AudioBufferSourceNode.res +21 -0
- package/src/web-audio/AudioContext.res +59 -0
- package/src/web-audio/AudioDestinationNode.res +1 -0
- package/src/web-audio/AudioNode.res +76 -0
- package/src/web-audio/AudioParam.res +65 -0
- package/src/web-audio/AudioProcessingEvent.res +10 -0
- package/src/web-audio/AudioScheduledSourceNode.res +23 -0
- package/src/web-audio/AudioWorkletNode.res +11 -0
- package/src/web-audio/BaseAudioContext.res +141 -0
- package/src/web-audio/BiquadFilterNode.res +21 -0
- package/src/web-audio/ChannelMergerNode.res +10 -0
- package/src/web-audio/ChannelSplitterNode.res +10 -0
- package/src/web-audio/ConstantSourceNode.res +10 -0
- package/src/web-audio/ConvolverNode.res +10 -0
- package/src/web-audio/DelayNode.res +10 -0
- package/src/web-audio/DynamicsCompressorNode.res +10 -0
- package/src/web-audio/GainNode.res +10 -0
- package/src/web-audio/IIRFilterNode.res +21 -0
- package/src/web-audio/MediaElementAudioSourceNode.res +10 -0
- package/src/web-audio/MediaStreamAudioDestinationNode.res +10 -0
- package/src/web-audio/MediaStreamAudioSourceNode.res +10 -0
- package/src/web-audio/OfflineAudioCompletionEvent.res +10 -0
- package/src/web-audio/OfflineAudioContext.res +58 -0
- package/src/web-audio/OscillatorNode.res +17 -0
- package/src/web-audio/PannerNode.res +10 -0
- package/src/web-audio/PeriodicWave.res +8 -0
- package/src/web-audio/StereoPannerNode.res +10 -0
- package/src/web-audio/WaveShaperNode.res +10 -0
- package/src/web-audio/WebAudioTypes.res +1309 -0
- package/src/web-audio/Worklet.res +14 -0
- package/src/window/CustomElementRegistry.res +30 -0
- package/src/window/Document.res +470 -0
- package/src/window/DomGlobal.res +459 -0
- package/src/window/History.res +37 -0
- package/src/window/HistoryTypes.res +26 -0
- package/src/window/IdleDeadline.res +5 -0
- package/src/window/Location.res +108 -0
- package/src/window/VisualViewport.res +5 -0
- package/src/window/VisualViewportTypes.res +37 -0
- package/src/window/Window.res +556 -0
- package/src/window/XPathExpression.res +16 -0
- package/src/window/XPathResult.res +46 -0
- package/src/workers/Clients.res +39 -0
- package/src/workers/NavigationPreloadManager.res +26 -0
- package/src/workers/ServiceWorker.res +38 -0
- package/src/workers/ServiceWorkerContainer.res +34 -0
- package/src/workers/ServiceWorkerRegistration.res +32 -0
- package/src/workers/ServiceWorkerScope.res +12 -0
- package/src/workers/ServiceWorkerTypes.res +153 -0
- package/src/workers/SharedWorker.res +68 -0
- package/src/workers/SharedWorkerScope.res +29 -0
- package/src/workers/WebWorkersTypes.res +46 -0
- package/src/workers/Worker.res +48 -0
- package/src/workers/WorkerLocation.res +18 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Returns the token with index index.
|
|
3
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/item)
|
|
4
|
+
*/
|
|
5
|
+
@send
|
|
6
|
+
external item: (DOM.domTokenList, int) => Null.t<string> = "item"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
Returns true if token is present, and false otherwise.
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/contains)
|
|
11
|
+
*/
|
|
12
|
+
@send
|
|
13
|
+
external contains: (DOM.domTokenList, string) => bool = "contains"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Adds all arguments passed, except those already present.
|
|
17
|
+
|
|
18
|
+
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
|
|
19
|
+
|
|
20
|
+
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
|
|
21
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/add)
|
|
22
|
+
*/
|
|
23
|
+
@throws(JsExn) @send
|
|
24
|
+
external add: (DOM.domTokenList, string) => unit = "add"
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Removes arguments passed, if they are present.
|
|
28
|
+
|
|
29
|
+
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
|
|
30
|
+
|
|
31
|
+
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
|
|
32
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/remove)
|
|
33
|
+
*/
|
|
34
|
+
@throws(JsExn) @send
|
|
35
|
+
external remove: (DOM.domTokenList, string) => unit = "remove"
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()).
|
|
39
|
+
|
|
40
|
+
Returns true if token is now present, and false otherwise.
|
|
41
|
+
|
|
42
|
+
Throws a "SyntaxError" DOMException if token is empty.
|
|
43
|
+
|
|
44
|
+
Throws an "InvalidCharacterError" DOMException if token contains any spaces.
|
|
45
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/toggle)
|
|
46
|
+
*/
|
|
47
|
+
@throws(JsExn) @send
|
|
48
|
+
external toggle: (DOM.domTokenList, ~token: string, ~force: bool=?) => bool = "toggle"
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
Replaces token with newToken.
|
|
52
|
+
|
|
53
|
+
Returns true if token was replaced with newToken, and false otherwise.
|
|
54
|
+
|
|
55
|
+
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
|
|
56
|
+
|
|
57
|
+
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
|
|
58
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/replace)
|
|
59
|
+
*/
|
|
60
|
+
@throws(JsExn) @send
|
|
61
|
+
external replace: (DOM.domTokenList, ~token: string, ~newToken: string) => bool = "replace"
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
Returns true if token is in the associated attribute's supported tokens. Returns false otherwise.
|
|
65
|
+
|
|
66
|
+
Throws a TypeError if the associated attribute has no supported tokens defined.
|
|
67
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/supports)
|
|
68
|
+
*/
|
|
69
|
+
@throws(JsExn) @send
|
|
70
|
+
external supports: (DOM.domTokenList, string) => bool = "supports"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@new
|
|
2
|
+
external make: unit => DOM.abortController = "AbortController"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
6
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
|
7
|
+
*/
|
|
8
|
+
@send
|
|
9
|
+
external abort: (DOM.abortController, ~reason: JSON.t=?) => unit = "abort"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
include EventTarget.Impl({type t = DOM.abortSignal})
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
|
|
5
|
+
*/
|
|
6
|
+
@scope("AbortSignal")
|
|
7
|
+
external abort: (~reason: JSON.t=?) => DOM.abortSignal = "abort"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
|
|
11
|
+
*/
|
|
12
|
+
@scope("AbortSignal")
|
|
13
|
+
external timeout: int => DOM.abortSignal = "timeout"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
|
|
17
|
+
*/
|
|
18
|
+
@scope("AbortSignal")
|
|
19
|
+
external any: array<DOM.abortSignal> => DOM.abortSignal = "any"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
|
|
23
|
+
*/
|
|
24
|
+
@throws(JsExn) @send
|
|
25
|
+
external throwIfAborted: DOM.abortSignal => unit = "throwIfAborted"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
type eventInit = DOM.eventInit = {
|
|
2
|
+
mutable bubbles?: bool,
|
|
3
|
+
mutable cancelable?: bool,
|
|
4
|
+
mutable composed?: bool,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@new
|
|
8
|
+
external make: (~type_: string, ~eventInitDict: eventInit=?) => DOM.event = "Event"
|
|
9
|
+
|
|
10
|
+
@get
|
|
11
|
+
external type_: DOM.event => EventType.t = "type"
|
|
12
|
+
|
|
13
|
+
@get
|
|
14
|
+
external target: DOM.event => Null.t<DOM.eventTarget> = "target"
|
|
15
|
+
|
|
16
|
+
@get
|
|
17
|
+
external currentTarget: DOM.event => Null.t<DOM.eventTarget> = "currentTarget"
|
|
18
|
+
|
|
19
|
+
@get
|
|
20
|
+
external eventPhase: DOM.event => int = "eventPhase"
|
|
21
|
+
|
|
22
|
+
@get
|
|
23
|
+
external bubbles: DOM.event => bool = "bubbles"
|
|
24
|
+
|
|
25
|
+
@get
|
|
26
|
+
external cancelable: DOM.event => bool = "cancelable"
|
|
27
|
+
|
|
28
|
+
@get
|
|
29
|
+
external defaultPrevented: DOM.event => bool = "defaultPrevented"
|
|
30
|
+
|
|
31
|
+
@get
|
|
32
|
+
external composed: DOM.event => bool = "composed"
|
|
33
|
+
|
|
34
|
+
@get
|
|
35
|
+
external isTrusted: DOM.event => bool = "isTrusted"
|
|
36
|
+
|
|
37
|
+
@get
|
|
38
|
+
external timeStamp: DOM.event => float = "timeStamp"
|
|
39
|
+
|
|
40
|
+
module Impl = (
|
|
41
|
+
T: {
|
|
42
|
+
type t
|
|
43
|
+
},
|
|
44
|
+
) => {
|
|
45
|
+
external asEvent: T.t => DOM.event = "%identity"
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
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.
|
|
49
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
50
|
+
*/
|
|
51
|
+
@send
|
|
52
|
+
external composedPath: T.t => array<DOM.eventTarget> = "composedPath"
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
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.
|
|
56
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
57
|
+
*/
|
|
58
|
+
@send
|
|
59
|
+
external preventDefault: T.t => unit = "preventDefault"
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
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.
|
|
63
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
64
|
+
*/
|
|
65
|
+
@send
|
|
66
|
+
external stopImmediatePropagation: T.t => unit = "stopImmediatePropagation"
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
70
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
71
|
+
*/
|
|
72
|
+
@send
|
|
73
|
+
external stopPropagation: T.t => unit = "stopPropagation"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
include Impl({type t = DOM.event})
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@new
|
|
2
|
+
external make: unit => DOM.eventTarget = "EventTarget"
|
|
3
|
+
|
|
4
|
+
module Impl = (
|
|
5
|
+
T: {
|
|
6
|
+
type t
|
|
7
|
+
},
|
|
8
|
+
) => {
|
|
9
|
+
external asEventTarget: T.t => DOM.eventTarget = "%identity"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
21
|
+
|
|
22
|
+
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
23
|
+
|
|
24
|
+
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
25
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
26
|
+
*/
|
|
27
|
+
@send
|
|
28
|
+
external addEventListener: (
|
|
29
|
+
T.t,
|
|
30
|
+
EventType.t,
|
|
31
|
+
DOM.EventListener.t<'event>,
|
|
32
|
+
~options: DOM.EventListener.addEventListenerOptions=?,
|
|
33
|
+
) => unit = "addEventListener"
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
45
|
+
|
|
46
|
+
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
47
|
+
|
|
48
|
+
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
49
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
50
|
+
*/
|
|
51
|
+
@send
|
|
52
|
+
external addEventListenerWithCapture: (
|
|
53
|
+
T.t,
|
|
54
|
+
EventType.t,
|
|
55
|
+
DOM.EventListener.t<'event>,
|
|
56
|
+
@as(json`true`) _,
|
|
57
|
+
) => unit = "addEventListener"
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
61
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
62
|
+
*/
|
|
63
|
+
@send
|
|
64
|
+
external removeEventListener: (
|
|
65
|
+
T.t,
|
|
66
|
+
EventType.t,
|
|
67
|
+
DOM.EventListener.t<'event>,
|
|
68
|
+
~options: DOM.EventListener.options=?,
|
|
69
|
+
) => unit = "removeEventListener"
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
73
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
74
|
+
*/
|
|
75
|
+
@send
|
|
76
|
+
external removeEventListenerUseCapture: (
|
|
77
|
+
T.t,
|
|
78
|
+
EventType.t,
|
|
79
|
+
DOM.EventListener.t<'event>,
|
|
80
|
+
@as(json`true`) _,
|
|
81
|
+
) => unit = "removeEventListener"
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
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.
|
|
85
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
86
|
+
*/
|
|
87
|
+
@throws(JsExn) @send
|
|
88
|
+
external dispatchEvent: (T.t, DOM.event) => bool = "dispatchEvent"
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
include Impl({type t = DOM.eventTarget})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Impl = (
|
|
2
|
+
T: {
|
|
3
|
+
type t
|
|
4
|
+
},
|
|
5
|
+
) => {
|
|
6
|
+
include Event.Impl({type t = T.t})
|
|
7
|
+
|
|
8
|
+
external asExtendableEvent: T.t => DOM.extendableEvent = "%identity"
|
|
9
|
+
|
|
10
|
+
@send
|
|
11
|
+
external waitUntil: (T.t, promise<'a>) => unit = "waitUntil"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
include Impl({type t = DOM.extendableEvent})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type t = FetchTypes.bodyInit
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
5
|
+
*/
|
|
6
|
+
external fromString: string => t = "%identity"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
10
|
+
*/
|
|
11
|
+
external fromArrayBuffer: ArrayBuffer.t => t = "%identity"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
15
|
+
*/
|
|
16
|
+
external fromTypedArray: TypedArray.t<'t> => t = "%identity"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
20
|
+
*/
|
|
21
|
+
external fromDataView: DataView.t => t = "%identity"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
25
|
+
*/
|
|
26
|
+
external fromBlob: Blob.t => t = "%identity"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
30
|
+
*/
|
|
31
|
+
external fromFile: File.t => t = "%identity"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
35
|
+
*/
|
|
36
|
+
external fromURLSearchParams: URLSearchParams.t => t = "%identity"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
40
|
+
*/
|
|
41
|
+
external fromFormData: FormData.t => t = "%identity"
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
45
|
+
*/
|
|
46
|
+
external fromReadableStream: ReadableStream.t<'t> => t = "%identity"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available.
|
|
3
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
4
|
+
*/
|
|
5
|
+
external fetch: (string, ~init: Request.requestInit=?) => promise<Response.t> = "fetch"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available.
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
10
|
+
*/
|
|
11
|
+
external fetchWithRequest: (Request.t, ~init: Request.requestInit=?) => promise<Response.t> =
|
|
12
|
+
"fetch"
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
type responseType =
|
|
4
|
+
| @as("basic") Basic
|
|
5
|
+
| @as("cors") Cors
|
|
6
|
+
| @as("default") Default
|
|
7
|
+
| @as("error") Error
|
|
8
|
+
| @as("opaque") Opaque
|
|
9
|
+
| @as("opaqueredirect") Opaqueredirect
|
|
10
|
+
|
|
11
|
+
type requestDestination =
|
|
12
|
+
| @as("audio") Audio
|
|
13
|
+
| @as("audioworklet") Audioworklet
|
|
14
|
+
| @as("document") Document
|
|
15
|
+
| @as("embed") Embed
|
|
16
|
+
| @as("font") Font
|
|
17
|
+
| @as("frame") Frame
|
|
18
|
+
| @as("iframe") Iframe
|
|
19
|
+
| @as("image") Image
|
|
20
|
+
| @as("manifest") Manifest
|
|
21
|
+
| @as("object") Object
|
|
22
|
+
| @as("paintworklet") Paintworklet
|
|
23
|
+
| @as("report") Report
|
|
24
|
+
| @as("script") Script
|
|
25
|
+
| @as("sharedworker") Sharedworker
|
|
26
|
+
| @as("style") Style
|
|
27
|
+
| @as("track") Track
|
|
28
|
+
| @as("video") Video
|
|
29
|
+
| @as("worker") Worker
|
|
30
|
+
| @as("xslt") Xslt
|
|
31
|
+
|
|
32
|
+
type referrerPolicy =
|
|
33
|
+
| @as("no-referrer") NoReferrer
|
|
34
|
+
| @as("no-referrer-when-downgrade") NoReferrerWhenDowngrade
|
|
35
|
+
| @as("origin") Origin
|
|
36
|
+
| @as("origin-when-cross-origin") OriginWhenCrossOrigin
|
|
37
|
+
| @as("same-origin") SameOrigin
|
|
38
|
+
| @as("strict-origin") StrictOrigin
|
|
39
|
+
| @as("strict-origin-when-cross-origin") StrictOriginWhenCrossOrigin
|
|
40
|
+
| @as("unsafe-url") UnsafeUrl
|
|
41
|
+
|
|
42
|
+
type requestMode =
|
|
43
|
+
| @as("cors") Cors
|
|
44
|
+
| @as("navigate") Navigate
|
|
45
|
+
| @as("no-cors") NoCors
|
|
46
|
+
| @as("same-origin") SameOrigin
|
|
47
|
+
|
|
48
|
+
type requestCredentials =
|
|
49
|
+
| @as("include") Include
|
|
50
|
+
| @as("omit") Omit
|
|
51
|
+
| @as("same-origin") SameOrigin
|
|
52
|
+
|
|
53
|
+
type requestCache =
|
|
54
|
+
| @as("default") Default
|
|
55
|
+
| @as("force-cache") ForceCache
|
|
56
|
+
| @as("no-cache") NoCache
|
|
57
|
+
| @as("no-store") NoStore
|
|
58
|
+
| @as("only-if-cached") OnlyIfCached
|
|
59
|
+
| @as("reload") Reload
|
|
60
|
+
|
|
61
|
+
type requestRedirect =
|
|
62
|
+
| @as("error") Error
|
|
63
|
+
| @as("follow") Follow
|
|
64
|
+
| @as("manual") Manual
|
|
65
|
+
|
|
66
|
+
type requestPriority =
|
|
67
|
+
| @as("auto") Auto
|
|
68
|
+
| @as("high") High
|
|
69
|
+
| @as("low") Low
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
@editor.completeFrom(Response) This WebApiFetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
|
|
73
|
+
[See Headers on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
74
|
+
*/
|
|
75
|
+
@editor.completeFrom(Headers)
|
|
76
|
+
type headers = private {}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
This WebApiFetch API interface represents a resource request.
|
|
80
|
+
[See Request on MDN](https://developer.mozilla.org/docs/Web/API/Request)
|
|
81
|
+
*/
|
|
82
|
+
@editor.completeFrom(Request)
|
|
83
|
+
type request = private {
|
|
84
|
+
/**
|
|
85
|
+
Returns request's HTTP method, which is "GET" by default.
|
|
86
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
87
|
+
*/
|
|
88
|
+
method: string,
|
|
89
|
+
/**
|
|
90
|
+
Returns the WebApiURL of request as a string.
|
|
91
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
92
|
+
*/
|
|
93
|
+
url: string,
|
|
94
|
+
/**
|
|
95
|
+
Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
|
|
96
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
97
|
+
*/
|
|
98
|
+
headers: headers,
|
|
99
|
+
/**
|
|
100
|
+
Returns the kind of resource requested by request, e.g., "document" or "script".
|
|
101
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/destination)
|
|
102
|
+
*/
|
|
103
|
+
destination: requestDestination,
|
|
104
|
+
/**
|
|
105
|
+
Returns the referrer of request. Its value can be a same-origin WebApiURL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
|
|
106
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/referrer)
|
|
107
|
+
*/
|
|
108
|
+
referrer: string,
|
|
109
|
+
/**
|
|
110
|
+
Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
|
|
111
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy)
|
|
112
|
+
*/
|
|
113
|
+
referrerPolicy: referrerPolicy,
|
|
114
|
+
/**
|
|
115
|
+
Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
|
|
116
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/mode)
|
|
117
|
+
*/
|
|
118
|
+
mode: requestMode,
|
|
119
|
+
/**
|
|
120
|
+
Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
|
|
121
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/credentials)
|
|
122
|
+
*/
|
|
123
|
+
credentials: requestCredentials,
|
|
124
|
+
/**
|
|
125
|
+
Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
126
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
|
127
|
+
*/
|
|
128
|
+
cache: requestCache,
|
|
129
|
+
/**
|
|
130
|
+
Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
|
|
131
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
132
|
+
*/
|
|
133
|
+
redirect: requestRedirect,
|
|
134
|
+
/**
|
|
135
|
+
Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
|
|
136
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
137
|
+
*/
|
|
138
|
+
integrity: string,
|
|
139
|
+
/**
|
|
140
|
+
Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
141
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
142
|
+
*/
|
|
143
|
+
keepalive: bool,
|
|
144
|
+
/**
|
|
145
|
+
Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
146
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
147
|
+
*/
|
|
148
|
+
signal: DOM.abortSignal,
|
|
149
|
+
/**
|
|
150
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
151
|
+
*/
|
|
152
|
+
body: Null.t<FileTypes.readableStream<array<int>>>,
|
|
153
|
+
/**
|
|
154
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed)
|
|
155
|
+
*/
|
|
156
|
+
bodyUsed: bool,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
This WebApiFetch API interface represents the response to a request.
|
|
161
|
+
[See Response on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
162
|
+
*/
|
|
163
|
+
@editor.completeFrom(Response)
|
|
164
|
+
type response = private {
|
|
165
|
+
/**
|
|
166
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/type)
|
|
167
|
+
*/
|
|
168
|
+
@as("type")
|
|
169
|
+
type_: responseType,
|
|
170
|
+
/**
|
|
171
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/url)
|
|
172
|
+
*/
|
|
173
|
+
url: string,
|
|
174
|
+
/**
|
|
175
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/redirected)
|
|
176
|
+
*/
|
|
177
|
+
redirected: bool,
|
|
178
|
+
/**
|
|
179
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/status)
|
|
180
|
+
*/
|
|
181
|
+
status: int,
|
|
182
|
+
/**
|
|
183
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/ok)
|
|
184
|
+
*/
|
|
185
|
+
ok: bool,
|
|
186
|
+
/**
|
|
187
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/statusText)
|
|
188
|
+
*/
|
|
189
|
+
statusText: string,
|
|
190
|
+
/**
|
|
191
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
|
192
|
+
*/
|
|
193
|
+
headers: headers,
|
|
194
|
+
/**
|
|
195
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
196
|
+
*/
|
|
197
|
+
body: Null.t<FileTypes.readableStream<array<int>>>,
|
|
198
|
+
/**
|
|
199
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed)
|
|
200
|
+
*/
|
|
201
|
+
bodyUsed: bool,
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
|
206
|
+
[See FormData on MDN](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
207
|
+
*/
|
|
208
|
+
@editor.completeFrom(FormData)
|
|
209
|
+
type formData = private {}
|
|
210
|
+
|
|
211
|
+
@editor.completeFrom(HeadersInit) type headersInit
|
|
212
|
+
|
|
213
|
+
@editor.completeFrom(BodyInit) type bodyInit
|
|
214
|
+
|
|
215
|
+
type requestInfo = unknown
|
|
216
|
+
|
|
217
|
+
@editor.completeFrom(FormDataEntryValue) @unboxed
|
|
218
|
+
type formDataEntryValue =
|
|
219
|
+
| String(string)
|
|
220
|
+
| File(FileTypes.file)
|
|
221
|
+
|
|
222
|
+
type requestInit = {
|
|
223
|
+
/**
|
|
224
|
+
A string to set request's method.
|
|
225
|
+
*/
|
|
226
|
+
mutable method?: string,
|
|
227
|
+
/**
|
|
228
|
+
A Headers object, an object literal, or an array of two-item arrays to set request's headers.
|
|
229
|
+
*/
|
|
230
|
+
mutable headers?: headersInit,
|
|
231
|
+
/**
|
|
232
|
+
A BodyInit object or null to set request's body.
|
|
233
|
+
*/
|
|
234
|
+
mutable body?: Nullable.t<bodyInit>,
|
|
235
|
+
/**
|
|
236
|
+
A string whose value is a same-origin WebApiURL, "about:client", or the empty string, to set request's referrer.
|
|
237
|
+
*/
|
|
238
|
+
mutable referrer?: string,
|
|
239
|
+
/**
|
|
240
|
+
A referrer policy to set request's referrerPolicy.
|
|
241
|
+
*/
|
|
242
|
+
mutable referrerPolicy?: referrerPolicy,
|
|
243
|
+
/**
|
|
244
|
+
A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
|
|
245
|
+
*/
|
|
246
|
+
mutable mode?: requestMode,
|
|
247
|
+
/**
|
|
248
|
+
A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
|
|
249
|
+
*/
|
|
250
|
+
mutable credentials?: requestCredentials,
|
|
251
|
+
/**
|
|
252
|
+
A string indicating how the request will interact with the browser's cache to set request's cache.
|
|
253
|
+
*/
|
|
254
|
+
mutable cache?: requestCache,
|
|
255
|
+
/**
|
|
256
|
+
A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
|
|
257
|
+
*/
|
|
258
|
+
mutable redirect?: requestRedirect,
|
|
259
|
+
/**
|
|
260
|
+
A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
|
|
261
|
+
*/
|
|
262
|
+
mutable integrity?: string,
|
|
263
|
+
/**
|
|
264
|
+
A boolean to set request's keepalive.
|
|
265
|
+
*/
|
|
266
|
+
mutable keepalive?: bool,
|
|
267
|
+
/**
|
|
268
|
+
An AbortSignal to set request's signal.
|
|
269
|
+
*/
|
|
270
|
+
mutable signal?: Nullable.t<DOM.abortSignal>,
|
|
271
|
+
mutable priority?: requestPriority,
|
|
272
|
+
/**
|
|
273
|
+
Can only be null. Used to disassociate request from any Window.
|
|
274
|
+
*/
|
|
275
|
+
mutable window?: Nullable.t<unit>,
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
type responseInit = {
|
|
279
|
+
mutable status?: int,
|
|
280
|
+
mutable statusText?: string,
|
|
281
|
+
mutable headers?: headersInit,
|
|
282
|
+
}
|