|
@@ -2,6 +2,7 @@ import { Canvg, presets } from 'canvg'
|
|
|
|
|
|
// https://gist.githubusercontent.com/n1ru4l/9c7eff52fe084d67ff15ae6b0af5f171/raw/da9fe36d72171d4e36b92aced587b48dc5182792/offscreen-canvas-polyfill.js
|
|
|
if (!window.OffscreenCanvas) {
|
|
|
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
// @ts-ignore
|
|
|
window.OffscreenCanvas = class OffscreenCanvas {
|
|
|
canvas: HTMLCanvasElement
|
|
@@ -10,6 +11,7 @@ if (!window.OffscreenCanvas) {
|
|
|
this.canvas.width = width
|
|
|
this.canvas.height = height
|
|
|
|
|
|
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
// @ts-ignore
|
|
|
this.canvas.convertToBlob = () => {
|
|
|
return new Promise(resolve => {
|
|
@@ -17,6 +19,7 @@ if (!window.OffscreenCanvas) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
// @ts-ignore
|
|
|
return this.canvas
|
|
|
}
|