import React__default from 'react';

/**
 * 图片裁剪相关类型定义
 */
interface GridConfig {
    rows: number;
    columns: number;
    cellWidth: number;
    cellHeight: number;
}
interface GridCell {
    id: string;
    row: number;
    column: number;
    x: number;
    y: number;
    offsetX: number;
    offsetY: number;
    width: number;
    height: number;
    selected: boolean;
}
interface CropResult {
    blob: Blob;
    dataUrl: string;
    index: number;
    row: number;
    column: number;
    cell: GridCell;
    filename?: string;
}
interface ImageInfo {
    width: number;
    height: number;
    naturalWidth: number;
    naturalHeight: number;
    image?: HTMLImageElement;
    file?: File;
}
interface CropOptions {
    quality?: number;
    format?: 'image/png' | 'image/jpeg' | 'image/webp';
    filenamePrefix?: string;
}
interface ExportOptions extends CropOptions {
    filename?: string;
    zipFilename?: string;
    cropOptions?: CropOptions;
}
interface ImageGridCropperConfig {
    defaultRows?: number;
    defaultColumns?: number;
    defaultCellWidth?: number;
    defaultCellHeight?: number;
    minRows?: number;
    maxRows?: number;
    minColumns?: number;
    maxColumns?: number;
    maxCellSize?: number;
    minCellSize?: number;
}

/**
 * 图片网格裁剪器主组件
 * Image Grid Cropper Main Component
 */

interface ImageGridCropperProps {
    /** 初始配置 */
    config?: ImageGridCropperConfig;
    /** 导出成功回调 */
    onExportSuccess?: (results: CropResult[]) => void;
    /** 导出失败回调 */
    onExportError?: (error: string) => void;
    /** 自定义样式类名 */
    className?: string;
}
declare const ImageGridCropper: React__default.FC<ImageGridCropperProps>;

/**
 * 网格控制组件
 * Grid Controls Component
 */

interface GridControlsProps {
    /** 网格配置 */
    config: GridConfig;
    /** 配置变更回调 */
    onChange: (config: GridConfig) => void;
    /** 是否禁用 */
    disabled?: boolean;
    /** 最大行列数 */
    maxRows?: number;
    maxColumns?: number;
    /** 最大最小单元格尺寸 */
    maxCellSize?: number;
    minCellSize?: number;
    /** 是否显示重置按钮 */
    showReset?: boolean;
    /** 重置回调 */
    onReset?: () => void;
}
declare const GridControls: React__default.FC<GridControlsProps>;

/**
 * 图片裁剪工具函数
 * Image Cropping Utilities
 */

/**
 * 从文件加载图片
 */
declare function loadImageFromFile(file: File): Promise<ImageInfo>;
/**
 * 裁剪单个网格单元格
 */
declare function cropGridCell(imageInfo: ImageInfo, cell: GridCell, cellWidth: number, cellHeight: number, options?: CropOptions): Promise<CropResult>;
/**
 * 批量裁剪多个网格单元格
 */
declare function cropMultipleCells(imageInfo: ImageInfo, cells: GridCell[], cellWidth: number, cellHeight: number, options?: CropOptions, onProgress?: (current: number, total: number) => void): Promise<CropResult[]>;
/**
 * 生成网格单元格预览
 */
declare function generateCellPreview(imageInfo: ImageInfo, cell: GridCell, cellWidth: number, cellHeight: number, previewSize?: number): Promise<string>;
/**
 * 验证裁剪区域是否在图片范围内
 */
declare function validateCropArea(imageWidth: number, imageHeight: number, offsetX: number, offsetY: number, cropWidth: number, cropHeight: number): boolean;
/**
 * 自动调整偏移量以保持在图片范围内
 */
declare function constrainOffset(imageWidth: number, imageHeight: number, offsetX: number, offsetY: number, cropWidth: number, cropHeight: number): {
    offsetX: number;
    offsetY: number;
};

/**
 * 下载工具函数
 * Download Utilities
 */

/**
 * 创建ZIP压缩包并下载
 */
declare function downloadAsZip(results: CropResult[], zipFilename?: string): Promise<void>;
/**
 * 下载单个Blob文件
 */
declare function downloadBlob(blob: Blob, filename: string): void;
/**
 * 批量下载多个文件（不压缩）
 */
declare function downloadMultipleFiles(results: CropResult[], delay?: number): Promise<void>;
/**
 * 计算压缩包大小
 */
declare function calculateTotalSize(results: CropResult[]): number;
/**
 * 格式化文件大小
 */
declare function formatFileSize(bytes: number): string;

export { type CropOptions, type CropResult, type ExportOptions, type GridCell, type GridConfig, GridControls, type GridControlsProps, ImageGridCropper, type ImageGridCropperConfig, type ImageGridCropperProps, type ImageInfo, calculateTotalSize, constrainOffset, cropGridCell, cropMultipleCells, downloadAsZip, downloadBlob, downloadMultipleFiles, formatFileSize, generateCellPreview, loadImageFromFile, validateCropArea };
