gabzim / circle-to-polygon

Receives a Coordinate, a Radius and a Number of edges and aproximates a circle by creating a polygon that fills its area
ISC License
113 stars 29 forks source link

Add typings #17

Closed gabzim closed 4 years ago

gabzim commented 4 years ago

@johachi How do you feel about us either: a. Porting this to typescript b. Adding a typings file for people consuming this from typescript?

Right now we're limited to using var etc on our source. If we don't want to add typing to the module maybe we could at least at a transpilation step via babel?

What are your thoughts on this?

johachi commented 4 years ago

I'm actually open to port this to TypeScript. I will have to learn it for my new job any way, so this could be a good start. How would you want to go about doing this?

zakjan commented 4 years ago

Hi, full port to TS would be great! Meanwhile I sent a PR to add external TS typings to simplify consuming the library from downstream TS projects.

https://github.com/gabzim/circle-to-polygon/pull/25

gabzim commented 4 years ago

Thanks a lot for your contribution @zakjan, it's really appreciated. I have one small question and then if @johachi is good to merge, I'm good as well.

zakjan commented 4 years ago

DefinitelyTyped PR just got merged.

johachi commented 4 years ago

@zakjan thats great! Thank you for your effort. Please feel free to open a PR to update the readme to mention that there is TS support. :) If not I will do it in a few days.

@gabzim I'm closing this issue now since there now is a type in DefinitelyTyped.