3 ms·
TL;DR - Simplified Declaration File (.d.ts) Acquisition (via npm) - Non-nullable Types - Control Flow Analyzed Types - The readonly Modifier Finally, I was
by k__ 10y ago
TL;DR
- Simplified Declaration File (.d.ts) Acquisition (via npm)
- Non-nullable Types
- Control Flow Analyzed Types
- The readonly Modifier
Finally, I was wating for months :)
- wereHamster 10y agoAnd a whole lot more. https://github.com/Microsoft/TypeScript/wiki/Roadmap https://github.com/Microsoft/TypeScript/wiki/Roadmap has a summary of the most important changes.
- novaleaf 10y agoi hope they will add details on creating new d.ts files for the new @types scope.
- DanRosenwasser 10y agoWe've got some of the documentation out now. You can see more at https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html https://www.typescriptlang.org/docs/handbook/declaration-fil.... When submitting PRs, new files will need to be written for the `types-2.0` branch on DefinitelyTyped.
- animesh 10y agoSo 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.
- FrancoDiaz 10y agoSimplified Declaration File (.d.ts) Acquisition (via npm) This is huge from a usability perspective.
- ng12 10y agoIt doesn't seem to be ready. Random thing are broken that weren't in Typings.
- FrancoDiaz 10y agoThere's a couple different things we're talking about here. The ability to install typings via npm, which is good because it gets rid of another tool (typings) and everything is in package.json. But the other thing is the ability to consume declaration files in node_module packages themselves, which I consider a bigger win.
- ng12 10y agoWhy couldn't you do that before? Definition files are just ts files, wouldn't tsc be able to find them in node_modules?
- FrancoDiaz 10y agoI'll add the ability to use globs in tsconfig is a big win too. http://www.typescriptlang.org/docs/handbook/tsconfig-json.html http://www.typescriptlang.org/docs/handbook/tsconfig-json.ht...