BridgeJS: Add support for exporting structs using a box by wfltaylor · Pull Request #740 · swiftwasm/JavaScriptKit
Addresses #737
Add an optional structStyle parameter, where using .reference will export the struct as a heap-allocated box. This makes the struct act like a class: @JS must be added to any property which should be exported. Much like a @JS class, JavaScript consumers can call release() to release memory without relying on FinalizationRegistry.
A copy() method is synthesised, so JS consumers can duplicate the struct.