@rescript/webapi 0.1.0-experimental-47c6b2c → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescript/webapi",
3
- "version": "0.1.0-experimental-47c6b2c",
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",
@@ -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, ~input: request, ~init: requestInit=?) => Promise.t<response> = "fetch"
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 fetch2: (window, ~input: string, ~init: requestInit=?) => Promise.t<response> = "fetch"
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: (~input: request, ~init: requestInit=?) => Promise.t<response> = "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
- external fetch2: (~input: string, ~init: requestInit=?) => Promise.t<response> = "fetch"
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)