@rescript/webapi 0.1.0-experimental-20e9e63 → 0.1.0-experimental-9b9723d
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 +2 -2
- package/src/FetchAPI/BodyInit.res +47 -0
- package/src/FetchAPI/HeadersInit.res +11 -0
- package/src/FetchAPI.res +4 -2
- package/src/Prelude.res +0 -2
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-9b9723d",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"test": "node tests/index.js",
|
|
31
31
|
"build": "rewatch",
|
|
32
|
-
"format": "rescript format -all && prettier --write ./
|
|
32
|
+
"format": "rescript format -all && prettier --write ./tests/index.js ./package.json",
|
|
33
33
|
"docs": "astro dev",
|
|
34
34
|
"build:docs": "astro build"
|
|
35
35
|
},
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
open FileAPI
|
|
2
|
+
open FetchAPI
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
6
|
+
*/
|
|
7
|
+
external fromString: string => bodyInit = "%identity"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
11
|
+
*/
|
|
12
|
+
external fromArrayBuffer: ArrayBuffer.t => bodyInit = "%identity"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
16
|
+
*/
|
|
17
|
+
external fromTypedArray: TypedArray.t<'t> => bodyInit = "%identity"
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
21
|
+
*/
|
|
22
|
+
external fromDataView: DataView.t => bodyInit = "%identity"
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
26
|
+
*/
|
|
27
|
+
external fromBlob: blob => bodyInit = "%identity"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
31
|
+
*/
|
|
32
|
+
external fromFile: file => bodyInit = "%identity"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
36
|
+
*/
|
|
37
|
+
external fromURLSearchParams: urlSearchParams => bodyInit = "%identity"
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
41
|
+
*/
|
|
42
|
+
external fromFormData: formData => bodyInit = "%identity"
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
46
|
+
*/
|
|
47
|
+
external fromReadableStream: readableStream<'t> => bodyInit = "%identity"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
open FetchAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_headers)
|
|
5
|
+
*/
|
|
6
|
+
external fromDict: dict<string> => headersInit = "%identity"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_headers)
|
|
10
|
+
*/
|
|
11
|
+
external fromHeaders: headers => headersInit = "%identity"
|
package/src/FetchAPI.res
CHANGED
|
@@ -218,7 +218,9 @@ type urlSearchParams = {
|
|
|
218
218
|
size: int,
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
type headersInit
|
|
221
|
+
type headersInit
|
|
222
|
+
|
|
223
|
+
type bodyInit
|
|
222
224
|
|
|
223
225
|
type requestInfo = any
|
|
224
226
|
|
|
@@ -236,7 +238,7 @@ type requestInit = {
|
|
|
236
238
|
/**
|
|
237
239
|
A BodyInit object or null to set request's body.
|
|
238
240
|
*/
|
|
239
|
-
mutable body?:
|
|
241
|
+
mutable body?: bodyInit,
|
|
240
242
|
/**
|
|
241
243
|
A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
|
|
242
244
|
*/
|