jburzynski / TypeGen

Single-class-per-file C# to TypeScript generator
MIT License
195 stars 55 forks source link

Issues when generating from Record Types #164

Closed dersia closed 1 year ago

dersia commented 1 year ago

All out POCOs are record classes and we want to export them as Interfaces. So far this works, because record classes are just classes, but the problem is that the c# compiler when generating the class adds IEquatable<> interface for the record class. unfortunately this is exported as interface implementing IEquatable. Since IEquatable is not really helpful it doesn't help on ts side.

I would like to exclude IEquatable for record. I would also like to implement this, if that is ok for you. I have a prototype already that makes it configurable and defaults to old behavior.

jburzynski commented 1 year ago

Fixed in version 4.5.0 by adding type blacklist (ability to specify types that should not be generated). Some common interfaces are added to the blacklist by default, including IEquatable. This also solves other issues that have been happening when some interfaces or framework-specific classes were being generated, but they shouldn't be generated.