UNPKG
@mt-kit/utils
Version:
latest (1.7.0)
1.7.0
1.6.0
1.5.1
1.5.0
1.4.0
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
一个常用的工具库
not-have.github.io/micro-tools/
Not-have/micro-tools
@mt-kit/utils
/
dist
/
image-url-to-base64
/
index.d.ts
8 lines
(7 loc)
•
406 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
/** * 将图像 URL 转换为 base64 编码的字符串 *
@param
url 是要转换的图像的 URL *
@param
mineType 是可选参数,用于指定生成的 base64 字符串的 MIME 类型,默认为 image/png *
@returns
返回一个 Promise 对象,resolve 后的值是生成的 base64 编码的字符串 */
export
default
function
imageUrlToBase64
(
url
:
string
,
mineType
?:
string
):
Promise
<
string
>;