forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnectivity.d.ts
More file actions
42 lines (37 loc) · 1.19 KB
/
connectivity.d.ts
File metadata and controls
42 lines (37 loc) · 1.19 KB
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
37
38
39
40
41
42
/**
* Contains connectivity utility methods.
*/
declare module "connectivity" {
/**
* Gets the type of connection.
* Returns a value from the connectivity.connectionType enumeration.
* To use this method on Android you need to have the android.permission.ACCESS_NETWORK_STATE permission added to the AndroidManifest.xml file.
*/
export function getConnectionType(): number;
/**
* Defines the different connection types.
*/
export module connectionType {
/**
* Denotes no connection.
*/
export var none: number;
/**
* Denotes a WiFi connection.
*/
export var wifi: number;
/**
* Denotes a mobile connection, i.e. cellular network or WAN
*/
export var mobile: number;
}
/**
* Starts monitoring the connection type.
* @param connectionChangedCallback A function that will be called when the connection type changes.
*/
export function startMonitoring(connectionTypeChangedCallback: (newConnectionType: number) => void): void;
/**
* Stops monitoring the connection type.
*/
export function stopMonitoring(): void;
}