Skip to content

Commit

Permalink
refactor(email-composer): reorder code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Sep 18, 2018
1 parent 3699fa9 commit 49d27e8
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/@ionic-native/plugins/email-composer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,30 @@ export interface EmailComposerOptions {
})
@Injectable()
export class EmailComposer extends IonicNativePlugin {
/**
* Checks if the app has a permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
hasPermission(): Promise<boolean> {
return;
}

/**
* Request permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> {
return;
}

/**
* Verifies if sending emails is supported on the device.
*
Expand Down Expand Up @@ -147,26 +171,17 @@ export class EmailComposer extends IonicNativePlugin {
}

/**
* Request permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> {
return;
}

/**
* Checks if the app has a permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
* Displays the email composer pre-filled with data.
*
* @param {EmailComposerOptions} options Email
* @param {any} [scope] Scope for the promise
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@Cordova({
successIndex: 0,
errorIndex: 2
successIndex: 1,
errorIndex: 3
})
hasPermission(): Promise<boolean> {
open(options: EmailComposerOptions, scope?: any): Promise<any> {
return;
}

Expand All @@ -178,19 +193,4 @@ export class EmailComposer extends IonicNativePlugin {
*/
@Cordova()
addAlias(alias: string, packageName: string): void {}

/**
* Displays the email composer pre-filled with data.
*
* @param {EmailComposerOptions} options Email
* @param {any} [scope] Scope for the promise
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@Cordova({
successIndex: 1,
errorIndex: 3
})
open(options: EmailComposerOptions, scope?: any): Promise<any> {
return;
}
}

0 comments on commit 49d27e8

Please sign in to comment.