How do I use `external` with javascript enums in k...
# javascript
s
How do I use
external
with javascript enums in kt code. ?
s
What kind of enums do you have in mind? TypeScript enums?
t
Serialization required for this case
Untitled
If you need non-strict mode, than you can use constants instead
Untitled.kt
s
thanks a lot @turansky
s
Standard library uses workaround with extension properties on companion object of external interface https://github.com/JetBrains/kotlin/blob/75f1fb0237b6c248643ba3cb7013ea2750247659/libraries/stdlib/js/src/org.w3c/org.w3c.dom.kt#L6369
👍 1
t
This variant is better for strict typization