(type: string, quality: number)
| 93 | ctx.drawImage(bitmap, 0, 0, targetWidth, targetHeight); |
| 94 | }, |
| 95 | toBlob(type: string, quality: number): Promise<Blob> { |
| 96 | if (isOffscreenCanvas(canvas)) { |
| 97 | return canvas.convertToBlob({ type, quality }); |
| 98 | } |
| 99 | |
| 100 | return new Promise<Blob>((resolve, reject) => { |
| 101 | canvas.toBlob( |
| 102 | (blob: Blob | null) => blob ? resolve(blob) : reject(new Error('Failed to create blob')), |
| 103 | type, |
| 104 | quality |
| 105 | ); |
| 106 | }); |
| 107 | }, |
| 108 | }; |
| 109 | } |
nothing calls this directly
no test coverage detected