是否可以对元组类型的内容进行自动完成?还有为什么不能使用“简单”类型,如下面的示例所示;
type Litterals = 'foo' | 'bar';
type T1<T extends Litterals> = T;
// good autocomplete on simple literal
type Test1 = T1<'bar'>;
type T2<T extends Litterals[]> = T;
// no autocomplete
type Test2 = T2<['']>
type TBonus<...(T extends Litterals)> = T;
// how to achieve that?
type TestBonus = TBonus<'foo', 'bar', 'bar', 'foo' /* ... and as much as we want */>