提供一个类型,例如一个类
class User {
Name: String;
Surname: String;
BirthDate: Date;
constructor(
name: String,
surname: String,
birthDate: Date) {
this.Name = name;
this.Surname = surname;
this.BirthDate = birthDate;
}
}
如何从类型中枚举类型的属性名称,而不是从它的实例中?
目标结果将是属性名称(以任何顺序):
['Name', 'Surname', 'BirthDate']