1// @needsAudit 2export type NetworkState = { 3 /** 4 * A [`NetworkStateType`](#networkstatetype) enum value that represents the current network 5 * connection type. 6 */ 7 type?: NetworkStateType; 8 /** 9 * If there is an active network connection. Note that this does not mean that internet is reachable. 10 * This field is `false` if the type is either `Network.NetworkStateType.NONE` or `Network.NetworkStateType.UNKNOWN`, 11 * `true` otherwise. 12 */ 13 isConnected?: boolean; 14 /** 15 * If the internet is reachable with the currently active network connection. On Android, this 16 * depends on `NetInfo.isConnected()` (API level < 29) or `ConnectivityManager.getActiveNetwork()` 17 * (API level >= 29). On iOS, this value will always be the same as `isConnected`. 18 */ 19 isInternetReachable?: boolean; 20}; 21 22// @needsAudit 23/** 24 * An enum of the different types of devices supported by Expo. 25 */ 26export enum NetworkStateType { 27 /** 28 * No active network connection detected. 29 */ 30 NONE = 'NONE', 31 /** 32 * The connection type could not be determined. 33 */ 34 UNKNOWN = 'UNKNOWN', 35 /** 36 * Active network connection over mobile data or [`DUN-specific`](https://developer.android.com/reference/android/net/ConnectivityManager#TYPE_MOBILE_DUN) 37 * mobile connection when setting an upstream connection for tethering. 38 */ 39 CELLULAR = 'CELLULAR', 40 /** 41 * Active network connection over WiFi. 42 */ 43 WIFI = 'WIFI', 44 /** 45 * Active network connection over Bluetooth. 46 */ 47 BLUETOOTH = 'BLUETOOTH', 48 /** 49 * Active network connection over Ethernet. 50 */ 51 ETHERNET = 'ETHERNET', 52 /** 53 * Active network connection over Wimax. 54 */ 55 WIMAX = 'WIMAX', 56 /** 57 * Active network connection over VPN. 58 */ 59 VPN = 'VPN', 60 /** 61 * Active network connection over other network connection types. 62 */ 63 OTHER = 'OTHER', 64} 65