import type { Dispatch, ForwardedRef, MutableRefObject, SetStateAction } from 'react'; import type { default as Cropper } from 'react-easy-crop'; import type { CropperProps } from 'react-easy-crop'; import type { Area } from 'react-easy-crop/types'; import { RcFile } from '../upload/interface'; export interface ImgCropProps { aspect?: number; shape?: 'rect' | 'round'; grid?: boolean; quality?: number; fillColor?: string; prefixCls?: string; zoom?: boolean; rotate?: boolean; minZoom?: number; maxZoom?: number; modalTitle?: string; modalWidth?: number; modalOk?: string; modalCancel?: string; modalMaskTransitionName?: string; modalClassName?: string; modalTransitionName?: string; onModalOk?: (file: void | boolean | string | Blob | File) => void; onModalCancel?: () => void; beforeCrop?: (file: RcFile, fileList: RcFile[]) => boolean | Promise; onUploadFail?: (err: Error) => void; cropperProps?: Partial; children: JSX.Element; } export interface EasyCropRef { rotateVal: number; setZoomVal: Dispatch>; setRotateVal: Dispatch>; cropPixelsRef: MutableRefObject; } export type EasyCropProps = Required> & { cropperRef: ForwardedRef; image: string; prefixCls?: string; }; export interface ImgcropLocale { modalTitle: string; } export type OnModalOk = NonNullable; export type CanvasImageSource = HTMLCanvasElement | HTMLVideoElement | HTMLImageElement | SVGImageElement | ImageBitmap; export type BlobPart = string | Blob | ArrayBufferView | ArrayBuffer;