package dev.inmo.postssystem.client.ui.fsm

import dev.inmo.micro_utils.fsm.common.State
import dev.inmo.micro_utils.serialization.typed_serializer.TypedSerializer
import kotlinx.serialization.*

@Serializable(UIFSMStateSerializer::class)
sealed interface UIFSMState : State {
    val from: UIFSMState?
        get() = null
    override val context: String
        get() = "main"
}

object UIFSMStateSerializer : KSerializer<UIFSMState> by TypedSerializer(
    "auth" to AuthUIFSMState.serializer(),
)

@Serializable
data class AuthUIFSMState(
    override val from: UIFSMState? = null,
    override val context: String = "main"
) : UIFSMState
val DefaultAuthUIFSMState = AuthUIFSMState()
