From dcd7ad430fe822ba63d01729466938e9e0039690 Mon Sep 17 00:00:00 2001 From: Guille Date: Fri, 8 Jul 2016 00:58:21 +0200 Subject: [PATCH] refactor(email): --- src/plugins/emailcomposer.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index a2e0f821..532f9fe6 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -1,5 +1,8 @@ -import {Plugin, Cordova} from './plugin'; +import { Cordova, Plugin } from './plugin'; + + declare var cordova: any; + /** * @name Email Composer * @description @@ -53,7 +56,7 @@ export class EmailComposer { * @param app {string?} An optional app id or uri scheme. * @returns {Promise} Resolves if available, rejects if not available */ - static isAvailable (app?: string): Promise { + static isAvailable(app?: string): Promise { return new Promise((resolve, reject) => { if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); }); else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); }); @@ -67,7 +70,7 @@ export class EmailComposer { * @param packageName {string} The package name */ @Cordova() - static addAlias(alias: string, packageName: string): void {} + static addAlias(alias: string, packageName: string): void { } /** * Displays the email composer pre-filled with data. @@ -80,9 +83,10 @@ export class EmailComposer { successIndex: 1, errorIndex: 3 }) - static open(email: Email, scope?: any): Promise {return; } + static open(email: Email, scope?: any): Promise { return; } } + export interface Email { app?: string; to?: string | Array; @@ -92,4 +96,4 @@ export interface Email { subject?: string; body?: string; isHtml?: boolean; -} \ No newline at end of file +}