@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,83 @@
1
+ @@warning("-30")
2
+
3
+ /**
4
+ This Web Speech API interface is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
5
+ [See SpeechSynthesis on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesis)
6
+ */
7
+ @editor.completeFrom(SpeechSynthesis)
8
+ type speechSynthesis = private {
9
+ ...DOM.eventTarget,
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/pending)
12
+ */
13
+ pending: bool,
14
+ /**
15
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/speaking)
16
+ */
17
+ speaking: bool,
18
+ /**
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/paused)
20
+ */
21
+ paused: bool,
22
+ }
23
+
24
+ /**
25
+ This Web Speech API interface represents a voice that the system supports. Every SpeechSynthesisVoice has its own relative speech service including information about language, name and URI.
26
+ [See SpeechSynthesisVoice on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice)
27
+ */
28
+ type speechSynthesisVoice = {
29
+ /**
30
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/voiceURI)
31
+ */
32
+ voiceURI: string,
33
+ /**
34
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/name)
35
+ */
36
+ name: string,
37
+ /**
38
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/lang)
39
+ */
40
+ lang: string,
41
+ /**
42
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/localService)
43
+ */
44
+ localService: bool,
45
+ /**
46
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/default)
47
+ */
48
+ default: bool,
49
+ }
50
+
51
+ /**
52
+ This Web Speech API interface represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.)
53
+ [See SpeechSynthesisUtterance on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance)
54
+ TODO: mark as private once mutating fields of private records is allowed
55
+ */
56
+ @editor.completeFrom(SpeechSynthesisUtterance)
57
+ type speechSynthesisUtterance = {
58
+ ...DOM.eventTarget,
59
+ /**
60
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/text)
61
+ */
62
+ mutable text: string,
63
+ /**
64
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/lang)
65
+ */
66
+ mutable lang: string,
67
+ /**
68
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/voice)
69
+ */
70
+ mutable voice: Null.t<speechSynthesisVoice>,
71
+ /**
72
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/volume)
73
+ */
74
+ mutable volume: float,
75
+ /**
76
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/rate)
77
+ */
78
+ mutable rate: float,
79
+ /**
80
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance/pitch)
81
+ */
82
+ mutable pitch: float,
83
+ }
@@ -0,0 +1,123 @@
1
+ @@warning("-30")
2
+
3
+ type textTrackKind =
4
+ | @as("captions") Captions
5
+ | @as("chapters") Chapters
6
+ | @as("descriptions") Descriptions
7
+ | @as("metadata") Metadata
8
+ | @as("subtitles") Subtitles
9
+
10
+ type textTrackMode =
11
+ | @as("disabled") Disabled
12
+ | @as("hidden") Hidden
13
+ | @as("showing") Showing
14
+
15
+ /**
16
+ [See TextTrackCueList on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCueList)
17
+ */
18
+ @editor.completeFrom(TextTrackCueList)
19
+ type textTrackCueList = private {
20
+ /**
21
+ Returns the number of cues in the list.
22
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCueList/length)
23
+ */
24
+ length: int,
25
+ }
26
+
27
+ /**
28
+ TextTrackCues represent a string of text that will be displayed for some duration of time on a TextTrack. This includes the start and end times that the cue will be displayed. A TextTrackCue cannot be used directly, instead one of the derived types (e.g. VTTCue) must be used.
29
+ [See TextTrackCue on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue)
30
+ TODO: mark as private once mutating fields of private records is allowed
31
+ */
32
+ @editor.completeFrom(TextTrack)
33
+ type rec textTrackCue = {
34
+ ...DOM.eventTarget,
35
+ /**
36
+ Returns the TextTrack object to which this text track cue belongs, if any, or null otherwise.
37
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue/track)
38
+ */
39
+ track: Null.t<textTrack>,
40
+ /**
41
+ Returns the text track cue identifier.
42
+
43
+ Can be set.
44
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue/id)
45
+ */
46
+ mutable id: string,
47
+ /**
48
+ Returns the text track cue start time, in seconds.
49
+
50
+ Can be set.
51
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue/startTime)
52
+ */
53
+ mutable startTime: float,
54
+ /**
55
+ Returns the text track cue end time, in seconds.
56
+
57
+ Can be set.
58
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue/endTime)
59
+ */
60
+ mutable endTime: float,
61
+ /**
62
+ Returns true if the text track cue pause-on-exit flag is set, false otherwise.
63
+
64
+ Can be set.
65
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackCue/pauseOnExit)
66
+ */
67
+ mutable pauseOnExit: bool,
68
+ }
69
+
70
+ /**
71
+ This interface also inherits properties from EventTarget.
72
+ [See TextTrack on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack)
73
+ TODO: mark as private once mutating fields of private records is allowed
74
+ */
75
+ @editor.completeFrom(TextTrack) and textTrack = {
76
+ ...DOM.eventTarget,
77
+ /**
78
+ Returns the text track kind string.
79
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/kind)
80
+ */
81
+ kind: textTrackKind,
82
+ /**
83
+ Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).
84
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/label)
85
+ */
86
+ label: string,
87
+ /**
88
+ Returns the text track language string.
89
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/language)
90
+ */
91
+ language: string,
92
+ /**
93
+ Returns the ID of the given track.
94
+
95
+ For in-band tracks, this is the ID that can be used with a fragment if the format supports media fragment syntax, and that can be used with the getTrackById() method.
96
+
97
+ For TextTrack objects corresponding to track elements, this is the ID of the track element.
98
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/id)
99
+ */
100
+ id: string,
101
+ /**
102
+ Returns the text track in-band metadata track dispatch type string.
103
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/inBandMetadataTrackDispatchType)
104
+ */
105
+ inBandMetadataTrackDispatchType: string,
106
+ /**
107
+ Returns the text track mode, represented by a string from the following list:
108
+
109
+ Can be set, to change the mode.
110
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/mode)
111
+ */
112
+ mutable mode: textTrackMode,
113
+ /**
114
+ Returns the text track list of cues, as a TextTrackCueList object.
115
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/cues)
116
+ */
117
+ cues: Null.t<textTrackCueList>,
118
+ /**
119
+ Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.
120
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrack/activeCues)
121
+ */
122
+ activeCues: Null.t<textTrackCueList>,
123
+ }
@@ -0,0 +1,2 @@
1
+ external fromString: string => PushTypes.applicationServerKey = "%identity"
2
+ external fromUint8Array: Uint8Array.t => PushTypes.applicationServerKey = "%identity"
@@ -0,0 +1,12 @@
1
+ @@warning("-30")
2
+
3
+ /**
4
+ This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
5
+ [See MessagePort on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort)
6
+ */
7
+ @editor.completeFrom(MessagePort)
8
+ type messagePort = private {
9
+ ...DOM.eventTarget,
10
+ }
11
+
12
+ type structuredSerializeOptions = {mutable transfer?: array<Dict.t<string>>}
@@ -0,0 +1,10 @@
1
+ include Event.Impl({type t = WebSocketsTypes.closeEvent})
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent)
5
+ */
6
+ @new
7
+ external make: (
8
+ ~type_: string,
9
+ ~eventInitDict: WebSocketsTypes.closeEventInit=?,
10
+ ) => WebSocketsTypes.closeEvent = "CloseEvent"
@@ -0,0 +1,43 @@
1
+ type event = DOM.event
2
+ type eventTarget = DOM.eventTarget
3
+ type messageEventSource = WebSocketsTypes.messageEventSource
4
+
5
+ type messageEvent<'t> = WebSocketsTypes.messageEvent<'t>
6
+ type messageEventInit<'t> = WebSocketsTypes.messageEventInit<'t>
7
+
8
+ type t<'t> = messageEvent<'t>
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessageEvent)
12
+ */
13
+ @new
14
+ external make: (~type_: string, ~eventInitDict: messageEventInit<'t>=?) => t<'t> = "MessageEvent"
15
+
16
+ external asEvent: t<'t> => event = "%identity"
17
+ /**
18
+ Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
20
+ */
21
+ @send
22
+ external composedPath: t<'t> => array<eventTarget> = "composedPath"
23
+
24
+ /**
25
+ When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
26
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
27
+ */
28
+ @send
29
+ external stopPropagation: t<'t> => unit = "stopPropagation"
30
+
31
+ /**
32
+ Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
33
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
34
+ */
35
+ @send
36
+ external stopImmediatePropagation: t<'t> => unit = "stopImmediatePropagation"
37
+
38
+ /**
39
+ If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
40
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
41
+ */
42
+ @send
43
+ external preventDefault: t<'t> => unit = "preventDefault"
@@ -0,0 +1,38 @@
1
+ type t = ChannelMessagingTypes.messagePort = private {...ChannelMessagingTypes.messagePort}
2
+ type structuredSerializeOptions = ChannelMessagingTypes.structuredSerializeOptions
3
+
4
+ include EventTarget.Impl({type t = t})
5
+
6
+ /**
7
+ Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
8
+
9
+ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
10
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
11
+ */
12
+ @throws(JsExn) @send
13
+ external postMessage: (t, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
14
+ "postMessage"
15
+
16
+ /**
17
+ Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
18
+
19
+ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
20
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
21
+ */
22
+ @throws(JsExn) @send
23
+ external postMessage2: (t, ~message: JSON.t, ~options: structuredSerializeOptions=?) => unit =
24
+ "postMessage"
25
+
26
+ /**
27
+ Begins dispatching messages received on the port.
28
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
29
+ */
30
+ @send
31
+ external start: t => unit = "start"
32
+
33
+ /**
34
+ Disconnects the port, so that it is no longer active.
35
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
36
+ */
37
+ @send
38
+ external close: t => unit = "close"
@@ -0,0 +1,46 @@
1
+ type t = NotificationTypes.notification = private {...NotificationTypes.notification}
2
+ type notificationDirection = NotificationTypes.notificationDirection
3
+ type notificationPermission = NotificationTypes.notificationPermission
4
+ type notificationAction = NotificationTypes.notificationAction = {
5
+ ...NotificationTypes.notificationAction,
6
+ }
7
+ type notificationOptions = NotificationTypes.notificationOptions = {
8
+ ...NotificationTypes.notificationOptions,
9
+ }
10
+ type getNotificationOptions = NotificationTypes.getNotificationOptions = {
11
+ ...NotificationTypes.getNotificationOptions,
12
+ }
13
+ type notificationPermissionCallback = NotificationTypes.notificationPermissionCallback
14
+ type notificationEvent = NotificationTypes.notificationEvent = {
15
+ ...NotificationTypes.notificationEvent,
16
+ }
17
+
18
+ /**
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification)
20
+ */
21
+ @throws(JsExn) @new
22
+ external make: (~title: string, ~options: notificationOptions=?) => t = "Notification"
23
+
24
+ include EventTarget.Impl({type t = t})
25
+
26
+ /**
27
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/requestPermission_static)
28
+ */
29
+ @scope("Notification")
30
+ external requestPermission: (
31
+ ~deprecatedCallback: notificationPermissionCallback=?,
32
+ ) => promise<notificationPermission> = "requestPermission"
33
+
34
+ /**
35
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/close)
36
+ */
37
+ @send
38
+ external close: t => unit = "close"
39
+
40
+ /**
41
+ [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission_static)
42
+ */
43
+ @scope("Notification") @val
44
+ external permission: notificationPermission = "permission"
45
+
46
+ module Types = NotificationTypes
@@ -0,0 +1,107 @@
1
+ @@warning("-30")
2
+
3
+ type notificationDirection =
4
+ | @as("auto") Auto
5
+ | @as("ltr") Ltr
6
+ | @as("rtl") Rtl
7
+
8
+ type notificationPermission =
9
+ | @as("default") Default
10
+ | @as("denied") Denied
11
+ | @as("granted") Granted
12
+
13
+ /**
14
+ This Notifications API interface is used to configure and display desktop notifications to the user.
15
+ [See WebApiNotification on MDN](https://developer.mozilla.org/docs/Web/API/Notification)
16
+ */
17
+ @editor.completeFrom(Notification)
18
+ type notification = private {
19
+ ...DOM.eventTarget,
20
+ /**
21
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/permission_static)
22
+ */
23
+ permission: notificationPermission,
24
+ /**
25
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/title)
26
+ */
27
+ title: string,
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/dir)
30
+ */
31
+ dir: notificationDirection,
32
+ /**
33
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/lang)
34
+ */
35
+ lang: string,
36
+ /**
37
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/body)
38
+ */
39
+ body: string,
40
+ /**
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/tag)
42
+ */
43
+ tag: string,
44
+ /**
45
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/icon)
46
+ */
47
+ icon: string,
48
+ /**
49
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/badge)
50
+ */
51
+ badge: string,
52
+ /**
53
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/silent)
54
+ */
55
+ silent: Null.t<bool>,
56
+ /**
57
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/requireInteraction)
58
+ */
59
+ requireInteraction: bool,
60
+ /**
61
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/data)
62
+ */
63
+ data?: JSON.t,
64
+ }
65
+
66
+ /**
67
+ An array of actions to display in the notification, for which the default is an empty array.
68
+ [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#actions)
69
+ */
70
+ type notificationAction = {
71
+ action: string,
72
+ title: string,
73
+ icon?: string,
74
+ }
75
+
76
+ type notificationOptions = {
77
+ mutable dir?: notificationDirection,
78
+ mutable lang?: string,
79
+ mutable body?: string,
80
+ mutable tag?: string,
81
+ mutable icon?: string,
82
+ mutable badge?: string,
83
+ mutable silent?: Nullable.t<bool>,
84
+ mutable requireInteraction?: bool,
85
+ mutable data?: JSON.t,
86
+ mutable actions?: array<notificationAction>,
87
+ /**
88
+ [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#vibrate)
89
+ */
90
+ mutable vibrate?: array<int>,
91
+ }
92
+
93
+ type getNotificationOptions = {mutable tag?: string}
94
+
95
+ type notificationPermissionCallback = notificationPermission => unit
96
+
97
+ type notificationEvent = {
98
+ ...DOM.extendableEvent,
99
+ /**
100
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NotificationEvent/action)
101
+ */
102
+ action: string,
103
+ /**
104
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NotificationEvent/notification)
105
+ */
106
+ notification: notification,
107
+ }
@@ -0,0 +1,3 @@
1
+ type t = PushTypes.pushEvent = private {...PushTypes.pushEvent}
2
+
3
+ include ExtendableEvent.Impl({type t = t})
@@ -0,0 +1,24 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/subscribe)
3
+ */
4
+ @send
5
+ external subscribe: (
6
+ PushTypes.pushManager,
7
+ ~options: PushTypes.pushSubscriptionOptionsInit=?,
8
+ ) => promise<PushTypes.pushSubscription> = "subscribe"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/getSubscription)
12
+ */
13
+ @send
14
+ external getSubscription: PushTypes.pushManager => promise<Null.t<PushTypes.pushSubscription>> =
15
+ "getSubscription"
16
+
17
+ /**
18
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/permissionState)
19
+ */
20
+ @send
21
+ external permissionState: (
22
+ PushTypes.pushManager,
23
+ ~options: PushTypes.pushSubscriptionOptionsInit=?,
24
+ ) => promise<PushTypes.permissionState> = "permissionState"
@@ -0,0 +1,15 @@
1
+ type t = PushTypes.pushMessageData
2
+
3
+ /**
4
+ The json() method of the PushMessageData interface extracts push message data by parsing it as a JSON string and returning the result.
5
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushMessageData/json)
6
+ */
7
+ @send
8
+ external json: t => JSON.t = "json"
9
+
10
+ /**
11
+ The text() method of the PushMessageData interface extracts push message data as a plain text string.
12
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushMessageData/text)
13
+ */
14
+ @send
15
+ external text: t => string = "text"
@@ -0,0 +1,20 @@
1
+ /**
2
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/getKey)
3
+ */
4
+ @send
5
+ external getKey: (
6
+ PushTypes.pushSubscription,
7
+ PushTypes.pushEncryptionKeyName,
8
+ ) => Null.t<ArrayBuffer.t> = "getKey"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/unsubscribe)
12
+ */
13
+ @send
14
+ external unsubscribe: PushTypes.pushSubscription => promise<bool> = "unsubscribe"
15
+
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/toJSON)
18
+ */
19
+ @send
20
+ external toJSON: PushTypes.pushSubscription => PushTypes.pushSubscriptionJSON = "toJSON"
@@ -0,0 +1,88 @@
1
+ @@warning("-30")
2
+
3
+ type permissionState =
4
+ | @as("denied") Denied
5
+ | @as("granted") Granted
6
+ | @as("prompt") Prompt
7
+
8
+ type pushEncryptionKeyName =
9
+ | @as("auth") Auth
10
+ | @as("p256dh") P256dh
11
+
12
+ /**
13
+ This WebApiPush API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
14
+ [See PushManager on MDN](https://developer.mozilla.org/docs/Web/API/PushManager)
15
+ */
16
+ @editor.completeFrom(PushManager)
17
+ type pushManager = private {
18
+ /**
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/supportedContentEncodings_static)
20
+ */
21
+ supportedContentEncodings: array<string>,
22
+ }
23
+
24
+ type applicationServerKey
25
+
26
+ /**
27
+ [See PushSubscriptionOptions on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions)
28
+ */
29
+ type pushSubscriptionOptions = {
30
+ /**
31
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/userVisibleOnly)
32
+ */
33
+ userVisibleOnly: bool,
34
+ /**
35
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey)
36
+ */
37
+ applicationServerKey: Null.t<applicationServerKey>,
38
+ }
39
+
40
+ /**
41
+ This WebApiPush API interface provides a subcription's WebApiURL endpoint and allows unsubscription from a push service.
42
+ [See PushSubscription on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription)
43
+ */
44
+ @editor.completeFrom(PushSubscription)
45
+ type pushSubscription = private {
46
+ /**
47
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/endpoint)
48
+ */
49
+ endpoint: string,
50
+ /**
51
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/expirationTime)
52
+ */
53
+ expirationTime: Null.t<int>,
54
+ /**
55
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/options)
56
+ */
57
+ options: pushSubscriptionOptions,
58
+ }
59
+
60
+ type pushSubscriptionOptionsInit = {
61
+ mutable userVisibleOnly?: bool,
62
+ mutable applicationServerKey?: Nullable.t<applicationServerKey>,
63
+ }
64
+
65
+ type pushSubscriptionJSONKeys = {
66
+ /** Base64URL-encoded ArrayBuffer value */
67
+ p256dh: string,
68
+ /** Base64URL-encoded ArrayBuffer value */
69
+ auth: string,
70
+ }
71
+
72
+ type pushSubscriptionJSON = {
73
+ mutable endpoint?: string,
74
+ mutable expirationTime?: Nullable.t<int>,
75
+ mutable keys?: pushSubscriptionJSONKeys,
76
+ }
77
+
78
+ @editor.completeFrom(PushMessageData)
79
+ type pushMessageData
80
+
81
+ @editor.completeFrom(PushEvent)
82
+ type pushEvent = private {
83
+ ...DOM.extendableEvent,
84
+ /**
85
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushEvent/data)
86
+ */
87
+ data: Null.t<pushMessageData>,
88
+ }