TypeScript · Senior · Question 64 of 75
How do you get the type of a module's exports without importing its values?
type Api = typeof import('./api');- ✓Correct answer: With a type-only
typeof import('...')expression - 2With
import type * as - 3It's impossible
Explanation
This is handy for lazy-loaded modules: you can type the result of a dynamic import() without bundling it eagerly.