Imagine I have the following scenario :
const sub = new Subject<{ id: string; value: string; }>();
Is there a method to obtain the generic type assigned to the Subject object?
const item: ??? = { id: '1', value: 'value' };
Although I could create an interface or manually assign the same type to my item, I am curious if there is a way to retrieve the generic type of another object in a more universal manner.