是否可以在 Typescript 中向数组类型添加描述?
Is it possible to add description to an array type in Typescript?
我有以下类型:
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]
我有以下类型:
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]