I'm very new to typescript and having a hard time finding some extensive documentation on keyof. If you have
export interface someClassProps<T extends object> {
/*
Lets assume T look is an object that looks something like:
T = {"name": "",
"val": NaN,
"active": false}
*/
A: Array<T>; // an array of objects
B: keyof T; // What type is this? Is just a type of object or is it the keys of T?
C: keyof Array<T>[0]; // Is this the keys of T?
D: keyof Array<T> // Is this type object?
}
What type do you get for B or C? I'm hoping to get a type from keyof that is the would be name | val | active. Am I looking for an approach that looks like B, C, or something fully different?
Alternatively is there an easy way to print the types from keyof? That would allow me to just figure this out.