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

Allow BuildKonfig to be marked with @JsExport #35

Closed
dellisd opened this issue Aug 18, 2020 · 2 comments · Fixed by #39
Closed

Allow BuildKonfig to be marked with @JsExport #35

dellisd opened this issue Aug 18, 2020 · 2 comments · Fixed by #39

Comments

@dellisd
Copy link
Contributor

dellisd commented Aug 18, 2020

This is a pretty niche use case, but with Kotlin 1.4's generated TypeScript definitions only top level declarations marked with @JsExport will be included.

In my case, I am building a web client in TypeScript (rather than use Kotlin/JS) that makes use of a shared multiplatform module that depends on some API keys that are set through a BuildKonfig object.

Naturally, this would depend on #31.

@yshrsmz
Copy link
Owner

yshrsmz commented Aug 19, 2020

Yes, this should be covered too.

According to the API document, expect declaration can not be exported for now.

So actual declaration in js sourceset should be annotated, and we need to find a way to check the target platform.

@yshrsmz
Copy link
Owner

yshrsmz commented Aug 19, 2020

So we need to

  • annotate the common object with @JsExport if there is no target specific BuildKonfig configuration
  • or annotate actual object in js sourceset

@yshrsmz yshrsmz mentioned this issue Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants