typescript_advanced
БесплатноБез исполняемых скриптовНе проверенTypeScript 5+ advanced patterns, type utilities ve best practices rehberi.
от vuralserhat86★ 43 звезды на GitHubОб этом скилле
📘 TypeScript Advanced
TypeScript 5+ advanced patterns rehberi.
📋 Utility Types
// Partial - tüm prop'lar optional
type PartialUser = Partial<User>;
// Required - tüm prop'lar required
type RequiredUser = Required<User>;
// Pick - seçili prop'lar
type UserName = Pick<User, 'id' | 'name'>;
// Omit - prop'ları çıkar
type UserWithoutPassword = Omit<User, 'password'>;
// Record - key-value map
type UserMap = Record<string, User>;
// ReturnType - fonksiyon return tipi
type Result = ReturnType<typeof fetchUser>;
🔧 Advanced Patterns
Discriminated Unions
type Result<T> =
| { success: true; data: T }
| { success: false; error: string };
function handle(result: Result<User>) {
if (result.success) {
console.log(result.data); // User
} else {
console.log(result.error); // string
}
}
Template Literal Types
type EventName = `on${Capitalize<string>}`;
// "onClick", "onHover", etc.
type Route = `/${string}`;
Conditional Types
type NonNullable<T> = T extends null | undefined ? never : T;
type Flatten<T> = T extends Array<infer U> ? U : T;
🎯 Zod Integration
import { z } from 'zod';
const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
age: z.number().min(0).max(120),
});
type User = z.infer<typeof UserSchema>;
⚡ Best Practices
- Strict mode always on
- Avoid
any- useunknowninstead - Prefer interfaces for objects
- Use const assertions for literals
- Type narrowing over type assertions
🔄 Workflow
Kaynak: TypeScript 5.0 Release Notes & Total TypeScript Best Practices
Aşama 1: Type Design & Schema
- Interface vs Type: Nesne yapıları için
interface, union ve karmaşık tipler içintypealias'larını belirle. - Zod Validation: Runtime güvenliği için şemaları tanımla ve
z.inferile TS tiplerini türet. - Strict Check:
tsconfig.jsondosyasındastrict: trueayarının aktif olduğunu doğrula.
Aşama 2: Advanced Logic Implementation
- Type Narrowing:
unknowntiplerinitype guards(is, in) veyaassertskullanarak daralt. - Conditional & Mapped Types: Tekrar eden tipleri dinamik hale getirmek için
T extends U ? X : Yyapılarını kullan. - Generic Constraints: Generic tipleri
extendsile kısıtlayarak tip güvenliğini artır.
Aşama 3: Refactoring & Verification
- Remove
any: Tümanykullanımlarınıunknownveya spesifik union tipleriyle değiştir. - Performance Audit: Karmaşık recursive tiplerin derleme (build) süresini etkilemediğini doğrula.
- Documentation:
@param,@returnsve@typeParaetiketleriyle gelişmiş tipleri dökümante et.
Kontrol Noktaları
| Aşama | Doğrulama |
|---|---|
| 1 | eslint-plugin-typescript hataları temizlendi mi? |
| 2 | "Discriminated Unions" ile tüm case'ler handle edildi mi? |
| 3 | Tip tanımları ile gerçek runtime verileri tutarlı mı? |
TypeScript Advanced v1.5 - With Workflow
Установить typescript_advanced в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл typescript_advanced?
TypeScript 5+ advanced patterns, type utilities ve best practices rehberi.
Как установить скилл typescript_advanced?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл typescript_advanced запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic