My current TypeScript type definition is as follows:
type MyKeys = 'foo' | 'bar' | 'baz'
I am looking to create a custom type that includes keys from MyKeys
, but also additional keys, like so:
type CustomType = {
[key in MyKeys]: boolean
quux: boolean // <--- Error: '}' expected.ts(1005)
}
How can I combine generic keys with specific key names in this scenario?