Lab 03: Advanced Interfaces & Types
Step 1: Setup
docker run -it --rm node:20-alpine sh
npm install -g typescript ts-node
mkdir /lab03 && cd /lab03
cat > tsconfig.json << 'EOF'
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true
}
}
EOFStep 2: Interface vs Type Alias
Step 3: Declaration Merging
Step 4: Index Signatures
Step 5: Mapped Types
Step 6: Conditional Types
Step 7: The infer Keyword
infer KeywordStep 8: Capstone — Type Utilities Library
Summary
Concept
Syntax
Key Difference
Last updated
