Skip to content
academia.sh

Course Intermediate

TypeScript

By the end of this course

Start course

01

Type System Fundamentals

The guarantee the static type layer provides, basic types, escape hatches, type inference, union and intersection types, and const types.

  1. 01 The Purpose of TypeScript The error class the static type layer catches, the erasure of types at compile time, and the distinction between type checking and runtime validation.
  2. 02 Basic Types The first typed version of the measurement record, using primitive types, array and readonly array notations, tuples, enums, and object types.
  3. 03 any, unknown, and never The assignability rules and use sites of any, which turns off checking, unknown, which forces it, and never, which has no values.
  4. 04 Type Inference The compiler's rules for inferring types from an initial value, context, and return expressions; widening behavior and where a type annotation is still required.
  5. 05 Union and Intersection Types The shared-member rule in a union type, the discriminated union pattern, combining types with intersection, and the collapse of conflicting fields to the empty type.
  6. 06 Const Types and as const Single-value literal types, stopping widening with as const, deriving a union type from a fixed list, and how the satisfies operator differs from a type annotation.

02

Structures and Contracts

Interfaces, type aliases, classes and access modifiers, function types, and the rules of structural type compatibility.

  1. 01 Interfaces Defining a structural contract with an interface, optional and readonly fields, extension, index signatures, and declaration merging.
  2. 02 Type Aliases The differences between a type declaration and an interface: naming any type, the absence of declaration merging, circular-reference rules, a class contract written with a type alias, and a selection criterion.
  3. 03 Classes and Access Modifiers Typing class fields, the compile-time and runtime counterparts of visibility modifiers, parameter properties, abstract classes, and the implements declaration.
  4. 04 Function Types Function type syntax, optional and rest parameters, the void return type's special behavior, the parameter-count rule, overloading, and the this parameter.
  5. 05 Structural Type Compatibility The rules of duck typing, excess property checking on object literals, the direction rule for function parameters, and ways to break structural compatibility.

03

Advanced Types

Generics and constraints, type narrowing, mapped and conditional types, template literal types, utility types, and recursive type definitions.

  1. 01 Generics Writing shape-independent structures with type parameters, type argument inference, constraints, the keyof constraint, default type parameters, and generic misuse.
  2. 02 Type Narrowing Type narrowing through control flow analysis; the typeof, in, and instanceof guards, the trap of truthiness narrowing, type predicates, assertion functions, and situations where narrowing is lost.
  3. 03 Mapped Types Producing a new type from an existing one; adding and removing field modifiers, key remapping, filtering fields, and how mapping behaves on arrays and tuples.
  4. 04 Conditional Types Type-level branching, the distribution rule over unions and closing off distribution, extracting a type piece with infer, and the limit of conditional return types.
  5. 05 Template Literal Types Expressing string formats as types, the cross product over unions, built-in string transforms, parsing a format with infer, open-ended patterns, and a literal type dissolving inside string.
  6. 06 Utility Types The standard library's ready-made type transforms; field modifiers, picking and omitting fields, building a table, filtering unions, and tools that derive types from signatures.
  7. 07 Recursive Types Self-referential type definitions, deep transforms, producing key paths with type-level recursion, and the compiler's expansion depth limit.

04

Project Configuration

Compiler configuration and strictness flags, declaration files, working with JavaScript, module resolution, and the build and run flow.

  1. 01 Compiler Configuration The structure of the configuration file, the strictness umbrella and its sub-flags, additional strictness options outside the umbrella, and target and library settings.
  2. 02 Declaration Files Carrying type definitions separately from implementation; generating declarations from source, ambient module declarations, global scope declarations, and extending outside types with merging.
  3. 03 Working With JavaScript Bringing JavaScript files into the project and checking them, typing with comments, file-level check directives, and the gradual migration strategy.
  4. 04 Module Resolution The compiler's rules for turning a module name into a file, the extension requirement, resolution strategies, the limit of path mapping on output, and the fix through package subpath imports.
  5. 05 Build and Run Flow Separating type checking from publish output, publish behavior on error, the options enabling per-file transpilation, type-only imports, and type-stripping runtimes.

Start typing to search.

↑↓ Esc navigate · open · close