既存の型のキーを変換して新しい型を生成する高度な型操作
// Mapped Type
type Optional<T> = { [K in keyof T]?: T[K] };
// Template Literal Type (TS 4.1)
type EventName = 'click' | 'focus' | 'blur';
type HandlerName = `on${Capitalize<EventName>}`;
// 'onClick' | 'onFocus' | 'onBlur'
// 条件型
type NonNullable<T> = T extends null | undefined ? never : T;Mapped TypesはPick/OmitなどのUtility Typesの実装に使われている。Template Literal Typesで文字列の型レベル操作が可能。