import { OneSignal } from '@ionic-native/onesignal' ; import { Observable } from 'rxjs/Observable' ; import { Observer } from 'rxjs/Observer' ; 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 ; isIos ? : boolean ; isAndroid ? : boolean ; isWP ? : boolean ; isWP_WNS ? : boolean ; isAdm ? : boolean ; isChrome ? : boolean ; isChromeWeb ? : boolean ; isSafari ? : boolean ; isAnyWeb ? : boolean ; included_segments ? : string [ ] ; excluded_segments ? : string [ ] ; include_player_ids ? : string [ ] ; include_ios_tokens ? : string [ ] ; include_android_reg_ids ? : string [ ] ; include_wp_uris ? : string [ ] ; include_wp_wns_uris ? : string [ ] ; include_amazon_reg_ids ? : string [ ] ; include_chrome_reg_ids ? : string [ ] ; include_chrome_web_reg_ids ? : string [ ] ; app_ids ? : string [ ] ; tags ? : any [ ] ; ios_badgeType ? : string ; ios_badgeCount ? : number ; ios_sound ? : string ; android_sound ? : string ; adm_sound ? : string ; wp_sound ? : string ; wp_wns_sound ? : string ; data ? : any ; buttons ? : any ; small_icon ? : string ; large_icon ? : string ; big_picture ? : string ; adm_small_icon ? : string ; adm_large_icon ? : string ; adm_big_picture ? : string ; chrome_icon ? : string ; chrome_big_picture ? : string ; chrome_web_icon ? : string ; firefox_icon ? : string ; url ? : string ; send_after ? : string ; delayed_option ? : string ; delivery_time_of_day ? : string ; android_led_color ? : string ; android_accent_color ? : string ; android_visibility ? : number ; content_available ? : boolean ; amazon_background_data ? : boolean ; template_id ? : string ; android_group ? : string ; android_group_message ? : any ; adm_group ? : string ; adm_group_message ? : any ; ttl ? : number ; priority ? : number ; ios_category ? : string ; } /**
 * **ANDROID** - Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
 */ export declare enum OSLockScreenVisibility { /**
     * Fully visible (default)
     */ Public = 1 , /**
     * Contents are hidden
     */ Private = 0 , /**
     * Not shown
     */ Secret = - 1 } /**
 * How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used.
 */ export declare enum OSDisplayType { /**
     * notification is silent, or inFocusDisplaying is disabled.
     */ None = 0 , /**
     * (**DEFAULT**) - native alert dialog display.
     */ InAppAlert = 1 , /**
     * native notification display.
     */ Notification = 2 } /**
 * Contents and settings of the notification the user received.
 */ export interface OSNotificationPayload { /**
     * OneSignal notification UUID.
     */ notificationID : string ; /**
     * Title of the notification.
     */ title : string ; /**
     * Body of the notification.
     */ body : string ; /**
     * Custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data
     * or with the 'data' field on the REST API.
     */ additionalData ? : any ; /**
     * **ANDROID** - Small icon resource name set on the notification.
     */ smallIcon ? : string ; /**
     * **ANDROID** - Large icon set on the notification.
     */ largeIcon ? : string ; /**
     * **ANDROID** - Big picture image set on the notification.
     */ bigPicture ? : string ; /**
     * **ANDROID** - Accent color shown around small notification icon on Android 5+ devices. ARGB format.
     */ smallIconAccentColor ? : string ; /**
     * URL to open when opening the notification.
     */ launchUrl ? : string ; /**
     * Sound resource to play when the notification is shown.
     */ sound : string ; /**
     * **ANDROID** - Devices that have a notification LED will blink in this color. ARGB format.
     */ ledColor ? : string ; lockScreenVisibility ? : OSLockScreenVisibility ; /**
     * **ANDROID** - Notifications with this same key will be grouped together as a single summary notification.
     */ groupKey ? : string ; /**
     * **ANDROID** - Summary text displayed in the summary notification.
     */ groupMessage ? : string ; /**
     * List of action buttons on the notification.
     */ actionButtons : OSActionButton [ ] ; /**
     * **ANDROID** - The Google project number the notification was sent under.
     */ fromProjectNumber ? : string ; /**
     * **ANDROID** - If a background image was set this object will be available.
     */ backgroundImageLayout ? : OSBackgroundImageLayout ; priority ? : number ; /**
     * List of action buttons on the notification.
     */ rawPayload : string ; } /**
 * List of action buttons on the notification.
 */ export interface OSActionButton { /**
     * Id assigned to the button.
     */ id : string ; /**
     * Text show on the button to the user.
     */ text : string ; /**
     * **ANDROID** - Icon shown on the button.
     */ icon : string ; } /**
 * OSPermissionState
 */ export interface OSPermissionState { /**
     * User was prompted.
     */ hasPrompted : boolean ; /**
     * Permissions Status
     */ status : any ; /**
     * Permissions State (Android Only)
     */ state : any ; } /**
 * OSSubscriptionState
 */ export interface OSSubscriptionState { subscribed : boolean ; userSubscriptionSetting : any ; userId : any ; pushToken : any ; } /**
 * Subscription and permissions status
 */ export interface OSPermissionSubscriptionState { /**
     * Id assigned to the button.
     */ permissionStatus : OSPermissionState ; /**
     * Text show on the button to the user.
     */ subscriptionStatus : OSSubscriptionState ; } /**
 * **ANDROID** - If a background image was set, this object will be available.
 */ export interface OSBackgroundImageLayout { /**
     * Image URL or name used as the background image.
     */ image : string ; /**
     * Text color of the title on the notification. ARGB Format.
     */ titleTextColor : string ; /**
     * Text color of the body on the notification. ARGB Format.
     */ bodyTextColor : string ; } /**
 * The information returned from a notification the user received.
 */ export interface OSNotificationOpenedResult { action : { /**
         * Was the notification opened normally (`Opened`) or was a button pressed on the notification (`ActionTaken`).
         */ type : OSActionType ; /**
         * If `type` == `ActionTaken` then this will contain the id of the button pressed.
         */ actionID ? : string ; } ; notification : OSNotification ; } export declare enum OSActionType { Opened = 0 , ActionTake = 1 } export class OneSignalMock extends OneSignal { /**
     * constants to use in inFocusDisplaying()
     */ OSInFocusDisplayOption : { None : number ; InAppAlert : number ; Notification : number ; } ; param { string } appId param { string } googleProjectNumber returns { any } startInit ( appId , googleProjectNumber ? ) { return ; } ; return { Observable < OneSignalReceivedNotification > } handleNotificationReceived ( ) { let response ; return Observable . create ( ( observer ) => { observer . next ( response ) ; observer . complete ( ) ; } ) ; } ; return { Observable < OneSignalOpenedNotification > } handleNotificationOpened ( ) { let response ; return Observable . create ( ( observer ) => { observer . next ( response ) ; observer . complete ( ) ; } ) ; } ; param settings returns { any } iOSSettings ( settings ) { return ; } ; returns { any } endInit ( ) { return ; } ; returns { Promise < boolean > } promptForPushNotificationsWithUserResponse ( ) { let response = true ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; returns { Promise < any > } getTags ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; returns { Promise < Object > } getIds ( ) { let response ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; param { string } Key param { string } Value sendTag ( key , value ) { } ; param { string } Pass sendTags ( json ) { } ; param { string } Key deleteTag ( key ) { } ; param { Array < string > } Keys deleteTags ( keys ) { } ; /**
     * Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
     * Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
     */ registerForPushNotifications ( ) { } ; param { boolean } false enableVibrate ( enable ) { } ; param { boolean } false enableSound ( enable ) { } ; param { DisplayType } displayOption returns { any } inFocusDisplaying ( displayOption ) { return ; } ; param { boolean } enable setSubscription ( enable ) { } ; returns { Promise < OSPermissionSubscriptionState > } getPermissionSubscriptionState ( ) { let response ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; param { notificationObj } Parameters returns { Promise < any > } postNotification ( notificationObj ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; param notificationId { string } cancelNotification ( notificationId ) { } ; /**
     * Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
     */ promptLocation ( ) { } ; param email { string } syncHashedEmail ( email ) { } ; param { loglevel } contains setLogLevel ( logLevel ) { } ; return { Observable < any > } addPermissionObserver ( ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } ; return { Observable < any > } addSubscriptionObserver ( ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } ; }