Is there a way to create a generic function that can accept generic arguments like Data<string, number>
?
Take a look at this code snippet:
interface Data<T,R> {
a:T;
c:R;
}
function foo(
data: Data<string, number>
){
return test(data)
}
//trying to make this function generic
function test<?, T extends Data<?, ?>>(
data: T,
): T {
return data
}
Any suggestions on how to approach this?