type a = {id?:number,phone?:string}|{id?:number,name?:string}
type b = ?a
期待: type b = 'id'|'phone'|'name'
1
CAze 2020-05-26 17:21:12 +08:00
a & {name?: string} 就好了
|
3
chouchoui 2020-05-26 17:28:10 +08:00
其实更困惑的是
type a = { id?: number, phone?: string, name?: string } 为什么不能是这个格式…… |
4
horizon 2020-05-26 17:37:05 +08:00
interface A {
id?: string; phone?: string; } interface B { id?: string; name?: string; } type C = keyof (A & B); |
5
horizon 2020-05-26 17:38:04 +08:00
我看错了,无视。。
|
6
chouchoui 2020-05-26 17:39:17 +08:00
|