Suppose I have the following code snippet:
interface Generic <S, T> {
_?: [S, T];
id: string;
...
}
interface A {}
interface B {}
interface C {}
interface D {}
type t1 = Generic<A, B>;
type t2 = Generic<B, C>;
This is code that I cannot change (from another package). My question is: is there a way for me to find out programatically what are S and T for a given type (e.g. t1, t2)?
I have a strong suspicion that since this information is lost after compilation, I will never be able to figure out what S and T are at runtime. Even worst, I won't be able to look at details from t1 and t2 (just like this previous question).
However, since I'm very new to TypeScript, I wonder if I just didn't know the right way to ask, and the internet actually has an answer for me.
So, is it possible? How?