I'm writing multiplatform bindings for ffmpeg on jvm and native. my question is the best way to design the common API.
On both jvm and native side there are classes I wanna make available in common, but the issue with that is their properties. The current solution I have now is using extension values for every property
Copy code
// commonMain
expect class SomeClass
expect val SomeClass.a: Int
expect val SomeClass.b: Int
Copy code
// jvmMain
actual typealias SomeClass = SomeJvmClass
actual val SomeClass.a: Int
get() = a
actual val SomeClass.b: Int
get() = b
I don't really like it and some of the classes have dozens of properties. The other idea I had is a wrapper class around the actual type. So I'm not really sure what the best thing to do is
c
CLOVIS
07/29/2024, 3:27 PM
The simplest solution, IMO, is to create an interface in