From 49e4606a2fe981e4b686de41a567c364431af49f Mon Sep 17 00:00:00 2001 From: A C SREEDHAR REDDY Date: Wed, 20 May 2020 13:31:30 +0530 Subject: [PATCH 1/4] Updated bs to latest --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0a62d4..bc1187d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "release": "npmpub" }, "devDependencies": { - "bs-platform": "^5.2.0", + "bs-platform": "^7.3.2", "husky": "^1.3.0", "lint-staged": "^10.1.1", "npmpub": "^5.0.0", From f7d380e24cb0f735ae344ba721bdecbe3d369e6d Mon Sep 17 00:00:00 2001 From: A C SREEDHAR REDDY Date: Wed, 20 May 2020 13:35:16 +0530 Subject: [PATCH 2/4] change response type from object to record with new version of bs, records get converted to objects. --- src/ReactNativeImagePicker.re | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/ReactNativeImagePicker.re b/src/ReactNativeImagePicker.re index fe62a6b..cf898fd 100644 --- a/src/ReactNativeImagePicker.re +++ b/src/ReactNativeImagePicker.re @@ -70,24 +70,23 @@ module ImagePicker = { }; type response = { - . - "didCancel": bool, - "error": option(string), - "customButton": string, - "data": string, - "uri": string, - "origURL": option(string), - "isVertical": bool, - "width": int, - "height": int, - "fileSize": int, - "type": option(string), - "fileName": option(string), - "path": option(string), - "latitude": option(float), - "longitude": option(float), - "timestamp": int, - "originalRotation": float, + didCancel: bool, + error: option(string), + customButton: string, + data: string, + uri: string, + origURL: option(string), + isVertical: bool, + width: int, + height: int, + fileSize: int, + _type: option(string), + fileName: option(string), + path: option(string), + latitude: option(float), + longitude: option(float), + timestamp: int, + originalRotation: float, }; [@bs.module "react-native-image-picker"] [@bs.scope "default"] From c8bf9b24380108dd85b8031a96135381bda480ea Mon Sep 17 00:00:00 2001 From: A C SREEDHAR REDDY Date: Wed, 20 May 2020 14:01:52 +0530 Subject: [PATCH 3/4] convert type_ to type --- src/ReactNativeImagePicker.re | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ReactNativeImagePicker.re b/src/ReactNativeImagePicker.re index cf898fd..314bd29 100644 --- a/src/ReactNativeImagePicker.re +++ b/src/ReactNativeImagePicker.re @@ -80,7 +80,8 @@ module ImagePicker = { width: int, height: int, fileSize: int, - _type: option(string), + [@bs.as "type"] + type_: option(string), fileName: option(string), path: option(string), latitude: option(float), From 119e81bb9cb254b9b325f2e400e39c5512502101 Mon Sep 17 00:00:00 2001 From: a-c-sreedhar-reddy Date: Thu, 11 Jun 2020 15:08:58 +0530 Subject: [PATCH 4/4] make data option in response --- src/ReactNativeImagePicker.bs.js | 2 +- src/ReactNativeImagePicker.re | 14 +++++--------- yarn.lock | 8 ++++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/ReactNativeImagePicker.bs.js b/src/ReactNativeImagePicker.bs.js index 7c7f711..24d2a0f 100644 --- a/src/ReactNativeImagePicker.bs.js +++ b/src/ReactNativeImagePicker.bs.js @@ -10,7 +10,7 @@ var $$Storage = { }; var Options = { Button: Button, PermissionDenied: PermissionDenied, - Storage: $$Storage + $$Storage: $$Storage }; var ImagePicker = { diff --git a/src/ReactNativeImagePicker.re b/src/ReactNativeImagePicker.re index 314bd29..8610619 100644 --- a/src/ReactNativeImagePicker.re +++ b/src/ReactNativeImagePicker.re @@ -5,8 +5,7 @@ module ImagePicker = { module Button = { type t; - [@bs.obj] - external make: (~title: string=?, ~name: string=?, unit) => t = ""; + [@bs.obj] external make: (~title: string=?, ~name: string=?, unit) => t; }; module PermissionDenied = { @@ -21,8 +20,7 @@ module ImagePicker = { ~okTitle: string, unit ) => - t = - ""; + t; }; module Storage = { @@ -37,8 +35,7 @@ module ImagePicker = { ~waitUntilSaved: bool=?, unit ) => - t = - ""; + t; }; [@bs.obj] @@ -65,15 +62,14 @@ module ImagePicker = { ~customButtons: array(Button.t)=?, unit ) => - t = - ""; + t; }; type response = { didCancel: bool, error: option(string), customButton: string, - data: string, + data: option(string), uri: string, origURL: option(string), isVertical: bool, diff --git a/yarn.lock b/yarn.lock index 0950583..7b39f5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -250,10 +250,10 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" -bs-platform@^5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.2.1.tgz#3f76f6d4f4c7255296375a8104c8be332770b691" - integrity sha512-3ISP+RBC/NYILiJnphCY0W3RTYpQ11JGa2dBBLVug5fpFZ0qtSaL3ZplD8MyjNeXX2bC7xgrWfgBSn8Tc9om7Q== +bs-platform@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.3.2.tgz#301f5c9b4e8cf5713cb60ca22e145e56e793affe" + integrity sha512-seJL5g4anK9la4erv+B2o2sMHQCxDF6OCRl9en3hbaUos/S3JsusQ0sPp4ORsbx5eXfHLYBwPljwKXlgpXtsgQ== caller-callsite@^2.0.0: version "2.0.0"