Today we’re announcing TypeScript 1.5 Alpha, the first preview of the TypeScript 1.5 release. This release shows off many of the features that will be in the final TypeScript 1.5 release. In the alpha release, you’ll be able to use three new capabilities of the TypeScript tools: a richer ES6 experience, decorators, and a new Sublime Text plugin.
You can try this alpha out today by installing the new compiler available on npm.
Richer ES6 experience
In TypeScript 1.5, we’re adding a number of new ES6 features. These features work together with the TypeScript type system to give you helpful tooling when working with the new ES6 code patterns.
Modules
The module syntax of ES6 is a powerful way of working with modules. You can interact with modules by importing whole modules or by working with individual exports directly.
import * as Math from “my/math”;
import { add, subtract } from “my/math”;
ES6 also supports a range of functionality in specifying exports. You can export declarations, such as classes or functions. You can also export a ‘default’ to import the module directly. For example:
// math.ts
export function add(x, y) { return x + y }
export function subtract(x, y) { return x – y }
export default function multiply(x, y) { return x * y }
// myFile.ts
import {add, subtract} from “math”;
import times from “math”;
var result = times(add(2, 3), subtract(5, 3));
If you’ve been using TypeScript, you may notice that this is similar to TypeScript external modules. This is no accident. When we created external modules for TypeScript, we were working on the same problems. The ES6 design takes the capabilities even further, showing a powerful, mature design. We will continue to support external modules, but we will begin encouraging developers to use the more capable ES6 module syntax.
Destructuring
Destructuring is a handy new feature that comes as part of our ES6 support. With it, you can pull apart, or destructure, objects and arrays.
var [x, y] = [10, 20];
[x, y] = [y, x]; // a simple swap
You can also use destructuring to handle function parameters:
var myClient = {name: “Bob”, height: 6};
function greetClient({name, height: howTall}) {
console.log(“Hello, “ + name + “, who is “ + howTall + ” feet tall.”);
}
greetClient(myClient);
In the above, greetClient takes in a single object that has a name and height property. Using the ‘height: howTall’ syntax, we can rename the height property to howTall inside of greetClient.
And more
We’ve also added for-of support for better iteration, let/const compiling to ES5, unicode support, an ES6 output mode, and better support for computed properties.
Decorators
We’ve also worked with the Angular, Ember, and Aurelia (from the makers of Durandal) teams on a decorator proposal for ES7, which we’re previewing in TypeScript 1.5 Alpha. Decorators allow you to create a clean separation of concerns. In this example, we see how the @memoize decorator could be used to note that a getter/setter pair can be memoized:
class Person {
@memoize
get name() { return `${this.first} ${this.last}` }
set name(val) {
let [first, last] = val.split(‘ ‘);
this.first = first;
this.last = last;
}
}
Developers will be able to write new decorators and mix-and-match them to work with the type system.
Sublime Text plugin
Along with TypeScript 1.5 Alpha, we’re also releasing a preview of the Sublime Text plugin for TypeScript to enable more developers to get editor support when authoring TypeScript. This plugin works with both Sublime Text 2 and Sublime Text 3 and shows some of what is possible with the TypeScript type system. Sublime Text and the TypeScript plugin are available for OSX, Linux, and Windows.

TypeScript commands available in Sublime Text
The Sublime Text plugin allows you to easily navigate, refactor, format, and investigate TypeScript code. Those who tried the Sublime plugin that came with the ng-conf demo may also notice that this updated plugin is snappier, especially with larger files.
We’re excited to hear your feedback. If you’d like to leave a comment, you can fill out an issue on the issue tracker. Also, feel free to jump in and send us your pull requests to help make the Sublime plugin even better.
What’s next
This alpha release shows what will be possible in TypeScript 1.5 when it’s released, and we want to hear from you. We’re working hard on TypeScript 1.5, and you can help us make it a strong release by trying it out and sending us any issues you find.


Nice work on the Sublime plug-in.
Great!
Many, many thanks!
P.S.
I think you have one little typo in Person class: @memorize instead of @memoize.
@Harris
Thanks. Re: memoize, you can read more about memoization here: en.wikipedia.org/…/Memoization It's a cool trick for optimization. But looks like I typo'd in the sample. Will fix.
Thanks guys great job!
Will check it out asap! Can't wait for the stable version with VS support!
BTW: the date is a bit off. Blog post says it is created Mar 27 2015 but it was definitely not here a few hours ago π
Great!!
Assimilation started.
Decorators look quite interesting: smellegantcode.wordpress.com/…/typescript-1-5-get-the-decorators-in
"Let/const compiling to ES5" has major positive implications for how we code! Deserves its own section in the announcement, IMO. π Awesome stuff!
I've been waiting for this release for years! Looks really good. Looking forward to Visual Studio integration.
Regarding destructuring function parameters, is it possible to define the variable types? For example:
function greetClient({name, height: howTall})
both 'name' and 'howTall' are any, presumably. I imagine you can do:
function greetClient({name, height: howTall}: { name: string, howTall: number})
But can this be done more succinctly? Thanks.
@Jamie – I believe the type talks about the original shape, rather than with the renames, but yeah. Something like:
function greetClient({name, height: howTall }: { name: string, height: number }) { … }
@Jamie Alternatively, there is alway the option of a separately defined interface:
interface IPerson {
name: string;
height: number;
}
function greetClient({name, height: howTall }: IPerson) { … }
This is going to be great. I think TypeScript has become the precursor of ES6/7/next. More compelling to adopt now with all these ES6/7 features!
Can you tell anything about how this version will relate to the upcoming Visual Studio release? Will VS 2015 ship with TypeScript 1.5 or 1.4?
Decorators/Attributes in JavaScript are going to open alot of doors. Looking forward to using them. Keep up the great work guys. 2+ years in with TypeScript and it gets better and better.
I have managed to get the npm package into a VS 2013 (ASP.NET MVC project) using Package Intellisense tool.
What do I need to do, so that this project now uses the 1.5 compiler?
Looks great! I've been waiting for this. The one issue I'm having is using existing tsd files with es6 compilation. Any suggestion?
@Ben Tesser what specific issues are you running into? can you log them in github.com/…/issues
And what about yields? It wasn't easy for me to port them to my VS. Still waiting for official support π Btw, Great work π
@Fixer – we're currently thinking generators (yields and generator functions) will be part of 1.6.
import … from xxx , I prefer %S:space[…] ,usingβ%β ,we see "space" first, abbr. as S, then import some marks "…"
prefer "@" to "public" and "export"
if fact , i think assign variables, function, class by same means, as :
assign classA{} // this is class
assign funA(){} // this is function
assign varA // this is variable
at last "assign" can be killed
===
there's another idea, why thread program is so ugly, can it be as follows?
doA();
&! doC();
doB();
waitfor(doC);
here, doC runs in background
thanks!
@hubee – the syntax we show comes from the ES6 module syntax that is part of the JavaScript standard. With TypeScript being a superset of JS, we follow its syntax.
@hubee – better version:
doA();
var c = doC();
doB();
await c;
That's what TypeScript 1.6 is probably going to have (see prototypeAsync branch).
On this page, something named Telligent_CallbackManager is presenting an alert every time the page is reloaded. The alert states "The target of the callback could not be found"
This has been present for a couple of weeks now.
I'm thinking about this language these days. Can it be more simple,simplely.
1,
the constructed function can be replaced by"set(para1,para2){}" commonly.
when we assign a new variable , varA:ClassA = (para1,para2),that's enough.
2,
class convertor can be writed "get<class name>{}"
if varB:classB, varA:classA, we type varB = varA,what's happened? which properties' value of varA are given to those of varB, refer to calssA's "get<classB>{}" function.
3,
How about designning three logical operational values: True,False,NULL
NULL stands for undefine or nothing, all operations with NULL return NULL, no error occurs.
under the help of NULL, code can be writed arbitrarily.Therefor,Optional Properties may be useless.
4,
Can interface be mergered into class?
Even though class confines the variable,the variable can be adopted for special use. as below:
triangleA:{lineA:num;lineB:num;lineC:num}; // assign class triangleA
var varA:triangleA = {lineA:3,lineB:4,lineC:5}; //also varA:triangleA = (3,4,5)
var varL:float;
if(varA.lineA > 4) varL = varA.square(); // return NULL
varA:{function square(){formular sentences}}; // add proterty function"square()"
if(varA.lineA > 4) varL = varA.square(); // return 6
5,
For for,while,foreach sentences ,can be write as one sentence:
loop<>[](){}
eg. loop<this,that,group[]>[index,it](index >10 || it.value < 0){dosome()}
here,<this,that,group[]> constructs a list, waiting for being operated, the number's turn is "index","it" stands for the
number, () contains condition whether if loop "it".
for(int i = 0; i< 10; i++){}
vs
loop[int i,](i <10){}
while(;){}
vs
loop(){}
foreach(char ch in strings){if(ch>10)continue;else do()}
vs
loop<strings>[,ch](ch < 10){do()}
—
Think about the above.
thanks!
@hubee – for more in-depth syntax discussion, the best place is the TypeScript github site. That'll let us break down the idea and talk about it more easily:
You can file feature requests here: github.com/…/issues
Does it have support for Visual Studio Code?