Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use OffscreenCanvas in TypeScript project

I'd like to use OffscreenCanvas in a typescript project, but I have no idea how to do this. When I try:

let offscreen = new OffscreenCanvas(256, 256);

my ide says "Cannot find name OffscreenCanvas".

Any hints ?

like image 334
Lukh Avatar asked Jun 13 '18 07:06

Lukh


1 Answers

You can install @types/offscreencanvas to your project.

Yarn

yarn add @types/offscreencanvas

npm

npm i @types/offscreencanvas

Now enjoy it!

For more https://www.npmjs.com/package/@types/offscreencanvas

like image 62
A.Chan Avatar answered Dec 02 '22 16:12

A.Chan