1
- # ` @reason -react-native/cameraroll `
1
+ # ` @rescript -react-native/cameraroll `
2
2
3
- [ ![ Build Status] ( https://github.com/reason -react-native/cameraroll/workflows/Build/badge.svg )] ( https://github.com/reason -react-native/cameraroll/actions )
4
- [ ![ Version] ( https://img.shields.io/npm/v/@reason -react-native/cameraroll.svg )] ( https://www.npmjs.com/@reason -react-native/cameraroll )
5
- [ ![ Chat ] ( https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue )] ( https://reason-react-native.github.io/discord / )
3
+ [ ![ Build Status] ( https://github.com/rescript -react-native/cameraroll/workflows/Build/badge.svg )] ( https://github.com/rescript -react-native/cameraroll/actions )
4
+ [ ![ Version] ( https://img.shields.io/npm/v/@rescript -react-native/cameraroll.svg )] ( https://www.npmjs.com/@rescript -react-native/cameraroll )
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 / )
6
6
7
- [ ReScript] ( https://rescript-lang.org ) / [ Reason ] ( https://reasonml.github.io ) bindings for
7
+ [ ReScript] ( https://rescript-lang.org ) bindings for
8
8
[ ` @react-native-community/cameraroll ` ] ( https://github.com/react-native-cameraroll/react-native-cameraroll ) .
9
9
10
10
Exposed as ` ReactNativeCameraRoll ` module.
11
11
12
- ` @reason -react-native/cameraroll ` X.y.\* means it's compatible with
12
+ ` @rescript -react-native/cameraroll ` X.y.\* means it's compatible with
13
13
` @react-native-community/cameraroll ` X.y.\*
14
14
15
15
## Installation
@@ -20,22 +20,22 @@ is properly installed & configured by following their installation instructions,
20
20
you can install the bindings:
21
21
22
22
``` console
23
- npm install @reason -react-native/cameraroll
23
+ npm install @rescript -react-native/cameraroll
24
24
# or
25
- yarn add @reason -react-native/cameraroll
25
+ yarn add @rescript -react-native/cameraroll
26
26
```
27
27
28
- ` @reason -react-native/cameraroll ` should be added to ` bs-dependencies ` in your
28
+ ` @rescript -react-native/cameraroll ` should be added to ` bs-dependencies ` in your
29
29
` bsconfig.json ` :
30
30
31
31
``` diff
32
32
{
33
33
//...
34
34
"bs-dependencies": [
35
- "reason- react",
36
- "reason -react-native",
35
+ "@rescript/ react",
36
+ "rescript -react-native",
37
37
// ...
38
- + "@reason -react-native/cameraroll"
38
+ + "@rescript -react-native/cameraroll"
39
39
],
40
40
//...
41
41
}
@@ -51,7 +51,7 @@ Allows saving photos and videos to the Camera Roll or Photo Gallery, similar to
51
51
The function will return the URI for the saved file as a string wrapped in a
52
52
Promise.
53
53
54
- ``` reason
54
+ ``` rescript
55
55
save: string => Js.Promise.t(string)
56
56
```
57
57
@@ -64,7 +64,7 @@ specified in a `saveOptions` object.
64
64
The function will return the URI for the saved file as a string wrapped in a
65
65
Promise.
66
66
67
- ``` reason
67
+ ``` rescript
68
68
saveWithOptions: (string, saveOptions) => Js.Promise.t(string)
69
69
```
70
70
@@ -84,7 +84,7 @@ will be inferred to be a video.
84
84
The function will return the URI for the saved file as a string wrapped in a
85
85
Promise.
86
86
87
- ``` reason
87
+ ``` rescript
88
88
saveToCameraRoll: string => Js.Promise.t(string)
89
89
```
90
90
@@ -97,7 +97,7 @@ one of the polymorphic variants `` `photo `` or `` `video ``.
97
97
The function will return the URI for the saved file as a string wrapped in a
98
98
Promise.
99
99
100
- ``` reason
100
+ ``` rescript
101
101
saveToCameraRollWithType: (string, [ | `photo | `video]) => Js.Promise.t(string)
102
102
```
103
103
@@ -116,15 +116,15 @@ and base64 data URIs) or a local video file URI. The user will be presented with
116
116
a dialog box that showing the asset(s) and asked for confirmation. This cannot
117
117
be bypassed as per Apple Developer guidelines.
118
118
119
- ``` reason
119
+ ``` rescript
120
120
deletePhotos: array(string) => Js.Promise.t(bool)
121
121
```
122
122
123
123
### ` getAlbums `
124
124
125
125
Returns a list of albums wrapped in a Promise.
126
126
127
- ``` reason
127
+ ``` rescript
128
128
getAlbums: unit => Js.Promise.t(array(album))
129
129
```
130
130
@@ -133,7 +133,7 @@ getAlbums: unit => Js.Promise.t(array(album))
133
133
Returns a list of albums of type specified in a ` getAlbumsParams ` object,
134
134
wrapped in a Promise.
135
135
136
- ``` reason
136
+ ``` rescript
137
137
getAlbums: getAlbumsParams => Js.Promise.t(array(album))
138
138
```
139
139
@@ -147,15 +147,15 @@ of type `array(photoIdentifier)`, where each `photoIdentifier` object would
147
147
contain details of each photo or video matching parameters provided in the
148
148
` getPhotosParam ` object.
149
149
150
- ``` reason
150
+ ``` rescript
151
151
getPhotos: getPhotosParams => Js.Promise.t(photoIdentifiersPage)
152
152
```
153
153
154
154
## Types
155
155
156
156
### ` album `
157
157
158
- ``` reason
158
+ ``` rescript
159
159
type album = {
160
160
title: string,
161
161
count: int
@@ -166,7 +166,7 @@ type album = {
166
166
167
167
can be constructed with the constructor of the same name
168
168
169
- ``` reason
169
+ ``` rescript
170
170
getAlbumsParams:
171
171
(
172
172
~assetType: [@bs.string] [
@@ -188,7 +188,7 @@ can be constructed with the constructor of the same name
188
188
returned in a previous ` getPhotos ` call, under the ` end_cursor ` key contained
189
189
in turn under the ` page_info ` key.
190
190
191
- ``` reason
191
+ ``` rescript
192
192
getPhotosParams:
193
193
(
194
194
~first: int,
@@ -215,7 +215,7 @@ getPhotosParams:
215
215
216
216
### ` image `
217
217
218
- ``` reason
218
+ ``` rescript
219
219
type image = {
220
220
filename: Js.Nullable.t(string),
221
221
uri: string,
@@ -228,7 +228,7 @@ type image = {
228
228
229
229
### ` location `
230
230
231
- ``` reason
231
+ ``` rescript
232
232
type location = {
233
233
latitude: Js.Nullable.t(float),
234
234
longitude: Js.Nullable.t(float),
@@ -240,7 +240,7 @@ type location = {
240
240
241
241
### ` node `
242
242
243
- ``` reason
243
+ ``` rescript
244
244
type node = {
245
245
[@bs.as "type"]
246
246
_type: string,
@@ -254,7 +254,7 @@ type node = {
254
254
255
255
### ` pageInfo `
256
256
257
- ``` reason
257
+ ``` rescript
258
258
type pageInfo = {
259
259
[@bs.as "has_next_page"]
260
260
hasNextPage: bool,
@@ -268,7 +268,7 @@ type pageInfo = {
268
268
269
269
### ` photoIdentifiersPage `
270
270
271
- ``` reason
271
+ ``` rescript
272
272
type photoIdentifiersPage = {
273
273
edges: array(photoIdentifier),
274
274
[@bs.as "page_info"]
@@ -278,15 +278,15 @@ type photoIdentifiersPage = {
278
278
279
279
### ` photoIdentifier `
280
280
281
- ``` reason
281
+ ``` rescript
282
282
type photoIdentifier = {node}
283
283
```
284
284
285
285
### ` saveOptions `
286
286
287
287
can be constructed with the constructor of the same name
288
288
289
- ``` reason
289
+ ``` rescript
290
290
saveOptions:
291
291
(
292
292
~_type: [@bs.string] [
@@ -301,7 +301,7 @@ saveOptions:
301
301
302
302
## Example
303
303
304
- ``` reason
304
+ ``` rescript
305
305
open ReactNative;
306
306
open ReactNativeCameraRoll;
307
307
@@ -510,11 +510,11 @@ releases.
510
510
## Contribute
511
511
512
512
Read the
513
- [ contribution guidelines] ( https://github.com/reason -react-native/.github/blob/master/CONTRIBUTING.md )
513
+ [ contribution guidelines] ( https://github.com/rescript -react-native/.github/blob/master/CONTRIBUTING.md )
514
514
before contributing.
515
515
516
516
## Code of Conduct
517
517
518
518
We want this community to be friendly and respectful to each other. Please read
519
- [ our full code of conduct] ( https://github.com/reason -react-native/.github/blob/master/CODE_OF_CONDUCT.md )
519
+ [ our full code of conduct] ( https://github.com/rescript -react-native/.github/blob/master/CODE_OF_CONDUCT.md )
520
520
so that you can understand what actions will and will not be tolerated.
0 commit comments