mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* support useRef hook allows to also pass refs created with the `useRef` hook. see https://github.com/roadmanfong/react-cropper/issues/134#issuecomment-593984770 * use same cropperjs version as current react-cropper release * update interface def and tests
23 lines
955 B
TypeScript
23 lines
955 B
TypeScript
// Type definitions for react-cropper 1.3
|
|
// Project: https://github.com/roadmanfong/react-cropper, http://roadmanfong.github.io/react-cropper
|
|
// Definitions by: Stepan Mikhaylyuk <https://github.com/stepancar>
|
|
// Walter Barbagallo <https://github.com/bwlt>
|
|
// Harald Friessnegger <https://github.com/frisi>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// Minimum TypeScript Version: 3.7
|
|
|
|
import Cropper from 'cropperjs';
|
|
import * as React from 'react';
|
|
|
|
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
|
|
interface ReactCropperProps extends Cropper.Options, Omit<React.HTMLProps<HTMLImageElement>, 'data' | 'ref'> {
|
|
ref?: React.LegacyRef<ReactCropper>;
|
|
}
|
|
|
|
interface ReactCropper extends Cropper {} // tslint:disable-line no-empty-interface
|
|
declare class ReactCropper extends React.Component<ReactCropperProps> {
|
|
on(eventname: string, callback: () => void): void;
|
|
}
|
|
export default ReactCropper;
|