I download the last version of P5
types for TypeScript
.
I place it in the node folder, when I use importation the folder is detected but after when I try to implement p5 in the class, Sublim Text say the class is not found. Sure I miss something but what???
- Iâve barely touched p5js under TS.
- Maybe create a âtypingsâ subfolder and place the âp5.d.tsâ file there as I did here:
GitHub.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/instance/typings - You might also try out a direct reference:
///<reference path="typings/p5.d.ts"/>
In my old version, I make something like write, and thatâs work. But itâs a old file types
. I want use a the latest P5 version, download from npm
and when read the instruction iâve a feeling the folder p5
must add in the 'node-moduleand the organisation of type file file is completetly different, plus when I put the folder
types` where it work before thatâs donât work
older style thatâs work
new style with newest types version thatâs donât work
I try try different path and different place for folder but thatâs donât work.
import Position from './Z_Position'
//import * as _ from "p5";
////<reference path="./node_modules/@types/p5/index.d.ts"/>
////<reference path="./types/p5/index.d.ts"/>
///<reference path="types/p5/index.d.ts"/>
the file index there is class p5
so i suppose i must target this file to start ?
@ julian2 hello, when i posted my starting work about typeScript I see youâre sensitive to node
webpack
so may be youâve an idea about my new problem?
@Stanlepunk, if youâre still interested, Iâve refactored my âBall-in-the-Chamberâ TS sketch to use @types/p5
:
I had to convert the whole instance mode sketch version from using TS namespaces to ESNext browser native modules in order to work w/ @types/p5
though. But it was worth it!