Use import / export in TS sources. Type-only imports: import type { User } erase completely in output.
The lesson playground runs single-file snippets—no import between files here.
Project layout
In real repos: src/index.ts exports public API; tests import types with import type to avoid circular value imports. Bundlers (Vite, esbuild) respect "moduleResolution": "bundler" in modern tsconfig.
Self-check
- When should you use
import typeinstead ofimport?
Tip: Use import type to avoid circular value imports in large codebases.