import type { CropArea } from '../typings'; export interface ImagePosition { offsetX: number; offsetY: number; } export interface BaseDisplaySize { width: number; height: number; } export interface InitialCropAreaResult { baseDisplayHeight: number; baseDisplayWidth: number; cropArea: CropArea; imagePosition: ImagePosition; } /** * Calculate base scale for image to cover canvas (both dimensions). */ export declare function getBaseScale(rect: DOMRect, img: HTMLImageElement): number; /** * Calculate base display size of image. */ export declare function getBaseDisplaySize(rect: DOMRect, img: HTMLImageElement): BaseDisplaySize; /** * Calculate initial crop area and image position. */ export declare function calculateInitialCropArea(img: HTMLImageElement, rect: DOMRect, aspectRatio?: number): InitialCropAreaResult; /** * Constrain image position to ensure it covers crop area. */ export declare function constrainImagePosition(newOffsetX: number, newOffsetY: number, displayWidth: number, displayHeight: number, cropArea: CropArea): ImagePosition; /** * Check if two crop areas are similar (within threshold). */ export declare function isCropAreaSimilar(a: CropArea | null, b: CropArea | null, threshold?: number): boolean; /** * Check if two image positions are similar (within threshold). */ export declare function isImagePositionSimilar(a: ImagePosition | null, b: ImagePosition | null, threshold?: number): boolean;