TypeScript

A superscript of javascript that is transpiled into javascript. Even if an error, will compile to javascript. I.e using the wrong type for a variable will produce compile error, but produce working js New:

  • Strong Typing

  • Object oriented

  • Compile time errors

Valuable Because:

  • Get types from librarys to see all options and info in IDE

  • Much more static type errors especially around null checks

  • Easier to use internal code with argument annotations

Type Files

Types packages should just be in devDependencies

Should have .d.ts extension as recommended

Modules

Export keyword make this a module that can be imported

//In point.ts
export class Point {
  //...
}

//OTHER file in same dir
import { Point } from ./point

Last updated