@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
package/src/FetchAPI.res
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
open Prelude
|
|
4
|
+
open EventAPI
|
|
5
|
+
open FileAPI
|
|
6
|
+
|
|
7
|
+
type responseType =
|
|
8
|
+
| @as("basic") Basic
|
|
9
|
+
| @as("cors") Cors
|
|
10
|
+
| @as("default") Default
|
|
11
|
+
| @as("error") Error
|
|
12
|
+
| @as("opaque") Opaque
|
|
13
|
+
| @as("opaqueredirect") Opaqueredirect
|
|
14
|
+
|
|
15
|
+
type requestDestination =
|
|
16
|
+
| @as("audio") Audio
|
|
17
|
+
| @as("audioworklet") Audioworklet
|
|
18
|
+
| @as("document") Document
|
|
19
|
+
| @as("embed") Embed
|
|
20
|
+
| @as("font") Font
|
|
21
|
+
| @as("frame") Frame
|
|
22
|
+
| @as("iframe") Iframe
|
|
23
|
+
| @as("image") Image
|
|
24
|
+
| @as("manifest") Manifest
|
|
25
|
+
| @as("object") Object
|
|
26
|
+
| @as("paintworklet") Paintworklet
|
|
27
|
+
| @as("report") Report
|
|
28
|
+
| @as("script") Script
|
|
29
|
+
| @as("sharedworker") Sharedworker
|
|
30
|
+
| @as("style") Style
|
|
31
|
+
| @as("track") Track
|
|
32
|
+
| @as("video") Video
|
|
33
|
+
| @as("worker") Worker
|
|
34
|
+
| @as("xslt") Xslt
|
|
35
|
+
|
|
36
|
+
type referrerPolicy =
|
|
37
|
+
| @as("no-referrer") NoReferrer
|
|
38
|
+
| @as("no-referrer-when-downgrade") NoReferrerWhenDowngrade
|
|
39
|
+
| @as("origin") Origin
|
|
40
|
+
| @as("origin-when-cross-origin") OriginWhenCrossOrigin
|
|
41
|
+
| @as("same-origin") SameOrigin
|
|
42
|
+
| @as("strict-origin") StrictOrigin
|
|
43
|
+
| @as("strict-origin-when-cross-origin") StrictOriginWhenCrossOrigin
|
|
44
|
+
| @as("unsafe-url") UnsafeUrl
|
|
45
|
+
|
|
46
|
+
type requestMode =
|
|
47
|
+
| @as("cors") Cors
|
|
48
|
+
| @as("navigate") Navigate
|
|
49
|
+
| @as("no-cors") NoCors
|
|
50
|
+
| @as("same-origin") SameOrigin
|
|
51
|
+
|
|
52
|
+
type requestCredentials =
|
|
53
|
+
| @as("include") Include
|
|
54
|
+
| @as("omit") Omit
|
|
55
|
+
| @as("same-origin") SameOrigin
|
|
56
|
+
|
|
57
|
+
type requestCache =
|
|
58
|
+
| @as("default") Default
|
|
59
|
+
| @as("force-cache") ForceCache
|
|
60
|
+
| @as("no-cache") NoCache
|
|
61
|
+
| @as("no-store") NoStore
|
|
62
|
+
| @as("only-if-cached") OnlyIfCached
|
|
63
|
+
| @as("reload") Reload
|
|
64
|
+
|
|
65
|
+
type requestRedirect =
|
|
66
|
+
| @as("error") Error
|
|
67
|
+
| @as("follow") Follow
|
|
68
|
+
| @as("manual") Manual
|
|
69
|
+
|
|
70
|
+
type requestPriority =
|
|
71
|
+
| @as("auto") Auto
|
|
72
|
+
| @as("high") High
|
|
73
|
+
| @as("low") Low
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
This Fetch 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.
|
|
77
|
+
[See Headers on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
78
|
+
*/
|
|
79
|
+
type headers = {}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
This Fetch API interface represents a resource request.
|
|
83
|
+
[See Request on MDN](https://developer.mozilla.org/docs/Web/API/Request)
|
|
84
|
+
*/
|
|
85
|
+
type request = {
|
|
86
|
+
/**
|
|
87
|
+
Returns request's HTTP method, which is "GET" by default.
|
|
88
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
89
|
+
*/
|
|
90
|
+
method: string,
|
|
91
|
+
/**
|
|
92
|
+
Returns the URL of request as a string.
|
|
93
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
94
|
+
*/
|
|
95
|
+
url: string,
|
|
96
|
+
/**
|
|
97
|
+
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.
|
|
98
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
99
|
+
*/
|
|
100
|
+
headers: headers,
|
|
101
|
+
/**
|
|
102
|
+
Returns the kind of resource requested by request, e.g., "document" or "script".
|
|
103
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/destination)
|
|
104
|
+
*/
|
|
105
|
+
destination: requestDestination,
|
|
106
|
+
/**
|
|
107
|
+
Returns the referrer of request. Its value can be a same-origin URL 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.
|
|
108
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/referrer)
|
|
109
|
+
*/
|
|
110
|
+
referrer: string,
|
|
111
|
+
/**
|
|
112
|
+
Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
|
|
113
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy)
|
|
114
|
+
*/
|
|
115
|
+
referrerPolicy: referrerPolicy,
|
|
116
|
+
/**
|
|
117
|
+
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.
|
|
118
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/mode)
|
|
119
|
+
*/
|
|
120
|
+
mode: requestMode,
|
|
121
|
+
/**
|
|
122
|
+
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.
|
|
123
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/credentials)
|
|
124
|
+
*/
|
|
125
|
+
credentials: requestCredentials,
|
|
126
|
+
/**
|
|
127
|
+
Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
128
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
|
129
|
+
*/
|
|
130
|
+
cache: requestCache,
|
|
131
|
+
/**
|
|
132
|
+
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.
|
|
133
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
134
|
+
*/
|
|
135
|
+
redirect: requestRedirect,
|
|
136
|
+
/**
|
|
137
|
+
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]
|
|
138
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
139
|
+
*/
|
|
140
|
+
integrity: string,
|
|
141
|
+
/**
|
|
142
|
+
Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
143
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
144
|
+
*/
|
|
145
|
+
keepalive: bool,
|
|
146
|
+
/**
|
|
147
|
+
Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
148
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
149
|
+
*/
|
|
150
|
+
signal: abortSignal,
|
|
151
|
+
/**
|
|
152
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
153
|
+
*/
|
|
154
|
+
body: Null.t<readableStream<array<int>>>,
|
|
155
|
+
/**
|
|
156
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed)
|
|
157
|
+
*/
|
|
158
|
+
bodyUsed: bool,
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
This Fetch API interface represents the response to a request.
|
|
163
|
+
[See Response on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
164
|
+
*/
|
|
165
|
+
type response = {
|
|
166
|
+
/**
|
|
167
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/type)
|
|
168
|
+
*/
|
|
169
|
+
@as("type")
|
|
170
|
+
type_: responseType,
|
|
171
|
+
/**
|
|
172
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/url)
|
|
173
|
+
*/
|
|
174
|
+
url: string,
|
|
175
|
+
/**
|
|
176
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/redirected)
|
|
177
|
+
*/
|
|
178
|
+
redirected: bool,
|
|
179
|
+
/**
|
|
180
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/status)
|
|
181
|
+
*/
|
|
182
|
+
status: int,
|
|
183
|
+
/**
|
|
184
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/ok)
|
|
185
|
+
*/
|
|
186
|
+
ok: bool,
|
|
187
|
+
/**
|
|
188
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/statusText)
|
|
189
|
+
*/
|
|
190
|
+
statusText: string,
|
|
191
|
+
/**
|
|
192
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response/headers)
|
|
193
|
+
*/
|
|
194
|
+
headers: headers,
|
|
195
|
+
/**
|
|
196
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
197
|
+
*/
|
|
198
|
+
body: Null.t<readableStream<array<int>>>,
|
|
199
|
+
/**
|
|
200
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed)
|
|
201
|
+
*/
|
|
202
|
+
bodyUsed: bool,
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
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".
|
|
207
|
+
[See FormData on MDN](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
208
|
+
*/
|
|
209
|
+
type formData = {}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
[See URLSearchParams on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
213
|
+
*/
|
|
214
|
+
type urlSearchParams = {
|
|
215
|
+
/**
|
|
216
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size)
|
|
217
|
+
*/
|
|
218
|
+
size: int,
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
type headersInit = any
|
|
222
|
+
|
|
223
|
+
type requestInfo = any
|
|
224
|
+
|
|
225
|
+
type formDataEntryValue = any
|
|
226
|
+
|
|
227
|
+
type requestInit = {
|
|
228
|
+
/**
|
|
229
|
+
A string to set request's method.
|
|
230
|
+
*/
|
|
231
|
+
mutable method?: string,
|
|
232
|
+
/**
|
|
233
|
+
A Headers object, an object literal, or an array of two-item arrays to set request's headers.
|
|
234
|
+
*/
|
|
235
|
+
mutable headers?: headersInit,
|
|
236
|
+
/**
|
|
237
|
+
A BodyInit object or null to set request's body.
|
|
238
|
+
*/
|
|
239
|
+
mutable body?: Null.t<bodyInit>,
|
|
240
|
+
/**
|
|
241
|
+
A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
|
|
242
|
+
*/
|
|
243
|
+
mutable referrer?: string,
|
|
244
|
+
/**
|
|
245
|
+
A referrer policy to set request's referrerPolicy.
|
|
246
|
+
*/
|
|
247
|
+
mutable referrerPolicy?: referrerPolicy,
|
|
248
|
+
/**
|
|
249
|
+
A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
|
|
250
|
+
*/
|
|
251
|
+
mutable mode?: requestMode,
|
|
252
|
+
/**
|
|
253
|
+
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.
|
|
254
|
+
*/
|
|
255
|
+
mutable credentials?: requestCredentials,
|
|
256
|
+
/**
|
|
257
|
+
A string indicating how the request will interact with the browser's cache to set request's cache.
|
|
258
|
+
*/
|
|
259
|
+
mutable cache?: requestCache,
|
|
260
|
+
/**
|
|
261
|
+
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.
|
|
262
|
+
*/
|
|
263
|
+
mutable redirect?: requestRedirect,
|
|
264
|
+
/**
|
|
265
|
+
A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
|
|
266
|
+
*/
|
|
267
|
+
mutable integrity?: string,
|
|
268
|
+
/**
|
|
269
|
+
A boolean to set request's keepalive.
|
|
270
|
+
*/
|
|
271
|
+
mutable keepalive?: bool,
|
|
272
|
+
/**
|
|
273
|
+
An AbortSignal to set request's signal.
|
|
274
|
+
*/
|
|
275
|
+
mutable signal?: Null.t<abortSignal>,
|
|
276
|
+
mutable priority?: requestPriority,
|
|
277
|
+
/**
|
|
278
|
+
Can only be null. Used to disassociate request from any Window.
|
|
279
|
+
*/
|
|
280
|
+
mutable window?: Null.t<unit>,
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
type responseInit = {
|
|
284
|
+
mutable status?: int,
|
|
285
|
+
mutable statusText?: string,
|
|
286
|
+
mutable headers?: headersInit,
|
|
287
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
open FileAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob)
|
|
5
|
+
*/
|
|
6
|
+
@new
|
|
7
|
+
external make: (~blobParts: array<blobPart>=?, ~options: blobPropertyBag=?) => blob = "Blob"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/slice)
|
|
11
|
+
*/
|
|
12
|
+
@send
|
|
13
|
+
external slice: (blob, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/stream)
|
|
17
|
+
*/
|
|
18
|
+
@send
|
|
19
|
+
external stream: blob => readableStream<array<int>> = "stream"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/text)
|
|
23
|
+
*/
|
|
24
|
+
@send
|
|
25
|
+
external text: blob => Promise.t<string> = "text"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
|
|
29
|
+
*/
|
|
30
|
+
@send
|
|
31
|
+
external arrayBuffer: blob => Promise.t<ArrayBuffer.t> = "arrayBuffer"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
|
|
35
|
+
*/
|
|
36
|
+
@send
|
|
37
|
+
external bytes: blob => Promise.t<array<int>> = "bytes"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
open FileAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File)
|
|
5
|
+
*/
|
|
6
|
+
@new
|
|
7
|
+
external make: (
|
|
8
|
+
~fileBits: array<blobPart>,
|
|
9
|
+
~fileName: string,
|
|
10
|
+
~options: filePropertyBag=?,
|
|
11
|
+
) => 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"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
open FileAPI
|
|
2
|
+
|
|
3
|
+
external asFileSystemHandle: fileSystemDirectoryHandle => fileSystemHandle = "%identity"
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry)
|
|
6
|
+
*/
|
|
7
|
+
@send
|
|
8
|
+
external isSameEntry: (fileSystemDirectoryHandle, fileSystemHandle) => Promise.t<bool> =
|
|
9
|
+
"isSameEntry"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)
|
|
13
|
+
*/
|
|
14
|
+
@send
|
|
15
|
+
external getFileHandle: (
|
|
16
|
+
fileSystemDirectoryHandle,
|
|
17
|
+
~name: string,
|
|
18
|
+
~options: fileSystemGetFileOptions=?,
|
|
19
|
+
) => Promise.t<fileSystemFileHandle> = "getFileHandle"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)
|
|
23
|
+
*/
|
|
24
|
+
@send
|
|
25
|
+
external getDirectoryHandle: (
|
|
26
|
+
fileSystemDirectoryHandle,
|
|
27
|
+
~name: string,
|
|
28
|
+
~options: fileSystemGetDirectoryOptions=?,
|
|
29
|
+
) => Promise.t<fileSystemDirectoryHandle> = "getDirectoryHandle"
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/removeEntry)
|
|
33
|
+
*/
|
|
34
|
+
@send
|
|
35
|
+
external removeEntry: (
|
|
36
|
+
fileSystemDirectoryHandle,
|
|
37
|
+
~name: string,
|
|
38
|
+
~options: fileSystemRemoveOptions=?,
|
|
39
|
+
) => Promise.t<unit> = "removeEntry"
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/resolve)
|
|
43
|
+
*/
|
|
44
|
+
@send
|
|
45
|
+
external resolve: (fileSystemDirectoryHandle, fileSystemHandle) => Promise.t<array<string>> =
|
|
46
|
+
"resolve"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
open FileAPI
|
|
2
|
+
|
|
3
|
+
external asFileSystemHandle: fileSystemFileHandle => fileSystemHandle = "%identity"
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry)
|
|
6
|
+
*/
|
|
7
|
+
@send
|
|
8
|
+
external isSameEntry: (fileSystemFileHandle, fileSystemHandle) => Promise.t<bool> = "isSameEntry"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/getFile)
|
|
12
|
+
*/
|
|
13
|
+
@send
|
|
14
|
+
external getFile: fileSystemFileHandle => Promise.t<file> = "getFile"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/createWritable)
|
|
18
|
+
*/
|
|
19
|
+
@send
|
|
20
|
+
external createWritable: (
|
|
21
|
+
fileSystemFileHandle,
|
|
22
|
+
~options: fileSystemCreateWritableOptions=?,
|
|
23
|
+
) => Promise.t<fileSystemWritableFileStream> = "createWritable"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
open Prelude
|
|
2
|
+
open FileAPI
|
|
3
|
+
|
|
4
|
+
external asWritableStream: fileSystemWritableFileStream => writableStream<'w> = "%identity"
|
|
5
|
+
/**
|
|
6
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
|
|
7
|
+
*/
|
|
8
|
+
@send
|
|
9
|
+
external abort: (fileSystemWritableFileStream, ~reason: JSON.t=?) => Promise.t<unit> = "abort"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
|
13
|
+
*/
|
|
14
|
+
@send
|
|
15
|
+
external close: fileSystemWritableFileStream => Promise.t<unit> = "close"
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
|
19
|
+
*/
|
|
20
|
+
@send
|
|
21
|
+
external getWriter: fileSystemWritableFileStream => writableStreamDefaultWriter<'w> = "getWriter"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
25
|
+
*/
|
|
26
|
+
@send
|
|
27
|
+
external write: (fileSystemWritableFileStream, DataView.t) => Promise.t<unit> = "write"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
31
|
+
*/
|
|
32
|
+
@send
|
|
33
|
+
external write2: (fileSystemWritableFileStream, ArrayBuffer.t) => Promise.t<unit> = "write"
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
37
|
+
*/
|
|
38
|
+
@send
|
|
39
|
+
external write3: (fileSystemWritableFileStream, blob) => Promise.t<unit> = "write"
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
43
|
+
*/
|
|
44
|
+
@send
|
|
45
|
+
external write4: (fileSystemWritableFileStream, string) => Promise.t<unit> = "write"
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
49
|
+
*/
|
|
50
|
+
@send
|
|
51
|
+
external write5: (fileSystemWritableFileStream, writeParams) => Promise.t<unit> = "write"
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/seek)
|
|
55
|
+
*/
|
|
56
|
+
@send
|
|
57
|
+
external seek: (fileSystemWritableFileStream, int) => Promise.t<unit> = "seek"
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/truncate)
|
|
61
|
+
*/
|
|
62
|
+
@send
|
|
63
|
+
external truncate: (fileSystemWritableFileStream, int) => Promise.t<unit> = "truncate"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
open Prelude
|
|
2
|
+
open FileAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
6
|
+
*/
|
|
7
|
+
@new
|
|
8
|
+
external make: unit => readableStream<array<int>> = "ReadableStream"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
12
|
+
*/
|
|
13
|
+
@new
|
|
14
|
+
external make2: unit => unknown = "ReadableStream"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
18
|
+
*/
|
|
19
|
+
@new
|
|
20
|
+
external make3: unit => unknown = "ReadableStream"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
|
|
24
|
+
*/
|
|
25
|
+
@send
|
|
26
|
+
external cancel: (readableStream<'r>, ~reason: JSON.t=?) => Promise.t<unit> = "cancel"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
|
30
|
+
*/
|
|
31
|
+
@send
|
|
32
|
+
external getReader: (
|
|
33
|
+
readableStream<'r>,
|
|
34
|
+
~options: readableStreamGetReaderOptions=?,
|
|
35
|
+
) => readableStreamReader<'r> = "getReader"
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
|
|
39
|
+
*/
|
|
40
|
+
@send
|
|
41
|
+
external pipeThrough: (
|
|
42
|
+
readableStream<'r>,
|
|
43
|
+
~transform: readableWritablePair<'t, 'r>,
|
|
44
|
+
~options: streamPipeOptions=?,
|
|
45
|
+
) => readableStream<'t> = "pipeThrough"
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
|
49
|
+
*/
|
|
50
|
+
@send
|
|
51
|
+
external pipeTo: (
|
|
52
|
+
readableStream<'r>,
|
|
53
|
+
~destination: writableStream<'r>,
|
|
54
|
+
~options: streamPipeOptions=?,
|
|
55
|
+
) => Promise.t<unit> = "pipeTo"
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
|
59
|
+
*/
|
|
60
|
+
@send
|
|
61
|
+
external tee: readableStream<'r> => array<readableStream<unit>> = "tee"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
open Prelude
|
|
2
|
+
open FileAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
6
|
+
*/
|
|
7
|
+
@new
|
|
8
|
+
external make: (
|
|
9
|
+
~underlyingSink: underlyingSink<'w>=?,
|
|
10
|
+
~strategy: queuingStrategy<'w>=?,
|
|
11
|
+
) => writableStream<'w> = "WritableStream"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
|
|
15
|
+
*/
|
|
16
|
+
@send
|
|
17
|
+
external abort: (writableStream<'w>, ~reason: JSON.t=?) => Promise.t<unit> = "abort"
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
|
21
|
+
*/
|
|
22
|
+
@send
|
|
23
|
+
external close: writableStream<'w> => Promise.t<unit> = "close"
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
|
27
|
+
*/
|
|
28
|
+
@send
|
|
29
|
+
external getWriter: writableStream<'w> => writableStreamDefaultWriter<'w> = "getWriter"
|