canvas-sketch-util icon indicating copy to clipboard operation
canvas-sketch-util copied to clipboard

Type definitions and intellisense

Open neefrehman opened this issue 5 years ago • 8 comments

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?

image

neefrehman avatar Jun 27 '20 19:06 neefrehman

I believe these are generated by Visual Studio Code.

https://code.visualstudio.com/docs/editor/intellisense

awaer avatar Jun 27 '20 20:06 awaer

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

neefrehman avatar Jun 27 '20 21:06 neefrehman

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 avatar Jul 02 '20 08:07 mattdesl

@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.

smhutch avatar Feb 11 '21 22:02 smhutch

was this ever resolved ?

elesq avatar Jan 29 '23 22:01 elesq

@smhutch can you provide a PR with your typedefs?

bulkan avatar Sep 19 '23 05:09 bulkan

Did this ever get followed up on?

elesq avatar Feb 03 '24 14:02 elesq

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"
  }

babausias avatar Apr 21 '24 02:04 babausias