Ts keyof
索引查询 keyofkeyof可以用于获取某种类型的所有键,其返回类型是联合类型接口interface Person { name: string; age: number; location: string;}type K1 = keyof Person; // "name" | "age" | "location"type K2 = keyof Person[]; // number | "length"