From 66f0e03aefeab684bd10034dd6e0d2c29b5e361b Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Thu, 24 Mar 2016 13:15:55 -0400 Subject: [PATCH] fix(spinnerdialog): fix functionality --- src/plugins/spinnerdialog.ts | 39 ++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/plugins/spinnerdialog.ts b/src/plugins/spinnerdialog.ts index 4b8a5c750..cea467cad 100644 --- a/src/plugins/spinnerdialog.ts +++ b/src/plugins/spinnerdialog.ts @@ -1,18 +1,53 @@ import {Plugin, Cordova} from './plugin'; +/** + * @name Spinner Dialog + * @description + * @usage + * ```js + * import {SpinnerDialog} from 'ionic-native'; + * + * + * + * SpinnerDialog.show(); + * + * SpinnerDialog.hide(); + * ``` + */ @Plugin({ plugin: 'cordova-plugin-spinner-dialog', pluginRef: 'window.plugins.spinnerDialog', + repo: 'https://github.com/Paldom/SpinnerDialog', platforms: ['Android','iOS','Windows Phone 8'] }) export class SpinnerDialog { - @Cordova() - static show(title : string, message : string) : Promise {return} + /** + * Shows the spinner dialog + * @param title {string} Spinner title (shows on Android only) + * @param message {string} Spinner message + * @param cancelCallback {boolean|function} Set to false to set spinner not cancelable. Or provide a function to call when the user cancels the spinner. + * @param iOSOptions {object} Options for iOS only + */ + @Cordova({ + sync: true + }) + static show(title? : string, message? : string, cancelCallback? : any, iOSOptions? : SpinnerDialogIOSOptions) : void {} + + /** + * Hides the spinner dialog if visible + */ @Cordova({ sync: true }) static hide() : void {} +} + +export interface SpinnerDialogIOSOptions { + overlayOpacity? : number, + textColorRed? : number, + textColorGreen? : number, + textColorBlue? : number } \ No newline at end of file