-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
36 lines (31 loc) · 1.05 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
declare module 'react-native-redux-connectivity' {
// NetworkMonitor
export class NetworkMonitor {
constructor({dispatch}: {dispatch: (action: any) => unknown});
start(): () => void;
stop(): () => void;
}
// NetworkReducer
type connectionTypeType = 'none' | 'wifi' | 'cell' | 'unknown';
type effectiveTypeType = '2g' | '3g' | '4g' | 'unknown';
type networkChangedType = 'redux-connectivity/NETWORK_CHANGED';
type NetworkActionType = {
type: networkChangedType;
connected: boolean;
connectionType: connectionTypeType;
effectiveType: effectiveTypeType;
};
export interface NetworkMonitorState {
connected: boolean;
connectionType: connectionTypeType;
effectiveType: effectiveTypeType;
}
export function NetworkReducer(state: NetworkMonitorState, action: NetworkActionType | any): NetworkMonitorState;
namespace NetworkReducer {
export function setNetworkAction(
connected: boolean,
connectionType: connectionTypeType,
effectiveType: effectiveTypeType
): NetworkActionType;
}
}