I need to make the variable TYPES_GENERATED have the type that it has keys that in the array TYPES_ARR with symbol values.
const TYPES_ARR = [
'HttpClient',
'Parser'
]
const TYPES_GENERATED = {}
TYPES_ARR.forEach(i => {
TYPES_GENERATED[i] = Symbol.for(i)
})
I do not want to write:
const TYPES_GENERATED: {
HttpClient: symbol
Parser: symbol
} = {}
I took the code above from here.
Is there a way to do this? I can use the latest version of the TypeScript.