Lab 01: Type-Level Programming
Step 1: Setup
docker run -it --rm node:20-alpine sh
npm install -g typescript ts-node
mkdir /lab-adv01 && cd /lab-adv01
cat > tsconfig.json << 'EOF'
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true
}
}
EOFStep 2: Recursive Types
Step 3: Variadic Tuple Types
Step 4: Type-Safe Curry
Step 5: HList (Heterogeneous List)
Step 6: Awaited and Promise Inference
Step 7: TypeScript 5.x Features
Step 8: Capstone — Type-Level Utilities
Summary
Feature
Syntax
TS Version
Last updated
