5 ms·
So now tsd install angular is replaced by this? npm install -s @types/angular
by animesh 10y ago
So now
tsd install angular
is replaced by this?
npm install -s @types/angular
- k__ 10y agoAs far as I know, some libraries bring their own typings, especially when they're written in TypeScript.
- WorldMaker 10y agoRight, Angular 2 could build typings directly from their Typescript sources into their npm packages (there's a "typings" field to add to package.json being the only other step). If they did that all you need is npm install -s angular and typings just fall out of the sky for you. Aside, my biggest concern with the new @types scope is that it is still tightly coupled with the DefinitelyTyped megarepo. DT has been a great help over the years, but it's so huge and increasingly hard to contribute to as DT has increased its quality bar and its size makes it a stress test on git tools and IDEs, too.
- the_duke 10y agoIf the library has it's own .d.ts file in the repo, it will just work. Otherwise, the @types packages on npm are the way to go. Please note that most of the @types/XXX packages are just automatically extracted from the DefinitelyTyped repo. Big packages with lot's of updates can use their own repo. But this is a huge, huge usability win. No more haggling with additional tools to get your typings.
- tga 10y agoFrom a usability point of view is it really such a huge huge win that instead of using `typings install foo` you can now use `npm install @types/foo`? I can see it's better (not sure why a single repository(!) was ever considered a good idea), but in the end both methods work if all you need is to obtain the latest version of a .d.ts file.