ref(background-mode): fix wront types

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

View File

@ -2,27 +2,26 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* Configurations items that can be updated. * Configurations items that can be updated.
*/ */
export interface BackgroundModeConfiguration { export interface BackgroundModeConfiguration {
/** /**
* Title of the background task * Title of the background task
*/ */
title?: String; title?: string;
/** /**
* Description of background task * Description of background task
*/ */
text?: String; text?: string;
/** /**
* This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap * This will look for `<icon name>.png` in platforms/android/res/drawable|mipmap
*/ */
icon?: string; icon?: string;
/** Color */
color?: string; color?: string;
/** /**
@ -30,20 +29,21 @@ export interface BackgroundModeConfiguration {
*/ */
resume?: boolean; resume?: boolean;
/** Hidden */
hidden?: boolean; hidden?: boolean;
/** Big text */
bigText?: boolean; bigText?: boolean;
/** /**
* The text that scrolls itself on statusbar * The text that scrolls itself on statusbar
*/ */
ticker?: String; ticker?: string;
/** /**
* if true plugin will not display a notification. Default is false. * if true plugin will not display a notification. Default is false.
*/ */
silent?: boolean; silent?: boolean;
} }
/** /**
@ -74,7 +74,6 @@ export interface BackgroundModeConfiguration {
}) })
@Injectable() @Injectable()
export class BackgroundMode extends IonicNativePlugin { export class BackgroundMode extends IonicNativePlugin {
/** /**
* Enable the background mode. * Enable the background mode.
* Once called, prevents the app from being paused while in background. * Once called, prevents the app from being paused while in background.
@ -82,14 +81,16 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({ @Cordova({
sync: true sync: true
}) })
enable(): void { } enable(): void {}
/** /**
* Disable the background mode. * Disable the background mode.
* Once the background mode has been disabled, the app will be paused when in background. * Once the background mode has been disabled, the app will be paused when in background.
*/ */
@Cordova() @Cordova()
disable(): Promise<any> { return; } disable(): Promise<any> {
return;
}
/** /**
* Checks if background mode is enabled or not. * Checks if background mode is enabled or not.
@ -98,7 +99,9 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({ @Cordova({
sync: true sync: true
}) })
isEnabled(): boolean { return; } isEnabled(): boolean {
return;
}
/** /**
* Can be used to get the information if the background mode is active. * Can be used to get the information if the background mode is active.
@ -107,7 +110,9 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({ @Cordova({
sync: true sync: true
}) })
isActive(): boolean { return; } isActive(): boolean {
return;
}
/** /**
* Override the default title, ticker and text. * Override the default title, ticker and text.
@ -117,7 +122,9 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; } setDefaults(options?: BackgroundModeConfiguration): Promise<any> {
return;
}
/** /**
* Modify the displayed information. * Modify the displayed information.
@ -140,7 +147,9 @@ export class BackgroundMode extends IonicNativePlugin {
clearFunction: 'un', clearFunction: 'un',
clearWithArgs: true clearWithArgs: true
}) })
on(event: string): Observable<any> { return; } on(event: string): Observable<any> {
return;
}
/** /**
* Android allows to programmatically move from foreground to background. * Android allows to programmatically move from foreground to background.
@ -149,7 +158,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
moveToBackground(): void { } moveToBackground(): void {}
/** /**
* Enable GPS-tracking in background (Android). * Enable GPS-tracking in background (Android).
@ -158,7 +167,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
disableWebViewOptimizations (): void { } disableWebViewOptimizations(): void {}
/** /**
* Android allows to programmatically move from background to foreground. * Android allows to programmatically move from background to foreground.
@ -167,7 +176,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
moveToForeground(): void { } moveToForeground(): void {}
/** /**
* Override the back button on Android to go to background instead of closing the app. * Override the back button on Android to go to background instead of closing the app.
@ -176,7 +185,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
overrideBackButton(): void { } overrideBackButton(): void {}
/** /**
* Exclude the app from the recent task list. Works on Android 5.0+. * Exclude the app from the recent task list. Works on Android 5.0+.
@ -185,7 +194,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
excludeFromTaskList(): void { } excludeFromTaskList(): void {}
/** /**
* The method works async instead of isActive() or isEnabled(). * The method works async instead of isActive() or isEnabled().
@ -193,7 +202,9 @@ export class BackgroundMode extends IonicNativePlugin {
@Cordova({ @Cordova({
platforms: ['Android'] platforms: ['Android']
}) })
isScreenOff(): Promise<boolean> { return; } isScreenOff(): Promise<boolean> {
return;
}
/** /**
* Turn screen on * Turn screen on
@ -202,7 +213,7 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
wakeUp(): void { } wakeUp(): void {}
/** /**
* Turn screen on and show app even locked * Turn screen on and show app even locked
@ -211,6 +222,5 @@ export class BackgroundMode extends IonicNativePlugin {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
unlock(): void { } unlock(): void {}
} }