typescript-generator
typescript-generator copied to clipboard
Custom type mapping based on superclass
I have a T extends AbstractClass<T>
setup and wish for all T
to become string
in the TS models. Is this possible?
Many thanks
That's not possible. There is customTypeMappings
parameter but it only works with class names (and no inheritance). Where the generic variable T
comes from? Is it class type parameter? Or method type parameter?
Thanks for the reply @vojtechhabarta. The generic variable T
I realised isn't so important to the problem I have as the existence of a supertype. So I could rephrase the problem as:
I have
? extends SuperClass
and want all implementations ofSuperClass
to becomestring
.
To that end I'm working on a PR as a proof of concept which I will submit shortly.
Raised: https://github.com/vojtechhabarta/typescript-generator/pull/435