-
Notifications
You must be signed in to change notification settings - Fork 5
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
Handle naming conflicts from internally defined subclass #116
Comments
Thanks for the report! It's an interesting case, I'll have a think about it. The generator could wrap each nested C class in a separate TS namespace, but that could make other generated code more verbose. You could specify a distinct I've tried to make the generator as open and flexible as possible, so please try experimenting with overriding the default generator, and if you find something that works then please share it here. |
Hey @mdechdee, I've had a play around and I think I've finally got the namespace grouping working. I had implemented the skeleton for it, but never finished it. I was just playing around and I realised that it can be used to solve your problem. It's been a while since I've used TypeScript though - can you verify that this output would be suitable for you? export interface Test {
a: A;
b: B;
}
export interface A {
content: Content;
}
export interface B {
content: Content;
}
export namespace A {
export interface Content {
}
}
export namespace B {
export interface Content {
}
} I've added an option so the namespaces can be controlled dynamically, so this could be fine tuned if desired. |
@aSemy sorry for late response. I think the interface and namespace should not have naming conflict. export interface Test {
a: A;
b: B;
}
export interface A {
content: ANamespace.Content;
}
export interface B {
content: BNamespace.Content;
}
export namespace ANamespace {
export interface Content {};
}
export namespace BNamespace {
export interface Content {};
} |
I have a use case here where kotlin have internal subclass
the generated ts definition of class
Test
iswhich has some naming conflicts on enum C.
Do we have a way to handle this? I see some unimplemented namespace, could it be used here?
The text was updated successfully, but these errors were encountered: