TypeScript uses standard ES module syntax. Each file with a top-level `import` or `export` is its own module scope.
ts
// wallet.ts
export interface Wallet { address: string; balance: number; }
export function createWallet(address: string): Wallet {
return { address, balance: 0 };
}
export default class WalletService { /* ... */ }
// main.ts
import WalletService, { createWallet, Wallet } from "./wallet";`export type` / `import type` explicitly mark type-only exports, which some build tools use to safely strip them without touching runtime code. Named exports are generally preferred over default exports because they support better auto-import and refactoring tooling.