Suppose I start with...
type TypeNonGeneric = { prop1: any, prop2: string };
How do I transform it into...
type TypeGeneric<T> = { prop1: T, prop2: string };
I have reviewed the documentation and it appears that I need to create a new generic type that accepts TypeNonGeneric
as an input, iterates through its properties, and replaces any instance of any
with "T", while keeping all other types unchanged.