Additional Flow changes to files that use this component

Summary:
This diff includes:
1. Touchups to the `CameraRollView` typings.
2. Typings for `CameraRollViewExmaple`.
3. Flow fixes for internal callsites.

Reviewed By: yungsters

Differential Revision: D10362686

fbshipit-source-id: 48bf3fba0566e9c5c062aee3342d669f6c143d9f
This commit is contained in:
Ramanpreet Nara
2018-10-18 12:26:27 -07:00
committed by Facebook Github Bot
parent 8465094523
commit 4d917c8207
4 changed files with 50 additions and 24 deletions

View File

@@ -32,10 +32,12 @@ const ASSET_TYPE_OPTIONS = {
Photos: 'Photos',
};
type GetPhotosParams = {
export type GroupTypes = $Keys<typeof GROUP_TYPES_OPTIONS>;
export type GetPhotosParams = {
first: number,
after?: string,
groupTypes?: $Keys<typeof GROUP_TYPES_OPTIONS>,
groupTypes?: GroupTypes,
groupName?: string,
assetType?: $Keys<typeof ASSET_TYPE_OPTIONS>,
mimeTypes?: Array<string>,
@@ -84,6 +86,7 @@ export type PhotoIdentifier = {
type: string,
group_name: string,
image: {
filename: string,
uri: string,
height: number,
width: number,
@@ -153,8 +156,8 @@ const getPhotosReturnChecker = deprecatedCreateStrictShapeTypeChecker({
* See https://facebook.github.io/react-native/docs/cameraroll.html
*/
class CameraRoll {
static GroupTypesOptions: Object = GROUP_TYPES_OPTIONS;
static AssetTypeOptions: Object = ASSET_TYPE_OPTIONS;
static GroupTypesOptions = GROUP_TYPES_OPTIONS;
static AssetTypeOptions = ASSET_TYPE_OPTIONS;
/**
* `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.