sindresorhus / import-fresh

Import a module while bypassing the cache
MIT License
283 stars 24 forks source link

Add TypeScript definitions #12

Closed ronami closed 5 years ago

ronami commented 5 years ago

Summary

Hey, pretty straight-forward: Adding some TypeScript definitions.

sindresorhus commented 5 years ago

Thanks for creating a TypeScript definition. 🙌 Can you follow this styleguide?

Some examples:

ronami commented 5 years ago

Hey, I updated the PR by documenting the types in index.d.ts.

Just pointing out some things in the PR:

I went over the styleguide and didn't find anything that's missing, is there anything specific I should fix?

Thanks!

sindresorhus commented 5 years ago

I used any over unknown to match Node's definition: DefinitelyTyped/DefinitelyTyped:types/node/globals.d.ts@master#L192 .

The Node.js type definitions are not very good nor strict.

sindresorhus commented 5 years ago

Looks good. Thanks :)