import { CropArea } from './typings'; export interface CropToBlobOptions { /** * The image source (URL, File, or Blob). */ imageSrc: string | File | Blob; /** * The crop area coordinates and dimensions in image pixel space. */ cropArea: CropArea; /** * The canvas element used for cropping. * If not provided, a temporary canvas will be created. */ canvas?: HTMLCanvasElement; /** * The output image format. * @default 'image/png' */ format?: string; /** * The output image quality (0-1). * Only applies to 'image/jpeg' and 'image/webp' formats. * @default 0.92 */ quality?: number; /** * The output image width in pixels. * If not provided, uses the crop area width. */ outputWidth?: number; /** * The output image height in pixels. * If not provided, uses the crop area height. */ outputHeight?: number; } /** * Converts a cropped image area to a Blob. * * @param options - The cropping options * @returns A Promise that resolves to a Blob of the cropped image * * @example * ```tsx * const blob = await cropToBlob({ * imageSrc: 'https://example.com/image.jpg', * cropArea: { x: 100, y: 100, width: 200, height: 200 }, * format: 'image/jpeg', * quality: 0.9, * }); * ``` */ export declare function cropToBlob(options: CropToBlobOptions): Promise; /** * Converts a cropped image area to a File. * * @param options - The cropping options * @param filename - The filename for the output file * @returns A Promise that resolves to a File of the cropped image * * @example * ```tsx * const file = await cropToFile( * { * imageSrc: fileInput.files[0], * cropArea: { x: 100, y: 100, width: 200, height: 200 }, * }, * 'cropped-image.jpg', * ); * ``` */ export declare function cropToFile(options: CropToBlobOptions, filename: string): Promise; /** * Converts a cropped image area to a data URL. * * @param options - The cropping options * @returns A Promise that resolves to a data URL string of the cropped image * * @example * ```tsx * const dataUrl = await cropToDataURL({ * imageSrc: 'https://example.com/image.jpg', * cropArea: { x: 100, y: 100, width: 200, height: 200 }, * format: 'image/jpeg', * quality: 0.9, * }); * ``` */ export declare function cropToDataURL(options: CropToBlobOptions): Promise;