-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript or JSDoc #164
Labels
Comments
If desired, I'd be happy to make a PR with either Typescript or JSDoc. |
You can find the types here You can add it to your project like this:
|
@surdu Yes, the public API types are available. I'm specifically asking about internal types though. After all, I did port earcut to C# once, and it took a fair chunk of time to figure out the internal types. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used the excellent earcut library, and it was rock solid.
However, once I started looking into porting it to other languages (e.g. C#), I quickly ran into the issue of "wait, what type does this have"?
For example, what type does
list
have?https://github.com/mapbox/earcut/blob/afb5797dbf9272661ca4d49ee2e08bd0cd96e1ed/src/earcut.js#L272C30-L272C30
(Spoiler: It's a
Node
. Not aNode[]
)To make porting this library easier, and maybe also to make contributing to this library slightly easier, it would be lovely if we had type annotations.
The text was updated successfully, but these errors were encountered: