UNPKG

imgbb-webp-uploader

Version:

A utility for converting images to WebP format and uploading them to ImgBB

15 lines (14 loc) 584 B
/** * Converts an image file to WebP format * @param file Original image file * @param quality Quality of the WebP image (0-1) * @param maxWidth Maximum width of the output image * @returns Promise that resolves to a File object in WebP format */ export declare const convertToWebP: (file: File, quality?: number, maxWidth?: number) => Promise<File>; /** * Gets the size of a file in a human-readable format * @param bytes Size in bytes * @returns Formatted size string (e.g., "1.5 MB") */ export declare const getFormattedFileSize: (bytes: number) => string;