@rescript/webapi 0.1.0-experimental-4d9e1d7 → 0.1.0-experimental-cd67e9b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@ and add `@rescript/webapi` to your `rescript.json`:
20
20
  + "@rescript/webapi",
21
21
  ],
22
22
  "bsc-flags": [
23
- + "-open Global"
23
+ + "-open WebAPI.Global"
24
24
  ]
25
25
  }
26
26
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescript/webapi",
3
- "version": "0.1.0-experimental-4d9e1d7",
3
+ "version": "0.1.0-experimental-cd67e9b",
4
4
  "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5
5
  "homepage": "https://rescript-lang.github.io/experimental-rescript-webapi/",
6
6
  "bugs": "https://github.com/rescript-lang/experimental-rescript-webapi/issues",
package/src/Global.res CHANGED
@@ -13,116 +13,362 @@ open ChannelMessagingAPI
13
13
  open FetchAPI
14
14
  open EventAPI
15
15
 
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/window)
18
+ */
16
19
  external window: window = "window"
20
+
21
+ /**
22
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/self)
23
+ */
17
24
  external self: window = "self"
25
+
26
+ /**
27
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/document)
28
+ */
18
29
  external document: document = "document"
30
+
31
+ /**
32
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/name)
33
+ */
19
34
  external name: string = "name"
35
+
36
+ /**
37
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/location)
38
+ */
20
39
  external location: location = "location"
40
+
41
+ /**
42
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/history)
43
+ */
21
44
  external history: history = "history"
45
+
46
+ /**
47
+ Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element.
48
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/customElements)
49
+ */
22
50
  external customElements: customElementRegistry = "customElements"
51
+
52
+ /**
53
+ Returns true if the location bar is visible; otherwise, returns false.
54
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/locationbar)
55
+ */
23
56
  external locationbar: barProp = "locationbar"
57
+
58
+ /**
59
+ Returns true if the menu bar is visible; otherwise, returns false.
60
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/menubar)
61
+ */
24
62
  external menubar: barProp = "menubar"
63
+
64
+ /**
65
+ Returns true if the personal bar is visible; otherwise, returns false.
66
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/personalbar)
67
+ */
25
68
  external personalbar: barProp = "personalbar"
69
+
70
+ /**
71
+ Returns true if the scrollbars are visible; otherwise, returns false.
72
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollbars)
73
+ */
26
74
  external scrollbars: barProp = "scrollbars"
75
+
76
+ /**
77
+ Returns true if the status bar is visible; otherwise, returns false.
78
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/statusbar)
79
+ */
27
80
  external statusbar: barProp = "statusbar"
81
+
82
+ /**
83
+ Returns true if the toolbar is visible; otherwise, returns false.
84
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/toolbar)
85
+ */
28
86
  external toolbar: barProp = "toolbar"
87
+
88
+ /**
89
+ Returns true if the window has been closed, false otherwise.
90
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/closed)
91
+ */
29
92
  external closed: bool = "closed"
93
+
94
+ /**
95
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/frames)
96
+ */
30
97
  external frames: window = "frames"
98
+
99
+ /**
100
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/length)
101
+ */
31
102
  external length: int = "length"
103
+
104
+ /**
105
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/top)
106
+ */
32
107
  external top: window = "top"
108
+
109
+ /**
110
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/opener)
111
+ */
33
112
  external opener: JSON.t = "opener"
113
+
114
+ /**
115
+ Refers to either the parent WindowProxy, or itself.
116
+
117
+ It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.
118
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/parent)
119
+ */
34
120
  external parent: window = "parent"
121
+
122
+ /**
123
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/frameElement)
124
+ */
35
125
  external frameElement: element = "frameElement"
126
+
127
+ /**
128
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/navigator)
129
+ */
36
130
  external navigator: navigator = "navigator"
131
+
132
+ /**
133
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screen)
134
+ */
37
135
  external screen: screen = "screen"
136
+
137
+ /**
138
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/visualViewport)
139
+ */
38
140
  external visualViewport: visualViewport = "visualViewport"
141
+
142
+ /**
143
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/innerWidth)
144
+ */
39
145
  external innerWidth: int = "innerWidth"
146
+
147
+ /**
148
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/innerHeight)
149
+ */
40
150
  external innerHeight: int = "innerHeight"
151
+
152
+ /**
153
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollX)
154
+ */
41
155
  external scrollX: float = "scrollX"
156
+
157
+ /**
158
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollY)
159
+ */
42
160
  external scrollY: float = "scrollY"
161
+
162
+ /**
163
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screenX)
164
+ */
43
165
  external screenX: int = "screenX"
166
+
167
+ /**
168
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screenLeft)
169
+ */
44
170
  external screenLeft: int = "screenLeft"
171
+
172
+ /**
173
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screenY)
174
+ */
45
175
  external screenY: int = "screenY"
176
+
177
+ /**
178
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screenTop)
179
+ */
46
180
  external screenTop: int = "screenTop"
181
+
182
+ /**
183
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/outerWidth)
184
+ */
47
185
  external outerWidth: int = "outerWidth"
186
+
187
+ /**
188
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/outerHeight)
189
+ */
48
190
  external outerHeight: int = "outerHeight"
191
+
192
+ /**
193
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/devicePixelRatio)
194
+ */
49
195
  external devicePixelRatio: float = "devicePixelRatio"
196
+
197
+ /**
198
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/speechSynthesis)
199
+ */
50
200
  external speechSynthesis: speechSynthesis = "speechSynthesis"
201
+
202
+ /**
203
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/origin)
204
+ */
51
205
  external origin: string = "origin"
206
+
207
+ /**
208
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/isSecureContext)
209
+ */
52
210
  external isSecureContext: bool = "isSecureContext"
211
+
212
+ /**
213
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/crossOriginIsolated)
214
+ */
53
215
  external crossOriginIsolated: bool = "crossOriginIsolated"
216
+
217
+ /**
218
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/indexedDB)
219
+ */
54
220
  external indexedDB: idbFactory = "indexedDB"
221
+
222
+ /**
223
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/crypto)
224
+ */
55
225
  external crypto: crypto = "crypto"
226
+
227
+ /**
228
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/performance)
229
+ */
56
230
  external performance: performance = "performance"
231
+
232
+ /**
233
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/caches)
234
+ */
57
235
  external caches: cacheStorage = "caches"
236
+
237
+ /**
238
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/sessionStorage)
239
+ */
58
240
  external sessionStorage: storage = "sessionStorage"
241
+
242
+ /**
243
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/localStorage)
244
+ */
59
245
  external localStorage: storage = "localStorage"
60
246
 
247
+ /**
248
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/reportError)
249
+ */
61
250
  external reportError: JSON.t => unit = "reportError"
62
251
 
252
+ /**
253
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/btoa)
254
+ */
63
255
  external btoa: string => string = "btoa"
64
256
 
257
+ /**
258
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/atob)
259
+ */
65
260
  external atob: string => string = "atob"
66
261
 
262
+ /**
263
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
264
+ */
67
265
  external setTimeout: (~handler: string, ~timeout: int=?) => int = "setTimeout"
68
266
 
267
+ /**
268
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
269
+ */
69
270
  external setTimeout2: (~handler: unit => unit, ~timeout: int=?) => int = "setTimeout"
70
271
 
272
+ /**
273
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout)
274
+ */
71
275
  external clearTimeout: int => unit = "clearTimeout"
72
276
 
277
+ /**
278
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
279
+ */
73
280
  external setInterval: (~handler: string, ~timeout: int=?) => int = "setInterval"
74
281
 
282
+ /**
283
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
284
+ */
75
285
  external setInterval2: (~handler: unit => unit, ~timeout: int=?) => int = "setInterval"
76
286
 
287
+ /**
288
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearInterval)
289
+ */
77
290
  external clearInterval: int => unit = "clearInterval"
78
291
 
292
+ /**
293
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask)
294
+ */
79
295
  external queueMicrotask: voidFunction => unit = "queueMicrotask"
80
296
 
297
+ /**
298
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
299
+ */
81
300
  external createImageBitmap: (
82
301
  ~image: htmlImageElement,
83
302
  ~options: imageBitmapOptions=?,
84
303
  ) => Promise.t<imageBitmap> = "createImageBitmap"
85
304
 
305
+ /**
306
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
307
+ */
86
308
  external createImageBitmap2: (
87
309
  ~image: svgImageElement,
88
310
  ~options: imageBitmapOptions=?,
89
311
  ) => Promise.t<imageBitmap> = "createImageBitmap"
90
312
 
313
+ /**
314
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
315
+ */
91
316
  external createImageBitmap3: (
92
317
  ~image: htmlVideoElement,
93
318
  ~options: imageBitmapOptions=?,
94
319
  ) => Promise.t<imageBitmap> = "createImageBitmap"
95
320
 
321
+ /**
322
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
323
+ */
96
324
  external createImageBitmap4: (
97
325
  ~image: htmlCanvasElement,
98
326
  ~options: imageBitmapOptions=?,
99
327
  ) => Promise.t<imageBitmap> = "createImageBitmap"
100
328
 
329
+ /**
330
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
331
+ */
101
332
  external createImageBitmap5: (
102
333
  ~image: imageBitmap,
103
334
  ~options: imageBitmapOptions=?,
104
335
  ) => Promise.t<imageBitmap> = "createImageBitmap"
105
336
 
337
+ /**
338
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
339
+ */
106
340
  external createImageBitmap6: (
107
341
  ~image: offscreenCanvas,
108
342
  ~options: imageBitmapOptions=?,
109
343
  ) => Promise.t<imageBitmap> = "createImageBitmap"
110
344
 
345
+ /**
346
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
347
+ */
111
348
  external createImageBitmap7: (
112
349
  ~image: videoFrame,
113
350
  ~options: imageBitmapOptions=?,
114
351
  ) => Promise.t<imageBitmap> = "createImageBitmap"
115
352
 
353
+ /**
354
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
355
+ */
116
356
  external createImageBitmap8: (
117
357
  ~image: blob,
118
358
  ~options: imageBitmapOptions=?,
119
359
  ) => Promise.t<imageBitmap> = "createImageBitmap"
120
360
 
361
+ /**
362
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
363
+ */
121
364
  external createImageBitmap9: (
122
365
  ~image: imageData,
123
366
  ~options: imageBitmapOptions=?,
124
367
  ) => Promise.t<imageBitmap> = "createImageBitmap"
125
368
 
369
+ /**
370
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
371
+ */
126
372
  external createImageBitmap10: (
127
373
  ~image: htmlImageElement,
128
374
  ~sx: int,
@@ -132,6 +378,9 @@ external createImageBitmap10: (
132
378
  ~options: imageBitmapOptions=?,
133
379
  ) => Promise.t<imageBitmap> = "createImageBitmap"
134
380
 
381
+ /**
382
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
383
+ */
135
384
  external createImageBitmap11: (
136
385
  ~image: svgImageElement,
137
386
  ~sx: int,
@@ -141,6 +390,9 @@ external createImageBitmap11: (
141
390
  ~options: imageBitmapOptions=?,
142
391
  ) => Promise.t<imageBitmap> = "createImageBitmap"
143
392
 
393
+ /**
394
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
395
+ */
144
396
  external createImageBitmap12: (
145
397
  ~image: htmlVideoElement,
146
398
  ~sx: int,
@@ -150,6 +402,9 @@ external createImageBitmap12: (
150
402
  ~options: imageBitmapOptions=?,
151
403
  ) => Promise.t<imageBitmap> = "createImageBitmap"
152
404
 
405
+ /**
406
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
407
+ */
153
408
  external createImageBitmap13: (
154
409
  ~image: htmlCanvasElement,
155
410
  ~sx: int,
@@ -159,6 +414,9 @@ external createImageBitmap13: (
159
414
  ~options: imageBitmapOptions=?,
160
415
  ) => Promise.t<imageBitmap> = "createImageBitmap"
161
416
 
417
+ /**
418
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
419
+ */
162
420
  external createImageBitmap14: (
163
421
  ~image: imageBitmap,
164
422
  ~sx: int,
@@ -168,6 +426,9 @@ external createImageBitmap14: (
168
426
  ~options: imageBitmapOptions=?,
169
427
  ) => Promise.t<imageBitmap> = "createImageBitmap"
170
428
 
429
+ /**
430
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
431
+ */
171
432
  external createImageBitmap15: (
172
433
  ~image: offscreenCanvas,
173
434
  ~sx: int,
@@ -177,6 +438,9 @@ external createImageBitmap15: (
177
438
  ~options: imageBitmapOptions=?,
178
439
  ) => Promise.t<imageBitmap> = "createImageBitmap"
179
440
 
441
+ /**
442
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
443
+ */
180
444
  external createImageBitmap16: (
181
445
  ~image: videoFrame,
182
446
  ~sx: int,
@@ -186,6 +450,9 @@ external createImageBitmap16: (
186
450
  ~options: imageBitmapOptions=?,
187
451
  ) => Promise.t<imageBitmap> = "createImageBitmap"
188
452
 
453
+ /**
454
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
455
+ */
189
456
  external createImageBitmap17: (
190
457
  ~image: blob,
191
458
  ~sx: int,
@@ -195,6 +462,9 @@ external createImageBitmap17: (
195
462
  ~options: imageBitmapOptions=?,
196
463
  ) => Promise.t<imageBitmap> = "createImageBitmap"
197
464
 
465
+ /**
466
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
467
+ */
198
468
  external createImageBitmap18: (
199
469
  ~image: imageData,
200
470
  ~sx: int,
@@ -204,99 +474,257 @@ external createImageBitmap18: (
204
474
  ~options: imageBitmapOptions=?,
205
475
  ) => Promise.t<imageBitmap> = "createImageBitmap"
206
476
 
477
+ /**
478
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/structuredClone)
479
+ */
207
480
  external structuredClone: ('t, ~options: structuredSerializeOptions=?) => 't = "structuredClone"
208
481
 
482
+ /**
483
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
484
+ */
209
485
  external fetch: (~input: request, ~init: requestInit=?) => Promise.t<response> = "fetch"
210
486
 
487
+ /**
488
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
489
+ */
211
490
  external fetch2: (~input: string, ~init: requestInit=?) => Promise.t<response> = "fetch"
212
491
 
492
+ /**
493
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)
494
+ */
213
495
  external requestAnimationFrame: frameRequestCallback => int = "requestAnimationFrame"
214
496
 
497
+ /**
498
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame)
499
+ */
215
500
  external cancelAnimationFrame: int => unit = "cancelAnimationFrame"
216
501
 
502
+ /**
503
+ Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
504
+
505
+ The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
506
+
507
+ When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
508
+
509
+ When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
510
+
511
+ When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
512
+
513
+ If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
514
+
515
+ The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
516
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
517
+ */
217
518
  external addEventListener: (
218
519
  ~type_: string,
219
520
  ~callback: eventListener<'event>,
220
521
  ~options: addEventListenerOptions=?,
221
522
  ) => unit = "addEventListener"
222
523
 
524
+ /**
525
+ Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
526
+
527
+ The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
528
+
529
+ When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
530
+
531
+ When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
532
+
533
+ When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
534
+
535
+ If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
536
+
537
+ The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
538
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
539
+ */
223
540
  external addEventListener2: (
224
541
  ~type_: string,
225
542
  ~callback: eventListener<'event>,
226
543
  ~options: bool=?,
227
544
  ) => unit = "addEventListener"
228
545
 
546
+ /**
547
+ Removes the event listener in target's event listener list with the same type, callback, and options.
548
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
549
+ */
229
550
  external removeEventListener: (
230
551
  ~type_: string,
231
552
  ~callback: eventListener<'event>,
232
553
  ~options: eventListenerOptions=?,
233
554
  ) => unit = "removeEventListener"
234
555
 
556
+ /**
557
+ Removes the event listener in target's event listener list with the same type, callback, and options.
558
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
559
+ */
235
560
  external removeEventListener2: (
236
561
  ~type_: string,
237
562
  ~callback: eventListener<'event>,
238
563
  ~options: bool=?,
239
564
  ) => unit = "removeEventListener"
240
565
 
566
+ /**
567
+ Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
568
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
569
+ */
241
570
  external dispatchEvent: event => bool = "dispatchEvent"
242
571
 
572
+ /**
573
+ Closes the window.
574
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/close)
575
+ */
243
576
  external close: unit => unit = "close"
244
577
 
578
+ /**
579
+ Cancels the document load.
580
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/stop)
581
+ */
245
582
  external stop: unit => unit = "stop"
246
583
 
584
+ /**
585
+ Moves the focus to the window's browsing context, if any.
586
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/focus)
587
+ */
247
588
  external focus: unit => unit = "focus"
248
589
 
590
+ /**
591
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/open)
592
+ */
249
593
  external open_: (~url: string=?, ~target: string=?, ~features: string=?) => window = "open"
250
594
 
595
+ /**
596
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/alert)
597
+ */
251
598
  external alert: unit => unit = "alert"
252
599
 
600
+ /**
601
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/alert)
602
+ */
253
603
  external alert2: string => unit = "alert"
254
604
 
605
+ /**
606
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/confirm)
607
+ */
255
608
  external confirm: (~message: string=?) => bool = "confirm"
256
609
 
610
+ /**
611
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/prompt)
612
+ */
257
613
  external prompt: (~message: string=?, ~default: string=?) => string = "prompt"
258
614
 
615
+ /**
616
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/print)
617
+ */
259
618
  external print: unit => unit = "print"
260
619
 
620
+ /**
621
+ Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
622
+
623
+ Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
624
+
625
+ A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
626
+
627
+ If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
628
+
629
+ Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.
630
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/postMessage)
631
+ */
261
632
  external postMessage: (
262
633
  ~message: JSON.t,
263
634
  ~targetOrigin: string,
264
635
  ~transfer: array<Dict.t<string>>=?,
265
636
  ) => unit = "postMessage"
266
637
 
638
+ /**
639
+ Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
640
+
641
+ Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
642
+
643
+ A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
644
+
645
+ If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
646
+
647
+ Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.
648
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/postMessage)
649
+ */
267
650
  external postMessage2: (~message: JSON.t, ~options: windowPostMessageOptions=?) => unit =
268
651
  "postMessage"
269
652
 
653
+ /**
654
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/matchMedia)
655
+ */
270
656
  external matchMedia: string => mediaQueryList = "matchMedia"
271
657
 
658
+ /**
659
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/moveTo)
660
+ */
272
661
  external moveTo: (~x: int, ~y: int) => unit = "moveTo"
273
662
 
663
+ /**
664
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/moveBy)
665
+ */
274
666
  external moveBy: (~x: int, ~y: int) => unit = "moveBy"
275
667
 
668
+ /**
669
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/resizeTo)
670
+ */
276
671
  external resizeTo: (~width: int, ~height: int) => unit = "resizeTo"
277
672
 
673
+ /**
674
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/resizeBy)
675
+ */
278
676
  external resizeBy: (~x: int, ~y: int) => unit = "resizeBy"
279
677
 
678
+ /**
679
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scroll)
680
+ */
280
681
  external scroll: (~options: scrollToOptions=?) => unit = "scroll"
281
682
 
683
+ /**
684
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scroll)
685
+ */
282
686
  external scroll2: (~x: float, ~y: float) => unit = "scroll"
283
687
 
688
+ /**
689
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
690
+ */
284
691
  external scrollTo: (~options: scrollToOptions=?) => unit = "scrollTo"
285
692
 
693
+ /**
694
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
695
+ */
286
696
  external scrollTo2: (~x: float, ~y: float) => unit = "scrollTo"
287
697
 
698
+ /**
699
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
700
+ */
288
701
  external scrollBy: (~options: scrollToOptions=?) => unit = "scrollBy"
289
702
 
703
+ /**
704
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
705
+ */
290
706
  external scrollBy2: (~x: float, ~y: float) => unit = "scrollBy"
291
707
 
708
+ /**
709
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getComputedStyle)
710
+ */
292
711
  external getComputedStyle: (~elt: element, ~pseudoElt: string=?) => cssStyleDeclaration =
293
712
  "getComputedStyle"
294
713
 
714
+ /**
715
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/requestIdleCallback)
716
+ */
295
717
  external requestIdleCallback: (
296
718
  ~callback: idleRequestCallback,
297
719
  ~options: idleRequestOptions=?,
298
720
  ) => int = "requestIdleCallback"
299
721
 
722
+ /**
723
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/cancelIdleCallback)
724
+ */
300
725
  external cancelIdleCallback: int => unit = "cancelIdleCallback"
301
726
 
727
+ /**
728
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getSelection)
729
+ */
302
730
  external getSelection: unit => selection = "getSelection"
@@ -1,18 +0,0 @@
1
- @@warning("-30")
2
-
3
- open EventAPI
4
-
5
- /**
6
- [See PictureInPictureWindow on MDN](https://developer.mozilla.org/docs/Web/API/PictureInPictureWindow)
7
- */
8
- type pictureInPictureWindow = {
9
- ...eventTarget,
10
- /**
11
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PictureInPictureWindow/width)
12
- */
13
- width: int,
14
- /**
15
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PictureInPictureWindow/height)
16
- */
17
- height: int,
18
- }
@@ -1 +0,0 @@
1
- module AudioListener = {}