@rescript/webapi 0.1.0-experimental-fb395c3 → 0.1.0-experimental-20e9e63
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 +1 -1
- package/package.json +1 -1
- package/src/DOMAPI/Window.res +19 -2
- package/src/Global.res +21 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescrip
|
|
|
9
9
|
Install the package using your favorite package manager:
|
|
10
10
|
|
|
11
11
|
```shell
|
|
12
|
-
npm i
|
|
12
|
+
npm i @rescript/webapi@experimental
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
and add `@rescript/webapi` to your `rescript.json`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescript/webapi",
|
|
3
|
-
"version": "0.1.0-experimental-
|
|
3
|
+
"version": "0.1.0-experimental-20e9e63",
|
|
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/DOMAPI/Window.res
CHANGED
|
@@ -294,16 +294,33 @@ external structuredClone: (window, 't, ~options: structuredSerializeOptions=?) =
|
|
|
294
294
|
"structuredClone"
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
|
+
`fetch(window, string, init)`
|
|
298
|
+
|
|
299
|
+
Starts the process of fetching a resource from the network,
|
|
300
|
+
returning a promise that is fulfilled once the response is available.
|
|
301
|
+
|
|
302
|
+
```res
|
|
303
|
+
let response = await window->Window.fetch("https://rescript-lang.org")
|
|
304
|
+
```
|
|
305
|
+
|
|
297
306
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
298
307
|
*/
|
|
299
308
|
@send
|
|
300
|
-
external fetch: (window,
|
|
309
|
+
external fetch: (window, string, ~init: requestInit=?) => Promise.t<response> = "fetch"
|
|
301
310
|
|
|
302
311
|
/**
|
|
312
|
+
`fetch_withRequest(window, request, init)`
|
|
313
|
+
|
|
314
|
+
Starts the process of fetching a resource from the network,
|
|
315
|
+
returning a promise that is fulfilled once the response is available.
|
|
316
|
+
|
|
317
|
+
```res
|
|
318
|
+
let response = await window->Window.fetch(myRequest)
|
|
319
|
+
```
|
|
303
320
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
304
321
|
*/
|
|
305
322
|
@send
|
|
306
|
-
external
|
|
323
|
+
external fetch_withRequest: (window, request, ~init: requestInit=?) => Promise.t<response> = "fetch"
|
|
307
324
|
|
|
308
325
|
/**
|
|
309
326
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)
|
package/src/Global.res
CHANGED
|
@@ -480,14 +480,33 @@ external createImageBitmap18: (
|
|
|
480
480
|
external structuredClone: ('t, ~options: structuredSerializeOptions=?) => 't = "structuredClone"
|
|
481
481
|
|
|
482
482
|
/**
|
|
483
|
+
`fetch(string, init)`
|
|
484
|
+
|
|
485
|
+
Starts the process of fetching a resource from the network,
|
|
486
|
+
returning a promise that is fulfilled once the response is available.
|
|
487
|
+
|
|
488
|
+
```res
|
|
489
|
+
let response = await fetch("https://rescript-lang.org")
|
|
490
|
+
```
|
|
491
|
+
|
|
483
492
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
484
493
|
*/
|
|
485
|
-
external fetch: (
|
|
494
|
+
external fetch: (string, ~init: requestInit=?) => Promise.t<response> = "fetch"
|
|
486
495
|
|
|
487
496
|
/**
|
|
497
|
+
`fetch_withRequest(request, init)`
|
|
498
|
+
|
|
499
|
+
Starts the process of fetching a resource from the network,
|
|
500
|
+
returning a promise that is fulfilled once the response is available.
|
|
501
|
+
|
|
502
|
+
```res
|
|
503
|
+
let response = await fetch(myRequest)
|
|
504
|
+
```
|
|
505
|
+
|
|
488
506
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
489
507
|
*/
|
|
490
|
-
|
|
508
|
+
@send
|
|
509
|
+
external fetch_withRequest: (request, ~init: requestInit=?) => Promise.t<response> = "fetch"
|
|
491
510
|
|
|
492
511
|
/**
|
|
493
512
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)
|