TS introduced default parameters types for generics in v2.3 Generic parameter defaults
So I can define a generic type as follows:
interface MyGenericType<T = any, U = any, V = any, W = any> { }
And then I can use it as follows:
declare const xyz: MyGenericType<any, any, any, Date>;
I am trying to get rid of these default types and only specify the ones I want to define by names as follows?
declare const xyz: MyGenericType<{ W: Date }>;
However that did not work as expected because { W: Date } is replacing T the first param not replacing W.
Is that thing not doable in Typescript?
Is there any workarounds other than defining any in the generic type declaration?