I have the following class:
class Animal {
name: string
age: number
}
I want to be able to retrieve the types of the class's properties without it being initialized. Here is how I expect to be using this:
function getClassPropertyTypes(classType) {
// perform some magic
}
// The returned value should be either an array or object with the property key and its type
getClassPropertyTypes(Animal)
Aucun commentaire:
Enregistrer un commentaire