learn-typescript
learn-typescript copied to clipboard
Learn TypeScript
TypeScript: the typed superset of JS
This is an ongoing work. See this repo, until new advice, as a collection of notes. Thanks!
Notes
As I did years ago with React (tutorial that I should resume someday; please, forgive my laziness), I decided to put (and publish) some notes related to the new kid on the block, the JS Superset TypeScript.
Later, we will use typescript locally (feel free to install it as a global package: npm install -g typescript). But, for the moment, we consume repl.it
Index
-
Intro
-
Structural Typing
-
Type Inference and Type Annotation
- Type Annotation
- Type Inference
- Const Assertion
-
Types:
- String
- Number
- Boolean
- Union Types (OR)
- Discriminated Unions
- Intersection Types (AND)
- Null
- Undefined
- Void
- Never
- Any
- Unknown
- Object
- Optional modifier (?)
- Non-null assertion operator (!)
- Array
- Tuple
- Enum
- Set
-
Type Alias and Interfaces:
- Alias
- Implements
- Utility types
- Readonly
- Required
- Record
- Partial
- Interfaces
- Extends
- Implements
- Alias
-
Classes:
- Classes ... here
Functions:
- Functions
Type Assertions, Type Casting and Type Declaration
- Type Assertions
- Type Casting
- Type Declaration
Type Guards:
- Type Guards
Intersection types:
- Intersection Types
Generics:
- Generics