UNPKG

@zhangmmm/ming-ui

Version:
34 lines (33 loc) 1.04 kB
import React from 'react'; import { ConfigConsumerProps } from '../config-provider'; import './style/index.less'; declare type FitType = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'; interface ImageProps { src: string; alt?: string; fit?: FitType; preview?: boolean; zIndex?: number; placeholder?: React.ReactNode; error?: React.ReactNode; } interface ImageState { isError: boolean; loading: boolean; imageWidth: number; imageHeight: number; isPreview: boolean; } declare class Img extends React.Component<ImageProps, ImageState> { constructor(props: ImageProps); handleLoad: (e: Event, img: HTMLImageElement) => void; handleError: () => void; loadImage: () => void; changePreviewState: (state: boolean) => void; handlePreview: () => void; renderImage: ({ getPrefixCls }: ConfigConsumerProps) => JSX.Element; componentDidMount(): void; componentWillUnmount(): void; render(): JSX.Element; } export default Img;