File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
4
+ var Button = { } ;
5
+
4
6
var PermissionDenied = { } ;
5
7
6
8
var $$Storage = { } ;
7
9
8
10
var Options = {
11
+ Button : Button ,
9
12
PermissionDenied : PermissionDenied ,
10
13
Storage : $$Storage
11
14
} ;
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ module ImagePicker = {
2
2
module Options = {
3
3
type t ;
4
4
5
+ module Button = {
6
+ type t ;
7
+
8
+ [@ bs . obj ] external make : (~title : string , ~name : string ) => t = "" ;
9
+ };
10
+
5
11
module PermissionDenied = {
6
12
type t ;
7
13
@@ -55,14 +61,43 @@ module ImagePicker = {
55
61
~videoQuality : [@ bs . string ] [ | ` low | ` medium | ` high ] =?,
56
62
~storageOptions : Storage . t =?,
57
63
~permissionDenied : PermissionDenied . t =?,
64
+ ~customButtons : array (Button . t )=?,
58
65
unit
59
66
) =>
60
67
t =
61
68
"" ;
62
69
};
63
70
64
- type response = {. "didCancel": bool };
71
+ type response = {
72
+ .
73
+ "didCancel": bool ,
74
+ "error": string ,
75
+ "customButton": string ,
76
+ "data": string ,
77
+ "uri": string ,
78
+ "oriURL": string ,
79
+ "isVertical": bool ,
80
+ "width": int ,
81
+ "height": int ,
82
+ "fileSize": int ,
83
+ "type": string ,
84
+ "fileName": string ,
85
+ "path": string ,
86
+ "latitude": float ,
87
+ "longitude": float ,
88
+ "timestamp": int ,
89
+ "originalRotation": float ,
90
+ };
91
+
92
+ [@ bs . module "react-native-image-picker" ] [@ bs . scope "default" ]
93
+ external launchCamera : (Options . t , response => unit ) => unit =
94
+ "launchCamera" ;
95
+
96
+ [@ bs . module "react-native-image-picker" ] [@ bs . scope "default" ]
97
+ external showImagePicker : (Options . t , response => unit ) => unit =
98
+ "showImagePicker" ;
65
99
66
100
[@ bs . module "react-native-image-picker" ] [@ bs . scope "default" ]
67
- external launchCamera : Options . t => response = "launchCamera" ;
101
+ external launchImageLibrary : (Options . t , response => unit ) => unit =
102
+ "launchImageLibrary" ;
68
103
};
You can’t perform that action at this time.
0 commit comments