react-sketch icon indicating copy to clipboard operation
react-sketch copied to clipboard

Missing type declarations for components

Open ghost opened this issue 5 years ago • 3 comments

I was using Fabric.js and stumbeled upon your framework, I was rebuilding a lot of components and functionality that react-sketch allready contains. What I noticed is that when I run npm i @types/react-sketch npm cannot find a type declaration file. I added it by hand, I used the one in the types folder on the master branch and noticed that it only contained a declaration file for SketchField and not the other components.

Do you have a complete declaration file or should I make one?

List of components to add are:

  • Arrow
  • Circle
  • fabrictool
  • history
  • line
  • pan
  • pencil
  • rectangle
  • select

ghost avatar Feb 19 '20 08:02 ghost

Hi, I'm facing the same issue in react-sketch and because of this production build is not working. Can you tell me how you added type declaration file manually?

prograk avatar Dec 29 '20 04:12 prograk

I was playing around with this library and found later that an other framework was more what I needed. With better Typescript support. https://konvajs.org/

KonvaJS is fully compatable with Typescript and React and is better when you want to draw custom shapes. The only thing that is not supported is a textbox where you can type on the canvas. But you can accomplish that with a workaround. By making a input field with absulote position.

If you want to add a declaration file, you can edit the types file https://github.com/tbolis/react-sketch/tree/master/types and add the missing components.

ghost avatar Dec 29 '20 08:12 ghost

Yes thanks for the suggestion and I did find the declaration file but I'm not able to run project. If possible can you tell me how you added type file manually ? Coz I'm not able to achieve it.

prograk avatar Dec 29 '20 17:12 prograk