Closed mamazu closed 5 years ago
I have updated the repository to have the latest version of the p5 types.
You can pull the latest
Or
You can do this yourself with:
npm install --save-dev @types/p5
You will also need to add a typing file to expose the types to the global namespace:
import module = require('p5');
export = module;
export as namespace p5;
declare global {
interface Window {
p5: typeof module;
}
}
I hope this helps. Let em know if there are still things missing.
I just cloned a new copy of the project and after a long typescript build time it throws this error:
node_modules/@types/p5/src/webgl/material.d.ts(62,11): error TS2304: Cannot find name 'MediaElement'.
@mamazu Looks like this is a known issue with the current type definition file:
https://github.com/p5-types/p5.ts/issues/9
You should be able to ignore this for now as it's not an error with your code. I will update to a newer version of the p5 type definition when one becomes available.
Thanks.
It is missing some properties of
p5.Color
likelevels
ormaxes