As said by @jonrsharpe
import type ... is used when you only need the type, not the value, of the import.
import
: Importing Both Types and Values
The import
statement is used to import both types and values (functions, classes, variables, objects, etc.) from a module. When you use a regular import
, TypeScript will import the type information along with the actual runtime values.
import type
: Importing Only Types
The import type
statement, introduced in TypeScript, is used to import only the type information from a module. It indicates that you are interested in using the types of exported values but not the actual runtime values.
Additionally, we use import type to use the type for type-checking purposes without including the actual runtime values of the module in the emitted JavaScript code.
Reference: https://medium.com/@quizzesforyou/import-vs-import-type-in-typescript-8e5177b62bea