feat(local-notifications): add missing functions

This commit is contained in:
Daniel 2018-09-18 15:37:39 +02:00
parent 640da1b618
commit 10d222dcea

View File

@ -483,6 +483,24 @@ export interface ILocalNotification {
})
@Injectable()
export class LocalNotifications extends IonicNativePlugin {
/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}
/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
return;
}
/**
* Schedules a single or multiple notifications
* @param options {Notification | Array<ILocalNotification>} optional
@ -569,6 +587,26 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Check if a notification has a given type.
* @param {number} id The ID of the notification.
* @param {string} type The type of the notification.
* @returns {Promise<boolean>}
*/
@Cordova()
hasType(id: number, type: string): Promise<boolean> {
return;
}
/**
* Get the type (triggered, scheduled) for the notification.
* @param {number} id The ID of the notification.
*/
@Cordova()
getType(id: number): Promise<boolean> {
return;
}
/**
* Get all the notification ids
* @returns {Promise<Array<number>>}
@ -578,15 +616,6 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
return;
}
/**
* Get the ids of scheduled notifications
* @returns {Promise<Array<number>>} Returns a promise
@ -596,6 +625,15 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
return;
}
/**
* Get a notification object
* @param notificationId {any} The id of the notification to get
@ -606,6 +644,15 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<ILocalNotification[]> {
return;
}
/**
* Get a scheduled notification object
* @param notificationId {any} The id of the notification to get
@ -626,51 +673,6 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}
/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
return;
}
/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}
/**
* Adds a group of actions
* @param groupId The id of the action group
@ -678,10 +680,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addActions(
groupId: any,
actions: ILocalNotificationAction[]
): Promise<any> {
addActions(groupId: any, actions: ILocalNotificationAction[]): Promise<any> {
return;
}
@ -727,6 +726,24 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}
/**
* Sets a callback for a specific event
* @param eventName {string} The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions