mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-24 11:50:17 +08:00
ref(background-mode): fix wrong types
ref(background-mode): fix wrong types
This commit is contained in:
commit
c421d43155
@ -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.
|
||||||
@ -89,7 +88,9 @@ export class BackgroundMode extends IonicNativePlugin {
|
|||||||
* 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.
|
||||||
@ -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
|
||||||
@ -212,5 +223,4 @@ export class BackgroundMode extends IonicNativePlugin {
|
|||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
unlock(): void {}
|
unlock(): void {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user