p5.js
p5.js copied to clipboard
add `export default p5` at end of global.d.ts
Resolves #8302
Changes:
adds a final export default p5 to global.d.ts when it's prepared in typescript.mjs
changes one of the type tests (test/types/basic.js) to use this default import.
Prepared following @davepagurek 's instruction. (Thanks!)
PR Checklist
- [x]
npm run lintpasses - [x] Unit tests are included / updated
Also tested the fix successfully with a couple of p5 global-mode typescript projects, locally, including this non-trivial one.
Process:
used npm pack on the patched p5 code, and and
then in my test projects ran npm install that-new-p5.tgz in place of p5 from npm.
Changed those projects to use import p5 from "p5/global".
Both type-checked and ran fine.