如下,想知道怎么定义arr的类型
type Tag = 'xxx'|'xxx'|'xx'
interface More {
one: boolean
two: string
}
const tag:Tag = 'xxx'
const more:More = {
one: true,
two: 'xx'
}
const tagInfo = {
more
}
//如何定义这个的类型
const arr = [
{
tag,
...tagInfo[tag]
}
]
想到了一个解决方案