# javascript

István Mészáros

11/25/2023, 10:01 AM
👋 Hi everyone! 🙂 In our first KMP (JS) project we're just experimenting everything and tried to enable ES6 classes via:
Copy code
tasks.withType<KotlinJsCompile>().configureEach {
    kotlinOptions {
        useEsClasses = true
In the generated typescript definitions we see:
Copy code
static fromString(value: string, $box: Nullable<BigDecimal>): BigDecimal;
The corresponding Kotlin source is:
Copy code
    actual constructor(value: String) : this(BigNumber(value), scaleOf(value))
Why the argument
is added to the generated TS code? It's not there if ES6 classes are disabled. We use Kotlin
Thanks in advance!
👀 2

Artem Kobzar

11/27/2023, 11:41 AM
Hey. Could you share please the code that you annotated with the JsExport annotation. It could be added inside inner classes constructors.

István Mészáros

11/27/2023, 12:17 PM
Hi Artem! I created a repo to demonstrate the issue: I also pushed the dist directory to see what output I got: I hope this helps! Thaks a lot for your effort!

Edoardo Luppi

11/27/2023, 12:44 PM
That's some neat way of declaring static methods without a companion, it seems. I'm not sure that use case was ever intended to be applicable.
If it indeed wasn't, I like it! But maybe proper support for statics would be better.