typescript-advanced-types
Installation
SKILL.md
TypeScript Advanced Types
Master TypeScript's advanced type system for building robust, type-safe applications.
Generics
// Basic generic function
function identity<T>(value: T): T {
return value;
}
// Generic with constraint
interface HasLength { length: number; }
function logLength<T extends HasLength>(item: T): T {
console.log(item.length);
return item;
}