diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts new file mode 100644 index 00000000..fd790628 --- /dev/null +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -0,0 +1,67 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface CallLogObject { + name: string; + value: string; + operator: '==' | '!=' | '>' | '>=' | '<' | '<='; +} + +/** + * @name Call Log + * @description + * This plugin access the call history on a device and that can be filtered + * + * @usage + * ```typescript + * import { CallLog } from '@ionic-native/call-log'; + * + * + * constructor(private callLog: CallLog) { } + * + * ```` + * @interfaces + * CallLogObject + * + */ +@Plugin({ + pluginName: 'CallLog', + plugin: 'cordova-plugin-calllog', + pluginRef: 'plugins.callLog', + repo: 'https://github.com/creacore-team/cordova-plugin-calllog', + platforms: ['Android'] +}) +@Injectable() +export class CallLog extends IonicNativePlugin { + /** + * This function return the call logs + * @param filters {CallLogObject[]} array of object to filter the query + * @return {Promise} + */ + @Cordova() + getCallLog(filters: CallLogObject[]): Promise { + return; + } + + /** + * Check permission + * @returns {Promise} + */ + @Cordova({ + platforms: ['Android'] + }) + hasReadPermission(): Promise { + return; + } + + /** + * Request permission + * @returns {Promise} + */ + @Cordova({ + platforms: ['Android'] + }) + requestReadPermission(): Promise { + return; + } +}