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.
This commit is contained in:
Martin Konicek 2015-07-27 09:22:51 -07:00
Родитель b7253dc604
Коммит 33e62f71f4
1 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -109,17 +109,28 @@ var getPhotosReturnChecker = createStrictShapeTypeChecker({
}).isRequired,
});
/**
* `CameraRoll` provides access to the local camera roll / gallery.
*/
class CameraRoll {
static GroupTypesOptions: Array<string>;
static AssetTypeOptions: Array<string>;
/**
* Saves the image with tag `tag` to the camera roll.
* Saves the image to the camera roll / gallery.
*
* @param {string} tag - Can be any of the three kinds of tags we accept:
* 1. URL
* 2. assets-library tag
* 3. tag returned from storing an image in memory
* @param {string} tag On Android, this is a local URI, such
* as `"file:///sdcard/img.png"`.
*
* On iOS, the tag can be one of the following:
*
* - local URI
* - assets-library tag
* - a tag not maching any of the above, which means the image data will
* be stored in memory (and consume memory as long as the process is alive)
*
* @param successCallback Invoked with the value of `tag` on success.
* @param errorCallback Invoked with error message on error.
*/
static saveImageWithTag(tag, successCallback, errorCallback) {
invariant(
@ -140,10 +151,10 @@ class CameraRoll {
* Invokes `callback` with photo identifier objects from the local camera
* roll of the device matching shape defined by `getPhotosReturnChecker`.
*
* @param {object} params - See `getPhotosParamChecker`.
* @param {function} callback - Invoked with arg of shape defined by
* `getPhotosReturnChecker` on success.
* @param {function} errorCallback - Invoked with error message on error.
* @param {object} params See `getPhotosParamChecker`.
* @param {function} callback Invoked with arg of shape defined by
* `getPhotosReturnChecker` on success.
* @param {function} errorCallback Invoked with error message on error.
*/
static getPhotos(params, callback, errorCallback) {
var metaCallback = callback;