This is basically what I was hoping to accomplish but it is no go for launch:
type MyType<
T extends {},
K extends string = 'keyName'
> = T & {
[K]: {
value: string
}
};
A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.ts
Is there any way to pass in a key and have it shape the resulting type or interface?
Thanks.