enum Foo {
'Foo' = 'A',
'Bar' = 'B'
}
type Value = `${Foo}` // 'A' | 'B'
I'm wondering why the enum type triggers the autodispatch feature in the template string type? Does anyone know what's going on here
Because the types allowed in the template string type are 'string | number | bigint | boolean | null | undefined'
But does enum belong to one of these types? I try to get the keytype Key = keyof typeof Foo //'Foo' | 'Bar'
,This syntax proves that enums are more like objects,So why enums can be in template strings