import { fabric } from "fabric"; import type { UseCropReturn } from "../types"; interface UseCropOptions { /** Callback when crop is applied */ onCropApply?: (newImage: fabric.Image) => void; /** Callback when crop is cancelled */ onCropCancel?: () => void; /** Callback when crop mode starts */ onCropStart?: () => void; } /** * Hook for managing image cropping * * @example * ```tsx * const crop = useCrop(canvasRef, imageRef, setImageRef, { * onCropApply: (newImg) => { * initializeHistory(); * saveState(); * } * }); * * // Start crop mode * crop.startCrop(); * * // Apply crop * await crop.applyCrop(); * * // Cancel crop * crop.cancelCrop(); * ``` */ export declare function useCrop(canvasRef: React.MutableRefObject, imageRef: React.MutableRefObject, setImage: (img: fabric.Image | null) => void, options?: UseCropOptions): UseCropReturn; export default useCrop;