mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|
|
|
export interface CallLogObject {
|
|
name: string;
|
|
value: string|Array<string>;
|
|
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like';
|
|
}
|
|
|
|
/**
|
|
* @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<any>}
|
|
*/
|
|
@Cordova()
|
|
getCallLog(filters: CallLogObject[]): Promise<any> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Check permission
|
|
* @returns {Promise<any>}
|
|
*/
|
|
@Cordova({
|
|
platforms: ['Android']
|
|
})
|
|
hasReadPermission(): Promise<any> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Request permission
|
|
* @returns {Promise<any>}
|
|
*/
|
|
@Cordova({
|
|
platforms: ['Android']
|
|
})
|
|
requestReadPermission(): Promise<any> {
|
|
return;
|
|
}
|
|
}
|