import type ImageEditInfo from '../types/ImageEditInfo'; /** * @internal * Generate new dataURL from an image and edit info * @param image The image to generate data URL from. It is supposed to have original src loaded * @param editInfo Edit info of the image * @returns A BASE64 encoded string with image prefix that represents the content of the generated image. * If there are rotate/crop/resize info in the edit info, the generated image will also reflect the result. * It is possible to throw exception since the original image may not be able to read its content from * the code, so better check canRegenerateImage() of the image first. * @throws Exception when fail to generate dataURL from canvas */ export default function generateDataURL(image: HTMLImageElement, editInfo: ImageEditInfo): string;