Hey guys,
I’m compiling a lib that is supposed to be consumed by TypeScript.
How do I export a
Long
to JS with the IR compiler ???
@JsExport
fun long(): Long = 0x12_34_56_78_9A_BC_DE_F0
Calling this
long
function with typescript returns the following object:
Long { _low: -1698898192, _high: 305419896 }
Casting to int does NOT do the trick as the compiler overflows :
@JsExport
fun int(): Int = 0x12_34_56_78_9A_BC_DE_F0.toInt()
Calling this
int
function with typescript returns a negative number:
-1698898192
How can I export a
Long
?