/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package com.runicgateway.app.core.net

import kotlinx.serialization.json.JsonObject

/**
 * A lifecycle or data event from the public shard SSE stream (PLAN.md §6.2).
 *
 *  - [Open]   — a connection was established (drive the live indicator on).
 *  - [Closed] — the connection dropped or none is available (indicator off);
 *               [ShardStreamClient] will reconnect with backoff.
 *  - [Frame]  — a live event: its `kind` plus the raw JSON object, which the
 *               boards decode into their DTO (`champ.update` → `ChampDto`, …).
 */
sealed interface ShardStreamEvent {
    data object Open : ShardStreamEvent
    data object Closed : ShardStreamEvent
    data class Frame(val kind: String, val data: JsonObject) : ShardStreamEvent
}
