/** * @file 图片处理相关 utils */ /** * 将 base64 图片转为 Blob, 然后可用于下载等用途 * * @param data - base64 字符串 * @returns 转换后的 Blob */ export declare function base64ImageToBlob(data: string): Blob; /** * 将指定 html 元素打印并下载为 jpeg 格式的图片. * 内置了一些预处理逻辑: * 1. 目标元素内带有 data-html-to-canvas-remove 属性的元素都会在打印前被移除 * * @param el - 目标元素 * @param name - 下载的文件名, 应为 xx.jpg * @param preprocess - 打印前的预处理, 一般用于对打印样式进行调整 (在 clone 的元素中进行, 不影响原元素) */ export declare function downloadHtmlAsImage({ el, name, preprocess, }: { el: HTMLElement; name: string; preprocess?: (el: HTMLElement) => HTMLElement; }): Promise; /** * 判断一个字符串是否为 url * * @param url - 字符串 * @returns 是否 */ export declare const isUrl: (url: string) => boolean; /** * 判断文件名或 URL 是否是图片 * * @param filenameOrURL - 文件名或 URL * @returns 是否 */ export declare const isImage: (filenameOrURL: string) => boolean;