From 0f3c1886d33359f5085162c76721a583fe7d404c Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 13:18:00 -0400 Subject: [PATCH 1/7] feat(plugin): add splashscreen --- src/plugins/splashscreen.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/plugins/splashscreen.ts diff --git a/src/plugins/splashscreen.ts b/src/plugins/splashscreen.ts new file mode 100644 index 000000000..c7999781c --- /dev/null +++ b/src/plugins/splashscreen.ts @@ -0,0 +1,36 @@ +import {Plugin, Cordova} from './plugin' + +/** + * @name Splashscreen + * @description This plugin displays and hides a splash screen during application launch. + * @usage + * ```ts + * Splashscreen.show(); + * + * Splashscreen.hide(); + * ``` + */ +@Plugin({ + plugin: 'cordova-plugin-splashscreen', + pluginRef: 'navigator.splashscreen', + repo: 'https://github.com/apache/cordova-plugin-splashscreen' +}) +export class Splashscreen { + + /** + * Shows the splashscreen + */ + @Cordova({ + sync: true + }) + static show() : void {} + + /** + * Hides the splashscreen + */ + @Cordova({ + sync: true + }) + static hide() : void {} + +} \ No newline at end of file From 29bf01190fde45f2a166f300b719524e06fd468d Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 13:18:54 -0400 Subject: [PATCH 2/7] docs(splashscreen): --- src/plugins/splashscreen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/splashscreen.ts b/src/plugins/splashscreen.ts index c7999781c..0069d163b 100644 --- a/src/plugins/splashscreen.ts +++ b/src/plugins/splashscreen.ts @@ -2,7 +2,7 @@ import {Plugin, Cordova} from './plugin' /** * @name Splashscreen - * @description This plugin displays and hides a splash screen during application launch. + * @description This plugin displays and hides a splash screen during application launch. The methods below allows showing and hiding the splashscreen after the app has loaded. * @usage * ```ts * Splashscreen.show(); From e1dc6061bddca78ceb2220b6810db1a861fb7d5e Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 13:29:59 -0400 Subject: [PATCH 3/7] feat(plugin): add android hotspot plugin --- src/plugins/hotspot.ts | 100 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 src/plugins/hotspot.ts diff --git a/src/plugins/hotspot.ts b/src/plugins/hotspot.ts new file mode 100644 index 000000000..89106b1be --- /dev/null +++ b/src/plugins/hotspot.ts @@ -0,0 +1,100 @@ +import {Plugin, Cordova} from './plugin' + +/** + * @name Hotspot + * @description + * @platforms Android + * @usage + */ +@Plugin({ + plugin: 'cordova-plugin-hotspot', + pluginRef: 'cordova.plugnis.hotspot', + repo: 'https://github.com/hypery2k/cordova-hotspot-plugin' +}) +export class Hotspot { + + @Cordova() + static isAvailable() : Promise {return} + + @Cordova() + static toggleWifi() : Promise {return} + + @Cordova() + static createHotspot(ssid : string, mode : string, password : string) : Promise {return} + + @Cordova() + static startHotspot() : Promise {return} + + @Cordova() + static configureHotspot(ssid : string, mode : string, password : string) : Promise {return} + + @Cordova() + static stopHotspot() : Promise {return} + + @Cordova() + static isHotspotEnabled() : Promise {return} + + @Cordova() + static getAllHotspotDevices() : Promise {return} + + @Cordova() + static connectToHotspot(ssid, password) : Promise {return} + + @Cordova() + static connectToWifiAuthEncrypt(ssid, password, authentication, encryption) : Promise {return} + + @Cordova() + static addWifiNetwork(ssid, mode, password) : Promise {return} + + @Cordova() + static removeWifiNetwork(ssid) : Promise {return} + + @Cordova() + static isConnectedToInternet() : Promise {return} + + @Cordova() + static isConnectedToInternetViaWifi() : Promise {return} + + @Cordova() + static isWifiOn() : Promise {return} + + @Cordova() + static isWifiSupported() : Promise {return} + + @Cordova() + static isWifiDirectSupported() : Promise {return} + + @Cordova() + static scanWifi() : Promise {return} + + @Cordova() + static scanWifiByLevel() : Promise {return} + + @Cordova() + static startPeriodicallyScan(interval, duration) : Promise {return} + + @Cordova() + static stopPeriodicallyScan() : Promise {return} + + @Cordova() + static getNetConfig() : Promise {return} + + @Cordova() + static getConnectionInfo() : Promise {return} + + @Cordova() + static pingHost(ip) : Promise {return} + + @Cordova() + static getMacAddressOfHost(ip) : Promise {return} + + @Cordova() + static isDnsLive(ip) : Promise {return} + + @Cordova() + static isPortLife(ip) : Promise {return} + + @Cordova() + static isRooted() : Promise {return} + +} \ No newline at end of file From 22bb218e1054c220bcfa46a7ba8ec54a141de103 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 13:34:19 -0400 Subject: [PATCH 4/7] feat(plugin): add DB Meter --- src/plugins/dbmeter.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/plugins/dbmeter.ts diff --git a/src/plugins/dbmeter.ts b/src/plugins/dbmeter.ts new file mode 100644 index 000000000..d5c32c86b --- /dev/null +++ b/src/plugins/dbmeter.ts @@ -0,0 +1,30 @@ +import {Plugin, Cordova} from './plugin' +// TODO docs +/** + * @name DB Meter + * @description + * @platforms Android, iOS + * @usage + */ +@Plugin({ + plugin: 'cordova-plugin-dbmeter', + pluginRef: 'DBMeter', + repo: 'https://github.com/akofman/cordova-plugin-dbmeter' +}) +export class DBMeter { + + + // TODO use observable instead + @Cordova() + static start () : Promise {return} + + @Cordova() + static stop () : Promise {return} + + @Cordova() + static isListening() : Promise {return} + + @Cordova() + static delete() : Promise {return} + +} \ No newline at end of file From 8c17a2a6c246cc0307cd3f1105aade0d4a1249e5 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 13:39:29 -0400 Subject: [PATCH 5/7] feat(plugin): add base64 to gallery --- src/plugins/base64togallery.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/plugins/base64togallery.ts diff --git a/src/plugins/base64togallery.ts b/src/plugins/base64togallery.ts new file mode 100644 index 000000000..0c48f1af0 --- /dev/null +++ b/src/plugins/base64togallery.ts @@ -0,0 +1,31 @@ +import {Plugin, Cordova} from './plugin' +/** + * @name Base64 To Gallery + * @description This plugin allows you to save base64 data as a png image into the device + * @platforms Android, iOS, Windows Phone + * @usage + * ```ts + * Base64ToGallery.base64ToGallery(base64Data, 'img_').then( + * res => console.log("Saved image to gallery ", res), + * err => console.log("Error saving image to gallery ", err) + * ); + * ``` + */ +@Plugin({ + plugin: 'cordova-base64-to-gallery', + pluginRef: 'cordova', + repo: 'https://github.com/Nexxa/cordova-base64-to-gallery' +}) +export class Base64ToGallery { + + /** + * + * @param data + * @param prefix + */ + @Cordova() + base64ToGallery(data : string , prefix? : string ) : Promise { + return + } + +} \ No newline at end of file From 765ef48a23e7c7e8cd91f53b941a480d3877f379 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 15:05:15 -0400 Subject: [PATCH 6/7] docs(dbmeter): complete docs --- src/plugins/dbmeter.ts | 49 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/src/plugins/dbmeter.ts b/src/plugins/dbmeter.ts index d5c32c86b..00fd2afd8 100644 --- a/src/plugins/dbmeter.ts +++ b/src/plugins/dbmeter.ts @@ -1,10 +1,30 @@ import {Plugin, Cordova} from './plugin' -// TODO docs +import {Observable} from "rxjs/Observable"; /** * @name DB Meter - * @description + * @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone. * @platforms Android, iOS * @usage + * ```ts + * // Start listening + * let subscription = DBMeter.start().subscribe( + * data => console.log(data) + * ); + * + * // Check if we are listening + * DBMeter.isListening().then( + * (isListening : boolean) => console.log(isListening) + * ); + * + * // Stop listening + * subscription.unsubscribe(); + * + * // Delete DBMeter instance from memory + * DBMeter.delete().then( + * () => console.log("Deleted DB Meter instance"), + * error => console.log("Error occurred while deleting DB Meter instance") + * ); + * ``` */ @Plugin({ plugin: 'cordova-plugin-dbmeter', @@ -13,17 +33,34 @@ import {Plugin, Cordova} from './plugin' }) export class DBMeter { + /** + * Starts listening + * @return {Observable} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening. + */ + @Cordova({ + observable: true, + clearFunction: 'stop' + }) + static start () : Observable {return} - // TODO use observable instead - @Cordova() - static start () : Promise {return} - + /** + * Stops listening + * @private + */ @Cordova() static stop () : Promise {return} + /** + * Check if the DB Meter is listening + * @return {Promise} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening + */ @Cordova() static isListening() : Promise {return} + /** + * Delete the DB Meter instance + * @return {Promise} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur. + */ @Cordova() static delete() : Promise {return} From a80c4ee2bf47feec4bd1e00c484350a5257cc107 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 13 Mar 2016 15:19:21 -0400 Subject: [PATCH 7/7] feat(plugin): add keyboard --- src/plugins/keyboard.ts | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/plugins/keyboard.ts diff --git a/src/plugins/keyboard.ts b/src/plugins/keyboard.ts new file mode 100644 index 000000000..d44915406 --- /dev/null +++ b/src/plugins/keyboard.ts @@ -0,0 +1,50 @@ +import {Cordova, Plugin} from './plugin' +import {Observable} from "rxjs/Observable"; + +@Plugin({ + plugin: 'ionic-plugin-keyboard', + pluginRef: 'cordova.plugins.Keyboard', + repo: 'https://github.com/driftyco/ionic-plugin-keyboard' +}) +export class Keyboard { + + /** + * Hide the keyboard accessory bar with the next, previous and done buttons. + * @param hide {boolean} + */ + @Cordova({ + sync: true + }) + static hideKeyboardAccessoryBar(hide : boolean) : void {} + + /** + * Close the keyboard if open + */ + @Cordova({ + sync: true + }) + static close() : void {} + + @Cordova({ + sync: true + }) + static disableScroll(disable : boolean) : void {} + + @Cordova({ + sync: true + }) + static show() : void {} + + @Cordova({ + sync: true + }) + static close() : void {} + + //static onKeyboardShow() : Observable { + // return new Observable( + // observer => { + // + // } + // ); + //} +} \ No newline at end of file