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. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Has this been explored at all for v3 at least? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.ts
instead 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
Person
example from the docs. I tried adding aPrintMe
method as part of the Person class, but it didn't get added in the generatedmodels.ts
as 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.
Beta Was this translation helpful? Give feedback.
All reactions