From ab52c91f47a37bb0530cce4551b58dfd3aece76b Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sat, 11 Jun 2016 11:07:19 -0400 Subject: [PATCH] refactor(plugins): replace types in plugin files --- src/plugins/emailcomposer.ts | 14 +++- src/plugins/hotspot.ts | 96 +++++++++++++++++++++-- src/plugins/types/connection-info.type.ts | 30 ------- src/plugins/types/email.type.ts | 13 --- src/plugins/types/hotspot-device.type.ts | 15 ---- src/plugins/types/network-config.type.ts | 21 ----- src/plugins/types/network.type.ts | 37 --------- 7 files changed, 102 insertions(+), 124 deletions(-) delete mode 100644 src/plugins/types/connection-info.type.ts delete mode 100644 src/plugins/types/email.type.ts delete mode 100644 src/plugins/types/hotspot-device.type.ts delete mode 100644 src/plugins/types/network-config.type.ts delete mode 100644 src/plugins/types/network.type.ts diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index a1349328d..a2e0f8212 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -1,7 +1,5 @@ import {Plugin, Cordova} from './plugin'; -import {Email} from './types/email.type'; -declare var cordova; - +declare var cordova: any; /** * @name Email Composer * @description @@ -85,3 +83,13 @@ export class EmailComposer { static open(email: Email, scope?: any): Promise {return; } } +export interface Email { + app?: string; + to?: string | Array; + cc?: string | Array; + bcc?: string | Array; + attachments?: Array; + subject?: string; + body?: string; + isHtml?: boolean; +} \ No newline at end of file diff --git a/src/plugins/hotspot.ts b/src/plugins/hotspot.ts index acc29c853..9932a0f7a 100644 --- a/src/plugins/hotspot.ts +++ b/src/plugins/hotspot.ts @@ -1,10 +1,5 @@ import {Plugin, Cordova} from './plugin'; -import {Network} from './types/network.type'; -import {NetworkConfig} from './types/network-config.type'; -import {ConnectionInfo} from './types/connection-info.type'; -import {HotspotDevice} from './types/hotspot-device.type'; - /** * @name Hotspot * @description @@ -220,3 +215,94 @@ export class Hotspot { static isRooted(): Promise {return; } } + +export interface ConnectionInfo { + /** + * @property {string} SSID + * The service set identifier (SSID) of the current 802.11 network. + */ + SSID: string; + /** + * @property {string} BSSID + * The basic service set identifier (BSSID) of the current access point. + */ + BSSID: string; + /** + * @property {string} linkSpeed + * The current link speed in Mbps + */ + linkSpeed: string; + /** + * @property {string} IPAddress + * The IP Address + */ + IPAddress: string; + /** + * @property {string} networkID + * Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. + */ + networkID: string; +} + +export interface Network { + /** + * @property {string} SSID + * Human readable network name + */ + SSID: string; + /** + * @property {string} BSSID + * MAC Address of the access point + */ + BSSID: string; + /** + * @property {number (int)} frequency + * The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point. + */ + frequency: number; + /** + * @property {number} level + * The detected signal level in dBm, also known as the RSSI. + */ + level: number; + /** + * @property {number} timestamp + * Timestamp in microseconds (since boot) when this result was last seen. + */ + timestamp: number; + /** + * @property {string} capabilities + * Describes the authentication, key management, and encryption schemes supported by the access point. + */ + capabilities: string; +} +export interface NetworkConfig { + /** + * @property {string} deviceIPAddress - Device IP Address + */ + deviceIPAddress: string; + /** + * @property {string} deviceMacAddress - Device MAC Address + */ + deviceMacAddress: string; + /** + * @property {string} gatewayIPAddress - Gateway IP Address + */ + gatewayIPAddress: string; + /** + * @property {string} gatewayMacAddress - Gateway MAC Address + */ + gatewayMacAddress: string; +} +export interface HotspotDevice { + /** + * @property {string} ip + * Hotspot IP Address + */ + ip: string; + /** + * @property {string} mac + * Hotspot MAC Address + */ + mac: string; +} diff --git a/src/plugins/types/connection-info.type.ts b/src/plugins/types/connection-info.type.ts deleted file mode 100644 index 37a7c73b6..000000000 --- a/src/plugins/types/connection-info.type.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @name ConnectionInfo - */ -export interface ConnectionInfo { - /** - * @property {string} SSID - * The service set identifier (SSID) of the current 802.11 network. - */ - SSID: string; - /** - * @property {string} BSSID - * The basic service set identifier (BSSID) of the current access point. - */ - BSSID: string; - /** - * @property {string} linkSpeed - * The current link speed in Mbps - */ - linkSpeed: string; - /** - * @property {string} IPAddress - * The IP Address - */ - IPAddress: string; - /** - * @property {string} networkID - * Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. - */ - networkID: string; -} diff --git a/src/plugins/types/email.type.ts b/src/plugins/types/email.type.ts deleted file mode 100644 index d133d1b3f..000000000 --- a/src/plugins/types/email.type.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Email object for Opening Email Composer - */ -export interface Email { - app?: string; - to?: string | Array; - cc?: string | Array; - bcc?: string | Array; - attachments?: Array; - subject?: string; - body?: string; - isHtml?: boolean; -} \ No newline at end of file diff --git a/src/plugins/types/hotspot-device.type.ts b/src/plugins/types/hotspot-device.type.ts deleted file mode 100644 index 660dbb42c..000000000 --- a/src/plugins/types/hotspot-device.type.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @name HotspotDevice - */ -export interface HotspotDevice { - /** - * @property {string} ip - * Hotspot IP Address - */ - ip: string; - /** - * @property {string} mac - * Hotspot MAC Address - */ - mac: string; -} diff --git a/src/plugins/types/network-config.type.ts b/src/plugins/types/network-config.type.ts deleted file mode 100644 index ce48444c0..000000000 --- a/src/plugins/types/network-config.type.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @name ConnectionInfo - */ -export interface NetworkConfig { - /** - * @property {string} deviceIPAddress - Device IP Address - */ - deviceIPAddress: string; - /** - * @property {string} deviceMacAddress - Device MAC Address - */ - deviceMacAddress: string; - /** - * @property {string} gatewayIPAddress - Gateway IP Address - */ - gatewayIPAddress: string; - /** - * @property {string} gatewayMacAddress - Gateway MAC Address - */ - gatewayMacAddress: string; -} diff --git a/src/plugins/types/network.type.ts b/src/plugins/types/network.type.ts deleted file mode 100644 index 16243a1c7..000000000 --- a/src/plugins/types/network.type.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @name Network - * @description - * Based on [ScanResult](http://developer.android.com/reference/android/net/wifi/ScanResult.html) - */ -export interface Network { - /** - * @property {string} SSID - * Human readable network name - */ - SSID: string; - /** - * @property {string} BSSID - * MAC Address of the access point - */ - BSSID: string; - /** - * @property {number (int)} frequency - * The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point. - */ - frequency: number; - /** - * @property {number} level - * The detected signal level in dBm, also known as the RSSI. - */ - level: number; - /** - * @property {number} timestamp - * Timestamp in microseconds (since boot) when this result was last seen. - */ - timestamp: number; - /** - * @property {string} capabilities - * Describes the authentication, key management, and encryption schemes supported by the access point. - */ - capabilities: string; -}