import React from 'react'; import { FlexStyle, LayoutChangeEvent, ShadowStyleIOS, StyleProp, TransformsStyle, ViewProps, ImageResolvedAssetSource, AccessibilityProps, ColorValue } from 'react-native'; export declare type ResizeMode = 'contain' | 'cover' | 'stretch' | 'center'; export declare type Priority = 'low' | 'normal' | 'high'; declare type Cache = 'immutable' | 'web' | 'cacheOnly'; export declare type Source = { uri?: string; headers?: { [key: string]: string; }; priority?: Priority; cache?: Cache; }; export interface OnLoadEvent { nativeEvent: { width: number; height: number; }; } export interface OnProgressEvent { nativeEvent: { loaded: number; total: number; }; } export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS { backfaceVisibility?: 'visible' | 'hidden'; borderBottomLeftRadius?: number; borderBottomRightRadius?: number; backgroundColor?: ColorValue; borderColor?: ColorValue; borderWidth?: number; borderRadius?: number; borderTopLeftRadius?: number; borderTopRightRadius?: number; overlayColor?: ColorValue; tintColor?: ColorValue; opacity?: number; } export interface FastImageProps extends AccessibilityProps, ViewProps { source: Source | number; resizeMode?: ResizeMode; fallback?: boolean; onLoadStart?(): void; onProgress?(event: OnProgressEvent): void; onLoad?(event: OnLoadEvent): void; onError?(): void; onLoadEnd?(): void; /** * onLayout function * * Invoked on mount and layout changes with * * {nativeEvent: { layout: {x, y, width, height}}}. */ onLayout?: (event: LayoutChangeEvent) => void; /** * * Style */ style?: StyleProp; /** * TintColor * * If supplied, changes the color of all the non-transparent pixels to the given color. */ tintColor?: ColorValue; /** * A unique identifier for this element to be used in UI Automation testing scripts. */ testID?: string; /** * Render children within the image. */ children?: React.ReactNode; } interface FastImageState { resolvedSource?: ImageResolvedAssetSource & { borderRadius?: number; }; } export default class FastImage extends React.PureComponent { static defaultProps: { resizeMode: string; }; static priority: { readonly low: "low"; readonly normal: "normal"; readonly high: "high"; }; static resizeMode: { readonly contain: "contain"; readonly cover: "cover"; readonly stretch: "stretch"; readonly center: "center"; }; static cacheControl: { readonly immutable: "immutable"; readonly web: "web"; readonly cacheOnly: "cacheOnly"; }; static preload: (sources: Source[]) => any; static displayName: string; private fastImageRef; constructor(props: FastImageProps); refresh(): void; static getDerivedStateFromProps({ style, source, fallback }: FastImageProps, previousState: FastImageState): FastImageState | null; render(): JSX.Element; } export declare const clearMemoryCache: () => any; export declare const clearDiskCache: () => any; export {}; //# sourceMappingURL=index.d.ts.map