I have a method, that should accepts any object, as long as all its fields are strings or numbers
I made this, which works great with duck typing
sta
T's constraint can refer to T (with some restrictions), so you can use a mapped type to generate a constraint that has the same fields as T:
function interpolateParams(
route: string,
params: T) : string { /*...*/ }
Beware that trickery with circular type parameter constraints can sometimes cause problems, though this scenario will likely be OK.