Skip to content

Commit 313d7f4

Browse files
committed
ReScript
1 parent 059b754 commit 313d7f4

File tree

10 files changed

+141
-158
lines changed

10 files changed

+141
-158
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
13-
#*.bs.js # we do want this files to ensure zero-cost
12+
# ReScript artifacts
13+
# *.bs.js # we do want this files to ensure zero-cost
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog of `@reason-react-native/image-picker`
1+
# Changelog of `@rescript-react-native/image-picker`
22

33
## 2.3.4 - 2020-11-17
44

@@ -12,11 +12,11 @@ rescript 8.2 compat
1212

1313
### Breaking changes
1414

15-
- Change response type from object to records [#4](https://github.com/reason-react-native/image-picker/pull/4) by [@a-c-sreedhar-reddy](https://github.com/a-c-sreedhar-reddy)
15+
- Change response type from object to records [#4](https://github.com/rescript-react-native/image-picker/pull/4) by [@a-c-sreedhar-reddy](https://github.com/a-c-sreedhar-reddy)
1616

1717
### Minor changes
1818

19-
- Upgrade deps [340ab78](https://github.com/reason-react-native/image-picker/commit/340ab78) by [@MoOx](https://github.com/MoOx)
19+
- Upgrade deps [340ab78](https://github.com/rescript-react-native/image-picker/commit/340ab78) by [@MoOx](https://github.com/MoOx)
2020

2121
## 2.3.1 - 2020-06-11
2222

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native contributors
3+
Copyright (c) 2019 @rescript-react-native contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# `@reason-react-native/image-picker`
1+
# `@rescript-react-native/image-picker`
22

3-
[![Build Status](https://github.com/reason-react-native/image-picker/workflows/Build/badge.svg)](https://github.com/reason-react-native/image-picker/actions)
4-
[![Version](https://img.shields.io/npm/v/@reason-react-native/image-picker.svg)](https://www.npmjs.com/@reason-react-native/image-picker)
5-
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reasonml-community.github.io/reason-react-native/discord/)
3+
[![Build Status](https://github.com/rescript-react-native/image-picker/workflows/Build/badge.svg)](https://github.com/rescript-react-native/image-picker/actions)
4+
[![Version](https://img.shields.io/npm/v/@rescript-react-native/image-picker.svg)](https://www.npmjs.com/@rescript-react-native/image-picker)
5+
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)
66

7-
[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
7+
[ReScript](https://rescript-lang.org) bindings for
88
[`react-native-image-picker`](https://github.com/react-native-community/react-native-image-picker).
99

1010
Exposed as `ReactNativeImagePicker` module.
1111

12-
`@reason-react-native/image-picker` X.y.\* means it's compatible with
12+
`@rescript-react-native/image-picker` X.y.\* means it's compatible with
1313
`react-native-image-picker` X.y.\*
1414

1515
## Installation
@@ -20,30 +20,30 @@ is properly installed & configured by following their installation instructions,
2020
you can install the bindings:
2121

2222
```console
23-
npm install @reason-react-native/image-picker
23+
npm install @rescript-react-native/image-picker
2424
# or
25-
yarn add @reason-react-native/image-picker
25+
yarn add @rescript-react-native/image-picker
2626
```
2727

28-
`@reason-react-native/image-picker` should be added to `bs-dependencies` in your
28+
`@rescript-react-native/image-picker` should be added to `bs-dependencies` in your
2929
`bsconfig.json`:
3030

3131
```diff
3232
{
3333
//...
3434
"bs-dependencies": [
35-
"reason-react",
36-
"reason-react-native",
35+
"@rescript/react",
36+
"rescript-react-native",
3737
// ...
38-
+ "@reason-react-native/image-picker"
38+
+ "@rescript-react-native/image-picker"
3939
],
4040
//...
4141
}
4242
```
4343

4444
## Usage
4545

46-
```reason
46+
```rescript
4747
open ReactNativeImagePicker;
4848
4949
ImagePicker.(
@@ -81,11 +81,11 @@ releases.
8181
## Contribute
8282

8383
Read the
84-
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
84+
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
8585
before contributing.
8686

8787
## Code of Conduct
8888

8989
We want this community to be friendly and respectful to each other. Please read
90-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
90+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
9191
so that you can understand what actions will and will not be tolerated.

bsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "@reason-react-native/image-picker",
3-
"refmt": 3,
4-
"reason": {
5-
"react-jsx": 3
6-
},
2+
"name": "@rescript-react-native/image-picker",
3+
"reason": { "react-jsx": 3 },
74
"namespace": false,
85
"package-specs": {
96
"module": "commonjs",

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@reason-react-native/image-picker",
2+
"name": "@rescript-react-native/image-picker",
33
"description": "ReScript bindings for react-native-image-picker.",
44
"version": "2.3.4",
55
"publishConfig": {
@@ -8,20 +8,18 @@
88
"peerDependencies": {
99
"react-native-image-picker": "^2.3.0"
1010
},
11-
"repository": "https://github.com/reason-react-native/image-picker.git",
11+
"repository": "https://github.com/rescript-react-native/image-picker.git",
1212
"license": "MIT",
1313
"keywords": [
1414
"rescript",
15-
"reason",
16-
"reasonml",
17-
"bucklescript",
1815
"react-native",
1916
"image-picker"
2017
],
2118
"files": [
2219
"*.md",
2320
"bsconfig.json",
24-
"src/**/*.re",
21+
"src/**/*.res",
22+
"src/**/*.resi",
2523
"src/**/*.js",
2624
"!src/**/*.bs.js"
2725
],
@@ -38,7 +36,7 @@
3836
"release": "npmpub"
3937
},
4038
"devDependencies": {
41-
"bs-platform": "^8.2.0",
39+
"bs-platform": "^9.0.0",
4240
"husky": "^4.0.0",
4341
"lint-staged": "^10.0.0",
4442
"npmpub": "^5.0.0",

src/ReactNativeImagePicker.re

Lines changed: 0 additions & 118 deletions
This file was deleted.

src/ReactNativeImagePicker.res

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
module ImagePicker = {
2+
module Options = {
3+
type t
4+
5+
module Button = {
6+
type t
7+
8+
@obj external make: (~title: string=?, ~name: string=?, unit) => t = ""
9+
}
10+
11+
module PermissionDenied = {
12+
type t
13+
14+
@obj
15+
external options: (
16+
~title: string,
17+
~text: string,
18+
~reTryTitle: string,
19+
~okTitle: string,
20+
) => t = ""
21+
}
22+
23+
module Storage = {
24+
type t
25+
26+
@obj
27+
external options: (
28+
~skipBackup: bool=?,
29+
~path: string=?,
30+
~cameraRoll: bool=?,
31+
~waitUntilSaved: bool=?,
32+
unit,
33+
) => t = ""
34+
}
35+
36+
@obj
37+
external make: (
38+
~title: string=?,
39+
~cancelButtonTitle: string=?,
40+
~takePhotoButtonTitle: string=?,
41+
~chooseFromLibraryButtonTitle: string=?,
42+
~chooseWhichLibraryTitle: string=?,
43+
~tintColor: string=?,
44+
~cameraType: [#front | #back]=?,
45+
~mediaType: [#photo | #video | #mixed]=?,
46+
~maxWidth: float=?,
47+
~maxHeight: float=?,
48+
~quality: float=?,
49+
~durationLimit: int=?,
50+
~rotation: float=?,
51+
~allowsEditing: bool=?,
52+
~noData: bool=?,
53+
~videoQuality: [#low | #medium | #high]=?,
54+
~storageOptions: Storage.t=?,
55+
~permissionDenied: PermissionDenied.t=?,
56+
~customButtons: array<Button.t>=?,
57+
unit,
58+
) => t = ""
59+
}
60+
61+
type response = {
62+
didCancel: bool,
63+
error: option<string>,
64+
customButton: string,
65+
data: option<string>,
66+
uri: string,
67+
origURL: option<string>,
68+
isVertical: bool,
69+
width: int,
70+
height: int,
71+
fileSize: int,
72+
@as("type")
73+
type_: option<string>,
74+
fileName: option<string>,
75+
path: option<string>,
76+
latitude: option<float>,
77+
longitude: option<float>,
78+
timestamp: int,
79+
originalRotation: float,
80+
}
81+
82+
@module("react-native-image-picker") @scope("default")
83+
external launchCamera: (Options.t, response => unit) => unit = "launchCamera"
84+
85+
@module("react-native-image-picker") @scope("default")
86+
external showImagePicker: (Options.t, response => unit) => unit = "showImagePicker"
87+
88+
@module("react-native-image-picker") @scope("default")
89+
external launchImageLibrary: (Options.t, response => unit) => unit = "launchImageLibrary"
90+
}
91+
/*
92+
ImagePicker.(
93+
launchCamera(
94+
Options.make(
95+
~title="Take a picture",
96+
~cameraType=`back,
97+
~mediaType=`photo,
98+
~permissionDenied=
99+
Options.PermissionDenied.options(
100+
~title="Permission denied !",
101+
~text="text",
102+
~reTryTitle="Retry",
103+
~okTitle="Ok !",
104+
),
105+
(),
106+
),
107+
)
108+
);
109+
*/

0 commit comments

Comments
 (0)