surgeon icon indicating copy to clipboard operation
surgeon copied to clipboard

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

Open NSExceptional opened this issue 3 years ago • 1 comments

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.

NSExceptional avatar Jul 16 '21 20:07 NSExceptional

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

gajus avatar Jul 16 '21 20:07 gajus