I am currently working with a type that I have obtained from a third party source. My goal is to determine the type of a specific property within that type, using TypeScript.
For example:
type GivenType = {
prop: string;
}
type desiredType = <<GetTypeOf GivenType.prop>>
desiredType === string // true;
I am seeking the correct syntax for
<<GetTypeOf GivenType.prop>>
After reviewing the TypeScript documentation, I have learned that extracting types is typically performed on objects or interfaces using commands like typeof
or returnType
.