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, see6493a85754/Libraries/CameraRoll/RCTCameraRollManager.m (L98)
and6493a85754/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:
parent
dc514a5640
commit
97869e22d7
|
@ -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.',
|
||||
|
|
Loading…
Reference in New Issue