Is it possible to retrieve all static variable names and static method names associated with a class, similar to how the Object.keys method returns a list of key names attached to an object?
Typescript Example:
class FindStatics {
static num1:string = 'Num 1';
static num2:string = 'Num 2';
notStatic:string = "I'm not static";
static concat ():string {
return `${FindStatics.num1} loves ${FindStatics.num2}`
}
addToNonStatic(str:string):string {
return `${this.notStatic} + ${str}`;
}
}
In the above example, what I am looking for is a way to extract only the names of the static variables and methods - in this case, num1
, num2
, and concat
.