type-only import

An import written import type { X } or import { type X }, which brings in only types and is always removed from the output.

In more detail

Because the whole statement disappears on compile, a single-file transpiler never emits an import of something that does not exist at run time. verbatimModuleSyntax requires them for every import that is only used as a type.

Examples

import type { ClientOptions } from "./client.js";
import { ApiClient, type ClientOptions } from "./client.js";

Related terms

Taught in

References