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 11'use strict' ;
22
33
4+ var Button = { } ;
5+
46var PermissionDenied = { } ;
57
68var $$Storage = { } ;
79
810var Options = {
11+ Button : Button ,
912 PermissionDenied : PermissionDenied ,
1013 Storage : $$Storage
1114} ;
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ module ImagePicker = {
22 module Options = {
33 type t ;
44
5+ module Button = {
6+ type t ;
7+
8+ [@ bs . obj ] external make : (~title : string , ~name : string ) => t = "" ;
9+ };
10+
511 module PermissionDenied = {
612 type t ;
713
@@ -55,14 +61,43 @@ module ImagePicker = {
5561 ~videoQuality : [@ bs . string ] [ | ` low | ` medium | ` high ] =?,
5662 ~storageOptions : Storage . t =?,
5763 ~permissionDenied : PermissionDenied . t =?,
64+ ~customButtons : array (Button . t )=?,
5865 unit
5966 ) =>
6067 t =
6168 "" ;
6269 };
6370
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" ;
6599
66100 [@ 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" ;
68103};
You can’t perform that action at this time.
0 commit comments