import { ImageMimeType } from "./ImageFormatUtils"; export declare function currentDisplayPxPerInch(): number; export declare function getDpiAdaptiveSize(naturalWidth: number, naturalHeight: number, imageDPI: number, includeDeviceRatio?: boolean): { width: number; height: number; }; export declare function setDpiAdaptiveSize(sampleImage: HTMLCanvasElement | HTMLImageElement, imageDPI: number): void; export declare function getImageNaturalSize(img: HTMLImageElement): { width: number; height: number; }; /** * Create image element using specified image url. **/ export declare function dataUrlToImage(dataUrl: string): Promise; /** * Converts an image Data-URL or URL into a Uint8Array of its binary data. * @param dataUrl - The image URL or Data-URL to convert. * @returns Promise that resolves to a Uint8Array containing the image bytes. */ export declare function dataUrlToUint8Array(dataUrl: string): Promise; export declare function imageDataToCanvas(dataUrl: string, canvas?: HTMLCanvasElement, dx?: number, dy?: number, dw?: number, dh?: number): Promise; export declare function resizeImage(sourceImage: HTMLImageElement, destinationCanvas: HTMLCanvasElement, width: number, height: number, keepAspectRatio?: boolean): void; export declare function resizeImageDataUrl(originalImageDataUrl: string, originalNaturalSize: { width: number; height: number; }, width: number, height: number, keepAspectRatio?: boolean): Promise; export declare function cropImage(sourceImage: HTMLImageElement, destinationCanvas: HTMLCanvasElement, x: number, y: number, width: number, height: number): void; export declare function copyImageCanvasToClipboard(canvas: HTMLCanvasElement, imageType?: ImageMimeType): void; export declare function getImageCanvasFromClipboard(imageType?: ImageMimeType): Promise; /** * Safely updates the canvas with the provided ImageData, handling compatibility issues on certain platforms. * @param canvas - The HTMLCanvasElement to be updated. * @param imageData - The ImageData containing pixel information to be applied to the canvas. * @returns A Promise that resolves to a boolean indicating the success of the operation. */ export declare function safePutImageData(canvas: HTMLCanvasElement, imageData: ImageData, clipPaths?: Path2D[]): Promise; export declare function imageFromUrl(imageUrl: string): Promise; export declare function dataUrlToUint8ArrayViaCanvas(dataUrl: string): Promise; export declare const ImageUtils: { cropImage: typeof cropImage; dataUrlToUint8Array: typeof dataUrlToUint8Array; dataUrlToUint8ArrayViaCanvas: typeof dataUrlToUint8ArrayViaCanvas; resizeImage: typeof resizeImage; resizeImageDataUrl: typeof resizeImageDataUrl; currentDisplayPxPerInch: typeof currentDisplayPxPerInch; getImageNaturalSize: typeof getImageNaturalSize; imageFromUrl: typeof imageFromUrl; imageDataToCanvas: typeof imageDataToCanvas; setDpiAdaptiveSize: typeof setDpiAdaptiveSize; getDpiAdaptiveSize: typeof getDpiAdaptiveSize; copyImageCanvasToClipboard: typeof copyImageCanvasToClipboard; getImageCanvasFromClipboard: typeof getImageCanvasFromClipboard; };