Phil Kagebein
08/26/2025, 9:35 PM2.1.20 -> 2.2.10. Previously, we used KtMap.getInstance().fromJsMap() to convert a JS Map to a Kotlin map so that the client can send some data back to KM. However, in 2.2.10 getInstance() is not available anymore. Is there a more preferred way to do these sorts of operators for objects like KtMap or KtList?Edoardo Luppi
08/27/2025, 8:36 AMEdoardo Luppi
08/27/2025, 8:46 AMKtMap.getInstance().
However the generated TS declarations are incorrect.
This might be https://youtrack.jetbrains.com/issue/KT-79926, @Artem Kobzar should be able to confirm.Artem Kobzar
08/27/2025, 9:40 AMgetInstance from the d.ts .
However, since the 2.3.0 for the KtMap and KtList the getInstance will be dropped and you could use just KtMap.fromJsMap from both ESM and CJS (we did it to eliminate differences between the module systems to make the migration smoother)Phil Kagebein
08/28/2025, 3:19 PMSeth Madison
10/21/2025, 11:09 PMobject types that inherit from sealed interfaces? We have code like this:
@JsExport
sealed interface Foo
@JsExport
object Bar : Foo
And the codegen is suffering from a similar problem. We get:
export declare interface Foo {
    readonly __doNotUseOrImplementIt: {
        readonly "philo.Foo": unique symbol;
    };
}
export declare abstract class Bar {
    static readonly getInstance: () => typeof Bar.$metadata$.type;
    private constructor();
}
/** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
export declare namespace Bar.$metadata$ {
    abstract class type extends KtSingleton<constructor>() {
        private constructor();
    }
    abstract class constructor implements Foo {
        readonly __doNotUseOrImplementIt: Foo["__doNotUseOrImplementIt"];
        private constructor();
    }
}
The problem is that getInstance() is returning the type, not the object itself, so TS complains.Artem Kobzar
10/22/2025, 11:35 AMSeth Madison
10/28/2025, 10:55 PMArtem Kobzar
10/29/2025, 5:09 AMSeth Madison
10/29/2025, 5:19 AM