我有以下类型:
const type Person = [string, number, number]
const type Person = [
string, // name
number, // age
number // height
]
是否可以为元素添加注释?或者有什么约定吗?与功能类似:Where is the syntax for TypeScript comments documented?
最佳答案
我认为最接近的解决方案是 Labeled tuple elements
const type Person = [name: string, age: number, height: number]
关于typescript - 是否可以在 Typescript 中为数组类型添加描述?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72377313/