@cloudcome/utils-browser
Version:
cloudcome utils for browser
10 lines (9 loc) • 419 B
TypeScript
/**
* 加载图片并返回一个包含 HTMLImageElement 的 Promise
* @param {string} url - 图片的 URL 地址
* @returns {Promise<HTMLImageElement>} 返回一个包含 HTMLImageElement 的 Promise
* @example
* const img = await imageLoad('https://example.com/image.png');
* @throws {Error} 如果图片加载失败,抛出错误
*/
export declare function imageLoad(url: string): Promise<HTMLImageElement>;