@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.
Files changed (341) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/package.json +61 -0
  4. package/rescript.json +557 -0
  5. package/src/animation/Animation.res +149 -0
  6. package/src/animation/AnimationEffect.res +71 -0
  7. package/src/animation/DocumentTimeline.res +8 -0
  8. package/src/canvas/Canvas.res +179 -0
  9. package/src/canvas/CanvasGradient.res +11 -0
  10. package/src/canvas/CanvasPattern.res +11 -0
  11. package/src/canvas/CanvasRenderingContext2D.res +868 -0
  12. package/src/canvas/CanvasTypes.res +452 -0
  13. package/src/canvas/FillStyle.res +25 -0
  14. package/src/canvas/HTMLCanvasElement.res +101 -0
  15. package/src/canvas/ImageBitmap.res +6 -0
  16. package/src/canvas/ImageBitmapRenderingContext.res +9 -0
  17. package/src/canvas/ImageData.res +17 -0
  18. package/src/canvas/OffscreenCanvas.res +87 -0
  19. package/src/canvas/Path2D.res +186 -0
  20. package/src/canvas/VideoColorSpace.res +11 -0
  21. package/src/canvas/VideoFrame.res +217 -0
  22. package/src/core/ArrayBufferTypedArrayOrDataView.res +4 -0
  23. package/src/core/DOM.res +1026 -0
  24. package/src/core/EventType.res +108 -0
  25. package/src/crypto/Crypto.res +11 -0
  26. package/src/crypto/SubtleCrypto.res +173 -0
  27. package/src/crypto/WebCryptoTypes.res +71 -0
  28. package/src/css-font-loading/BaseCSSFontLoading.res +24 -0
  29. package/src/css-font-loading/CssFontLoadingTypes.res +92 -0
  30. package/src/css-font-loading/FontFace.res +62 -0
  31. package/src/css-font-loading/FontFaceSet.res +38 -0
  32. package/src/cssom/CSSRuleList.res +5 -0
  33. package/src/cssom/CSSStyleDeclaration.res +1734 -0
  34. package/src/cssom/CSSStyleValue.res +17 -0
  35. package/src/cssom/MediaList.res +29 -0
  36. package/src/cssom/MediaQueryList.res +18 -0
  37. package/src/cssom/StylePropertyMap.res +56 -0
  38. package/src/cssom/StylePropertyMapReadOnly.res +22 -0
  39. package/src/cssom/StyleSheet.res +152 -0
  40. package/src/cssom/StyleSheetList.res +17 -0
  41. package/src/device/GamepadHapticActuator.res +16 -0
  42. package/src/device/GamepadTypes.res +86 -0
  43. package/src/device/Geolocation.res +31 -0
  44. package/src/device/GeolocationCoordinates.res +5 -0
  45. package/src/device/GeolocationPosition.res +5 -0
  46. package/src/device/GeolocationTypes.res +81 -0
  47. package/src/device/LockManager.res +26 -0
  48. package/src/device/ScreenOrientation.res +7 -0
  49. package/src/device/ScreenWakeLockTypes.res +26 -0
  50. package/src/device/WakeLock.res +8 -0
  51. package/src/device/WakeLockSentinel.res +7 -0
  52. package/src/device/WebLocksTypes.res +45 -0
  53. package/src/device/WebMIDI.res +7 -0
  54. package/src/device/WebMidiTypes.res +36 -0
  55. package/src/dom-nodes/AbstractRange.res +30 -0
  56. package/src/dom-nodes/Attr.res +101 -0
  57. package/src/dom-nodes/CDATASection.res +7 -0
  58. package/src/dom-nodes/CaretPosition.res +2 -0
  59. package/src/dom-nodes/CharacterData.res +199 -0
  60. package/src/dom-nodes/Comment.res +15 -0
  61. package/src/dom-nodes/DOMImplementation.res +131 -0
  62. package/src/dom-nodes/DOMTree.res +1653 -0
  63. package/src/dom-nodes/DocumentFragment.res +96 -0
  64. package/src/dom-nodes/Element.res +509 -0
  65. package/src/dom-nodes/ElementInternals.res +39 -0
  66. package/src/dom-nodes/HTML.res +11 -0
  67. package/src/dom-nodes/HTMLCollection.res +25 -0
  68. package/src/dom-nodes/NamedNodeMap.res +46 -0
  69. package/src/dom-nodes/Node.res +114 -0
  70. package/src/dom-nodes/NodeFilter.res +4 -0
  71. package/src/dom-nodes/NodeIterator.res +38 -0
  72. package/src/dom-nodes/NodeList.res +6 -0
  73. package/src/dom-nodes/ProcessingInstruction.res +15 -0
  74. package/src/dom-nodes/Range.res +156 -0
  75. package/src/dom-nodes/Selection.res +137 -0
  76. package/src/dom-nodes/ShadowRoot.res +23 -0
  77. package/src/dom-nodes/StaticRange.res +6 -0
  78. package/src/dom-nodes/Text.res +31 -0
  79. package/src/dom-nodes/TreeWalker.res +65 -0
  80. package/src/dom-platform/DOMException.res +7 -0
  81. package/src/dom-platform/DOMStringList.res +15 -0
  82. package/src/dom-platform/DOMStringMap.res +5 -0
  83. package/src/dom-platform/DOMTokenList.res +70 -0
  84. package/src/event/AbortController.res +9 -0
  85. package/src/event/AbortSignal.res +25 -0
  86. package/src/event/Event.res +76 -0
  87. package/src/event/EventTarget.res +91 -0
  88. package/src/event/ExtendableEvent.res +14 -0
  89. package/src/fetch/BodyInit.res +46 -0
  90. package/src/fetch/Fetch.res +12 -0
  91. package/src/fetch/FetchTypes.res +282 -0
  92. package/src/fetch/FormData.res +71 -0
  93. package/src/fetch/FormDataEntryValue.res +2 -0
  94. package/src/fetch/Headers.res +59 -0
  95. package/src/fetch/HeadersInit.res +16 -0
  96. package/src/fetch/Request.res +61 -0
  97. package/src/fetch/Response.res +127 -0
  98. package/src/file/BaseFileAndDirectoryEntries.res +72 -0
  99. package/src/file/Blob.res +48 -0
  100. package/src/file/File.res +15 -0
  101. package/src/file/FileAndDirectoryEntriesTypes.res +35 -0
  102. package/src/file/FileList.res +16 -0
  103. package/src/file/FileSystemDirectoryEntry.res +42 -0
  104. package/src/file/FileSystemDirectoryHandle.res +49 -0
  105. package/src/file/FileSystemDirectoryReader.res +9 -0
  106. package/src/file/FileSystemEntry.res +9 -0
  107. package/src/file/FileSystemFileHandle.res +25 -0
  108. package/src/file/FileSystemHandle.res +6 -0
  109. package/src/file/FileSystemWritableFileStream.res +65 -0
  110. package/src/file/FileTypes.res +225 -0
  111. package/src/file/ReadableStream.res +79 -0
  112. package/src/file/WritableStream.res +27 -0
  113. package/src/file/WritableStreamDefaultController.res +5 -0
  114. package/src/geometry/DOMMatrix.res +206 -0
  115. package/src/geometry/DOMMatrixReadOnly.res +140 -0
  116. package/src/geometry/DOMPoint.res +28 -0
  117. package/src/geometry/DOMPointReadOnly.res +22 -0
  118. package/src/geometry/DOMRect.res +22 -0
  119. package/src/geometry/DOMRectList.res +2 -0
  120. package/src/geometry/DOMRectReadOnly.res +19 -0
  121. package/src/html/HTMLAnchorElement.res +373 -0
  122. package/src/html/HTMLAreaElement.res +353 -0
  123. package/src/html/HTMLBRElement.res +9 -0
  124. package/src/html/HTMLBaseElement.res +20 -0
  125. package/src/html/HTMLBodyElement.res +9 -0
  126. package/src/html/HTMLButtonElement.res +98 -0
  127. package/src/html/HTMLDListElement.res +9 -0
  128. package/src/html/HTMLDataElement.res +14 -0
  129. package/src/html/HTMLDataListElement.res +14 -0
  130. package/src/html/HTMLDialogElement.res +40 -0
  131. package/src/html/HTMLDivElement.res +9 -0
  132. package/src/html/HTMLElement.res +108 -0
  133. package/src/html/HTMLEmbedElement.res +275 -0
  134. package/src/html/HTMLFieldSetElement.res +70 -0
  135. package/src/html/HTMLFormControlsCollection.res +21 -0
  136. package/src/html/HTMLFormElement.res +39 -0
  137. package/src/html/HTMLFrameSetElement.res +9 -0
  138. package/src/html/HTMLHRElement.res +9 -0
  139. package/src/html/HTMLHeadElement.res +256 -0
  140. package/src/html/HTMLHeadingElement.res +9 -0
  141. package/src/html/HTMLHtmlElement.res +9 -0
  142. package/src/html/HTMLIFrameElement.res +69 -0
  143. package/src/html/HTMLImageElement.res +349 -0
  144. package/src/html/HTMLInputElement.res +310 -0
  145. package/src/html/HTMLLIElement.res +9 -0
  146. package/src/html/HTMLLabelElement.res +25 -0
  147. package/src/html/HTMLLegendElement.res +14 -0
  148. package/src/html/HTMLLinkElement.res +69 -0
  149. package/src/html/HTMLMapElement.res +20 -0
  150. package/src/html/HTMLMenuElement.res +8 -0
  151. package/src/html/HTMLMetaElement.res +29 -0
  152. package/src/html/HTMLMeterElement.res +38 -0
  153. package/src/html/HTMLModElement.res +9 -0
  154. package/src/html/HTMLOListElement.res +24 -0
  155. package/src/html/HTMLObjectElement.res +89 -0
  156. package/src/html/HTMLOptGroupElement.res +19 -0
  157. package/src/html/HTMLOptionElement.res +49 -0
  158. package/src/html/HTMLOptionsCollection.res +35 -0
  159. package/src/html/HTMLOutputElement.res +73 -0
  160. package/src/html/HTMLParagraphElement.res +9 -0
  161. package/src/html/HTMLPictureElement.res +9 -0
  162. package/src/html/HTMLPreElement.res +9 -0
  163. package/src/html/HTMLProgressElement.res +29 -0
  164. package/src/html/HTMLQuoteElement.res +9 -0
  165. package/src/html/HTMLScriptElement.res +310 -0
  166. package/src/html/HTMLSelectElement.res +157 -0
  167. package/src/html/HTMLSlotElement.res +34 -0
  168. package/src/html/HTMLSourceElement.res +18 -0
  169. package/src/html/HTMLSpanElement.res +9 -0
  170. package/src/html/HTMLStyleElement.res +24 -0
  171. package/src/html/HTMLTableCaptionElement.res +9 -0
  172. package/src/html/HTMLTableCellElement.res +40 -0
  173. package/src/html/HTMLTableElement.res +100 -0
  174. package/src/html/HTMLTableRowElement.res +40 -0
  175. package/src/html/HTMLTableSectionElement.res +30 -0
  176. package/src/html/HTMLTemplateElement.res +31 -0
  177. package/src/html/HTMLTextAreaElement.res +177 -0
  178. package/src/html/HTMLTimeElement.res +14 -0
  179. package/src/html/HTMLTitleElement.res +15 -0
  180. package/src/html/HTMLUListElement.res +9 -0
  181. package/src/html/HTMLUnknownElement.res +9 -0
  182. package/src/media/BaseEncryptedMediaExtensions.res +97 -0
  183. package/src/media/DomHTMLMediaElement.res +206 -0
  184. package/src/media/EncryptedMediaExtensionsHTMLMediaElement.res +15 -0
  185. package/src/media/EncryptedMediaExtensionsTypes.res +43 -0
  186. package/src/media/HTMLAudioElement.res +9 -0
  187. package/src/media/HTMLTrackElement.res +14 -0
  188. package/src/media/HTMLVideoElement.res +78 -0
  189. package/src/media/MediaCapabilities.res +19 -0
  190. package/src/media/MediaCapabilitiesTypes.res +83 -0
  191. package/src/media/MediaCaptureAndStreamsTypes.res +197 -0
  192. package/src/media/MediaDeviceInfo.res +9 -0
  193. package/src/media/MediaDevices.res +40 -0
  194. package/src/media/MediaError.res +14 -0
  195. package/src/media/MediaKeySession.res +53 -0
  196. package/src/media/MediaKeyStatusMap.res +11 -0
  197. package/src/media/MediaKeySystemAccess.res +14 -0
  198. package/src/media/MediaKeys.res +35 -0
  199. package/src/media/MediaMetadata.res +10 -0
  200. package/src/media/MediaSession.res +25 -0
  201. package/src/media/MediaSessionTypes.res +85 -0
  202. package/src/media/MediaStream.res +89 -0
  203. package/src/media/MediaStreamTrack.res +51 -0
  204. package/src/media/PictureInPicture.res +7 -0
  205. package/src/media/PictureInPictureTypes.res +17 -0
  206. package/src/media/RemotePlayback.res +25 -0
  207. package/src/media/RemotePlaybackTypes.res +20 -0
  208. package/src/media/SpeechSynthesis.res +33 -0
  209. package/src/media/SpeechSynthesisUtterance.res +8 -0
  210. package/src/media/TextTrack.res +15 -0
  211. package/src/media/TextTrackCueList.res +9 -0
  212. package/src/media/TextTrackList.res +17 -0
  213. package/src/media/TimeRanges.res +29 -0
  214. package/src/media/VideoPlaybackQuality.res +18 -0
  215. package/src/media/WebSpeechTypes.res +83 -0
  216. package/src/media/WebVttTypes.res +123 -0
  217. package/src/messaging/ApplicationServerKey.res +2 -0
  218. package/src/messaging/ChannelMessagingTypes.res +12 -0
  219. package/src/messaging/CloseEvent.res +10 -0
  220. package/src/messaging/MessageEvent.res +43 -0
  221. package/src/messaging/MessagePort.res +38 -0
  222. package/src/messaging/Notification.res +46 -0
  223. package/src/messaging/NotificationTypes.res +107 -0
  224. package/src/messaging/PushEvent.res +3 -0
  225. package/src/messaging/PushManager.res +24 -0
  226. package/src/messaging/PushMessageData.res +15 -0
  227. package/src/messaging/PushSubscription.res +20 -0
  228. package/src/messaging/PushTypes.res +88 -0
  229. package/src/messaging/WebSocket.res +74 -0
  230. package/src/messaging/WebSocketsTypes.res +124 -0
  231. package/src/navigator/Clipboard.res +29 -0
  232. package/src/navigator/ClipboardItem.res +20 -0
  233. package/src/navigator/ClipboardTypes.res +31 -0
  234. package/src/navigator/CredentialManagementTypes.res +138 -0
  235. package/src/navigator/CredentialsContainer.res +33 -0
  236. package/src/navigator/Navigator.res +166 -0
  237. package/src/navigator/Permissions.res +10 -0
  238. package/src/navigator/PermissionsTypes.res +38 -0
  239. package/src/observers/IntersectionObserver.res +36 -0
  240. package/src/observers/IntersectionObserverRoot.res +23 -0
  241. package/src/observers/IntersectionObserverTypes.res +67 -0
  242. package/src/observers/MutationObserver.res +94 -0
  243. package/src/observers/ResizeObserver.res +30 -0
  244. package/src/observers/ResizeObserverTypes.res +56 -0
  245. package/src/performance/Performance.res +101 -0
  246. package/src/performance/PerformanceEntry.res +5 -0
  247. package/src/performance/PerformanceMark.res +16 -0
  248. package/src/performance/PerformanceTypes.res +86 -0
  249. package/src/storage/Cache.res +117 -0
  250. package/src/storage/CacheStorage.res +43 -0
  251. package/src/storage/CacheTypes.res +24 -0
  252. package/src/storage/IDBDatabase.res +54 -0
  253. package/src/storage/IDBFactory.res +34 -0
  254. package/src/storage/IDBIndex.res +83 -0
  255. package/src/storage/IDBObjectStore.res +183 -0
  256. package/src/storage/IDBTransaction.res +22 -0
  257. package/src/storage/IndexedDbTypes.res +213 -0
  258. package/src/storage/Storage.res +42 -0
  259. package/src/storage/StorageEvent.res +10 -0
  260. package/src/storage/StorageManager.res +24 -0
  261. package/src/storage/StorageTypes.res +11 -0
  262. package/src/storage/WebStorageTypes.res +57 -0
  263. package/src/svg/SVGElement.res +115 -0
  264. package/src/svg/SVGGraphicsElement.res +16 -0
  265. package/src/svg/SVGLength.res +9 -0
  266. package/src/ui-events/CompositionEvent.res +10 -0
  267. package/src/ui-events/DataTransfer.res +38 -0
  268. package/src/ui-events/DataTransferItem.res +21 -0
  269. package/src/ui-events/DataTransferItemList.res +34 -0
  270. package/src/ui-events/FocusEvent.res +10 -0
  271. package/src/ui-events/InputEvent.res +16 -0
  272. package/src/ui-events/KeyboardEvent.res +16 -0
  273. package/src/ui-events/MouseEvent.res +26 -0
  274. package/src/ui-events/PointerEvent.res +24 -0
  275. package/src/ui-events/Touch.res +5 -0
  276. package/src/ui-events/TouchEvent.res +10 -0
  277. package/src/ui-events/TouchList.res +5 -0
  278. package/src/ui-events/UIEvent.res +20 -0
  279. package/src/ui-events/UiEventsTypes.res +590 -0
  280. package/src/ui-events/WheelEvent.res +10 -0
  281. package/src/url/URL.res +38 -0
  282. package/src/url/URLSearchParams.res +104 -0
  283. package/src/url/UrlTypes.res +69 -0
  284. package/src/view-transitions/ViewTransition.res +5 -0
  285. package/src/view-transitions/ViewTransitionsTypes.res +22 -0
  286. package/src/web-audio/AnalyserNode.res +38 -0
  287. package/src/web-audio/AudioBuffer.res +33 -0
  288. package/src/web-audio/AudioBufferSourceNode.res +21 -0
  289. package/src/web-audio/AudioContext.res +59 -0
  290. package/src/web-audio/AudioDestinationNode.res +1 -0
  291. package/src/web-audio/AudioNode.res +76 -0
  292. package/src/web-audio/AudioParam.res +65 -0
  293. package/src/web-audio/AudioProcessingEvent.res +10 -0
  294. package/src/web-audio/AudioScheduledSourceNode.res +23 -0
  295. package/src/web-audio/AudioWorkletNode.res +11 -0
  296. package/src/web-audio/BaseAudioContext.res +141 -0
  297. package/src/web-audio/BiquadFilterNode.res +21 -0
  298. package/src/web-audio/ChannelMergerNode.res +10 -0
  299. package/src/web-audio/ChannelSplitterNode.res +10 -0
  300. package/src/web-audio/ConstantSourceNode.res +10 -0
  301. package/src/web-audio/ConvolverNode.res +10 -0
  302. package/src/web-audio/DelayNode.res +10 -0
  303. package/src/web-audio/DynamicsCompressorNode.res +10 -0
  304. package/src/web-audio/GainNode.res +10 -0
  305. package/src/web-audio/IIRFilterNode.res +21 -0
  306. package/src/web-audio/MediaElementAudioSourceNode.res +10 -0
  307. package/src/web-audio/MediaStreamAudioDestinationNode.res +10 -0
  308. package/src/web-audio/MediaStreamAudioSourceNode.res +10 -0
  309. package/src/web-audio/OfflineAudioCompletionEvent.res +10 -0
  310. package/src/web-audio/OfflineAudioContext.res +58 -0
  311. package/src/web-audio/OscillatorNode.res +17 -0
  312. package/src/web-audio/PannerNode.res +10 -0
  313. package/src/web-audio/PeriodicWave.res +8 -0
  314. package/src/web-audio/StereoPannerNode.res +10 -0
  315. package/src/web-audio/WaveShaperNode.res +10 -0
  316. package/src/web-audio/WebAudioTypes.res +1309 -0
  317. package/src/web-audio/Worklet.res +14 -0
  318. package/src/window/CustomElementRegistry.res +30 -0
  319. package/src/window/Document.res +470 -0
  320. package/src/window/DomGlobal.res +459 -0
  321. package/src/window/History.res +37 -0
  322. package/src/window/HistoryTypes.res +26 -0
  323. package/src/window/IdleDeadline.res +5 -0
  324. package/src/window/Location.res +108 -0
  325. package/src/window/VisualViewport.res +5 -0
  326. package/src/window/VisualViewportTypes.res +37 -0
  327. package/src/window/Window.res +556 -0
  328. package/src/window/XPathExpression.res +16 -0
  329. package/src/window/XPathResult.res +46 -0
  330. package/src/workers/Clients.res +39 -0
  331. package/src/workers/NavigationPreloadManager.res +26 -0
  332. package/src/workers/ServiceWorker.res +38 -0
  333. package/src/workers/ServiceWorkerContainer.res +34 -0
  334. package/src/workers/ServiceWorkerRegistration.res +32 -0
  335. package/src/workers/ServiceWorkerScope.res +12 -0
  336. package/src/workers/ServiceWorkerTypes.res +153 -0
  337. package/src/workers/SharedWorker.res +68 -0
  338. package/src/workers/SharedWorkerScope.res +29 -0
  339. package/src/workers/WebWorkersTypes.res +46 -0
  340. package/src/workers/Worker.res +48 -0
  341. package/src/workers/WorkerLocation.res +18 -0
@@ -0,0 +1,65 @@
1
+ external asWritableStream: FileTypes.fileSystemWritableFileStream => FileTypes.writableStream<'w> =
2
+ "%identity"
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
5
+ */
6
+ @send
7
+ external abort: (FileTypes.fileSystemWritableFileStream, ~reason: JSON.t=?) => promise<unit> =
8
+ "abort"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
12
+ */
13
+ @send
14
+ external close: FileTypes.fileSystemWritableFileStream => promise<unit> = "close"
15
+
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
18
+ */
19
+ @throws(JsExn) @send
20
+ external getWriter: FileTypes.fileSystemWritableFileStream => FileTypes.writableStreamDefaultWriter<
21
+ 'w,
22
+ > = "getWriter"
23
+
24
+ /**
25
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
26
+ */
27
+ @send
28
+ external write: (FileTypes.fileSystemWritableFileStream, DataView.t) => promise<unit> = "write"
29
+
30
+ /**
31
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
32
+ */
33
+ @send
34
+ external write2: (FileTypes.fileSystemWritableFileStream, ArrayBuffer.t) => promise<unit> = "write"
35
+
36
+ /**
37
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
38
+ */
39
+ @send
40
+ external write3: (FileTypes.fileSystemWritableFileStream, FileTypes.blob) => promise<unit> = "write"
41
+
42
+ /**
43
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
44
+ */
45
+ @send
46
+ external write4: (FileTypes.fileSystemWritableFileStream, string) => promise<unit> = "write"
47
+
48
+ /**
49
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
50
+ */
51
+ @send
52
+ external write5: (FileTypes.fileSystemWritableFileStream, FileTypes.writeParams) => promise<unit> =
53
+ "write"
54
+
55
+ /**
56
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/seek)
57
+ */
58
+ @send
59
+ external seek: (FileTypes.fileSystemWritableFileStream, int) => promise<unit> = "seek"
60
+
61
+ /**
62
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/truncate)
63
+ */
64
+ @send
65
+ external truncate: (FileTypes.fileSystemWritableFileStream, int) => promise<unit> = "truncate"
@@ -0,0 +1,225 @@
1
+ @@warning("-30")
2
+
3
+ type endingType =
4
+ | @as("native") Native
5
+ | @as("transparent") Transparent
6
+
7
+ type readableStreamReaderMode = | @as("byob") Byob
8
+
9
+ type fileSystemHandleKind =
10
+ | @as("directory") Directory
11
+ | @as("file") File
12
+
13
+ type writeCommandType =
14
+ | @as("seek") Seek
15
+ | @as("truncate") Truncate
16
+ | @as("write") Write
17
+
18
+ /**
19
+ A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The WebApiFile interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
20
+ [See Blob on MDN](https://developer.mozilla.org/docs/Web/API/Blob)
21
+ */
22
+ @editor.completeFrom(Blob)
23
+ type blob = DOM.blob = private {
24
+ /**
25
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/size)
26
+ */
27
+ size: int,
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/type)
30
+ */
31
+ @as("type")
32
+ type_: string,
33
+ }
34
+
35
+ /**
36
+ This Streams API interface represents a readable stream of byte data. The WebApiFetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
37
+ [See ReadableStream on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
38
+ */
39
+ @editor.completeFrom(ReadableStream)
40
+ type readableStream<'r> = {
41
+ /**
42
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked)
43
+ */
44
+ locked: bool,
45
+ }
46
+
47
+ /**
48
+ This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
49
+ [See WritableStream on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream)
50
+ */
51
+ type writableStream<'w> = {
52
+ /**
53
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
54
+ */
55
+ locked: bool,
56
+ }
57
+
58
+ /**
59
+ This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
60
+ [See WritableStreamDefaultController on MDN](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
61
+ */
62
+ @editor.completeFrom(WritableStreamDefaultController)
63
+ type writableStreamDefaultController = private {
64
+ /**
65
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal)
66
+ */
67
+ signal: DOM.abortSignal,
68
+ }
69
+
70
+ /**
71
+ Provides information about files and allows JavaScript in a web page to access their content.
72
+ [See WebApiFile on MDN](https://developer.mozilla.org/docs/Web/API/File)
73
+ */
74
+ @editor.completeFrom(File)
75
+ type file = DOM.file = private {
76
+ ...blob,
77
+ /**
78
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/name)
79
+ */
80
+ name: string,
81
+ /**
82
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/lastModified)
83
+ */
84
+ lastModified: int,
85
+ /**
86
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/webkitRelativePath)
87
+ */
88
+ webkitRelativePath: string,
89
+ }
90
+
91
+ /**
92
+ [See FileSystemHandle on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle)
93
+ */
94
+ @editor.completeFrom(FileSystemHandle)
95
+ type fileSystemHandle = private {
96
+ /**
97
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/kind)
98
+ */
99
+ kind: fileSystemHandleKind,
100
+ /**
101
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/name)
102
+ */
103
+ name: string,
104
+ }
105
+
106
+ /**
107
+ [See FileSystemDirectoryHandle on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle)
108
+ */
109
+ @editor.completeFrom(FileSystemDirectoryHandle)
110
+ type fileSystemDirectoryHandle = private {
111
+ ...fileSystemHandle,
112
+ }
113
+
114
+ /**
115
+ [See FileSystemFileHandle on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle)
116
+ */
117
+ @editor.completeFrom(FileSystemFileHandle)
118
+ type fileSystemFileHandle = private {
119
+ ...fileSystemHandle,
120
+ }
121
+
122
+ /**
123
+ [See FileSystemWritableFileStream on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream)
124
+ */
125
+ @editor.completeFrom(FileSystemWritableFileStream)
126
+ type fileSystemWritableFileStream = private {
127
+ ...writableStream<unknown>,
128
+ }
129
+
130
+ @unboxed
131
+ type blobPart =
132
+ | String(string)
133
+ | Blob(blob)
134
+ // | ArrayBuffer(ArrayBuffer.t)
135
+ // | TypedArray(TypedArray.t<int>)
136
+
137
+ type queuingStrategy<'t> = unknown
138
+
139
+ type underlyingSink<'t> = unknown
140
+
141
+ type underlyingSource<'t> = unknown
142
+
143
+ type readableStreamReader<'t> = unknown
144
+
145
+ type writableStreamDefaultWriter<'t> = unknown
146
+
147
+ type fileSystemWriteChunkType = unknown
148
+
149
+ type underlyingSourceCancelCallback = JSON.t => promise<unit>
150
+
151
+ type blobPropertyBag = {
152
+ @as("type") mutable type_?: string,
153
+ mutable endings?: endingType,
154
+ }
155
+
156
+ type underlyingByteSource = {
157
+ @as("type") mutable type_: unknown,
158
+ mutable autoAllocateChunkSize?: int,
159
+ mutable start?: unknown,
160
+ mutable pull?: unknown,
161
+ mutable cancel?: underlyingSourceCancelCallback,
162
+ }
163
+
164
+ type readableStreamGetReaderOptions = {
165
+ /**
166
+ Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
167
+
168
+ This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
169
+ */
170
+ mutable mode?: readableStreamReaderMode,
171
+ }
172
+
173
+ type readableWritablePair<'r, 'w> = {
174
+ mutable readable: readableStream<'r>,
175
+ /**
176
+ Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
177
+
178
+ Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
179
+ */
180
+ mutable writable: writableStream<'w>,
181
+ }
182
+
183
+ type streamPipeOptions = {
184
+ /**
185
+ Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
186
+
187
+ Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
188
+
189
+ Errors and closures of the source and destination streams propagate as follows:
190
+
191
+ An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
192
+
193
+ An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
194
+
195
+ When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
196
+
197
+ If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
198
+
199
+ The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding Event.AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
200
+ */
201
+ mutable preventClose?: bool,
202
+ mutable preventAbort?: bool,
203
+ mutable preventCancel?: bool,
204
+ mutable signal?: DOM.abortSignal,
205
+ }
206
+
207
+ type filePropertyBag = {
208
+ ...blobPropertyBag,
209
+ mutable lastModified?: int,
210
+ }
211
+
212
+ type fileSystemGetFileOptions = {mutable create?: bool}
213
+
214
+ type fileSystemGetDirectoryOptions = {mutable create?: bool}
215
+
216
+ type fileSystemRemoveOptions = {mutable recursive?: bool}
217
+
218
+ type fileSystemCreateWritableOptions = {mutable keepExistingData?: bool}
219
+
220
+ type writeParams = {
221
+ @as("type") mutable type_: writeCommandType,
222
+ mutable size?: Nullable.t<int>,
223
+ mutable position?: Nullable.t<int>,
224
+ mutable data?: Nullable.t<unknown>,
225
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
3
+ */
4
+ type t<'r> = FileTypes.readableStream<'r>
5
+
6
+ /**
7
+ `make()`
8
+
9
+ Creates a new empty `ReadableStream`.
10
+
11
+ ```res
12
+ let stream: ReadableStream.t<string> = ReadableStream.make()
13
+ ```
14
+
15
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
16
+ */
17
+ @new
18
+ external make: unit => t<'t> = "ReadableStream"
19
+
20
+ /**
21
+ `fromUnderlyingSource(underlyingSource<'t>, ~strategy: queuingStrategy<'t>=?)`
22
+
23
+ Creates a new `ReadableStream` from an `underlyingSource`, with an optional queuing strategy.
24
+
25
+ ```res
26
+ let stream = ReadableStream.fromUnderlyingSource(myUnderlyingSource)
27
+
28
+ let streamWithStrategy =
29
+ ReadableStream.fromUnderlyingSource(myUnderlyingSource, ~strategy=myQueuingStrategy)
30
+ ```
31
+
32
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
33
+ */
34
+ @throws(JsExn) @new
35
+ external fromUnderlyingSource: (
36
+ FileTypes.underlyingSource<'t>,
37
+ ~strategy: FileTypes.queuingStrategy<'t>=?,
38
+ ) => t<'t> = "ReadableStream"
39
+
40
+ /**
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
42
+ */
43
+ @send
44
+ external cancel: (t<'r>, ~reason: JSON.t=?) => promise<unit> = "cancel"
45
+
46
+ /**
47
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
48
+ */
49
+ @throws(JsExn) @send
50
+ external getReader: (
51
+ t<'r>,
52
+ ~options: FileTypes.readableStreamGetReaderOptions=?,
53
+ ) => FileTypes.readableStreamReader<'r> = "getReader"
54
+
55
+ /**
56
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
57
+ */
58
+ @throws(JsExn) @send
59
+ external pipeThrough: (
60
+ t<'r>,
61
+ ~transform: FileTypes.readableWritablePair<'t, 'r>,
62
+ ~options: FileTypes.streamPipeOptions=?,
63
+ ) => t<'t> = "pipeThrough"
64
+
65
+ /**
66
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
67
+ */
68
+ @send
69
+ external pipeTo: (
70
+ t<'r>,
71
+ ~destination: FileTypes.writableStream<'r>,
72
+ ~options: FileTypes.streamPipeOptions=?,
73
+ ) => promise<unit> = "pipeTo"
74
+
75
+ /**
76
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
77
+ */
78
+ @throws(JsExn) @send
79
+ external tee: t<'r> => array<t<unit>> = "tee"
@@ -0,0 +1,27 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream)
3
+ */
4
+ @throws(JsExn) @new
5
+ external make: (
6
+ ~underlyingSink: FileTypes.underlyingSink<'w>=?,
7
+ ~strategy: FileTypes.queuingStrategy<'w>=?,
8
+ ) => FileTypes.writableStream<'w> = "WritableStream"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
12
+ */
13
+ @send
14
+ external abort: (FileTypes.writableStream<'w>, ~reason: JSON.t=?) => promise<unit> = "abort"
15
+
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
18
+ */
19
+ @send
20
+ external close: FileTypes.writableStream<'w> => promise<unit> = "close"
21
+
22
+ /**
23
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
24
+ */
25
+ @throws(JsExn) @send
26
+ external getWriter: FileTypes.writableStream<'w> => FileTypes.writableStreamDefaultWriter<'w> =
27
+ "getWriter"
@@ -0,0 +1,5 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
3
+ */
4
+ @send
5
+ external error: (FileTypes.writableStreamDefaultController, ~e: JSON.t=?) => unit = "error"
@@ -0,0 +1,206 @@
1
+ /**
2
+ `make()`
3
+
4
+ Creates a new identity `DOMMatrix`.
5
+
6
+ ```res
7
+ let matrix = DOMMatrix.make()
8
+ ```
9
+
10
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
11
+ */
12
+ @new
13
+ external make: unit => DOM.domMatrix = "DOMMatrix"
14
+
15
+ /**
16
+ `fromString(string)`
17
+
18
+ Creates a new `DOMMatrix` from a transform string.
19
+
20
+ ```res
21
+ let matrix = DOMMatrix.fromString("matrix(1, 0, 0, 1, 0, 0)")
22
+ ```
23
+
24
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
25
+ */
26
+ @throws(JsExn) @new
27
+ external fromString: string => DOM.domMatrix = "DOMMatrix"
28
+
29
+ /**
30
+ `fromArray(array<float>)`
31
+
32
+ Creates a new `DOMMatrix` from an array of matrix component values.
33
+
34
+ ```res
35
+ let matrix = DOMMatrix.fromArray([1., 0., 0., 1., 0., 0.])
36
+ ```
37
+
38
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
39
+ */
40
+ @throws(JsExn) @new
41
+ external fromArray: array<float> => DOM.domMatrix = "DOMMatrix"
42
+
43
+ external asDOMMatrixReadOnly: DOM.domMatrix => DOM.domMatrixReadOnly = "%identity"
44
+ @scope("DOMMatrix")
45
+ external fromMatrix: (~other: DOM.domMatrixInit=?) => DOM.domMatrixReadOnly = "fromMatrix"
46
+
47
+ @throws(JsExn) @scope("DOMMatrix")
48
+ external fromFloat32Array: array<float> => DOM.domMatrixReadOnly = "fromFloat32Array"
49
+
50
+ @throws(JsExn) @scope("DOMMatrix")
51
+ external fromFloat64Array: Float64Array.t => DOM.domMatrixReadOnly = "fromFloat64Array"
52
+
53
+ /**
54
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate)
55
+ */
56
+ @send
57
+ external translate: (DOM.domMatrix, ~tx: float=?, ~ty: float=?, ~tz: float=?) => DOM.domMatrix =
58
+ "translate"
59
+
60
+ /**
61
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale)
62
+ */
63
+ @send
64
+ external scale: (
65
+ DOM.domMatrix,
66
+ ~scaleX: float=?,
67
+ ~scaleY: float=?,
68
+ ~scaleZ: float=?,
69
+ ~originX: float=?,
70
+ ~originY: float=?,
71
+ ~originZ: float=?,
72
+ ) => DOM.domMatrix = "scale"
73
+
74
+ @send
75
+ external scale3d: (
76
+ DOM.domMatrix,
77
+ ~scale: float=?,
78
+ ~originX: float=?,
79
+ ~originY: float=?,
80
+ ~originZ: float=?,
81
+ ) => DOM.domMatrix = "scale3d"
82
+
83
+ @send
84
+ external rotate: (DOM.domMatrix, ~rotX: float=?, ~rotY: float=?, ~rotZ: float=?) => DOM.domMatrix =
85
+ "rotate"
86
+
87
+ @send
88
+ external rotateFromVector: (DOM.domMatrix, ~x: float=?, ~y: float=?) => DOM.domMatrix =
89
+ "rotateFromVector"
90
+
91
+ @send
92
+ external rotateAxisAngle: (
93
+ DOM.domMatrix,
94
+ ~x: float=?,
95
+ ~y: float=?,
96
+ ~z: float=?,
97
+ ~angle: float=?,
98
+ ) => DOM.domMatrix = "rotateAxisAngle"
99
+
100
+ @send
101
+ external skewX: (DOM.domMatrix, ~sx: float=?) => DOM.domMatrix = "skewX"
102
+
103
+ @send
104
+ external skewY: (DOM.domMatrix, ~sy: float=?) => DOM.domMatrix = "skewY"
105
+
106
+ @send
107
+ external multiply: (DOM.domMatrix, ~other: DOM.domMatrixInit=?) => DOM.domMatrix = "multiply"
108
+
109
+ /**
110
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX)
111
+ */
112
+ @send
113
+ external flipX: DOM.domMatrix => DOM.domMatrix = "flipX"
114
+
115
+ @send
116
+ external flipY: DOM.domMatrix => DOM.domMatrix = "flipY"
117
+
118
+ @send
119
+ external inverse: DOM.domMatrix => DOM.domMatrix = "inverse"
120
+
121
+ @send
122
+ external transformPoint: (DOM.domMatrix, ~point: DOM.domPointInit=?) => DOM.domPoint =
123
+ "transformPoint"
124
+
125
+ @send
126
+ external toFloat32Array: DOM.domMatrix => array<float> = "toFloat32Array"
127
+
128
+ @send
129
+ external toFloat64Array: DOM.domMatrix => Float64Array.t = "toFloat64Array"
130
+
131
+ @send
132
+ external toJSON: DOM.domMatrix => Dict.t<string> = "toJSON"
133
+
134
+ @scope("DOMMatrix")
135
+ external fromMatrixD: (~other: DOM.domMatrixInit=?) => DOM.domMatrix = "fromMatrix"
136
+
137
+ @throws(JsExn) @scope("DOMMatrix")
138
+ external fromFloat32ArrayD: array<float> => DOM.domMatrix = "fromFloat32Array"
139
+
140
+ @throws(JsExn) @scope("DOMMatrix")
141
+ external fromFloat64ArrayD: Float64Array.t => DOM.domMatrix = "fromFloat64Array"
142
+
143
+ @send
144
+ external multiplySelf: (DOM.domMatrix, ~other: DOM.domMatrixInit=?) => DOM.domMatrix =
145
+ "multiplySelf"
146
+
147
+ @send
148
+ external preMultiplySelf: (DOM.domMatrix, ~other: DOM.domMatrixInit=?) => DOM.domMatrix =
149
+ "preMultiplySelf"
150
+
151
+ @send
152
+ external translateSelf: (DOM.domMatrix, ~tx: float=?, ~ty: float=?, ~tz: float=?) => DOM.domMatrix =
153
+ "translateSelf"
154
+
155
+ @send
156
+ external scaleSelf: (
157
+ DOM.domMatrix,
158
+ ~scaleX: float=?,
159
+ ~scaleY: float=?,
160
+ ~scaleZ: float=?,
161
+ ~originX: float=?,
162
+ ~originY: float=?,
163
+ ~originZ: float=?,
164
+ ) => DOM.domMatrix = "scaleSelf"
165
+
166
+ @send
167
+ external scale3dSelf: (
168
+ DOM.domMatrix,
169
+ ~scale: float=?,
170
+ ~originX: float=?,
171
+ ~originY: float=?,
172
+ ~originZ: float=?,
173
+ ) => DOM.domMatrix = "scale3dSelf"
174
+
175
+ @send
176
+ external rotateSelf: (
177
+ DOM.domMatrix,
178
+ ~rotX: float=?,
179
+ ~rotY: float=?,
180
+ ~rotZ: float=?,
181
+ ) => DOM.domMatrix = "rotateSelf"
182
+
183
+ @send
184
+ external rotateFromVectorSelf: (DOM.domMatrix, ~x: float=?, ~y: float=?) => DOM.domMatrix =
185
+ "rotateFromVectorSelf"
186
+
187
+ @send
188
+ external rotateAxisAngleSelf: (
189
+ DOM.domMatrix,
190
+ ~x: float=?,
191
+ ~y: float=?,
192
+ ~z: float=?,
193
+ ~angle: float=?,
194
+ ) => DOM.domMatrix = "rotateAxisAngleSelf"
195
+
196
+ @send
197
+ external skewXSelf: (DOM.domMatrix, ~sx: float=?) => DOM.domMatrix = "skewXSelf"
198
+
199
+ @send
200
+ external skewYSelf: (DOM.domMatrix, ~sy: float=?) => DOM.domMatrix = "skewYSelf"
201
+
202
+ @send
203
+ external invertSelf: DOM.domMatrix => DOM.domMatrix = "invertSelf"
204
+
205
+ @throws(JsExn) @send
206
+ external setMatrixValue: (DOM.domMatrix, string) => DOM.domMatrix = "setMatrixValue"