import { Template } from '@bluepic/types';
export type Clamp = {
    left: number;
    top: number;
    right: number;
    bottom: number;
};
export declare function clamp(value: number, min: number, max: number): number;
export declare function clampCrop(bbox: Template.Crop, clampBBox: Clamp): Template.Crop;
export declare function clampBBox(bbox: Template.Geometry.BBox, clampBBox: Template.Geometry.BBox): Template.Geometry.BBox;
/**
 * Clamp a bbox within bounds while preserving aspect ratio.
 * Used for passive re-clamping (e.g. when the user zooms out and
 * the skeleton must shrink to stay within image bounds).
 */
export declare function clampBBoxPreservingAspectRatio(bbox: Template.Geometry.BBox, bounds: Template.Geometry.BBox, aspectRatio?: number): Template.Geometry.BBox;
export declare function waitForImgLoad(img: HTMLImageElement): Promise<void>;
