Is there a recommended way to work with `external interface`s in common code in a multiplatform project? Maybe a sample project?
Right now I find myself doing a lot of stuff like
Copy code
// commonMain
interface HasFoo {
val foo: String
}
data class HasFooMobile(override val foo: String): HasFoo
// jsMain
external interface HasFooJs {
val foo: String
}
class HasFooJsWrapper(private val hasFooJs: HasFooJs): HasFoo {
override val foo = hasFooJs.foo
}
Would be nice to have some ability to declare an interface as
external
in Common code and have the keyword ignored on non-JS platforms…
👍 1
r
rnett
06/03/2021, 5:20 AM
Can you not use
external actual
? I don't have anything handy to try, but I would think it would work.