Create Flow Props for Image
Reviewed By: yungsters Differential Revision: D7270057 fbshipit-source-id: 1ecac28e4060fe0e85a4f0698406f8986ae16caf
This commit is contained in:
parent
67656991b3
commit
8bac869f5d
|
@ -6,6 +6,7 @@
|
||||||
*
|
*
|
||||||
* @providesModule ImageProps
|
* @providesModule ImageProps
|
||||||
* @flow
|
* @flow
|
||||||
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
@ -16,6 +17,36 @@ const ImageStylePropTypes = require('ImageStylePropTypes');
|
||||||
const PropTypes = require('prop-types');
|
const PropTypes = require('prop-types');
|
||||||
const StyleSheetPropType = require('StyleSheetPropType');
|
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 = {
|
module.exports = {
|
||||||
/**
|
/**
|
||||||
* See https://facebook.github.io/react-native/docs/image.html#style
|
* See https://facebook.github.io/react-native/docs/image.html#style
|
||||||
|
|
Loading…
Reference in New Issue