Skip to content

TypeScript issue for p5.Vector static methodsΒ #374

@dogatekin

Description

@dogatekin

Describe the bug
When using p5-svelte in TypeScript as decribed in https://p5-svelte.netlify.app/docs/typescript, p5.Vector static methods such as p5.Vector.add() work correctly, but there seems to be an issue with types that prevents e.g. IntelliSense from showing them.

To Reproduce
Create an app with the usage example from the docs:

<script lang="ts">
  import P5, { type Sketch } from "p5-svelte";

  const sketch: Sketch = (p5) => {
		p5.setup = () => {
			p5.createCanvas(p5.windowWidth, p5.windowHeight);
		};
		p5.draw = () => {
			p5.ellipse(p5.width / 2, p5.height / 2, p5.width, p5.height);
		};
	}
</script>

<P5 {sketch} />

Then add a line that uses a p5.Vector static method.

Expected behavior
Having IntelliSense work for these methods like it does for other p5 methods.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions