rxaviers / async-pool

Run multiple promise-returning & async functions with limited concurrency using native ES6/ES7
MIT License
798 stars 52 forks source link

Add TypeScript definitions #5

Closed krlwlfrt closed 5 years ago

krlwlfrt commented 5 years ago

Please supply TypeScript definitions for your async pool. Feel free to use the ones that I added to DefinitelyTyped.

See also #4.

If you'd like, I could open a pull request.

rxaviers commented 5 years ago

Thanks for having added the TypeScript definitions to DefinitelyTyped. The only resistance I have about importing them over here is the need to maintain them (and eventually flow). I prefer to keep them separate. Thanks for your comprehension.

krlwlfrt commented 5 years ago

Yes, I get that. I don't get the maintaining part though because the your API is stable and you'll probably not change that.

BTW.: You should have a look at TypeScript. It's awesome ;-)

rxaviers commented 5 years ago

Please, would you mind explaining to me what's the benefit of having the definitions in this package by exemplifying the current process to import it from a different repo and how it would be if we make this change? Thanks

krlwlfrt commented 5 years ago

DefinitelyTyped is only an auxiliary repository. It adds an extra layer of management because in order to use a project without TypeScript definitions one has to install 2 packages. The actual project and the TypeScript definitions. The versioning can become out of sync and it is not immediately obvious whether or not project and definitions are compatible.

If the definitions were inside the project itself one would only need to install said project and would be done.

The importing itself is handled by the TypeScript compiler which translates imports to the correct imports that are supported by the module system.

The benefit would be in the maintenance of dependencies.