April 16, 2015
Amateur Professional Eater
(Just as SASS is to CSS)
> Developed by Microsoft (I know, I know..)
> First public appearance: October 1, 2012
> Stable release: 1.4 released January 16, 2015
> Conforms to ECMA standards & proposals
> Open Source! github.com/Microsoft/TypeScript
What does it give us?
C, C++, C#, JADE, Java, Fortran, Haskell
Type a variable:
Type a function:
Standard JS Types: Boolean, Number, String, Array
Also includes Enum, Any, Void
Enforce types for array content
foo = 'Hello!';
foo = true;
foo = 42;
var pointless = initSomething(); // 🍋Compiler Error
A function that returns nothing
Basically ES6 import module syntax. Compiles into AMD, CommonJS, or vanilla ES6 JS.
External files which define types for libraries that aren't necessarily written in TS.
1.4 is stable now. 1.5 has more ES6 features, still in alpha.