mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 14:29:06 +08:00
Merge pull request #19750 from tansongyang/blob-util-patch
[blob-util] Add blobToDataURL
This commit is contained in:
@@ -13,5 +13,6 @@ blobUtil.blobToBase64String(testBlob); // $ExpectType Promise<string>
|
||||
blobUtil.blobToBinaryString(testBlob); // $ExpectType Promise<string>
|
||||
blobUtil.canvasToBlob(new HTMLCanvasElement()); // $ExpectType Promise<Blob>
|
||||
blobUtil.dataURLToBlob('data:abcd'); // $ExpectType Promise<Blob>
|
||||
blobUtil.blobToDataURL(testBlob); // $ExpectType Promise<string>
|
||||
blobUtil.imgSrcToDataURL('test.jpg'); // $ExpectType Promise<string>
|
||||
blobUtil.revokeObjectURL('blob:example'); // $ExpectType void
|
||||
|
||||
3
types/blob-util/index.d.ts
vendored
3
types/blob-util/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for blob-util 1.2
|
||||
// Type definitions for blob-util 1.3
|
||||
// Project: https://github.com/nolanlawson/blob-util#readme
|
||||
// Definitions by: Max Battcher <https://github.com/WorldMaker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -12,6 +12,7 @@ export function binaryStringToBlob(binary: string, type?: string): Promise<Blob>
|
||||
export function blobToBase64String(blob: Blob): Promise<string>;
|
||||
export function base64StringToBlob(base64: string, type?: string): Promise<Blob>;
|
||||
export function dataURLToBlob(dataURL: string): Promise<Blob>;
|
||||
export function blobToDataURL(blob: Blob): Promise<string>;
|
||||
export function imgSrcToDataURL(src: string, type?: string, crossOrigin?: string): Promise<string>;
|
||||
export function canvasToBlob(canvas: HTMLCanvasElement, type?: string): Promise<Blob>;
|
||||
export function imgSrcToBlob(src: string, type?: string, crossOrigin?: string): Promise<Blob>;
|
||||
|
||||
Reference in New Issue
Block a user