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 6493a85754/Libraries/CameraRoll/RCTCameraRollManager.m (L98) and 6493a85754/Libraries/CameraRoll/RCTCameraRollManager.m (L116)
Closes https://github.com/facebook/react-native/pull/15631

Differential Revision: D5714842

Pulled By: shergin

fbshipit-source-id: fb141b014c262bc4fb44419515e56bbe0641d8bf
This commit is contained in:
Maarten Schumacher 2017-09-12 09:59:36 -07:00 committed by Facebook Github Bot
parent dc514a5640
commit 97869e22d7
1 changed files with 2 additions and 2 deletions

View File

@ -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.',