Need Assistance?

support@tutorialshub.in

Async TypeScript, Modules & Declarations

ES Modules & import type

ADVERTISEMENT
TypeScript Free Lesson
5 min read
ADVERTISEMENT

When importing an interface or type alias, use import type { User } from './types';. This tells bundlers and TypeScript that the import is purely for compile-time checking and should be erased completely from the output JavaScript.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you