Skip to content

Commit 805367e

Browse files
Change response type from object to records (#4)
* Updated bs to latest * change response type from object to record with new version of bs, records get converted to objects. * convert type_ to type * make data option in response
1 parent ef526dd commit 805367e

File tree

3 files changed

+302
-381
lines changed

3 files changed

+302
-381
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"release": "npmpub"
3737
},
3838
"devDependencies": {
39-
"bs-platform": "^7.3.0",
39+
"bs-platform": "^7.3.2",
4040
"husky": "^1.3.0",
4141
"lint-staged": "^10.1.1",
4242
"npmpub": "^5.0.0",

src/ReactNativeImagePicker.re

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module ImagePicker = {
55
module Button = {
66
type t;
77

8-
[@bs.obj]
9-
external make: (~title: string=?, ~name: string=?, unit) => t = "";
8+
[@bs.obj] external make: (~title: string=?, ~name: string=?, unit) => t;
109
};
1110

1211
module PermissionDenied = {
@@ -20,8 +19,7 @@ module ImagePicker = {
2019
~reTryTitle: string,
2120
~okTitle: string
2221
) =>
23-
t =
24-
"";
22+
t;
2523
};
2624

2725
module Storage = {
@@ -36,8 +34,7 @@ module ImagePicker = {
3634
~waitUntilSaved: bool=?,
3735
unit
3836
) =>
39-
t =
40-
"";
37+
t;
4138
};
4239

4340
[@bs.obj]
@@ -64,29 +61,28 @@ module ImagePicker = {
6461
~customButtons: array(Button.t)=?,
6562
unit
6663
) =>
67-
t =
68-
"";
64+
t;
6965
};
7066

7167
type response = {
72-
.
73-
"didCancel": bool,
74-
"error": option(string),
75-
"customButton": string,
76-
"data": string,
77-
"uri": string,
78-
"origURL": option(string),
79-
"isVertical": bool,
80-
"width": int,
81-
"height": int,
82-
"fileSize": int,
83-
"type": option(string),
84-
"fileName": option(string),
85-
"path": option(string),
86-
"latitude": option(float),
87-
"longitude": option(float),
88-
"timestamp": int,
89-
"originalRotation": float,
68+
didCancel: bool,
69+
error: option(string),
70+
customButton: string,
71+
data: option(string),
72+
uri: string,
73+
origURL: option(string),
74+
isVertical: bool,
75+
width: int,
76+
height: int,
77+
fileSize: int,
78+
[@bs.as "type"]
79+
type_: option(string),
80+
fileName: option(string),
81+
path: option(string),
82+
latitude: option(float),
83+
longitude: option(float),
84+
timestamp: int,
85+
originalRotation: float,
9086
};
9187

9288
[@bs.module "react-native-image-picker"] [@bs.scope "default"]

0 commit comments

Comments
 (0)