Nico-Mayer / p5-vue

Simply add p5 to your Vue and Nuxt projects ✌️
https://p5vue-homepage.vercel.app/
12 stars 0 forks source link

Typescript support #4

Open elasticdotventures opened 11 months ago

elasticdotventures commented 11 months ago

here is a working typescript example:

<script setup lang="ts">
import * as p5Module from "p5"; // Rename the imported module

const sketch = (p5: typeof p5Module) => {
  p5.setup = () => {
    p5.createCanvas(500, 500);
  };

  p5.draw = () => {
    p5.background("#fff000");
  };
};
</script>