According to https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/:
DefinitelyTyped will still be the place to author new declaration files.
But it's unclear why we'd create new definitions at DefinitelyTyped as opposed to submitting them directly to NPM.
Being that DT is so large now, it seems counter productive to continue adding to that repo. What are the advantages of DT over publishing to NPM directly?
The DefinitelyTyped repo is being treated as the endorsed community repository of type declarations for packages that don't provide their own.
Answering this question depends on what you mean when you say
submitting them directly to NPM.
If you mean including the .d.ts file with the package that the .d.ts file corresponds to that's encouraged. The moment package, for example, includes and maintains its own declaration file.
If you mean providing your own type only package then DefinitelyTyped is the better location for those files and will provide some advantages. By including your file in DefinitelyTyped it will
To add to Paarth's answer, being in DefinitelyTyped provides extra benefits you should consider:
@types
publisher will automatically tag the latest compatible release for older TS versions (e.g. people on TS 2.1 can npm install @types/[email protected]
to get a 2.1-compatible version)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With