Skip to content

Commit

Permalink
Create Flow Props for Image
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7270057

fbshipit-source-id: 1ecac28e4060fe0e85a4f0698406f8986ae16caf
  • Loading branch information
elicwhite authored and facebook-github-bot committed Mar 14, 2018
1 parent 6765699 commit 8bac869
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Libraries/Image/ImageProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
* @providesModule ImageProps
* @flow
* @format
*/

'use strict';
Expand All @@ -16,6 +17,36 @@ const ImageStylePropTypes = require('ImageStylePropTypes');
const PropTypes = require('prop-types');
const StyleSheetPropType = require('StyleSheetPropType');

import type {ImageSource} from 'ImageSource';
import type {EdgeInsetsProp} from 'EdgeInsetsPropType';
import type {LayoutEvent} from 'CoreEventTypes';
import type {SyntheticEvent} from 'CoreEventTypes';

export type ImageProps = {
accessible?: boolean,
accessibilityLabel?: ?(string | Array<any> | any),
blurRadius?: number,
capInsets?: ?EdgeInsetsProp,

onError?: ?(event: SyntheticEvent<$ReadOnly<{||}>>) => void,
onLayout?: ?(event: LayoutEvent) => void,
onLoad?: ?() => void,
onLoadEnd?: ?() => void,
onLoadStart?: ?() => void,
resizeMethod?: ?('auto' | 'resize' | 'scale'),
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
source?: ?ImageSource,
style?: typeof ImageStylePropTypes,
testID?: ?string,

// ios
defaultSource?: ?ImageSource,
onPartialLoad?: ?() => void,
onProgress?: ?(
event: SyntheticEvent<$ReadOnly<{|loaded: number, total: number|}>>,
) => void,
};

module.exports = {
/**
* See https://facebook.github.io/react-native/docs/image.html#style
Expand Down

0 comments on commit 8bac869

Please sign in to comment.