【发布时间】:2018-09-29 08:32:22
【问题描述】:
如何在 TypeScript 中创建一个只接受包含两个或多个元素的数组的类型?
needsTwoOrMore(["onlyOne"]) // should have error
needsTwoOrMore(["one", "two"]) // should be allowed
needsTwoOrMore(["one", "two", "three"]) // should also be allowed
【问题讨论】:
标签: typescript