mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
refactor(email):
This commit is contained in:
parent
bc3f10cbc1
commit
dcd7ad430f
@ -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<boolean>} Resolves if available, rejects if not available
|
||||
*/
|
||||
static isAvailable (app?: string): Promise<any> {
|
||||
static isAvailable(app?: string): Promise<any> {
|
||||
return new Promise<boolean>((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<any> {return; }
|
||||
static open(email: Email, scope?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface Email {
|
||||
app?: string;
|
||||
to?: string | Array<string>;
|
||||
|
Loading…
Reference in New Issue
Block a user