The company used the Build 2016 conference to confirm that TypeScript 2.0 will be arriving in June and will be bringing a number of new features to the coding language.
TypeScript 2.0 is the future major build of the company’s open source programming language, and Microsoft said it will come with non-nullable types.
Non-nullable types is a new addition to TypeScript, using a compiler switch that Microsoft’s Ander Hejlsberg (Microsoft tech) said, “In strict null checks, we say undefined and null are no longer part of all of the types.”
The new version will come with two types, one that has a single undefined value, and another that is called null type. A number and a string is undefined, a Union Type that can join single and null types. “If you want to have a thing that can be number or undefined, you write it as a union type,” Hejlsberg said.
Some of the features coming in TypeScript 2.0 include async/await downlevel support, which allows code flows written out of sync to appear as if they were synchronous. Microsoft has discussed async/await before, saying last year that developers can use the feature only if they are targeting Node.js 4 of later.
The feature list for the upcoming release also include read-only properties, and enhanced typing acquisitions that use NPM to install type declaration packages.
SOURCE: Microsoft Build