小编nig*_*gel的帖子

递归数组类型打字稿

说我有类型 type Atom = string | boolean | number.我想定义一种类型的数组:

NestedArray = Atom | [a_0, a_1, ... , a_n]每个a_i都是a Atom或a NestedArray.

这可以在打字稿中实现吗?

typescript

7
推荐指数
1
解决办法
722
查看次数

标签 统计

typescript ×1