Last active
June 9, 2021 09:05
-
-
Save MoOx/6fb151383c81d69c88a71cb4002c8aca to your computer and use it in GitHub Desktop.
react native netinfo flow types (should be on flow-typed but I am too lazy to make tests)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '@react-native-community/netinfo' { | |
declare export type StateType = | |
| 'none' | |
| 'unknown' | |
| 'cellular' | |
| 'wifi' | |
| 'bluetooth' | |
| 'ethernet' | |
| 'wimax' | |
| 'vpn' | |
| 'other'; | |
declare export type CellularGeneration = 'null' | '2g' | '3g' | '4g'; | |
declare export type State = {| | |
type: StateType, | |
isConnected: boolean, | |
isInternetReachable: boolean, | |
|}; | |
declare export type Unsubscribe = () => void; | |
declare export default {| | |
State: State, | |
fetch: () => Promise<State>, | |
addEventListener: (listener: (State) => void) => Unsubscribe, | |
useNetInfo: () => State, | |
|}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
flow-typed/flow-typed#3472