🚀 Launch Special: $29/mo for life --d --h --m --s Claim Your Price →

TypeScript Fundamentals

TypeScript Fundamentals teaches JavaScript developers the core type system, interfaces, generics, function overloads, and modules, enabling them to write safer, more maintainable code across projects.

Who Should Take This

Front‑end engineers, back‑end developers, and full‑stack programmers who are comfortable with JavaScript and want to deepen their type‑safety skills will benefit. They seek practical knowledge to avoid runtime errors, improve code readability, and collaborate more effectively in TypeScript‑first codebases. The course assumes only basic JavaScript experience and provides hands‑on exercises to reinforce each concept.

What's Included in AccelaStudy® AI

Adaptive Knowledge Graph
Practice Questions
Lesson Modules
Console Simulator Labs
Exam Tips & Strategy
20 Activity Formats

Course Outline

60 learning goals
1 Type System Basics
3 topics

Primitive and special types

  • Identify the primitive types (string, number, boolean, bigint, symbol) and special types (null, undefined, void, never, unknown, any) and describe their role in the type system.
  • Explain the difference between unknown and any, including why unknown is the type-safe counterpart that requires narrowing before use.
  • Describe the never type as the bottom type that represents values that never occur, and explain its use in exhaustive switch checks and impossible function returns.

Type annotations and inference

  • Implement explicit type annotations on variables, function parameters, and return types to document expected shapes.
  • Explain how TypeScript infers types from initialization expressions, return statements, and contextual typing in callbacks and explain when inference is sufficient versus when annotations are needed.
  • Implement const assertions (as const) and the satisfies operator to narrow inferred types while preserving literal type information.

Literal and enum types

  • Describe string literal types, numeric literal types, and boolean literal types and explain how they constrain values to specific constants.
  • Implement numeric enums, string enums, and const enums and explain the difference in emitted JavaScript and runtime behavior.
  • Implement const assertions on object literals and arrays to infer the narrowest possible literal types and produce deeply readonly structures.
  • Compare enums versus union types of string literals to determine which approach provides better type safety and tree-shaking in a given scenario.
2 Interfaces & Type Aliases
3 topics

Object type shapes

  • Describe how interfaces define object shapes with required properties, optional properties (?), and readonly modifiers.
  • Implement type aliases with the type keyword for object shapes, primitives, unions, and tuples and explain the syntactic differences from interfaces.
  • Analyze scenarios to determine when to use an interface versus a type alias based on declaration merging, extension, and union type requirements.

Interface extension and composition

  • Implement interface extension with extends to compose larger interfaces from smaller ones, including multiple interface extension.
  • Explain declaration merging for interfaces and how repeated interface declarations combine their members into a single definition.
  • Implement index signatures ([key: string]: ValueType) and describe how they allow interfaces to accept arbitrary property names with typed values.

Tuple and array types

  • Describe typed arrays (string[], Array) and tuple types ([string, number]) including optional and rest elements in tuples.
  • Implement readonly arrays (ReadonlyArray, readonly T[]) and readonly tuples to prevent mutation and enforce immutability at the type level.
  • Compare arrays, tuples, and readonly variants to select the appropriate type for fixed-length structured data versus variable-length homogeneous collections.
3 Generics
3 topics

Generic functions and classes

  • Describe generic type parameters () on functions, classes, and interfaces, and explain how they enable writing reusable logic that preserves type information.
  • Implement generic functions with explicit and inferred type arguments to create type-safe utility functions such as identity, pair, and swap.
  • Implement generic classes and interfaces such as a typed Stack or Repository that maintain type safety across their public APIs.

Generic constraints

  • Implement generic constraints with extends to restrict type parameters to shapes, unions, or specific base types.
  • Implement the keyof constraint pattern () to safely access object properties by key type.
  • Implement default type parameters () and explain how they reduce verbosity for common use cases while preserving generic flexibility.
  • Evaluate generic constraint strategies to determine the minimal constraint that satisfies a function's implementation while maximizing caller flexibility.

Generic utility types

  • Describe the built-in utility types Partial, Required, Readonly, Pick, Omit, and Record and their common use cases.
  • Implement combinations of utility types to derive new types from existing interfaces such as creating update DTOs and readonly views.
  • Analyze type derivation chains to identify redundant utility type applications and simplify complex derived types.
4 Functions & Overloads
3 topics

Function type signatures

  • Describe function type expressions, call signatures, and construct signatures and explain how they type higher-order functions and callbacks.
  • Implement typed arrow functions and function declarations with optional parameters, default values, and rest parameters (...args: T[]).
  • Implement the this parameter type annotation to explicitly type the this context in methods and standalone functions.
  • Analyze function type compatibility rules including parameter bivariance, return type covariance, and how strictFunctionTypes affects assignability.

Function overloads

  • Describe function overload signatures and implementation signatures and explain the rules for overload resolution in TypeScript.
  • Implement function overloads that accept different parameter counts or types and return correspondingly different types.
  • Compare function overloads versus union parameter types versus generic signatures to determine which approach produces the clearest API contract.

Type narrowing in functions

  • Describe type narrowing with typeof, instanceof, in operator, and truthiness checks and explain how control flow analysis refines types within branches.
  • Implement user-defined type guard functions (param is Type) to create reusable narrowing predicates for complex union types.
  • Implement assertion functions (asserts param is Type) to narrow types by throwing on invalid input rather than returning a boolean predicate.
5 Module System
3 topics

ES module syntax

  • Describe named exports, default exports, re-exports, and barrel files (index.ts) and explain how they organize public APIs across modules.
  • Implement import and export statements with aliasing (as), namespace imports (* as), and type-only imports (import type) to manage dependencies.
  • Analyze module dependency graphs to identify circular imports and explain strategies for breaking dependency cycles.

Declaration files and ambient types

  • Describe declaration files (.d.ts), the DefinitelyTyped repository (@types packages), and the declare keyword for ambient declarations.
  • Implement ambient module declarations and global type augmentation to add types for untyped JavaScript libraries.
  • Evaluate when to use @types packages versus custom declaration files versus inline type assertions for integrating untyped third-party code.

Namespaces and module resolution

  • Describe the namespace keyword and explain when namespaces are appropriate versus ES modules for organizing types in declaration files.
  • Explain module resolution strategies (node, node16, bundler) and the moduleResolution tsconfig option and how they affect import path resolution.
6 Advanced Types
3 topics

Union and intersection types

  • Describe union types (A | B) and intersection types (A & B) and explain how they combine types with or/and semantics respectively.
  • Implement discriminated unions with a shared literal discriminant property and exhaustive switch handling for type-safe polymorphism.
  • Implement intersection types to compose interfaces into richer types and explain how conflicting property types resolve in intersections.
  • Analyze complex union and intersection type scenarios to predict the resulting type shape and identify never types caused by impossible intersections.

Mapped and conditional types

  • Describe mapped types ({[K in keyof T]: ...}) and explain how they transform every property of an existing type into a new shape.
  • Implement custom mapped types with key remapping (as), readonly/optional modifiers (+/-), and filtering to create projection and transformation types.
  • Describe conditional types (T extends U ? X : Y) and explain how they enable type-level branching including distributive behavior over union types.
  • Implement conditional types with infer to extract nested types such as function return types, promise unwrapping, and array element types.
  • Analyze complex mapped and conditional type compositions to predict the output type and debug type errors in derived type expressions.

Template literal and branded types

  • Describe template literal types (`prefix_${string}`) and explain how they create string pattern types by combining literal and primitive string types.
  • Implement template literal types to create event handler name types, route patterns, and CSS unit types that enforce string format at compile time.
  • Implement branded types using intersection with a unique symbol to create nominal type distinctions for structurally identical types like UserId versus OrderId.
  • Evaluate type-level string manipulation using Uppercase, Lowercase, Capitalize, and Uncapitalize intrinsic types combined with template literals.

Hands-On Labs

15 labs ~375 min total Console Simulator

Practice in a simulated cloud console or Python code sandbox — no account needed. Each lab runs entirely in your browser.

Scope

Included Topics

  • TypeScript 5.x type system fundamentals: type annotations, type inference, literal types, union types, intersection types, and the unknown/never/any types.
  • Interfaces and type aliases: defining object shapes, extending interfaces, declaration merging, index signatures, and readonly/optional modifiers.
  • Generics: generic functions, generic classes, generic constraints (extends), default type parameters, and conditional types.
  • Functions: parameter types, return types, overload signatures, rest parameters, this parameters, and function type expressions.
  • Module system: ES modules (import/export), namespace, declaration files (.d.ts), ambient declarations, and module resolution strategies.
  • Advanced types: mapped types, template literal types, discriminated unions, type guards, type assertions, and the satisfies operator.

Not Covered

  • React, Angular, Vue, or any framework-specific TypeScript patterns and JSX/TSX syntax.
  • Build tool configuration (tsconfig.json deep-dive beyond type-related options, webpack, esbuild, Vite config).
  • Runtime JavaScript features unrelated to the type system (DOM APIs, event loop, closures as a JS concept).
  • TypeScript compiler internals and AST manipulation.
  • Testing frameworks and their TypeScript integrations.
  • Decorator metadata and experimental decorator syntax beyond basic awareness.

Ready to master TypeScript Fundamentals?

Adaptive learning that maps your knowledge and closes your gaps.

Subscribe to Access