canvas-sketch-util
canvas-sketch-util copied to clipboard
Type definitions and intellisense
Hi @mattdesl, I've just been watching your Introduction to creative coding class on Frontend Masters, and noticed that when you're using this library your editor is giving you autocomplete and type annotations (pictured below). I've been looking around and can't see any type definitions in the library, is there a different way that you're getting these?

I believe these are generated by Visual Studio Code.
https://code.visualstudio.com/docs/editor/intellisense
@awaer yes they should be generated by the editor, but usually this is only possible if the library emits a .d.ts file, which I don't think canvas-sketch-util does. I'm using VSCode but can't see any of the definitions. Have you had luck getting them to show?
I'm definitely :+1: on Typescript definitions. It's not really an area I'm familiar with, but open to PRs and more discussion.
@mattdesl I have been using these utils quite extensively in my own projects, and have made a start on adding types to my personal site. I would be happy to help out with adding types to this repo.
was this ever resolved ?
@smhutch can you provide a PR with your typedefs?
Did this ever get followed up on?
I found this package which has enabled intellisense in the IDE for me: https://www.npmjs.com/package/canvas-sketch-util-types
I added it manually to the dev dependencies to the package.json:
"devDependencies": {
"@types/canvas-sketch-util": "npm:canvas-sketch-util-types"
}