How can we utilize typeof in order to specify the type of a class property? Take a look at both examples below, where example A works but example B does not.
A) Works outside class
const data: {age:number, name:string} = {age:10, name:'John'};
const age: typeof data.age = 33;
B) Not functional inside class. Is there a way to use the same method as in A within a class?
class Person{
data: {age:number, name:string} = {age:10, name:'John'};
age: typeof this.data.age; // Error, Cannot find name 'this'.(2304)
}