Skip to content

API reference

Every public declaration of reachable and reachable-testing, read from the ABI dumps committed with the source. The build fails whenever the code and its dump disagree, so this page always matches the released code. It's built for scanning; the site's /llms-full.txt inlines it.

It lists signatures only. Doc comments, and declarations that exist only on Android or the JVM, are in the Dokka reference. From Swift, StateFlows arrive as AsyncSequences and enums switch exhaustively (see iOS).

Reading the dumps: com.example/Type is the type Type in package com.example, <init> is a constructor, and = ... marks a parameter with a default value.

reachable

open annotation class com.happycodelucky.reachable/TestingOnly : kotlin/Annotation {
    constructor <init>()
}

final enum class com.happycodelucky.reachable/Transport : kotlin/Enum<com.happycodelucky.reachable/Transport> {
    enum entry Cellular
    enum entry Ethernet
    enum entry None
    enum entry Other
    enum entry Wifi

    final val entries
        final fun <get-entries>(): kotlin.enums/EnumEntries<com.happycodelucky.reachable/Transport>

    final fun valueOf(kotlin/String): com.happycodelucky.reachable/Transport
    final fun values(): kotlin/Array<com.happycodelucky.reachable/Transport>
}

abstract interface com.happycodelucky.reachable/Reachability : kotlin/AutoCloseable {
    abstract val dataMetered
        abstract fun <get-dataMetered>(): kotlinx.coroutines.flow/StateFlow<kotlin/Boolean>
    abstract val isDataMetered
        abstract fun <get-isDataMetered>(): kotlin/Boolean
    abstract val isReachable
        abstract fun <get-isReachable>(): kotlin/Boolean
    abstract val reachable
        abstract fun <get-reachable>(): kotlinx.coroutines.flow/StateFlow<kotlin/Boolean>
    abstract val status
        abstract fun <get-status>(): kotlinx.coroutines.flow/StateFlow<com.happycodelucky.reachable/ReachabilityStatus>

    abstract fun close()

    final object Companion {
        final val shared
            final fun <get-shared>(): com.happycodelucky.reachable/Reachability

        final fun installForTesting(com.happycodelucky.reachable/Reachability?): com.happycodelucky.reachable/TestingOverrideHandle
    }
}

abstract class com.happycodelucky.reachable.internal/StateFlowReachability : com.happycodelucky.reachable/Reachability {
    constructor <init>()

    final val dataMetered
        final fun <get-dataMetered>(): kotlinx.coroutines.flow/StateFlow<kotlin/Boolean>
    final val isClosed
        final fun <get-isClosed>(): kotlin/Boolean
    final val isDataMetered
        final fun <get-isDataMetered>(): kotlin/Boolean
    final val isReachable
        final fun <get-isReachable>(): kotlin/Boolean
    final val reachable
        final fun <get-reachable>(): kotlinx.coroutines.flow/StateFlow<kotlin/Boolean>
    final val scope
        final fun <get-scope>(): kotlinx.coroutines/CoroutineScope
    final val status
        final fun <get-status>(): kotlinx.coroutines.flow/StateFlow<com.happycodelucky.reachable/ReachabilityStatus>

    abstract fun onClose()
    final fun close()
    final fun publish(com.happycodelucky.reachable/ReachabilityStatus)
    open fun onCloseInvoked()
}

final class com.happycodelucky.reachable/ReachabilityStatus {
    constructor <init>(kotlin/Boolean, com.happycodelucky.reachable/Transport, kotlin/Boolean)

    final val isDataMetered
        final fun <get-isDataMetered>(): kotlin/Boolean
    final val isReachable
        final fun <get-isReachable>(): kotlin/Boolean
    final val transport
        final fun <get-transport>(): com.happycodelucky.reachable/Transport

    final fun component1(): kotlin/Boolean
    final fun component2(): com.happycodelucky.reachable/Transport
    final fun component3(): kotlin/Boolean
    final fun copy(kotlin/Boolean = ..., com.happycodelucky.reachable/Transport = ..., kotlin/Boolean = ...): com.happycodelucky.reachable/ReachabilityStatus
    final fun equals(kotlin/Any?): kotlin/Boolean
    final fun hashCode(): kotlin/Int
    final fun toString(): kotlin/String

    final object Companion {
        final val Unknown
            final fun <get-Unknown>(): com.happycodelucky.reachable/ReachabilityStatus
    }
}

final class com.happycodelucky.reachable/TestingOverrideHandle {
    final fun uninstall()
}

final fun com.happycodelucky.reachable/Reachability(): com.happycodelucky.reachable/Reachability

reachable-testing

final class com.happycodelucky.reachable.testing/FakeReachability : com.happycodelucky.reachable.internal/StateFlowReachability {
    constructor <init>(com.happycodelucky.reachable/ReachabilityStatus = ...)

    final val closeCallCount
        final fun <get-closeCallCount>(): kotlin/Int
    final val wasClosed
        final fun <get-wasClosed>(): kotlin/Boolean

    final fun emit(com.happycodelucky.reachable/ReachabilityStatus)
    final fun reset()
    final fun setDataMetered(kotlin/Boolean)
    final fun setReachable(kotlin/Boolean)
    final fun setTransport(com.happycodelucky.reachable/Transport)
}

final suspend fun <#A: kotlin/Any?> com.happycodelucky.reachable.testing/withFakeReachability(com.happycodelucky.reachable/ReachabilityStatus = ..., kotlin.coroutines/SuspendFunction1<com.happycodelucky.reachable.testing/FakeReachability, #A>): #A