@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,74 @@
1
+ type t = WebSocketsTypes.webSocket = private {...WebSocketsTypes.webSocket}
2
+ type binaryType = WebSocketsTypes.binaryType
3
+ type messageEvent<'t> = WebSocketsTypes.messageEvent<'t> = {...WebSocketsTypes.messageEvent<'t>}
4
+ type closeEvent = WebSocketsTypes.closeEvent = private {...WebSocketsTypes.closeEvent}
5
+ type messageEventSource = WebSocketsTypes.messageEventSource
6
+
7
+ /**
8
+ `fromURL(~url: string, ~protocols: string=?)`
9
+
10
+ Creates a new `WebSocket` from a URL and an optional single protocol.
11
+
12
+ ```res
13
+ let socket = WebSocket.fromURL(~url="wss://example.com/socket")
14
+ ```
15
+
16
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
17
+ */
18
+ @throws(JsExn) @new
19
+ external fromURL: (~url: string, ~protocols: string=?) => t = "WebSocket"
20
+
21
+ /**
22
+ `fromURLWithProtocols(~url: string, ~protocols: array<string>)`
23
+
24
+ Creates a new `WebSocket` from a URL and multiple protocols.
25
+
26
+ ```res
27
+ let socket =
28
+ WebSocket.fromURLWithProtocols(
29
+ ~url="wss://example.com/socket",
30
+ ~protocols=["chat", "superchat"],
31
+ )
32
+ ```
33
+
34
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
35
+ */
36
+ @throws(JsExn) @new
37
+ external fromURLWithProtocols: (~url: string, ~protocols: array<string>) => t = "WebSocket"
38
+
39
+ include EventTarget.Impl({type t = t})
40
+
41
+ /**
42
+ Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
43
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
44
+ */
45
+ @throws(JsExn) @send
46
+ external close: (t, ~code: int=?, ~reason: string=?) => unit = "close"
47
+
48
+ /**
49
+ Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
50
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
51
+ */
52
+ @throws(JsExn) @send
53
+ external send: (t, DataView.t) => unit = "send"
54
+
55
+ /**
56
+ Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
57
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
58
+ */
59
+ @throws(JsExn)
60
+ external sendArrayBuffer: (t, ArrayBuffer.t) => unit = "send"
61
+
62
+ /**
63
+ Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
64
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
65
+ */
66
+ @throws(JsExn)
67
+ external sendBlob: (t, Blob.t) => unit = "send"
68
+
69
+ /**
70
+ Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
71
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
72
+ */
73
+ @throws(JsExn)
74
+ external sendString: (t, string) => unit = "send"
@@ -0,0 +1,124 @@
1
+ @@warning("-30")
2
+
3
+ type binaryType =
4
+ | @as("arraybuffer") Arraybuffer
5
+ | @as("blob") Blob
6
+
7
+ type messageEventSource = unknown
8
+
9
+ /**
10
+ Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
11
+ [See WebSocket on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
12
+ TODO: mark as private once mutating fields of private records is allowed
13
+ */
14
+ @editor.completeFrom(WebSocket)
15
+ type webSocket = {
16
+ ...DOM.eventTarget,
17
+ /**
18
+ Returns the WebApiURL that was used to establish the WebSocket connection.
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
20
+ */
21
+ url: string,
22
+ /**
23
+ Returns the state of the WebSocket object's connection. It can have the values described below.
24
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
25
+ */
26
+ readyState: int,
27
+ /**
28
+ Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network.
29
+
30
+ If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.)
31
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/bufferedAmount)
32
+ */
33
+ bufferedAmount: int,
34
+ /**
35
+ Returns the extensions selected by the server, if any.
36
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
37
+ */
38
+ extensions: string,
39
+ /**
40
+ Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
42
+ */
43
+ protocol: string,
44
+ /**
45
+ Returns a string that indicates how binary data from the WebSocket object is exposed to scripts:
46
+
47
+ Can be set, to change how binary data is returned. The default is "blob".
48
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
49
+ */
50
+ mutable binaryType: binaryType,
51
+ }
52
+
53
+ /**
54
+ A CloseEvent is sent to clients using WebApiWebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
55
+ [See CloseEvent on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent)
56
+ */
57
+ @editor.completeFrom(CloseEvent)
58
+ type closeEvent = private {
59
+ ...DOM.event,
60
+ /**
61
+ Returns true if the connection closed cleanly; false otherwise.
62
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
63
+ */
64
+ wasClean: bool,
65
+ /**
66
+ Returns the WebSocket connection close code provided by the server.
67
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
68
+ */
69
+ code: int,
70
+ /**
71
+ Returns the WebSocket connection close reason provided by the server.
72
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
73
+ */
74
+ reason: string,
75
+ }
76
+
77
+ /**
78
+ A message received by a target object.
79
+ [See MessageEvent on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent)
80
+ */
81
+ type messageEvent<'t> = {
82
+ ...DOM.event,
83
+ /**
84
+ Returns the data of the message.
85
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
86
+ */
87
+ data: 't,
88
+ /**
89
+ Returns the origin of the message, for server-sent events and cross-document messaging.
90
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
91
+ */
92
+ origin: string,
93
+ /**
94
+ Returns the last event ID string, for server-sent events.
95
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
96
+ */
97
+ lastEventId: string,
98
+ /**
99
+ Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.
100
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
101
+ */
102
+ source: Null.t<messageEventSource>,
103
+ /**
104
+ Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.
105
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
106
+ */
107
+ ports: array<ChannelMessagingTypes.messagePort>,
108
+ }
109
+
110
+ type closeEventInit = {
111
+ ...Event.eventInit,
112
+ mutable wasClean?: bool,
113
+ mutable code?: int,
114
+ mutable reason?: string,
115
+ }
116
+
117
+ type messageEventInit<'t> = {
118
+ ...Event.eventInit,
119
+ mutable data?: 't,
120
+ mutable origin?: string,
121
+ mutable lastEventId?: string,
122
+ mutable source?: Nullable.t<messageEventSource>,
123
+ mutable ports?: array<ChannelMessagingTypes.messagePort>,
124
+ }
@@ -0,0 +1,29 @@
1
+ include EventTarget.Impl({type t = ClipboardTypes.clipboard})
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read)
5
+ */
6
+ @send
7
+ external read: ClipboardTypes.clipboard => promise<array<ClipboardTypes.clipboardItem>> = "read"
8
+
9
+ /**
10
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/readText)
11
+ */
12
+ @send
13
+ external readText: ClipboardTypes.clipboard => promise<string> = "readText"
14
+
15
+ /**
16
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/write)
17
+ */
18
+ @send
19
+ external write: (ClipboardTypes.clipboard, array<ClipboardTypes.clipboardItem>) => promise<unit> =
20
+ "write"
21
+
22
+ /**
23
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText)
24
+ */
25
+ @send
26
+ external writeText: (ClipboardTypes.clipboard, string) => promise<unit> = "writeText"
27
+
28
+ module ClipboardItem = ClipboardItem
29
+ module Types = ClipboardTypes
@@ -0,0 +1,20 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem)
3
+ */
4
+ @new
5
+ external make: (
6
+ ~items: unknown,
7
+ ~options: ClipboardTypes.clipboardItemOptions=?,
8
+ ) => ClipboardTypes.clipboardItem = "ClipboardItem"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType)
12
+ */
13
+ @send
14
+ external getType: (ClipboardTypes.clipboardItem, string) => promise<FileTypes.blob> = "getType"
15
+
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/supports_static)
18
+ */
19
+ @scope("ClipboardItem")
20
+ external supports: string => bool = "supports"
@@ -0,0 +1,31 @@
1
+ @@warning("-30")
2
+
3
+ type presentationStyle =
4
+ | @as("attachment") Attachment
5
+ | @as("inline") Inline
6
+ | @as("unspecified") Unspecified
7
+
8
+ /**
9
+ [See ClipboardItem on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem)
10
+ */
11
+ @editor.completeFrom(ClipboardItem)
12
+ type clipboardItem = private {
13
+ /**
14
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/presentationStyle)
15
+ */
16
+ presentationStyle: presentationStyle,
17
+ /**
18
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/types)
19
+ */
20
+ types: array<string>,
21
+ }
22
+
23
+ /**
24
+ [See WebApiClipboard on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard)
25
+ */
26
+ @editor.completeFrom(WebApiClipboard)
27
+ type clipboard = private {
28
+ ...DOM.eventTarget,
29
+ }
30
+
31
+ type clipboardItemOptions = {mutable presentationStyle?: presentationStyle}
@@ -0,0 +1,138 @@
1
+ @@warning("-30")
2
+
3
+ type authenticatorTransport =
4
+ | @as("ble") Ble
5
+ | @as("hybrid") Hybrid
6
+ | @as("internal") Internal
7
+ | @as("nfc") Nfc
8
+ | @as("usb") Usb
9
+
10
+ type credentialMediationRequirement =
11
+ | @as("conditional") Conditional
12
+ | @as("optional") Optional
13
+ | @as("required") Required
14
+ | @as("silent") Silent
15
+
16
+ type publicKeyCredentialType = | @as("public-key") PublicKey
17
+
18
+ type userVerificationRequirement =
19
+ | @as("discouraged") Discouraged
20
+ | @as("preferred") Preferred
21
+ | @as("required") Required
22
+
23
+ type authenticatorAttachment =
24
+ | @as("cross-platform") CrossPlatform
25
+ | @as("platform") Platform
26
+
27
+ type residentKeyRequirement =
28
+ | @as("discouraged") Discouraged
29
+ | @as("preferred") Preferred
30
+ | @as("required") Required
31
+
32
+ type attestationConveyancePreference =
33
+ | @as("direct") Direct
34
+ | @as("enterprise") Enterprise
35
+ | @as("indirect") Indirect
36
+ | @as("none") None
37
+
38
+ /**
39
+ [See CredentialsContainer on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer)
40
+ */
41
+ @editor.completeFrom(CredentialsContainer)
42
+ type credentialsContainer = private {}
43
+
44
+ /**
45
+ [See Credential on MDN](https://developer.mozilla.org/docs/Web/API/Credential)
46
+ */
47
+ type credential = {
48
+ /**
49
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Credential/id)
50
+ */
51
+ id: string,
52
+ /**
53
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Credential/type)
54
+ */
55
+ @as("type")
56
+ type_: string,
57
+ }
58
+
59
+ type publicKeyCredentialDescriptor = {
60
+ @as("type") mutable type_: publicKeyCredentialType,
61
+ mutable id: ArrayBufferTypedArrayOrDataView.t,
62
+ mutable transports?: array<authenticatorTransport>,
63
+ }
64
+
65
+ type authenticationExtensionsPRFValues = {
66
+ mutable first: ArrayBufferTypedArrayOrDataView.t,
67
+ mutable second?: ArrayBufferTypedArrayOrDataView.t,
68
+ }
69
+
70
+ type authenticationExtensionsPRFInputs = {
71
+ mutable eval?: authenticationExtensionsPRFValues,
72
+ mutable evalByCredential?: unknown,
73
+ }
74
+
75
+ type authenticationExtensionsClientInputs = {
76
+ mutable minPinLength?: bool,
77
+ mutable hmacCreateSecret?: bool,
78
+ mutable appid?: string,
79
+ mutable credProps?: bool,
80
+ mutable prf?: authenticationExtensionsPRFInputs,
81
+ }
82
+
83
+ type publicKeyCredentialRequestOptions = {
84
+ mutable challenge: ArrayBufferTypedArrayOrDataView.t,
85
+ mutable timeout?: int,
86
+ mutable rpId?: string,
87
+ mutable allowCredentials?: array<publicKeyCredentialDescriptor>,
88
+ mutable userVerification?: userVerificationRequirement,
89
+ mutable extensions?: authenticationExtensionsClientInputs,
90
+ }
91
+
92
+ type credentialRequestOptions = {
93
+ mutable mediation?: credentialMediationRequirement,
94
+ mutable signal?: DOM.abortSignal,
95
+ mutable publicKey?: publicKeyCredentialRequestOptions,
96
+ }
97
+
98
+ type publicKeyCredentialEntity = {mutable name: string}
99
+
100
+ type publicKeyCredentialRpEntity = {
101
+ ...publicKeyCredentialEntity,
102
+ mutable id?: string,
103
+ }
104
+
105
+ type publicKeyCredentialUserEntity = {
106
+ ...publicKeyCredentialEntity,
107
+ mutable id: ArrayBufferTypedArrayOrDataView.t,
108
+ mutable displayName: string,
109
+ }
110
+
111
+ type publicKeyCredentialParameters = {
112
+ @as("type") mutable type_: publicKeyCredentialType,
113
+ mutable alg: int,
114
+ }
115
+
116
+ type authenticatorSelectionCriteria = {
117
+ mutable authenticatorAttachment?: authenticatorAttachment,
118
+ mutable residentKey?: residentKeyRequirement,
119
+ mutable requireResidentKey?: bool,
120
+ mutable userVerification?: userVerificationRequirement,
121
+ }
122
+
123
+ type publicKeyCredentialCreationOptions = {
124
+ mutable rp: publicKeyCredentialRpEntity,
125
+ mutable user: publicKeyCredentialUserEntity,
126
+ mutable challenge: ArrayBufferTypedArrayOrDataView.t,
127
+ mutable pubKeyCredParams: array<publicKeyCredentialParameters>,
128
+ mutable timeout?: int,
129
+ mutable excludeCredentials?: array<publicKeyCredentialDescriptor>,
130
+ mutable authenticatorSelection?: authenticatorSelectionCriteria,
131
+ mutable attestation?: attestationConveyancePreference,
132
+ mutable extensions?: authenticationExtensionsClientInputs,
133
+ }
134
+
135
+ type credentialCreationOptions = {
136
+ mutable signal?: DOM.abortSignal,
137
+ mutable publicKey?: publicKeyCredentialCreationOptions,
138
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get)
3
+ */
4
+ @send
5
+ external get: (
6
+ CredentialManagementTypes.credentialsContainer,
7
+ ~options: CredentialManagementTypes.credentialRequestOptions=?,
8
+ ) => promise<Null.t<CredentialManagementTypes.credential>> = "get"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store)
12
+ */
13
+ @send
14
+ external store: (
15
+ CredentialManagementTypes.credentialsContainer,
16
+ CredentialManagementTypes.credential,
17
+ ) => promise<unit> = "store"
18
+
19
+ /**
20
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create)
21
+ */
22
+ @send
23
+ external create: (
24
+ CredentialManagementTypes.credentialsContainer,
25
+ ~options: CredentialManagementTypes.credentialCreationOptions=?,
26
+ ) => promise<Null.t<CredentialManagementTypes.credential>> = "create"
27
+
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess)
30
+ */
31
+ @send
32
+ external preventSilentAccess: CredentialManagementTypes.credentialsContainer => promise<unit> =
33
+ "preventSilentAccess"
@@ -0,0 +1,166 @@
1
+ type t = DOM.navigator
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/clipboard)
5
+ */
6
+ @get external clipboard: t => ClipboardTypes.clipboard = "clipboard"
7
+
8
+ /**
9
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/credentials)
10
+ */
11
+ @get external credentials: t => CredentialManagementTypes.credentialsContainer = "credentials"
12
+
13
+ /**
14
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/geolocation)
15
+ */
16
+ @get external geolocation: t => GeolocationTypes.geolocation = "geolocation"
17
+
18
+ /**
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/userActivation)
20
+ */
21
+ @get external userActivation: t => DOM.userActivation = "userActivation"
22
+
23
+ /**
24
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/mediaCapabilities)
25
+ */
26
+ @get external mediaCapabilities: t => MediaCapabilitiesTypes.mediaCapabilities = "mediaCapabilities"
27
+
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/mediaDevices)
30
+ */
31
+ @get external mediaDevices: t => MediaCaptureAndStreamsTypes.mediaDevices = "mediaDevices"
32
+
33
+ /**
34
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/mediaSession)
35
+ */
36
+ @get external mediaSession: t => MediaSessionTypes.mediaSession = "mediaSession"
37
+
38
+ /**
39
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/permissions)
40
+ */
41
+ @get external permissions: t => PermissionsTypes.permissions = "permissions"
42
+
43
+ /**
44
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/maxTouchPoints)
45
+ */
46
+ @get external maxTouchPoints: t => int = "maxTouchPoints"
47
+
48
+ /**
49
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/wakeLock)
50
+ */
51
+ @get external wakeLock: t => ScreenWakeLockTypes.wakeLock = "wakeLock"
52
+
53
+ /**
54
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/serviceWorker)
55
+ */
56
+ @get external serviceWorker: t => ServiceWorkerTypes.serviceWorkerContainer = "serviceWorker"
57
+
58
+ /**
59
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/userAgent)
60
+ */
61
+ @get external userAgent: t => string = "userAgent"
62
+
63
+ /**
64
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/language)
65
+ */
66
+ @get external language: t => string = "language"
67
+ /**
68
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/languages)
69
+ */
70
+ @get external languages: t => array<string> = "languages"
71
+ /**
72
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/onLine)
73
+ */
74
+ @get external onLine: t => bool = "onLine"
75
+ /**
76
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/cookieEnabled)
77
+ */
78
+ @get external cookieEnabled: t => bool = "cookieEnabled"
79
+ /**
80
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/pdfViewerEnabled)
81
+ */
82
+ @get external pdfViewerEnabled: t => bool = "pdfViewerEnabled"
83
+ /**
84
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/hardwareConcurrency)
85
+ */
86
+ @get external hardwareConcurrency: t => int = "hardwareConcurrency"
87
+ /**
88
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/storage)
89
+ */
90
+ @get external storage: t => StorageTypes.storageManager = "storage"
91
+ /**
92
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/locks)
93
+ */
94
+ @get external locks: t => WebLocksTypes.lockManager = "locks"
95
+ /**
96
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/webdriver)
97
+ */
98
+ @get external webdriver: t => bool = "webdriver"
99
+
100
+ /**
101
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
102
+ */
103
+ @send
104
+ external sendBeacon: (t, ~url: string, ~data: FileTypes.readableStream<unit>=?) => bool =
105
+ "sendBeacon"
106
+
107
+ /**
108
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
109
+ */
110
+ @send
111
+ external sendBeacon2: (t, ~url: string, ~data: FileTypes.blob=?) => bool = "sendBeacon"
112
+
113
+ /**
114
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
115
+ */
116
+ @send
117
+ external sendBeacon3: (t, ~url: string, ~data: DataView.t=?) => bool = "sendBeacon"
118
+
119
+ /**
120
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
121
+ */
122
+ @send
123
+ external sendBeacon4: (t, ~url: string, ~data: ArrayBuffer.t=?) => bool = "sendBeacon"
124
+
125
+ /**
126
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
127
+ */
128
+ @send
129
+ external sendBeacon5: (t, ~url: string, ~data: FetchTypes.formData=?) => bool = "sendBeacon"
130
+
131
+ /**
132
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
133
+ */
134
+ @send
135
+ external sendBeacon6: (t, ~url: string, ~data: UrlTypes.urlSearchParams=?) => bool = "sendBeacon"
136
+
137
+ /**
138
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon)
139
+ */
140
+ @send
141
+ external sendBeacon7: (t, ~url: string, ~data: string=?) => bool = "sendBeacon"
142
+
143
+ /**
144
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/getGamepads)
145
+ */
146
+ @throws(JsExn) @send
147
+ external getGamepads: t => array<Null.t<GamepadTypes.gamepad>> = "getGamepads"
148
+
149
+ /**
150
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/requestMediaKeySystemAccess)
151
+ */
152
+ @send
153
+ external requestMediaKeySystemAccess: (
154
+ t,
155
+ ~keySystem: string,
156
+ ~supportedConfigurations: array<BaseEncryptedMediaExtensions.mediaKeySystemConfiguration>,
157
+ ) => promise<'mediaKeySystemAccess> = "requestMediaKeySystemAccess"
158
+
159
+ /**
160
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Navigator/requestMIDIAccess)
161
+ */
162
+ @send
163
+ external requestMIDIAccess: (
164
+ t,
165
+ ~options: WebMidiTypes.midiOptions=?,
166
+ ) => promise<WebMidiTypes.midiAccess> = "requestMIDIAccess"
@@ -0,0 +1,10 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Permissions/query)
3
+ */
4
+ @send
5
+ external query: (
6
+ PermissionsTypes.permissions,
7
+ PermissionsTypes.permissionDescriptor,
8
+ ) => promise<PermissionsTypes.permissionStatus> = "query"
9
+
10
+ module Types = PermissionsTypes
@@ -0,0 +1,38 @@
1
+ @@warning("-30")
2
+
3
+ type permissionName =
4
+ | @as("geolocation") Geolocation
5
+ | @as("midi") Midi
6
+ | @as("notifications") Notifications
7
+ | @as("persistent-storage") PersistentStorage
8
+ | @as("push") Push
9
+ | @as("screen-wake-lock") ScreenWakeLock
10
+ | @as("storage-access") StorageAccess
11
+
12
+ type permissionState =
13
+ | @as("denied") Denied
14
+ | @as("granted") Granted
15
+ | @as("prompt") Prompt
16
+
17
+ /**
18
+ [See WebApiPermissions on MDN](https://developer.mozilla.org/docs/Web/API/Permissions)
19
+ */
20
+ @editor.completeFrom(WebApiPermissions)
21
+ type permissions = private {}
22
+
23
+ /**
24
+ [See PermissionStatus on MDN](https://developer.mozilla.org/docs/Web/API/PermissionStatus)
25
+ */
26
+ type permissionStatus = {
27
+ ...DOM.eventTarget,
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PermissionStatus/state)
30
+ */
31
+ state: permissionState,
32
+ /**
33
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PermissionStatus/name)
34
+ */
35
+ name: string,
36
+ }
37
+
38
+ type permissionDescriptor = {mutable name: permissionName}