Loading...
import { User } from './types';
export function greet(u: User) {
return u.name;
}import type { User } from './types';
export function greet(u: User) {
return u.name;
}import type is always removed from the output, so the module is not loaded at runtime just for a type.
import type and then calling new on it.import type or inline type specifiers.type.import type { X } removes the whole statement. import { type X, y } removes only X and keeps the value import y.
Only as a type. You cannot call new on it or use it with instanceof, because the import is erased.