TypeScript

BeginnerLesson 14 of 1825 min, hands-on

Modules

Part of the TypeScript course

Every TypeScript file is its own module. The moment a file has an import or export, its top-level names stop being globals and become module-scoped. This lesson is about the import/export syntax, the type-only variants that TypeScript adds, and the small but consequential rules for naming.

The default for a module is to expose each value by name ...

What you'll learn

  • ES module syntax
  • Named exports
  • Default export
  • type-only imports
  • re-exports
  • Module resolution basics

Work through Modules

Sign in free and open the TypeScript course. Work through the lesson, and ask the AI tutor when you get stuck.