Permalink
Browse files

Flow type: saveToCameraRoll returns a string

Summary:
Updates the flow typing to return Promise\<string\> instead of Promise\<Object\>. To validate that it actually does return a string, see https://github.com/facebook/react-native/blob/6493a857542c0985470311511c1be80982fcd474/Libraries/CameraRoll/RCTCameraRollManager.m#L98 and https://github.com/facebook/react-native/blob/6493a857542c0985470311511c1be80982fcd474/Libraries/CameraRoll/RCTCameraRollManager.m#L116
Closes #15631

Differential Revision: D5714842

Pulled By: shergin

fbshipit-source-id: fb141b014c262bc4fb44419515e56bbe0641d8bf
  • Loading branch information...
maartenschumacher authored and facebook-github-bot committed Sep 12, 2017
1 parent 0c5b390 commit 274e407ad1d903d51c9fb709aedfbf66a2726e1a
Showing with 2 additions and 2 deletions.
  1. +2 −2 Libraries/CameraRoll/CameraRoll.js
@@ -126,7 +126,7 @@ class CameraRoll {
/**
* `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.
*/
static saveImageWithTag(tag: string): Promise<Object> {
static saveImageWithTag(tag: string): Promise<string> {
console.warn(
'`CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.',
);
@@ -150,7 +150,7 @@ class CameraRoll {
static saveToCameraRoll(
tag: string,
type?: 'photo' | 'video',
): Promise<Object> {
): Promise<string> {
invariant(
typeof tag === 'string',
'CameraRoll.saveToCameraRoll must be a valid string.',

0 comments on commit 274e407

Please sign in to comment.