유틸리티 타입
맵드 타입 기반
Partial
interface Post {
title: string;
tags: string[];
content: string;
thumbnailURL? string;
}
// 임시 저장된 게시글
const draft: Partial<Post> = {
title : '초안 제목',
content : '초안'
}
// Partial 타입 직접 구현
type Partial<T> = {
[key in keyof T] ?: T[key]
};Required
Readonly
Pick<T, K>
Omit<T, K>
Record<K, V>
조건부 타입 기반
Exclude<T, U>
Extract<T, U>
ReturnType
Last updated