in 则可以遍历枚举类型
type Keys = "a" | "b" type Obj = { [p in Keys]: any } // -> { a: any, b: any }
最后更新于5年前