mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
refactor(network): add enum for connection types (#2754)
This commit is contained in:
parent
fb4d2640c1
commit
487acd603b
@ -11,6 +11,17 @@ import { merge } from 'rxjs/observable/merge';
|
|||||||
|
|
||||||
declare const navigator: any;
|
declare const navigator: any;
|
||||||
|
|
||||||
|
export enum Connection {
|
||||||
|
UNKNOWN = 0,
|
||||||
|
ETHERNET,
|
||||||
|
WIFI,
|
||||||
|
CELL_2G,
|
||||||
|
CELL_3G ,
|
||||||
|
CELL_4G,
|
||||||
|
CELL,
|
||||||
|
NONE
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Network
|
* @name Network
|
||||||
* @description
|
* @description
|
||||||
@ -62,6 +73,21 @@ declare const navigator: any;
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Network extends IonicNativePlugin {
|
export class Network extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constants for possible connection types
|
||||||
|
*/
|
||||||
|
Connection = {
|
||||||
|
UNKNOWN: 'unknown',
|
||||||
|
ETHERNET: 'ethernet',
|
||||||
|
WIFI: 'wifi',
|
||||||
|
CELL_2G: '2g',
|
||||||
|
CELL_3G: '3g',
|
||||||
|
CELL_4G: '4g',
|
||||||
|
CELL: 'cellular',
|
||||||
|
NONE: 'none'
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connection type
|
* Connection type
|
||||||
* @return {string}
|
* @return {string}
|
||||||
|
Loading…
Reference in New Issue
Block a user