68 lines
1.3 KiB
TypeScript
Raw Normal View History

2018-01-28 02:19:09 +01:00
import { Injectable } from '@angular/core';
2018-03-17 00:47:46 +01:00
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CallLogObject {
name: string;
value: string;
operator: '==' | '!=' | '>' | '>=' | '<' | '<=';
}
2018-01-28 02:19:09 +01:00
/**
* @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) { }
*
2018-03-17 00:47:46 +01:00
* ````
* @interfaces
* CallLogObject
2018-01-28 02:19:09 +01:00
*
*/
@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 {
/**
2018-01-28 13:53:16 +01:00
* This function return the call logs
2018-03-17 00:47:46 +01:00
* @param filters {CallLogObject[]} array of object to filter the query
2018-01-28 02:19:09 +01:00
* @return {Promise<any>}
*/
@Cordova()
2018-03-17 00:47:46 +01:00
getCallLog(filters: CallLogObject[]): Promise<any> {
return;
}
2018-01-28 02:19:09 +01:00
/**
* Check permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
2018-03-17 00:47:46 +01:00
hasReadPermission(): Promise<any> {
return;
}
2018-01-28 02:19:09 +01:00
/**
* Request permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
2018-03-17 00:47:46 +01:00
requestReadPermission(): Promise<any> {
return;
}
2018-01-28 02:19:09 +01:00
}