1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import { NetInfoNativeModule } from './privateTypes';
|
10 | declare type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
|
11 | declare type ConnectionEffectiveType = '2g' | '3g' | '4g' | 'slow-2g';
|
12 | declare type ConnectionSaveData = boolean;
|
13 | interface Events {
|
14 | change: Event;
|
15 | }
|
16 | interface Connection {
|
17 | type: ConnectionType;
|
18 | effectiveType: ConnectionEffectiveType;
|
19 | saveData: ConnectionSaveData;
|
20 | addEventListener<K extends keyof Events>(type: K, listener: (event: Events[K]) => void): void;
|
21 | removeEventListener<K extends keyof Events>(type: K, listener: (event: Events[K]) => void): void;
|
22 | }
|
23 | declare global {
|
24 | interface Navigator {
|
25 | connection?: Connection;
|
26 | mozConnection?: Connection;
|
27 | webkitConnection?: Connection;
|
28 | }
|
29 | }
|
30 | declare const RNCNetInfo: NetInfoNativeModule;
|
31 | export default RNCNetInfo;
|
32 |
|
\ | No newline at end of file |