Replies: 2 comments 3 replies
|
This came up in a discord chat the other day so at least one other person wants this (it was related to anonymous Go structs IIRC). I'm ok adding an option for interfaces. Perhaps typescriptify has an option already. |
2 replies
|
Has this been explored at all for v3 at least? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
First, couldn't find another discussion about this for some reason. If there is one, refer me to it, please.
Is there a way to configure wails so that the structs are generated as interfaces or types in
models.tsinstead of classes?Generally speaking, why not? Is it not more common to regard objects in js\ts as actual Objects and not classes that simply hold fields?
I thought that maybe it is a class because you could implement a function to the struct in go.
for example, the
Personexample from the docs. I tried adding aPrintMemethod as part of the Person class, but it didn't get added in the generatedmodels.tsas a function of the classPerson, so effectively (correct me if I'm wrong), the structs in Go can be generated to a simple interface or type inmodels.ts.Of course, I can't speak for all developers out there, but for me at least it has always been the case that I use Objects instead of fully defined classes for something that holds multiple fields.
Would like to have some answers on this, plus some feedback, if there is any, of what the library authors\maintainers think of this.
All reactions