From 44fe04bbbd3ac75594012602fbbe643f2fca19d7 Mon Sep 17 00:00:00 2001 From: Ibby Date: Tue, 27 Dec 2016 08:03:21 -0500 Subject: [PATCH] docs(): add interfaces --- src/plugins/onesignal.ts | 60 +++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/plugins/onesignal.ts b/src/plugins/onesignal.ts index 1437f3722..7b212fac2 100644 --- a/src/plugins/onesignal.ts +++ b/src/plugins/onesignal.ts @@ -2,6 +2,30 @@ import { Cordova, Plugin } from './plugin'; import { Observable } from 'rxjs/Observable'; export interface OSNotification { + /** + * Was app in focus. + */ + isAppInFocus: boolean; + /** + * Was notification shown to the user. Will be false for silent notifications. + */ + shown: boolean; + /** + * **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification. + */ + androidNotificationId?: number; + /** + * Payload received from OneSignal. + */ + payload: OSNotificationPayload; + /** + * How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed. + */ + displayType: OSDisplayType; + /** + * **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from. + */ + groupedNotifications?: OSNotificationPayload[]; app_id: string; contents: any; headings?: any; @@ -82,33 +106,6 @@ export enum OSLockScreenVisibility { Secret = -1 } -export interface OSNotification { - /** - * Was app in focus. - */ - isAppInFocus: boolean; - /** - * Was notification shown to the user. Will be false for silent notifications. - */ - shown: boolean; - /** - * **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification. - */ - androidNotificationId?: number; - /** - * Payload received from OneSignal. - */ - payload: OSNotificationPayload; - /** - * How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed. - */ - displayType: OSDisplayType; - /** - * **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from. - */ - groupedNotifications?: OSNotificationPayload[]; -} - /** * How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used. */ @@ -289,7 +286,14 @@ export enum OSActionType { * OneSignal.endInit(); * ``` * @interfaces - * OneSignalNotification + * OSNotification + * OSLockScreenVisibility + * OSDisplayType + * OSNotificationPayload + * OSActionButton + * OSBackgroundImageLayout + * OSNotificationOpenedResult + * OSActionType */ @Plugin({ pluginName: 'OneSignal',