我在Mantine documentation人中找到了这种类型的Tuple<string, 10>
,但我不能理解它的概念.我在打字操场上测试了一下,它抛出了编译错误.
// Object of arrays with 10 colors
colors: Record<string, Tuple<string, 10>>;
当我查找TypeScript documentation的时候,没有关于第一个类型是数组中的项类型的解释,第二个数字表示数组中的项数.有人能跟我分享一下这个类型定义是如何工作的吗?