You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Union types (other than rawvalue which are already done) should be supported. The best way to do this is unclear to me so this issue functions as a discussion point.
Example:
exporttypeFoo={foo: string}exporttypeBar={bar: string}exporttypeExample=Foo|Barexportfunctionexample(): Example
Could maybe generate:
@JSClassstruct Foo {@JSGettervarfoo:String@JSSetterfunc setFoo(_ value:String)throws(JSException)}@JSClass struct Bar {@JSGettervarbar:String@JSSetterfunc setBar(_ value:String)throws(JSException)}@JSClass enum Example {case foo(Foo)case bar(Bar)}@JSFunctionfunc example()throws(JSException)->Example
Note that ts unions can change dynamically eg if I set foo to null and bar to a string, the type changes from Foo to Bar, so idk if that works with an enum like this in Swift.
Union types (other than rawvalue which are already done) should be supported. The best way to do this is unclear to me so this issue functions as a discussion point.
Example:
Could maybe generate:
Note that ts unions can change dynamically eg if I set foo to null and bar to a string, the type changes from Foo to Bar, so idk if that works with an enum like this in Swift.