1 Utility Types(工具类型)
keyof
只抽属性名
interface exampleA {
name:string;
id:number;
create:string;
}
type TypeA = keyof exampleA; // 其实就相当于 type TypeA = 'name'|'id'|'create'
let b:TypeA = 'name';
b = 'id';
// b = 'end'; // Type '"end"[......]