💻
What problem are you trying to solve?
Babel does not support new TS instantiation expression microsoft/TypeScript#47607
function makeBox<T>(value: T) {
return { value };
};
const makeStringBox = makeBox<string>; // (value: string) => { value: string }
const stringBox = makeStringBox('abc'); // { value: string }
const ErrorMap = Map<string, Error>; // new () => Map<string, Error>
const errorMap = new ErrorMap(); // Map<string, Error>
Describe the solution you'd like
Implement it.
Adds new AST node TSInstantiationExpression.
interface TSInstantiationExpression {
type: "TSInstantiationExpression";
expression: Expression;
typeParameters: TSTypeParameterInstantiation;
}
Describe alternatives you've considered
Nothing.
Documentation, Adoption, Migration Strategy
microsoft/TypeScript#47607
💻
What problem are you trying to solve?
Babel does not support new TS instantiation expression microsoft/TypeScript#47607
Describe the solution you'd like
Implement it.
Adds new AST node
TSInstantiationExpression.Describe alternatives you've considered
Nothing.
Documentation, Adoption, Migration Strategy
microsoft/TypeScript#47607