Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for generic type constraints? #321

Open
RudeySH opened this issue Sep 15, 2019 · 0 comments
Open

Support for generic type constraints? #321

RudeySH opened this issue Sep 15, 2019 · 0 comments

Comments

@RudeySH
Copy link

RudeySH commented Sep 15, 2019

I'm using TypeWriter to convert all my C# models into TypeScript interfaces. One of my models looks like this:

public class ListData<TOptions> where TOptions : ListOptions { ... }

In this context ListOptions is another model that will also be converted into a TypeScript interface. However, the generated TypeScript interface of my ListData model looks like this:

interface ListData<TOptions> { ... }

The generic type constraint is lost. I want to achieve the following:

interface ListData<TOptions extends ListOptions> { ... }

I was hoping the TypeParameterCollection would contain information about the constraint, so I could achieve the above. However, I was not able to find any reference to generic type constraints. Are they not supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant