mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
chore(package): bump dependencies and lint rules
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
checkAvailability,
|
||||
Cordova,
|
||||
CordovaInstance,
|
||||
IonicNativePlugin,
|
||||
Plugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare const window: any;
|
||||
|
||||
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
|
||||
export type EventResponse = RegistrationEventResponse &
|
||||
NotificationEventResponse &
|
||||
Error;
|
||||
|
||||
export interface RegistrationEventResponse {
|
||||
/**
|
||||
@@ -13,7 +21,6 @@ export interface RegistrationEventResponse {
|
||||
registrationId: string;
|
||||
}
|
||||
|
||||
|
||||
export interface NotificationEventResponse {
|
||||
/**
|
||||
* The text of the push message sent from the 3rd party service.
|
||||
@@ -203,7 +210,6 @@ export interface BrowserPushOptions {
|
||||
* Default: http://push.api.phonegap.com/v1/push Optional.
|
||||
*/
|
||||
pushServiceURL?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface PushOptions {
|
||||
@@ -313,7 +319,6 @@ export type PushEvent = string;
|
||||
})
|
||||
@Injectable()
|
||||
export class Push extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Init push notifications
|
||||
* @param options {PushOptions}
|
||||
@@ -328,29 +333,36 @@ export class Push extends IonicNativePlugin {
|
||||
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new notification channel for Android O and above.
|
||||
* @param channel {Channel}
|
||||
*/
|
||||
@Cordova()
|
||||
createChannel(channel: Channel): Promise<any> { return; }
|
||||
createChannel(channel: Channel): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a notification channel for Android O and above.
|
||||
* @param id
|
||||
*/
|
||||
@Cordova()
|
||||
deleteChannel(id: string): Promise<any> { return; }
|
||||
deleteChannel(id: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of currently configured channels.
|
||||
* @return {Promise<Channel[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
listChannels(): Promise<Channel[]> { return; }
|
||||
|
||||
listChannels(): Promise<Channel[]> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,11 +374,12 @@ export class Push extends IonicNativePlugin {
|
||||
pluginRef: 'PushNotification'
|
||||
})
|
||||
export class PushObject {
|
||||
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(options: PushOptions) {
|
||||
if (checkAvailability('PushNotification', 'init', 'PushNotification') === true) {
|
||||
if (
|
||||
checkAvailability('PushNotification', 'init', 'PushNotification') === true
|
||||
) {
|
||||
this._objectInstance = window.PushNotification.init(options);
|
||||
}
|
||||
}
|
||||
@@ -381,7 +394,9 @@ export class PushObject {
|
||||
clearFunction: 'off',
|
||||
clearWithArgs: true
|
||||
})
|
||||
on(event: PushEvent): Observable<EventResponse> { return; }
|
||||
on(event: PushEvent): Observable<EventResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unregister method is used when the application no longer wants to receive push notifications.
|
||||
@@ -389,7 +404,9 @@ export class PushObject {
|
||||
* so you will need to re-register them if you want them to function again without an application reload.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
unregister(): Promise<any> { return; }
|
||||
unregister(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the badge count visible when the app is not running
|
||||
@@ -402,13 +419,17 @@ export class PushObject {
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
setApplicationIconBadgeNumber(count?: number): Promise<any> { return; };
|
||||
setApplicationIconBadgeNumber(count?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Get the current badge count visible when the app is not running
|
||||
* successHandler gets called with an integer which is the current badge count
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getApplicationIconBadgeNumber(): Promise<number> { return; }
|
||||
getApplicationIconBadgeNumber(): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS only
|
||||
@@ -419,13 +440,17 @@ export class PushObject {
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
finish(id?: string): Promise<any> { return; }
|
||||
finish(id?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the OS to clear all notifications from the Notification Center
|
||||
*/
|
||||
@CordovaInstance()
|
||||
clearAllNotifications(): Promise<any> { return; }
|
||||
clearAllNotifications(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The subscribe method is used when the application wants to subscribe a new topic to receive push notifications.
|
||||
@@ -433,7 +458,9 @@ export class PushObject {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
subscribe(topic: string): Promise<any> { return; }
|
||||
subscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unsubscribe method is used when the application no longer wants to receive push notifications from a specific topic but continue to receive other push messages.
|
||||
@@ -441,6 +468,7 @@ export class PushObject {
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
unsubscribe(topic: string): Promise<any> { return; }
|
||||
|
||||
unsubscribe(topic: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user