@rescript/webapi 0.1.0-experimental-3ece36f → 0.1.0-experimental-ef9aeac
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-
|
|
3
|
+
"version": "0.1.0-experimental-ef9aeac",
|
|
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/FetchAPI/Headers.res
CHANGED
|
@@ -5,13 +5,25 @@ open Prelude
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
6
6
|
*/
|
|
7
7
|
@new
|
|
8
|
-
external make:
|
|
8
|
+
external make: unit => headers = "Headers"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
12
12
|
*/
|
|
13
13
|
@new
|
|
14
|
-
external
|
|
14
|
+
external fromDict: dict<string> => headers = "Headers"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
18
|
+
*/
|
|
19
|
+
@new
|
|
20
|
+
external fromHeaders: headers => headers = "Headers"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
24
|
+
*/
|
|
25
|
+
@new
|
|
26
|
+
external fromKeyValueArray: array<(string, string)> => headers = "Headers"
|
|
15
27
|
|
|
16
28
|
/**
|
|
17
29
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Headers/append)
|
|
@@ -9,3 +9,8 @@ external fromDict: dict<string> => headersInit = "%identity"
|
|
|
9
9
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_headers)
|
|
10
10
|
*/
|
|
11
11
|
external fromHeaders: headers => headersInit = "%identity"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_headers)
|
|
15
|
+
*/
|
|
16
|
+
external fromKeyValueArray: array<(string, string)> => headersInit = "%identity"
|
package/src/FetchAPI/Request.res
CHANGED
|
@@ -5,13 +5,13 @@ open FileAPI
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request)
|
|
6
6
|
*/
|
|
7
7
|
@new
|
|
8
|
-
external
|
|
8
|
+
external fromURL: (string, ~init: requestInit=?) => request = "Request"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request)
|
|
12
12
|
*/
|
|
13
13
|
@new
|
|
14
|
-
external
|
|
14
|
+
external fromRequest: (request, ~init: requestInit=?) => request = "Request"
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer)
|
|
@@ -5,43 +5,61 @@ open FileAPI
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
6
6
|
*/
|
|
7
7
|
@new
|
|
8
|
-
external
|
|
8
|
+
external fromNull: (@as(json`null`) _, ~init: responseInit=?) => response = "Response"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
12
12
|
*/
|
|
13
13
|
@new
|
|
14
|
-
external
|
|
14
|
+
external fromString: (string, ~init: responseInit=?) => response = "Response"
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
18
18
|
*/
|
|
19
19
|
@new
|
|
20
|
-
external
|
|
20
|
+
external fromArrayBuffer: (ArrayBuffer.t, ~init: responseInit=?) => response = "Response"
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
24
24
|
*/
|
|
25
25
|
@new
|
|
26
|
-
external
|
|
26
|
+
external fromTypedArray: (TypedArray.t<'t>, ~init: responseInit=?) => response = "Response"
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
30
30
|
*/
|
|
31
31
|
@new
|
|
32
|
-
external
|
|
32
|
+
external fromDataView: (DataView.t, ~init: responseInit=?) => response = "Response"
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
36
36
|
*/
|
|
37
37
|
@new
|
|
38
|
-
external
|
|
38
|
+
external fromBlob: (blob, ~init: responseInit=?) => response = "Response"
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
42
42
|
*/
|
|
43
43
|
@new
|
|
44
|
-
external
|
|
44
|
+
external fromFile: (file, ~init: responseInit=?) => response = "Response"
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
48
|
+
*/
|
|
49
|
+
@new
|
|
50
|
+
external fromURLSearchParams: (urlSearchParams, ~init: responseInit=?) => response = "Response"
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
54
|
+
*/
|
|
55
|
+
@new
|
|
56
|
+
external fromFormData: (formData, ~init: responseInit=?) => response = "Response"
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Response)
|
|
60
|
+
*/
|
|
61
|
+
@new
|
|
62
|
+
external fromReadableStream: (readableStream<'t>, ~init: responseInit=?) => response = "Response"
|
|
45
63
|
|
|
46
64
|
/**
|
|
47
65
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer)
|
|
@@ -5,19 +5,25 @@ open Prelude
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
6
6
|
*/
|
|
7
7
|
@new
|
|
8
|
-
external make:
|
|
8
|
+
external make: unit => urlSearchParams = "URLSearchParams"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
12
12
|
*/
|
|
13
13
|
@new
|
|
14
|
-
external
|
|
14
|
+
external fromKeyValueArray: array<(string, string)> => urlSearchParams = "URLSearchParams"
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
18
18
|
*/
|
|
19
19
|
@new
|
|
20
|
-
external
|
|
20
|
+
external fromDict: dict<string> => urlSearchParams = "URLSearchParams"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
24
|
+
*/
|
|
25
|
+
@new
|
|
26
|
+
external fromString: string => urlSearchParams = "URLSearchParams"
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
29
|
Appends a specified key/value pair as a new search parameter.
|