imgbb-webp-uploader
Version:
A utility for converting images to WebP format and uploading them to ImgBB
27 lines (26 loc) • 744 B
TypeScript
export interface ImgBBUploadOptions {
apiKey: string;
webpQuality?: number;
maxWidth?: number;
convertToWebP?: boolean;
onProgress?: (progress: number) => void;
}
export interface ImgBBUploadResponse {
id: string;
url: string;
delete_url: string;
display_url: string;
title: string;
time: string;
size: {
original: number;
webp?: number;
};
}
/**
* Uploads an image to ImgBB with optional WebP conversion
* @param file The image file to upload
* @param options Upload options
* @returns Promise that resolves to the ImgBB response
*/
export declare const uploadToImgBB: (file: File, options: ImgBBUploadOptions) => Promise<ImgBBUploadResponse>;