From 487acd603befbb8adc484ecc49a4bd7993958dd7 Mon Sep 17 00:00:00 2001 From: Niklas Merz Date: Sun, 14 Oct 2018 13:30:34 +0200 Subject: [PATCH] refactor(network): add enum for connection types (#2754) --- src/@ionic-native/plugins/network/index.ts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/@ionic-native/plugins/network/index.ts b/src/@ionic-native/plugins/network/index.ts index 41278ab9e..aa03f48b5 100644 --- a/src/@ionic-native/plugins/network/index.ts +++ b/src/@ionic-native/plugins/network/index.ts @@ -11,6 +11,17 @@ import { merge } from 'rxjs/observable/merge'; declare const navigator: any; +export enum Connection { + UNKNOWN = 0, + ETHERNET, + WIFI, + CELL_2G, + CELL_3G , + CELL_4G, + CELL, + NONE +} + /** * @name Network * @description @@ -62,6 +73,21 @@ declare const navigator: any; }) @Injectable() 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 * @return {string}