UNPKG

473 BJavaScriptView Raw
1import { BaseImageResource } from './BaseImageResource.mjs';
2
3class CanvasResource extends BaseImageResource {
4 constructor(source) {
5 super(source);
6 }
7 static test(source) {
8 const { OffscreenCanvas } = globalThis;
9 if (OffscreenCanvas && source instanceof OffscreenCanvas) {
10 return true;
11 }
12 return globalThis.HTMLCanvasElement && source instanceof HTMLCanvasElement;
13 }
14}
15
16export { CanvasResource };
17//# sourceMappingURL=CanvasResource.mjs.map