April 16, 2015
Amateur Professional Eater
- What is it?
- Where did it come from?
- What are its goals?
- How can I use it?
- What happens in the future?
(Just as SASS is to CSS)
is already valid TypeScript
> 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
Typing with TypeScript
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.
By Eran Schoellhorn