UNPKG

935 BTypeScriptView Raw
1import React from 'react';
2import Cropper from 'cropperjs';
3
4interface ReactCropperElement extends HTMLImageElement {
5 cropper: Cropper;
6}
7interface ReactCropperDefaultOptions {
8 scaleX?: number;
9 scaleY?: number;
10 enable?: boolean;
11 zoomTo?: number;
12 rotateTo?: number;
13}
14interface ReactCropperProps extends ReactCropperDefaultOptions, Cropper.Options<HTMLImageElement>, Omit<React.HTMLProps<HTMLImageElement>, 'data' | 'ref' | 'crossOrigin'> {
15 crossOrigin?: '' | 'anonymous' | 'use-credentials' | undefined;
16 on?: (eventName: string, callback: () => void | Promise<void>) => void | Promise<void>;
17 onInitialized?: (instance: Cropper) => void | Promise<void>;
18}
19declare const ReactCropper: React.ForwardRefExoticComponent<ReactCropperProps & React.RefAttributes<HTMLImageElement | ReactCropperElement>>;
20
21export { ReactCropper as Cropper, ReactCropperElement, ReactCropperProps, ReactCropper as default };