import type { CanvasFormat, CropRect } from './canvas'; /** Loads `imageUrl`, scales it down to `maxWidth` / `maxHeight` and re-encodes it as a data URL (webp by default); rejects with an `Error` when the image cannot load. */ export declare function convertImage(imageUrl: string, options?: { format?: CanvasFormat; maxHeight?: number; maxWidth?: number; quality?: number; }): Promise; export interface LoadedImage { src: string; width: number; height: number; } export interface ImageTransform { rotate: 0 | 90 | 180 | 270; flipH: boolean; flipV: boolean; } /** Reads a File into a base64 data URL and resolves its natural dimensions. Throws for non-image files. */ export declare function loadImageFromFile(file: File): Promise; /** Resolves natural dimensions of an image URL (data URL or remote). */ export declare function loadImageDimensions(src: string): Promise; export interface CropImageOptions { format?: CanvasFormat; quality?: number; /** Output width in pixels. Defaults to the crop's own width, or to whatever keeps `height` at the crop ratio. */ width?: number; /** Output height in pixels. Defaults to the crop's own height, or to whatever keeps `width` at the crop ratio. */ height?: number; /** Off draws nearest-neighbour, which is what keeps pixel art square at another size. Defaults to on. */ smoothing?: boolean; } /** Renders `crop` - in natural image pixels, as `ImageCropper` emits it - to a new data URL. */ export declare function cropImage(src: string, crop: CropRect, options?: CropImageOptions): Promise; /** * Applies rotate / flip transforms to an image and returns a new data URL. * Uses an intermediate canvas; rotation is in clockwise degrees. */ export declare function transformImage(src: string, transform: ImageTransform, options?: Pick): Promise; /** Decodes a base64 data URL into a Blob, for sending bytes where a long base64 string would go. */ export declare function dataUrlToBlob(src: string): Blob; /** Reads a File into a data URL; resolves `null` for a missing file and rejects with an `Error` when the read fails. */ export declare function readFileAsDataUrl(file?: File | null): Promise; /** Fetch a remote image URL and return it as a base64 data URL (null on failure). */ export declare function resolveImageFromUrl(imageUrl: string): Promise; /** Extracts the first image File from a ClipboardEvent, or `null` if the paste holds none. */ export declare function readPastedImage(e: ClipboardEvent): File | null; //# sourceMappingURL=image.d.ts.map