add CallLogObject interface

This commit is contained in:
Daniel Sogl 2018-03-17 00:47:46 +01:00 committed by GitHub
parent 61c0ecfa4f
commit 5e40f3412a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,11 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CallLogObject {
name: string;
value: string;
operator: '==' | '!=' | '>' | '>=' | '<' | '<=';
}
/** /**
* @name Call Log * @name Call Log
@ -13,7 +19,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
* *
* constructor(private callLog: CallLog) { } * constructor(private callLog: CallLog) { }
* *
* ... * ````
* @interfaces
* CallLogObject
* *
*/ */
@Plugin({ @Plugin({
@ -25,16 +33,15 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
}) })
@Injectable() @Injectable()
export class CallLog extends IonicNativePlugin { export class CallLog extends IonicNativePlugin {
/** /**
* This function return the call logs * This function return the call logs
* @param filters {object[]} array of object to filter the query * @param filters {CallLogObject[]} array of object to filter the query
* Object must respect this structure {'name':'...', 'value': '...', 'operator': '=='}
* (see https://github.com/creacore-team/cordova-plugin-calllog for more details)
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
getCallLog(filters: object[]): Promise<any> { return; } getCallLog(filters: CallLogObject[]): Promise<any> {
return;
}
/** /**
* Check permission * Check permission
@ -43,7 +50,9 @@ export class CallLog extends IonicNativePlugin {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
hasReadPermission(): Promise<any> { return; } hasReadPermission(): Promise<any> {
return;
}
/** /**
* Request permission * Request permission
@ -52,5 +61,7 @@ export class CallLog extends IonicNativePlugin {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
requestReadPermission(): Promise<any> { return; } requestReadPermission(): Promise<any> {
return;
}
} }