feat(device-accounts): add android account interface

This commit is contained in:
Daniel Sogl 2018-03-16 15:11:08 +01:00 committed by GitHub
parent f11be24f74
commit d2261b6432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,16 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AndroidAccount {
/** Account creator */
CREATOR: AndroidAccount;
/** Account name */
name: string;
/** Account type */
type: string;
}
/**
* @name Device Accounts
@ -19,6 +30,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
* .catch(error => console.error(error));
*
* ```
* @interfaces
* AndroidAccount
*/
@Plugin({
pluginName: 'DeviceAccounts',
@ -29,33 +42,39 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class DeviceAccounts extends IonicNativePlugin {
/**
* Gets all accounts registered on the Android Device
* @returns {Promise<any>}
* @returns {Promise<AndroidAccount[]>}
*/
@Cordova()
get(): Promise<any> { return; }
get(): Promise<AndroidAccount[]> {
return;
}
/**
* Get all accounts registered on Android device for requested type
* @returns {Promise<any>}
* @returns {Promise<AndroidAccount[]>}
*/
@Cordova()
getByType(type: string): Promise<any> { return; }
getByType(type: string): Promise<AndroidAccount[]> {
return;
}
/**
* Get all emails registered on Android device (accounts with 'com.google' type)
* @returns {Promise<any>}
* @returns {Promise<string[]>}
*/
@Cordova()
getEmails(): Promise<any> { return; }
getEmails(): Promise<string[]> {
return;
}
/**
* Get the first email registered on Android device
* @returns {Promise<any>}
* @returns {Promise<string>}
*/
@Cordova()
getEmail(): Promise<any> { return; }
getEmail(): Promise<string> {
return;
}
}