-
Notifications
You must be signed in to change notification settings - Fork 239
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
Type mapping with generic #197
Comments
Hello, |
Yes, I tried to use i.e. pseudocode
and in cofig I set |
Mapping two Java classes to one TypeScript interface (even using However TypeScript has structural typing so generating two identical interfaces should not be a problem: interface ListWrapper1<T> {
id: string;
values: T[];
}
interface ListWrapper2<T> {
id: string;
values: T[];
}
const lw1: ListWrapper1<string> = {
id: "id1",
values: ["a"]
};
const lw2: ListWrapper2<string> = lw1; |
Yes, it works in TypeScript and it doesn't show an error, but I suppose that it will break a bit find usages and references as it will be two different interfaces |
I agree it's not optimal. Right solution would be to fix it in Java but I understand that it might not be always possible. Maybe I could make |
Ok, thanks |
Finally I returned to this issue and it is now possible to use generics in |
Unfortunately mentioned change in v2.10.466 broke mapping of generic classes to TypeScript non-generic types like <customTypeMappings>
<mapping>ListWrapper[T]:TsListWrapper[T]</mapping>
</customTypeMappings> |
Hello, i have some difficulties with the following situation, I have error
Multiple classes are mapped to the same name.
and I try to usecustomTypeMappings
but the issue is that theses classes has Generic type. How can I set generics incustomTypeMappings
?The text was updated successfully, but these errors were encountered: