Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warning: Exported declaration uses non-exportable parameter type #172

Open
gino-m opened this issue Jan 14, 2024 · 4 comments
Open

Comments

@gino-m
Copy link

gino-m commented Jan 14, 2024

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?

@qurbonzoda
Copy link
Contributor

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
Copy link
Contributor

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.

@gino-m
Copy link
Author

gino-m commented Jan 18, 2024

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.

@qurbonzoda
Copy link
Contributor

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

Is it what you are asking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants