Skip to content
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

Add TypeScript Definitions #17

Closed
imransl opened this issue Oct 8, 2019 · 1 comment
Closed

Add TypeScript Definitions #17

imransl opened this issue Oct 8, 2019 · 1 comment

Comments

@imransl
Copy link
Contributor

imransl commented Oct 8, 2019

I saw that the type definitions for TypeScript was removed due to #12. This is probably due to the not-so-good type definitions I created in a PR. My bad. However, we can still add type definitions using TypeScript's tsconfig.json. There is a setting called declaration that needs to be applied in it like here: https://github.com/frankwallis/react-slidedown/blob/master/tsconfig.json. TypeScript will then generate the TypeDefinitions automatically for us when we run its compiler.

@ZeeCoder
Copy link
Owner

It was specifically because of how this turned out:
#13 (comment)

I'm not comfortable adding TS definitions back in without knowing anything about TS myself, as I have no way of knowing whether anything TS-related that a lib user proposes makes sense or not, or whether someone else will come later and try to correct it to something that I yet again have no way to check myself.

I'm sure there's a way to use a 3rd party lib in a TS codebase without the lib being written in TS or having types explicitly exported.

I think I'll only add TS types here when I learn it in the future and then I'll just rewrite the whole source in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants