JS • Makes it easier to use traditional object-oriented design patterns, like classes and interfaces, in JS • Easy to learn—extends existing JavaScript syntax • Tracks new Javascript standards, like ES2015 & ES2016, as they come out
focuses on the shape that values have… “In TypeScript, interfaces fill the role of naming these types, and are a powerful way of defining contracts within your code as well as contracts with code outside of your project.”
build up reusable components… “Starting with ECMAScript 2015,… JavaScript programmers will be able to build their applications using this object-oriented class-based approach. In TypeScript, we allow developers to use these techniques now, and compile them down to JavaScript that works in [current browsers]…”
Typescript, this was “fun” • Pre-Typescript 2, you had to use TypeScript Definition Manager (tsd or typings commands) • As of Typescript 2+, you can npm install types packages, just like you do the libraries themselves
--save @types/jquery • Typescript compiler will automatically look in ./ node_modules/@types folder for type definitions • (you no longer need the triple-slash reference) /// <reference path="jquery/ jquery.d.ts" />
work-in-npm-when-to-use-types-and-why-what-are-compiler-opt-in-types/ -good explanation of the replacement for TypeScript Definition Manager • https://github.com/dzharii/awesome-typescript -curated list of TypeScript resources • https://app.pluralsight.com/library/courses/typescript -good introduction, paid site, free trial available