-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
lib/src/commonMain/kotlin/xyz/mcxross/ksui/model/serializer/CallArgObjectSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package xyz.mcxross.ksui.model.serializer | ||
|
||
import kotlinx.serialization.KSerializer | ||
import xyz.mcxross.ksui.model.CallArg | ||
|
||
object CallArgObjectSerializer : KSerializer<CallArg.Object> { | ||
override val descriptor: kotlinx.serialization.descriptors.SerialDescriptor = | ||
kotlinx.serialization.descriptors.buildClassSerialDescriptor("CallArg.Object") {} | ||
|
||
override fun serialize(encoder: kotlinx.serialization.encoding.Encoder, value: CallArg.Object) { | ||
encoder.encodeByte(1) | ||
} | ||
|
||
override fun deserialize(decoder: kotlinx.serialization.encoding.Decoder): CallArg.Object { | ||
throw NotImplementedError("CallArg.Object is not implemented") | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
lib/src/commonMain/kotlin/xyz/mcxross/ksui/model/serializer/CallArgPureSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package xyz.mcxross.ksui.model.serializer | ||
|
||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
import kotlinx.serialization.encoding.encodeCollection | ||
import xyz.mcxross.ksui.model.CallArg | ||
|
||
object CallArgPureSerializer : kotlinx.serialization.KSerializer<CallArg.Pure> { | ||
override val descriptor: SerialDescriptor = | ||
kotlinx.serialization.descriptors.buildClassSerialDescriptor("CallArg.Pure") { | ||
element("data", kotlinx.serialization.serializer<Byte>().descriptor) | ||
} | ||
|
||
override fun serialize(encoder: Encoder, value: CallArg.Pure) { | ||
encoder.encodeByte(0) | ||
encoder.encodeCollection(descriptor, value.data.size) { | ||
for (element in value.data) { | ||
encoder.encodeByte(element) | ||
} | ||
} | ||
} | ||
|
||
override fun deserialize(decoder: Decoder): CallArg.Pure { | ||
throw NotImplementedError("CallArg.Pure is not implemented") | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
lib/src/tvosMain/kotlin/xyz/mcxross/ksui/client/Platform.tvos.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package xyz.mcxross.ksui.client | ||
|
||
import io.ktor.client.engine.* | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
actual val defaultEngine: HttpClientEngine | ||
get() = TODO("Not yet implemented") | ||
|
||
actual suspend fun <T> runBlocking( | ||
context: CoroutineContext, | ||
block: suspend CoroutineScope.() -> T | ||
): T { | ||
TODO("Not yet implemented") | ||
} |
15 changes: 15 additions & 0 deletions
15
lib/src/watchosMain/kotlin/xyz/mcxross/ksui/client/Platform.watchos.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package xyz.mcxross.ksui.client | ||
|
||
import io.ktor.client.engine.* | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
actual val defaultEngine: HttpClientEngine | ||
get() = TODO("Not yet implemented") | ||
|
||
actual suspend fun <T> runBlocking( | ||
context: CoroutineContext, | ||
block: suspend CoroutineScope.() -> T | ||
): T { | ||
TODO("Not yet implemented") | ||
} |