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

Please add *basic* @types modules for this and Pianola! #41

Open
NSExceptional opened this issue Jul 16, 2021 · 1 comment
Open

Please add *basic* @types modules for this and Pianola! #41

NSExceptional opened this issue Jul 16, 2021 · 1 comment

Comments

@NSExceptional
Copy link

NSExceptional commented Jul 16, 2021

These packages cannot even be used from TypeScript without types. I couldn't care less about how accurate the types are, I just need something that allows me to import and use it from a TypeScript file. I know you've said it doesn't make sense to add types for something as dynamically/loosely typed as these libraries, but that's okay: that's what any/unknown are for. TypeScript's type system is extremely flexible and makes no compromises. You can express just about anything, and when you can't, just use any.

I've tried adding types myself, but I'll just say it's not going well. Happy to send you the files I have so far if you want to expand on them, but I think the underlying library may need to export the default export as a named function instead of an anonymous closure, which is where I got stuck and why I'm stopping now. Default exports are generally bad anyway. (The default export doesn't have to go away, you can export it in two places)

Please let me know how I can help! If I can change your mind here, I will gladly sponsor you as well, happy that I can soon use this awesome library from TypeScript.

@gajus
Copy link
Owner

gajus commented Jul 16, 2021

Contributions are welcome, even if it changes default export to named export.

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

No branches or pull requests

2 participants