可使用Record类型,有几个属性就对应几个类型参数,参考代码如下:
const asd: Record<string, number | string> = { 'name': 'xc', 'age': 29 }