Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33e62f7

Browse files
author
Martin Konicek
committed
[ReactNative] CameraRoll docs
Summary: In preparation for open sourcing React Native for Android, document which parts of the `CameraRoll` API are platform-specific. Renders like this: http://imgur.com/rbpXHKf We should improve docs generation for `@param`s.
1 parent b7253dc commit 33e62f7

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

Libraries/CameraRoll/CameraRoll.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,28 @@ var getPhotosReturnChecker = createStrictShapeTypeChecker({
109109
}).isRequired,
110110
});
111111

112+
/**
113+
* `CameraRoll` provides access to the local camera roll / gallery.
114+
*/
112115
class CameraRoll {
113116

114117
static GroupTypesOptions: Array<string>;
115118
static AssetTypeOptions: Array<string>;
116119
/**
117-
* Saves the image with tag `tag` to the camera roll.
120+
* Saves the image to the camera roll / gallery.
121+
*
122+
* @param {string} tag On Android, this is a local URI, such
123+
* as `"file:///sdcard/img.png"`.
124+
*
125+
* On iOS, the tag can be one of the following:
126+
*
127+
* - local URI
128+
* - assets-library tag
129+
* - a tag not maching any of the above, which means the image data will
130+
* be stored in memory (and consume memory as long as the process is alive)
118131
*
119-
* @param {string} tag - Can be any of the three kinds of tags we accept:
120-
* 1. URL
121-
* 2. assets-library tag
122-
* 3. tag returned from storing an image in memory
132+
* @param successCallback Invoked with the value of `tag` on success.
133+
* @param errorCallback Invoked with error message on error.
123134
*/
124135
static saveImageWithTag(tag, successCallback, errorCallback) {
125136
invariant(
@@ -140,10 +151,10 @@ class CameraRoll {
140151
* Invokes `callback` with photo identifier objects from the local camera
141152
* roll of the device matching shape defined by `getPhotosReturnChecker`.
142153
*
143-
* @param {object} params - See `getPhotosParamChecker`.
144-
* @param {function} callback - Invoked with arg of shape defined by
145-
* `getPhotosReturnChecker` on success.
146-
* @param {function} errorCallback - Invoked with error message on error.
154+
* @param {object} params See `getPhotosParamChecker`.
155+
* @param {function} callback Invoked with arg of shape defined by
156+
* `getPhotosReturnChecker` on success.
157+
* @param {function} errorCallback Invoked with error message on error.
147158
*/
148159
static getPhotos(params, callback, errorCallback) {
149160
var metaCallback = callback;

0 commit comments

Comments
 (0)