gwenaelp / vue-diagrams

Diagram component for vue.js, inspired by react-diagrams
MIT License
283 stars 64 forks source link

Typescript Compatability #7

Open GFLEMING133 opened 4 years ago

GFLEMING133 commented 4 years ago

Hi there,

This is more of a question than a bona-fide issue, but I am wondering if there's a type definition file for this project. I would like to use this library in my vueJS + Typescript project, but when I attempt to do so (e.g., npm install diagram-vue --save and import the Diagram component into one of my class components), I receive an error when I run npm run serve:

13:25 Could not find a declaration file for module 'diagram-vue'. 'C:/<more_path_stuff>/client/node_modules/diagram-vue/dist/diagram.umd.js' implicitly has an 'any' type.
  Try `npm install @types/diagram-vue` if it exists or add a new declaration (.d.ts) file containing `declare module 'diagram-vue';

I tried installing the types for the package, but got a 404. I'm not sure I'm technically skilled enough to write a type file (fairly new to vueJS and TS) hence the ask.

Thanks for your work--hopefully when I get this working it'll be really cool! Let me know if you want me to provide any code snippets from my project to better understand my use case if that would be helpful.

gwenaelp commented 4 years ago

Hi,

Thanks for your message, glad to see that this project reaches users !

At the moment there is nothing done. I am not that much into Typescript... I usually prefer writing everything directly in Javascript. That may change, but at the moment I am not skilled to acheive that task, sorry.

If you are motivated to try to implement it, or if anybody reading this issue is, please drop a message below :)

GFLEMING133 commented 4 years ago

That's okay--thanks for the response and invite to collaborate. I wish I were skilled enough to write the type def file but based on my time and knowledge constraints for the project I'm going to have to pass on the actual implementation for now. :(

For anyone looking in the future though, who needs this same functionality (only TS-compatible), I'd check out https://github.com/Patcher56/vue-flowy/. It isn't as cool as this library but it works like a charm with TS and has a nice clean look. Hope it helps someone!