@rescript/webapi 0.1.0-experimental-067a895 → 0.1.0-experimental-3c28b39
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-3c28b39",
|
|
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/ImageData.res
CHANGED
|
@@ -10,8 +10,8 @@ external make: (~sw: int, ~sh: int, ~settings: imageDataSettings=?) => imageData
|
|
|
10
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData)
|
|
11
11
|
*/
|
|
12
12
|
@new
|
|
13
|
-
external
|
|
14
|
-
~data:
|
|
13
|
+
external makeWithData: (
|
|
14
|
+
~data: Uint8ClampedArray.t,
|
|
15
15
|
~sw: int,
|
|
16
16
|
~sh: int=?,
|
|
17
17
|
~settings: imageDataSettings=?,
|
package/src/DOMAPI.res
CHANGED
|
@@ -3020,7 +3020,7 @@ and htmlCollectionOf<'t> = {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
|
|
3022
3022
|
/**
|
|
3023
|
-
A collection of HTML form control elements.
|
|
3023
|
+
A collection of HTML form control elements.
|
|
3024
3024
|
[See HTMLFormControlsCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection)
|
|
3025
3025
|
*/
|
|
3026
3026
|
@editor.completeFrom(HTMLFormControlsCollection) and htmlFormControlsCollection = {
|
|
@@ -9403,7 +9403,7 @@ type imageData = {
|
|
|
9403
9403
|
Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.
|
|
9404
9404
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData/data)
|
|
9405
9405
|
*/
|
|
9406
|
-
data:
|
|
9406
|
+
data: Uint8ClampedArray.t,
|
|
9407
9407
|
/**
|
|
9408
9408
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData/colorSpace)
|
|
9409
9409
|
*/
|
|
@@ -31,13 +31,7 @@ external delete: (formData, string) => unit = "delete"
|
|
|
31
31
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
|
32
32
|
*/
|
|
33
33
|
@send
|
|
34
|
-
external get: (formData, string) => null<
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/get)
|
|
38
|
-
*/
|
|
39
|
-
@send
|
|
40
|
-
external getFile: (formData, string) => null<file> = "get"
|
|
34
|
+
external get: (formData, string) => null<formDataEntryValue> = "get"
|
|
41
35
|
|
|
42
36
|
/**
|
|
43
37
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
|
|
@@ -51,6 +45,12 @@ external getAll: (formData, string) => array<formDataEntryValue> = "getAll"
|
|
|
51
45
|
@send
|
|
52
46
|
external has: (formData, string) => bool = "has"
|
|
53
47
|
|
|
48
|
+
/**
|
|
49
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/entries)
|
|
50
|
+
*/
|
|
51
|
+
@send
|
|
52
|
+
external entries: formData => Iterator.t<(string, formDataEntryValue)> = "entries"
|
|
53
|
+
|
|
54
54
|
/**
|
|
55
55
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FormData/keys)
|
|
56
56
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
open Prelude
|
|
2
|
+
open FetchAPI
|
|
3
|
+
open FileAPI
|
|
4
|
+
|
|
5
|
+
external fromString: string => formDataEntryValue = "%identity"
|
|
6
|
+
external fromFile: file => formDataEntryValue = "%identity"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
Represents a decoded version of the abstract `formDataEntryValue` type.
|
|
10
|
+
A FormData entry value is either a string or a File.
|
|
11
|
+
*/
|
|
12
|
+
type decoded =
|
|
13
|
+
| String(string)
|
|
14
|
+
| File(file)
|
|
15
|
+
|
|
16
|
+
let decode = (t: formDataEntryValue): decoded => {
|
|
17
|
+
if File.isInstanceOf(t) {
|
|
18
|
+
File(unsafeConversation(t))
|
|
19
|
+
} else {
|
|
20
|
+
String(unsafeConversation(t))
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/FetchAPI.res
CHANGED