package eu.friedcutlet.yokan.services.system import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow /** A one-off check; [NetworkMonitor] follows network changes. */ expect fun isOnUnmeteredNetwork(): Boolean /** Whether the device's current network is unmetered, updated as it changes networks. */ interface NetworkMonitor { /** False on a metered or Low Data Mode network, and without a network. */ val unmetered: StateFlow } /** Registers a monitor with the platform for the process lifetime; create one per process. */ expect fun createNetworkMonitor(): NetworkMonitor /** Platforms that don't expose metering (desktop, browser) are always unmetered. */ internal object UnmeteredNetwork : NetworkMonitor { override val unmetered: StateFlow = MutableStateFlow(true) } expect fun openSystemBrowser(url: String): Boolean /** * Apply the user-chosen UI language to the underlying platform so Compose * Multiplatform Resources picks up the matching translation on the next * recomposition. Pass `null` (or blank) to restore the system default. * * - JVM (Android + Desktop): updates `java.util.Locale.getDefault()`. * - iOS: sets `NSUserDefaults.AppleLanguages` — change takes effect on * next app launch (iOS caches the bundle locale). */ expect fun applyAppLanguage(languageCode: String?)