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

Add types to DefinitelyTyped

Open ajbogh opened this issue 7 years ago • 9 comments

Add Typescript types to the DefinitelyTyped repo so that imports use the correct types instead of requiring a type stub.

ajbogh avatar Oct 09 '18 18:10 ajbogh

I can try to help with this if you could give me some pointer on where to start? Is this related to issue #76?

hayer avatar Oct 14 '18 12:10 hayer

Hi @hayer. This is related as a secondary step to #76. First we should resolve #76, then we should add types to DefinitelyTyped. Realistically, we can add a stub or simplified types to DefinitelyTyped before completing #76, but we'd like to be as complete as possible.

The intent of this is to allow Typescript projects to use the project by installing @types/react-digraph using npm. This package does not exist at the moment. This would allow react-digraph types to be identified in non-Flow environments.

You should start with the DefinitelyTyped README if you're looking to take this task up.

ajbogh avatar Oct 30 '18 21:10 ajbogh

Any updates to this?

josh-degraw avatar Nov 25 '18 23:11 josh-degraw

Hi @josh-degraw. There is some internal momentum on this, but it's a perfect task for public support as well. The v5 refactor took a number of shortcuts with typing that we still need to smooth out, so it'd be a great place for community support, as typing doesn't change the underlying API.

Regarding the latest updates, we improved the rendering performance significantly in several areas, so that has been our main focus recently. We are still working on other updates and I plan to come back to this later.

Please feel free to submit a PR if you have the chance!

ajbogh avatar Nov 26 '18 04:11 ajbogh

Okay, thanks for the quick response!

josh-degraw avatar Nov 27 '18 00:11 josh-degraw

Question: are you guys open to bundling the type definitions with this package itself, or is that something you want to avoid? I ask because I've tried before with another package publishing via DefinitelyTyped and it was a major pain (in many ways; I eventually gave up, although that was just a minor update to an existing project), and I would assume that implementing the type definitions right in with the main project would make things easier all around.

josh-degraw avatar Nov 27 '18 05:11 josh-degraw

Bundling with the project is a great way to start. Since the package is developed with Flow, we're already going to export the flow types (not sure if I had set that up yet) to a /flowtypes folder. We can do the same with Typescript types by adding them to a /types folder in the root.

ajbogh avatar Nov 27 '18 06:11 ajbogh

Okay. If I have time I'd like to try and tackle this.

josh-degraw avatar Nov 27 '18 19:11 josh-degraw

Hi guys! What about typings/index.d.ts - are these types actual?

nukisman avatar Nov 01 '20 15:11 nukisman