https://kotlinlang.org logo
Title
e

eygraber

07/14/2022, 3:37 PM
Is there any way to strip the package from anything exported with
JsExport
?
Seems like it's not currently possible, but it would be nice to use typealiases for this - https://youtrack.jetbrains.com/issue/KT-49795/KJS-IR-Allow-typealias-of-exportable-type-to-be-exported
b

Big Chungus

07/14/2022, 4:19 PM
You can always not use package declaration
Alternatively you could provide your own js entrypoint file that re-exports nested package to top level (assuming you're building a library)
e

eygraber

07/14/2022, 4:46 PM
I'm using packages because it's a multiplatform library that targets jvm as well. I thought about a js entry point file, but I think that wouldn't work with the generated typescript.
b

Big Chungus

07/14/2022, 4:50 PM
It would if that file is ts
Although then your lib would only work with ts projects only
e

eygraber

07/14/2022, 5:44 PM
That would probably work for me. Although I would prefer something like a typealias for this 😅