Loading...
import { User, getUser } from './api';
const u: User = await getUser();import { type User, getUser } from './api';
const u: User = await getUser();Marking User with type lets the compiler drop it, so the output never imports a name that does not exist.
import type or an inline type specifier.import './file'.importsNotUsedAsValues and preserveValueImports are not used together with it.import type { A } removes the whole statement. import { type A, b } removes only A and keeps the import of b.
In files emitted as CommonJS, ES import syntax is an error under it; use import x = require('x') or switch the output to ES modules.