kotlinx.collections.immutable icon indicating copy to clipboard operation
kotlinx.collections.immutable copied to clipboard

Compiler warning: Exported declaration uses non-exportable parameter type

Open gino-m opened this issue 1 year ago • 4 comments

Tried using ImmutableList, ImmutableMap, PersistentList, and PersistentMap both in data class constructors and as fields.

Kotlin lang: 1.9.20. Deps:

 sourceSets {
    commonMain {
      dependencies { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7") }
    }
    jsMain {
        dependencies { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-js:0.3.7") }
    }

~Update: Looking at the code, I see the classes in this lib do not @JsExport any classes, making them inaccessible from Koltin JS (IR). Are there any plans to allow this library to be exposed through Kotlin JS libs as well?~

Update 2: I understand what I'm actually looking for is Typescript bindings for Kotlin stdlib or immutable collections. Is that on the roadmap by chance?

gino-m avatar Jan 14 '24 22:01 gino-m

Hi @gino-m If you added the library to the common source set dependencies, there is no need to add it to js. You should be able to use it in all targets, including js.

qurbonzoda avatar Jan 18 '24 09:01 qurbonzoda

The library currently does not export any API to JS code. But the library public API should be accessible from Kotlin code in jsMain source set.

qurbonzoda avatar Jan 18 '24 09:01 qurbonzoda

Thanks, that makes sense. I now understand what I'm actually looking for is Typescript bindings for Kotlin stdlib or immutable collections. Is that on the roadmap? Updated my original post to reflect this question.

gino-m avatar Jan 18 '24 14:01 gino-m

@gino-m There are ongoing efforts in stdlib to make this possible. See

  • https://youtrack.jetbrains.com/issue/KT-34995
  • https://youtrack.jetbrains.com/issue/KT-44871

Is it what you are asking for?

qurbonzoda avatar Mar 20 '24 10:03 qurbonzoda