/** * Save a element's content to a Blob object. * * @param {HTMLCanvasElement} canvas * @returns {Promise} */ export default function canvasToBlob( canvas: HTMLCanvasElement, type: string, quality?: number, ): Promise { return new Promise((resolve) => { canvas.toBlob(resolve, type, quality) }) }