react-advanced-cropper
Version:
The react cropper library that gives the possibility to create croppers exactly suited for your website design
57 lines (56 loc) • 2.15 kB
TypeScript
import React, { FC } from 'react';
import { CardinalDirection, OrdinalDirection, CropperTransitions, CropperState, MoveDirections, CropperInteractions, ResizeAnchor, Coordinates, RawAspectRatio } from 'advanced-cropper';
declare type HandlerComponent = FC<any>;
declare type LineComponent = FC<any>;
interface HandlerClassNames extends Partial<Record<OrdinalDirection, string>> {
default?: string;
disabled?: string;
hover?: string;
}
interface LineClassNames extends Partial<Record<CardinalDirection, string>> {
default?: string;
disabled?: string;
hover?: string;
}
interface DesiredCropperRef {
getState: () => CropperState | null;
getTransitions: () => CropperTransitions;
getInteractions: () => CropperInteractions;
hasInteractions: () => boolean;
resizeCoordinates: (anchor: ResizeAnchor, directions: Partial<MoveDirections>, parameters: unknown) => void;
resizeCoordinatesEnd: () => void;
moveCoordinates: (directions: Partial<MoveDirections>) => void;
moveCoordinatesEnd: () => void;
}
interface Props {
cropper: DesiredCropperRef;
coordinates?: Coordinates | ((state: CropperState | null) => Coordinates);
handlerComponent?: HandlerComponent;
handlers?: Partial<Record<OrdinalDirection, boolean>>;
handlerClassNames?: HandlerClassNames;
handlerWrapperClassNames?: HandlerClassNames;
lines?: Partial<Record<CardinalDirection, boolean>>;
lineComponent?: LineComponent;
lineClassNames?: LineClassNames;
lineWrapperClassNames?: LineClassNames;
className?: string;
movingClassName?: string;
resizingClassName?: string;
gridClassName?: string;
previewClassName?: string;
boundingBoxClassName?: string;
overlayClassName?: string;
draggableAreaClassName?: string;
minAspectRatio?: number;
maxAspectRatio?: number;
aspectRatio?: RawAspectRatio;
movable?: boolean;
resizable?: boolean;
grid?: boolean;
disabled?: boolean;
}
interface Methods {
aspectRatio: RawAspectRatio;
}
export declare const RectangleStencil: React.ForwardRefExoticComponent<Props & React.RefAttributes<Methods>>;
export {};