Loading...
Loading...
Advanced TypeScript patterns for type-safe, maintainable code using sophisticated type system features. Use when building type-safe APIs, implementing complex domain models, or leveraging TypeScript's advanced type capabilities.
npx skill4agent add nickcrew/claude-cortex typescript-advanced-patternsvalue is Type| Topic | Reference File |
|---|---|
| Conditional Types | |
| Mapped Types | |
| Template Literal Types | |
| Type Guards | |
| Discriminated Unions | |
| Branded Types | |
| Builder Pattern | |
| Advanced Generics | |
| Utility Types | |
| Type Inference | |
| Decorators | |
| Performance Best Practices | |
| Common Pitfalls | |
| Testing Types | |
tsconfig.json"strict": trueanyunknownunknownvalue is Typeas Typereadonlyreadonly"strict": truetsconfig.jsontypeinterfacetype UserId = string & { readonly __brand: 'UserId' };
function createUserId(id: string): UserId { return id as UserId; }type State =
| { status: 'loading' }
| { status: 'success'; data: string }
| { status: 'error'; error: Error };type Readonly<T> = { readonly [P in keyof T]: T[P] };
type Partial<T> = { [P in keyof T]?: T[P] };function isString(value: unknown): value is string {
return typeof value === 'string';
}