How do you import a type-only export in TypeScript 3.8+?

TypeScript Associate Easy

TypeScript Associate — Easy

How do you import a type-only export in TypeScript 3.8+?

Key points

  • The 'import type' syntax is used for type-only imports in TypeScript.
  • Using 'import { MyType }' would import both the type and the value, which is not necessary in this case.
  • 'require' syntax is not used for imports in TypeScript.

Ready to go further?

Related questions