JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 54402
  • Score
    100M100P100Q16596F
  • License MIT

TypeScript definitions for react-image-crop

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/react-image-crop) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/react-image-crop

    Summary

    This package contains type definitions for react-image-crop (https://github.com/DominicTobias/react-image-crop).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-image-crop/v7.

    index.d.ts

    import { Component, CSSProperties, ReactNode } from "react";
    
    export as namespace ReactCrop;
    
    declare namespace ReactCrop {
        interface Crop {
            aspect?: number | undefined;
            x?: number | undefined;
            y?: number | undefined;
            width?: number | undefined;
            height?: number | undefined;
        }
    
        interface ReactCropProps {
            src: string;
            crop?: Crop | undefined;
            imageAlt?: string | undefined;
            minWidth?: number | undefined;
            minHeight?: number | undefined;
            maxWidth?: number | undefined;
            maxHeight?: number | undefined;
            keepSelection?: boolean | undefined;
            onChange: (crop: Crop) => void;
            onComplete?: ((crop: Crop) => void) | undefined;
            onImageLoaded?: ((target: HTMLImageElement) => void) | undefined;
            onDragStart?: (() => void) | undefined;
            onDragEnd?: (() => void) | undefined;
            disabled?: boolean | undefined;
            crossorigin?: "anonymous" | "use-credentials" | undefined;
            children?: ReactNode | undefined;
            style?: CSSProperties | undefined;
            imageStyle?: CSSProperties | undefined;
            onImageError?: ((event: React.SyntheticEvent<HTMLImageElement>) => void) | undefined;
            className?: string | undefined;
            locked?: boolean | undefined;
            renderSelectionAddon?: ((state: any) => ReactNode) | undefined;
        }
    
        function makeAspectCrop(crop: Crop, image: HTMLImageElement): Crop;
        function containCrop(previousCrop: Crop, crop: Crop, image: HTMLImageElement): Crop;
    }
    
    declare class ReactCrop extends Component<ReactCrop.ReactCropProps> {
        onCropMouseTouchDown: (e: MouseEvent) => void;
        onComponentMouseTouchDown: (e: MouseEvent) => void;
        onDocMouseTouchMove: (e: MouseEvent) => void;
        onComponentKeyDown: (e: MouseEvent) => void;
        onDocMouseTouchEnd: (e: MouseEvent) => void;
        onImageLoad: (image: HTMLImageElement) => void;
        getCropStyle: () => CSSProperties;
        getNewSize: () => {
            width: number;
            height: number;
        };
        resolveCrop: (crop: ReactCrop.Crop, image: HTMLImageElement) => ReactCrop.Crop;
        dragCrop: () => ReactCrop.Crop;
        resizeCrop: () => ReactCrop.Crop;
        straightenYPath: (clientX: number) => number;
        createCropSelection: () => ReactNode;
        makeNewCrop: () => ReactCrop.Crop;
        crossOverCheck: () => void;
    }
    
    export = ReactCrop;
    

    Additional Details

    • Last updated: Tue, 07 Nov 2023 20:08:00 GMT
    • Dependencies: @types/react

    Credits

    These definitions were written by Daniela Yassuda, Elias Chaaya, and Søren Englund.