Typed Serializer
inline fun <T : Any> TypedSerializer(presetSerializers: Map<String, KSerializer<out T>> = emptyMap()): TypedSerializer<T>(source)
Creates a TypedSerializer for the reified type T.
Return
A new TypedSerializer instance
Parameters
preset Serializers
A map of type names to serializers for known subtypes
Type Parameters
T
The base type to serialize
inline fun <T : Any> TypedSerializer(vararg presetSerializers: Pair<String, KSerializer<out T>>): TypedSerializer<T>(source)
Creates a TypedSerializer for the reified type T with vararg preset serializers.
Return
A new TypedSerializer instance
Parameters
preset Serializers
Pairs of type names to serializers for known subtypes
Type Parameters
T
The base type to serialize