import 'intersection-observer'; import React, { MouseEventHandler } from 'react'; export interface LazyImageProps { src: string; alt: string; title?: string; className?: string; hoverOpacity?: number; isMobile?: boolean; active?: boolean; onClick?: MouseEventHandler; onMouseOver?: MouseEventHandler; onMouseOut?: MouseEventHandler; onLoading?: (src: string) => void; onLoaded?: (src: string) => void; onError?: () => void; } interface LazyImageStates { loading: boolean; } export default class LazyImage extends React.Component { static defaultProps: { className: string; hoverOpacity: any; isMobile: boolean; active: boolean; }; prefixCls: string; rootRef: React.RefObject; isUnmount: boolean; constructor(props: LazyImageProps); componentWillUnmount(): void; componentDidMount(): void; componentDidUpdate(prevProps: LazyImageProps): void; /** * 监听原生lazy loading, 并回调不同的事件 */ originalLazyLoad: () => void; onMouseOut: (ev: React.MouseEvent) => void; onMouseOver: (ev: React.MouseEvent) => void; render(): JSX.Element; } export {};