Hi all, I am trying to do something like below ```...
# multiplatform
l
Hi all, I am trying to do something like below
Copy code
// commonMain
expect class PlatformStream

// iosMain
actual typealias PlatformStream = NSInputStream

// androidMain
actual typealias PlatformStream = InputStream
android main doesn't work because InputStream is abstract and if i make commonMain abstract, iosMain will give issue. I can subclass InputStream but that is something i want to avoid in order to have a clean api as this will be exposed via a library i am working on.
I did find this which mentions error can be suppressed, but i am not sure how would i do that.
a
Just make a common interface that’s implemented in each platform with what you’re trying to do, then have expect actual initializer functions, you’ll thank me later 😊
l
hey @agrosner, thanks for you reply, maybe i missed some detail, my library is trying to abstract business logic (which currently is written in native apps separately) into single library and i am doing so for 3 targets, ios, android and browser, so there is lot of utilities and code written around native types to which other teams might not accept to divert from hence defining a custom stream interface might not be feasible and with js
ReadableStream
it anyways gets tricky i think. Hence l am looking if i can make above work somehow.