我想创建一个类,将一些基本类型包装成另一个基本类型,例如:
class MyClass<T> {
foo? : T
}
type Input = [string, number, boolean]
type Remap<T> = MyClass<T>
type Output = Remap<Input> // <-- Now it's MyClass<Input>
// Can I make the Remap to infer an Output as the following?
// type Output = [MyClass<string>, MyClass<number>, MyClass<boolean>]
但是,如果可行的话,我不知道如何创建适当的重映射类型以使输出符合我的预期.