@types/p5 not find like class in typeScript

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???

1 Like

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 npmand when read the instruction i’ve a feeling the folder p5must add in the 'node-moduleand the organisation of type file file is completetly different, plus when I put the foldertypes` where it work before that’s don’t work :frowning:

older style that’s work :slight_smile:

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 ?

1 Like

@ 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? :slight_smile:

@Stanlepunk, if you’re still interested, I’ve refactored my “Ball-in-the-Chamber” TS sketch to use @types/p5: :partying_face:

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! :sweat_smile:


@GoToLoop That’s sound good, I look at asap when my hangover will be go out !