Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function asyncCanvasToBlob(canvas: HTMLCanvasElement) {
- // https://github.com/jbccollins/async-canvas-to-blob/blob/31b3578eac940526049e1560d3aca01a9aa6d874/index.js#L2-L4
- return new Promise<void>(function(resolve: BlobCallback) {
- canvas.toBlob(resolve);
- })
- }
- // Line 03:
- // TS2345: Argument of type '(resolve: BlobCallback) => void' is not assignable to parameter of type '(resolve: (value: void | PromiseLike<void>) => void, reject: (reason?: any) => void) => void'.
- // Types of parameters 'resolve' and 'resolve' are incompatible.
- // Types of parameters 'value' and 'blob' are incompatible.
- // Type 'Blob | null' is not assignable to type 'void | PromiseLike<void>'.
- // Type 'null' is not assignable to type 'void | PromiseLike<void>'.
Add Comment
Please, Sign In to add comment