RN: Export ImageLoadEvent Type

Summary: Exports the `ImageLoadEvent` type so that components passing through the `onLoad` callback can be properly typed.

Reviewed By: TheSavior

Differential Revision: D10481050

fbshipit-source-id: f0a48163c6221087b0f9869c033c653316471af9
This commit is contained in:
Tim Yung
2018-10-21 00:41:53 -07:00
committed by Facebook Github Bot
parent b002df945b
commit b51a1d5791

View File

@@ -17,16 +17,14 @@ import type {ViewStyleProp, ImageStyleProp} from 'StyleSheet';
import type {DimensionValue} from 'StyleSheetTypes';
import type {ViewProps} from 'ViewPropTypes';
type OnLoadEvent = SyntheticEvent<
export type ImageLoadEvent = SyntheticEvent<
$ReadOnly<{|
// Only on Android
uri?: string,
source: $ReadOnly<{|
width: number,
height: number,
url: string,
|}>,
uri?: string, // Only on Android
|}>,
>;
@@ -112,7 +110,7 @@ export type ImageProps = {|
*
* See https://facebook.github.io/react-native/docs/image.html#onload
*/
onLoad?: ?(event: OnLoadEvent) => void,
onLoad?: ?(event: ImageLoadEvent) => void,
/**
* Invoked when load either succeeds or fails.