Module NetInfo-BsReactNative
type infoType
;NetInfo exposes info about online/offline status
You can read more on
NetInfo
API usage in official docs: https://facebook.github.io/react-native/docs/netinfoTypes
infoType
type infoType;
infoEffectiveType
type infoEffectiveType;
connectionType
type connectionType = | None | WiFi | Cellular | Unknown | Bluetooth | Ethernet | WiMax;
effectiveConnectionType
type effectiveConnectionType = | Net2G | Net3G | Net4G | Unknown;
info
type info = { . "_type": infoType, "effectiveType": infoEffectiveType, };
Methods
connectionType
let connectionType: infoType => connectionType;
effectiveConnectionType
let effectiveConnectionType: infoEffectiveType => effectiveConnectionType;
addEventListener
let addEventListener: (info => unit) => unit;
removeEventListener
let removeEventListener: (info => unit) => unit;
isConnectionExpensive
let isConnectionExpensive: unit => Js.Promise.t(bool);
getConnectionInfo
let getConnectionInfo: unit => Js.Promise.t(info);
type infoEffectiveType
;type connectionType
=
;|
None
|
WiFi
|
Cellular
|
Unknown
|
Bluetooth
|
Ethernet
|
WiMax
type effectiveConnectionType
=
;|
Net2G
|
Net3G
|
Net4G
|
Unknown
type info
= Js.t({. _type: infoType, effectiveType: infoEffectiveType, })
;
let connectionType: infoType => connectionType;
let effectiveConnectionType: infoEffectiveType => effectiveConnectionType;
let addEventListener: (info => unit) => unit;
let removeEventListener: (info => unit) => unit;
let isConnectionExpensive: unit => Js.Promise.t(bool);
let getConnectionInfo: unit => Js.Promise.t(info);
module IsConnected: { ... };