基于旧类型创建新类型(对象类型),减少重复,提高开发效率
type Obj = 'x' | 'y' type T = { X: number, y: number} type Type = { [key in Obj]: number }