So I’m trying to export `Map` types to JS so I add...
# multiplatform
a
So I’m trying to export
Map
types to JS so I added a
MapWrapper<K, V> : Map<K, V
that is `@JsExport`ed. But even if I manually override the method they still don’t end up in the typescript definitions. It seems that all functions that are declared in a non exported interface are not included in the export. Does anyone know of a workaround?
a
Probably, better ask in #javascript 🤷
m
One way to get around this is to make your map wrapper mirror the interface of map (or just the parts you need) without actually implementing map. So you can just have an
expect class MapWrapper
with actual implementations that use an internal
Map
with functions in
jsMain
that can convert to/from js types and functions with the other platforms that just return the internal
Map