Open FlorianCassayre opened 1 year ago
We are designing some custom extensions for our project, and one them relies on the generic parameter default type feature of Typescript. For example:
interface Test<T = string> {}
The current API of typescript-generator regarding generics is the following:
typescript-generator
public static class GenericVariableType extends BasicType { public GenericVariableType(String name) { super(name); } }
As you can see it is not possible to provide a default type, therefore we would like to request this functionality in the API.
Luckily the following workaround works (although it looks dirty):
new TsType.GenericVariableType("T = string")
I think a similar comment can be made about type bounds, I am not sure if these are supported either.
I did PR to support bounds but it wasn't accepted.
We are designing some custom extensions for our project, and one them relies on the generic parameter default type feature of Typescript. For example:
The current API of
typescript-generator
regarding generics is the following:As you can see it is not possible to provide a default type, therefore we would like to request this functionality in the API.
Luckily the following workaround works (although it looks dirty):