Today we’re excited to announce the final release of TypeScript 2.0!
TypeScript 2.0 has been a great journey for the team, with several contributions from the community and partners along the way. It brings several new features that enhance developer productivity, advances TypeScript’s alignment with ECMAScript’s evolution, provides wide support for JavaScript libraries and tools, and augments the language service that powers a first class editing experience across tools.
To get started, you can download TypeScript 2.0 for Visual Studio 2015 (which needs Update 3), grab it with NuGet, start using TypeScript 2.0 in Visual Studio Code, or install it with npm:
npm install -g typescript@2.0
For Visual Studio “15” Preview users, TypeScript 2.0 will be included in the next Preview release.
The 2.0 Journey
A couple of years ago we set out on this journey to version 2.0. TypeScript 1.0 had successfully shown developers the potential of JavaScript when combined with static types. Compile-time error checking saved countless hours of bug hunting, and TypeScript’s editor tools gave developers a huge productivity boost as they began building larger and larger JavaScript apps. However, to be a full superset of the most popular and widespread language in the world, TypeScript still had some growing to do.
TypeScript 1.1 brought a new, completely rewritten compiler that delivered a 4x performance boost. This new compiler core allowed more flexibility, faster iteration, and provided a performance baseline for future releases. Around the same time, the TypeScript repository migrated to GitHub to encourage community engagement and provide a better platform for collaboration.
TS 1.4 & 1.5 introduced a large amount of support for ES2015/ES6 in order to align with the future of the JavaScript language. In addition, TypeScript 1.5 introduced support for modules and decorators, allowing Angular 2 to adopt TypeScript and partner with us in the evolution of TypeScript for their needs.
TypeScript 1.6-1.8 delivered substantial type system improvements, with each new release lighting up additional JavaScript patterns and providing support for major JavaScript libraries. These releases also rounded out ES* support and buffed up the compiler with more advanced out-of-the-box error checking.
Today we’re thrilled to release version 2.0 of the TypeScript language. With this release, TypeScript delivers close ECMAScript spec alignment, wide support for JavaScript libraries and tools, and a language service that powers a first class editing experience in all major editors; all of which come together to provide an even more productive and scalable JavaScript development experience.
The TypeScript Community
Since 1.0, TypeScript has grown not only as a language but also as a community. Last month alone, TypeScript had over 2 million npm downloads compared to just 275K in the same month last year. In addition, we’ve had tremendous adoption of the TypeScript nightly builds with over 2000 users participating in discussion on GitHub and 1500 users logging issues. We’ve also accepted PRs from over 150 users, ranging from bug fixes to prototypes and major features.
DefinitelyTyped is another example of our community going above and beyond. Starting out as a small repository of declaration files (files that describe the shape of your JS libraries to TypeScript), it now contains over 2,000 libraries that have been written by-hand by over 2,500 individual contributors. It is currently the largest formal description of JavaScript libraries that we know of. By building up DefinitelyTyped, the TypeScript community has not only supported the usage of TypeScript with existing JavaScript libraries but also better defined our understanding of all JavaScript code.
The TypeScript and greater JavaScript communities have played a major role in the success that TypeScript has achieved thus far, and whether you’ve contributed, tweeted, tested, filed issues, or used TypeScript in your projects, we’re grateful for your continued support!

What’s New in TypeScript 2.0?
TypeScript 2.0 brings several new features over the 1.8 release, some of which we detailed in the 2.0 Beta and Release Candidate blog posts. Below are highlights of the biggest features that are now available in TypeScript, but you can read about tagged unions, the new never type, this types for functions, glob support in tsconfig, and all the other new features on our wiki.
Simplified Declaration File (.d.ts) Acquisition
Typings and tsd have been fantastic tools for the TypeScript ecosystem. Up until now, these package managers helped users get .d.ts files from DefinitelyTyped to their projects as fast as possible. Despite these tools, one of the biggest pain points for new users has been learning how to acquire and manage declaration file dependencies from these package managers.
Getting and using declaration files in 2.0 is much easier. To get declarations for a library like lodash, all you need is npm:
npm install --save @types/lodash
The above command installs the scoped package @types/lodash which TypeScript 2.0 will automatically reference when importing lodash anywhere in your program. This means you don’t need any additional tools and your .d.ts files can travel with the rest of your dependencies in your package.json.
It’s worth noting that both Typings and tsd will continue to work for existing projects, however 2.0-compatible declaration files may not be available through these tools. As such, we strongly recommend upgrading to the new npm workflow for TypeScript 2.0 and beyond.
We’d like to thank Blake Embrey for his work on Typings and helping us bring this solution forward.
Non-nullable Types
JavaScript has two values for “emptiness” – null and undefined. If null is the billion dollar mistake, undefined only doubles our losses. These two values are a huge source of errors in the JavaScript world because users often forget to account for null or undefined being returned from APIs.
TypeScript originally started out with the idea that types were always nullable. This meant that something with the type number could also have a value of null or undefined. Unfortunately, this didn’t provide any protection from null/undefined issues.
In TypeScript 2.0, null and undefined have their own types which allows developers to explicitly express when null/undefined values are acceptable. Now, when something can be either a number or null, you can describe it with the union type number | null (which reads as “number or null”).
Because this is a breaking change, we’ve added a --strictNullChecks mode to opt into this behavior. However, going forward it will be a general best practice to turn this flag on as it will help catch a wide range of null/undefined errors. To read more about non-nullable types, check out the PR on GitHub.
Control Flow Analyzed Types
TypeScript has had control flow analysis since 1.8, but starting in 2.0 we’ve expanded it to analyze even more control flows to produce the most specific type possible at any given point. When combined with non-nullable types, TypeScript can now do much more complex checks, like definite assignment analysis.
function f(condition: boolean) {
let result: number;
if (condition) {
result = computeImportantStuff();
}
// Whoops! 'result' might never have been initialized!
return result;
}
We’d like to thank Ivo Gabe de Wolff for contributing the initial work and providing substantial feedback on this feature. You can read more about control flow analysis on the PR itself.
The readonly Modifier
Immutable programming in TypeScript just got easier. Starting TypeScript 2.0, you can declare properties as read-only.
class Person {
readonly name: string;
constructor(name: string) {
if (name.length < 1) {
throw new Error("Empty name!");
}
this.name = name;
}
}
// Error! 'name' is read-only.
new Person("Daniel").name = "Dan";
Any get-accessor without a set-accessor is also now considered read-only.
What’s Next
TypeScript is JavaScript that scales. Starting from the same syntax and semantics that millions of JavaScript developers know today, TypeScript allows developers to use existing JavaScript code, incorporate popular JavaScript libraries, and call TypeScript code from JavaScript. TypeScript’s optional static types enable JavaScript developers to use highly-productive development tools and practices like static checking and code refactoring when developing JavaScript applications.
Going forward, we will continue to work with our partners and the community to evolve TypeScript’s type system to allow users to further express JavaScript in a statically typed fashion. In addition, we will focus on enhancing the TypeScript language service and set of tooling features so that developer tools become smarter and further boost developer productivity.
To each and every one of you who has been a part of the journey to 2.0: thank you! Your feedback and enthusiasm have brought the TypeScript language and ecosystem to where it is today. We hope you’re as excited for 2.0 and beyond as we are.
If you still haven’t used TypeScript, give it a try! We’d love to hear from you.
Happy hacking!
The TypeScript Team

Awesome news! Thanks to you, the entire TypeScript team, and everyone in the community for making this release this possible.
Congrats!
Great! Thanks for supporting js and making it more future proof.
nice
Awesome!
Hooray
Woot! Woot!
Great! It’s worth trying!
Where can we learn more about how to properly publish definitions for consumption through @types ?
i guess it says at the bottom of this page: http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
continue publishing via definetelyTyped.
or better, don’t publish the typings separately. Just add a “`types“` field to your “`package.json“` file
It’s a nice!
awesome!
Great release! I’ve been enjoying non-null types – *great* feature when combined with the flow analysis. I wish we had this in C#. 🙂
Looking forward to async/await in 2.1.
Async/await has been in for a while now.
Congratz!
Congratulations on 2.0 and thanks for all the hard work put in by Microsoft and the community to make TypeScript such a great addition to the JavaScript ecosystem!
I am very excited for the release. We have been using it in beta and rc for a couple months. The one issue I have is using strictNullChecks with external type definitions. I think am am stuck because the type definitions of the libraries I use (Angular2, lodash, localforge, etc) are not strict null safe.
I would love to use strictNullChecks on our codebase, but is there some way to tell it to go back to lax null checking for some/all library type definitions?
Without this it seems I will have to wait quite a while before I can actually use null checks and will end up having to turn it off whenever I add new libraries that don’t support it yet.
Right now your dependencies will need to be authored for strictNullChecks; much of the time 3rd party .d.ts files will still work regardless, but if not, feel free to send a PR to DefinitelyTyped on the types-2.0 branch.
Microsoft and the Typescript Team have advanced the Internet today! Before Typescript, the idea of working as a developer on the web kept me awake. I questioned my career. I am going to end up having to make scalable JavaScript with no tooling. No thanks.
I found TypeScript back on 0.x and all of my problems, concerns and worries evaporated.
When we talk teams, scale, tools and productivity. I would honestly now have to ask why TypeScript is not being used and would need a pretty good answer to accept it.
Thanks everyone for making the web a better place! 😀
Agreed. I can only image one answer: it’s less than 100 lines of code.
Even though TS is a great tool, one should always ask before any project start “Do I need this tool?” not the other way around. Just my 2 cents.
Instead of `npm install -s @types/lodash` do you mean `npm install -S @types/lodash`? (Capital `-S` to save dependencies to `package.json`.
It actually depends – if your project is intended to be consumed as a library, then you want your declaration files to be included. If not, you can leave them as dev dependencies. Giving guidance to use ‘dependencies’ bites people less than the alternative.
I now see what you meant – corrected, thanks!
The download on the typescript website takes me to 1.8.6 download. I was only able to get it from inside visual studio extensions dialog.
Please use the link in this blog. The download center servers take a few hours to propagate the updates everywhere.
Also, as usual, after installing typing tsc -v at the vs 2015 dev command prompt still reports 1.8.
Check the PATH string in your environment settings. There’s probably a reference to the 1.8 version. Change that to 2.0 and the new compiler will be picked up.
TypeScript, how I adore thee.
Hurray !!!!
Thanks TypeScript team and community! Great release!
Ah! Such a missed opportunity! ‘readonly’ could have been ‘val’ instead. 😉
Otherwise; looks good. Typescript is really getting in shape.
Awesome work! Non-nullables all the way!
Awesome. Thanks for all the amazing work!
Congrats, I love Typescript!
Thank you, guys!
Congrats entire TypeScript team and its contributors!! Simple continued awesome work.
Great!
Yay for non-nullable types! No more True, False, FileNotFound errors.
Next up, async/await support in ES5 please!
Big thanks
Yay!!
nice
very good
Typescript is the Pascal but much much better !! <3
Your example `npm install -s @types/lodash` is incorrect, to save a package dependency to the package,json you have to use` –save` option. -s option does nothing.
Corrected, thanks!
I am existing to use this.
I think you need to support more than just Visual Studio 2015. This alone makes me wonder if it will continue to be used outside the MS community.
Many editors are supported.
In fact Visual Studio is not even the “first class” editor as proven by the latest type definition features coming to the other editors before Visual Studio.
Please see http://www.typescriptlang.org/index.html#download-links for other editors/editor plugins for TypeScript.
Really cool!
I love TS but hate Visual Studio. How can I run TS without VS ??
If you’re not big on VS, you can use Visual Studio Code, which is a cross-platform lightweight editor built in TypeScript. It’s fast, free, and open-source. Check it out here: https://code.visualstudio.com/
We also have a list of supported editors on our wiki: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support
“We also have a list of supported editors on our wiki:”
Visual Studio 2013/2015
Visual Studio comes with TypeScript when installing Microsoft Web Tools.
TypeScript for Visual Studio 2015 can be found here
TypeScript for Visual Studio 2013 can be found here
So, does Visual Studio 2013 support TS 2.0?
Will Visual Studio 2013 be supported soon? I understand that Visual Studio Code is free but in many cases company software policies restrict what applications can be used, and we are still officially stuck on Visual Studio 2013 for the next year.
I sure wish that the TypeScript and ClearScript teams would get together and figure out how to enable direct TypeScript support in ClearScript. I would love to able to add TypeScript scripting to my .NET application via the ClearScript engine.
i guess that increased download rate from last year is in debt of angular using ts !
Congratulations. Keep up doing that excellent work.
Congratulations, guys. I’ve been using it all day and really like all the little improvements over the RC candidate. (Good job with the release announcement also, Daniel. It’s refreshing to see language without tedious buzzwords!)
Thanks @Noel Abrahams!
After update visual studio 2015, no longer have any intellisense in .ts files. Switched the TypeScriptToolsVersion in my csproj file, anything else to try?
Please make sure you have installed latest Update 3 from https://msdn.microsoft.com/en-us/library/mt752379.aspx. If not please uninstall all versions of TS, install latest Update 3, and reinstall TS again. If you are still running into issues please share your install logs with us in a new issue at https://github.com/Microsoft/TypeScript/issues, and we would be happy to dig into it.
Same here. No intellisense. Compile on save isn’t working. Indenting also no longer working. Keyword coloring and compiling during build is about the only thing still working.
I’m having the same problem
Same here, have syntax highlight, but no intellisens or identation. Any solutions?
Same here…no intellisense, I have update 3 and the patch to update 3, no go, I’ve tried just about everything suggested, nothing, updates always seem to break intellisense 😉
Had the same problem here.
Just saw under ‘Extensions and updates’ that there is a recent september KB patch for VS2015 Update 3.
That solved the problem for me.
Awesome!
Where can I find installer for VS2013? I have checked https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support#visual-studio-20132015 but 2.0 is still missing.
Haters gonna hate.
Very nice, I was able to remove all of my typings.json files and just include types using npm directly.
Great work guys!
How’s `readonly` different from `const` ?
Whereas const is for variables, readonly is for object/class properties and looks to be similar to readonly in C#: You can initialize it immediately, or you get one shot at initializing it (but only in a constructor? Not sure if that’s a requirement).
Thanks! I don’t know any C# so I was unaware of the resemblance.
Specifically readonly means you can get the value of the property but you can’t set it. This is not the same thing as it being const (unchanging) because it may change by some other means.
Whereas const on a local variable means it will never change – there is no way at all to change its value.
I rely a lot on the IntelliSense when coding, and typescript allows this to be a lot more accurate than working in plain js. Having typings as a separate part had always been a bone of contention with those who have not adopted ts. Now @types will help ease my workflow so much better.
VS2013 support: https://github.com/Microsoft/TypeScript/issues/11214
TypeScript @serverside:
– When will there be an official TypeScript runtime? The current options all compile *.ts into *.js and then executes the JS files.
– I’ve tried: ts-node, tsun, mancy
Correct me if I’m wrong about anything. I like the tools above, but just hope there would be an official one available for maximum performance and reliability.
I eagerly expected LINQ features from the horse mouth (Anders Hejlsberg) in Typescript 2.0
and not from any other third party libraries. Kindly incorporate LINQ Features in Future Version of Typescript
I eagerly expected LINQ features from the horse mouth (Anders Hejlsberg) in Typescript 2.0
and not from any other third party libraries. Kindly incorporate LINQ Features in Future Version of Typescript
YAY!!! 1M Kudos to TS Team!!! been using TS since the first release for my game engine ^ _^ Y
All I wish for the next release is *Internal access modifier* within the *same module name*.
Awesome news love that typings has moved to npm.
Is there a way to install/find old version of typing files?
Thank you and Thank for the Talk at ng-europe.
Nice thanks
Nice thanks. Works fine for me. Better than the older version.
I love the way that typescript changed the Javascript ecosystem. Thanks guys for making the developer world better.
I’m in Visual Studio 2013 hell right now on account of this botched update process with typescript. Where is the CURRENT VERSION for VS 2013?
Thanks for taking the time to share your experiences and knowledge.
There seem to be endless ideas and theories on how to get ranked and attract visitors.
I am very excited for the release.
Instead of `npm install -s @types/lodash` do you mean `npm install -S @types/lodash`?
i guess that increased download rate from last year is in debt of angular using ts !
It is a great article. You will surely like this also because it is a great stuff, yeah it giveS us lots of interest and pleasure.