1 | import React from 'react';
|
2 | import Cropper from 'cropperjs';
|
3 |
|
4 | interface ReactCropperElement extends HTMLImageElement {
|
5 | cropper: Cropper;
|
6 | }
|
7 | interface ReactCropperDefaultOptions {
|
8 | scaleX?: number;
|
9 | scaleY?: number;
|
10 | enable?: boolean;
|
11 | zoomTo?: number;
|
12 | rotateTo?: number;
|
13 | }
|
14 | interface 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 | }
|
19 | declare const ReactCropper: React.ForwardRefExoticComponent<ReactCropperProps & React.RefAttributes<HTMLImageElement | ReactCropperElement>>;
|
20 |
|
21 | export { ReactCropper as Cropper, ReactCropperElement, ReactCropperProps, ReactCropper as default };
|