1
- interface AutoPromptOptions { force ?: boolean ; forceSlidedownOverNative ?: boolean ; slidedownPromptOptions ?: IOneSignalAutoPromptOptions ; }
2
- interface IOneSignalAutoPromptOptions { force ?: boolean ; forceSlidedownOverNative ?: boolean ; isInUpdateMode ?: boolean ; categoryOptions ?: IOneSignalCategories ; }
3
- interface IOneSignalCategories { positiveUpdateButton : string ; negativeUpdateButton : string ; savingButtonText : string ; errorButtonText : string ; updateMessage : string ; tags : IOneSignalTagCategory [ ] ; }
4
- interface IOneSignalTagCategory { tag : string ; label : string ; checked ?: boolean ; }
5
- type PushSubscriptionNamespaceProperties = { id : string | null | undefined ; token : string | null | undefined ; optedIn : boolean ; } ;
6
- type SubscriptionChangeEvent = { previous : PushSubscriptionNamespaceProperties ; current : PushSubscriptionNamespaceProperties ; } ;
7
- type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay' ;
8
- type SlidedownEventName = 'slidedownShown' ;
9
- type OneSignalDeferredLoadedCallback = ( onesignal : IOneSignalOneSignal ) => void ;
10
- interface IOSNotification {
1
+ export interface AutoPromptOptions { force ?: boolean ; forceSlidedownOverNative ?: boolean ; slidedownPromptOptions ?: IOneSignalAutoPromptOptions ; }
2
+ export interface IOneSignalAutoPromptOptions { force ?: boolean ; forceSlidedownOverNative ?: boolean ; isInUpdateMode ?: boolean ; categoryOptions ?: IOneSignalCategories ; }
3
+ export interface IOneSignalCategories { positiveUpdateButton : string ; negativeUpdateButton : string ; savingButtonText : string ; errorButtonText : string ; updateMessage : string ; tags : IOneSignalTagCategory [ ] ; }
4
+ export interface IOneSignalTagCategory { tag : string ; label : string ; checked ?: boolean ; }
5
+ export type PushSubscriptionNamespaceProperties = { id : string | null | undefined ; token : string | null | undefined ; optedIn : boolean ; } ;
6
+ export type SubscriptionChangeEvent = { previous : PushSubscriptionNamespaceProperties ; current : PushSubscriptionNamespaceProperties ; } ;
7
+ export type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay' ;
8
+ export type SlidedownEventName = 'slidedownShown' ;
9
+ export type OneSignalDeferredLoadedCallback = ( onesignal : IOneSignalOneSignal ) => void ;
10
+ export interface IOSNotification {
11
11
/**
12
12
* The OneSignal notification id;
13
13
* - Primary id on OneSignal's REST API and dashboard
@@ -69,7 +69,7 @@ interface IOSNotification {
69
69
readonly confirmDelivery : boolean ;
70
70
}
71
71
72
- interface IOSNotificationActionButton {
72
+ export interface IOSNotificationActionButton {
73
73
/**
74
74
* Any unique identifier to represent which button was clicked. This is typically passed back to the service worker
75
75
* and host page through events to identify which button was clicked.
@@ -90,42 +90,42 @@ interface IOSNotificationActionButton {
90
90
readonly launchURL ?: string ;
91
91
}
92
92
93
- interface NotificationClickResult {
93
+ export interface NotificationClickResult {
94
94
readonly actionId ?: string ;
95
95
readonly url ?: string ;
96
96
}
97
97
98
- type NotificationEventTypeMap = {
98
+ export type NotificationEventTypeMap = {
99
99
'click' : NotificationClickEvent ;
100
100
'foregroundWillDisplay' : NotificationForegroundWillDisplayEvent ;
101
101
'dismiss' : NotificationDismissEvent ;
102
102
'permissionChange' : boolean ;
103
103
'permissionPromptDisplay' : void ;
104
104
} ;
105
105
106
- interface NotificationForegroundWillDisplayEvent {
106
+ export interface NotificationForegroundWillDisplayEvent {
107
107
readonly notification : IOSNotification ;
108
108
preventDefault ( ) : void ;
109
109
}
110
110
111
- interface NotificationDismissEvent {
111
+ export interface NotificationDismissEvent {
112
112
notification : IOSNotification ;
113
113
}
114
114
115
- interface NotificationClickEvent {
115
+ export interface NotificationClickEvent {
116
116
readonly notification : IOSNotification ;
117
117
readonly result : NotificationClickResult ;
118
118
}
119
119
120
- type UserChangeEvent = {
120
+ export type UserChangeEvent = {
121
121
current : UserNamespaceProperties ;
122
122
} ;
123
- type UserNamespaceProperties = {
123
+ export type UserNamespaceProperties = {
124
124
onesignalId : string | undefined ;
125
125
externalId : string | undefined ;
126
126
} ;
127
127
128
- interface IInitObject {
128
+ export interface IInitObject {
129
129
appId : string ;
130
130
subdomainName ?: string ;
131
131
requiresUserPrivacyConsent ?: boolean ;
@@ -147,7 +147,7 @@ interface IInitObject {
147
147
[ key : string ] : any ;
148
148
}
149
149
150
- interface IOneSignalOneSignal {
150
+ export interface IOneSignalOneSignal {
151
151
Slidedown : IOneSignalSlidedown ;
152
152
Notifications : IOneSignalNotifications ;
153
153
Session : IOneSignalSession ;
@@ -159,7 +159,7 @@ interface IOneSignalOneSignal {
159
159
setConsentGiven ( consent : boolean ) : Promise < void > ;
160
160
setConsentRequired ( requiresConsent : boolean ) : Promise < void > ;
161
161
}
162
- interface IOneSignalNotifications {
162
+ export interface IOneSignalNotifications {
163
163
permissionNative : NotificationPermission ;
164
164
permission : boolean ;
165
165
setDefaultUrl ( url : string ) : Promise < void > ;
@@ -169,7 +169,7 @@ interface IOneSignalNotifications {
169
169
addEventListener < K extends NotificationEventName > ( event : K , listener : ( obj : NotificationEventTypeMap [ K ] ) => void ) : void ;
170
170
removeEventListener < K extends NotificationEventName > ( event : K , listener : ( obj : NotificationEventTypeMap [ K ] ) => void ) : void ;
171
171
}
172
- interface IOneSignalSlidedown {
172
+ export interface IOneSignalSlidedown {
173
173
promptPush ( options ?: AutoPromptOptions ) : Promise < void > ;
174
174
promptPushCategories ( options ?: AutoPromptOptions ) : Promise < void > ;
175
175
promptSms ( options ?: AutoPromptOptions ) : Promise < void > ;
@@ -178,14 +178,14 @@ interface IOneSignalSlidedown {
178
178
addEventListener ( event : SlidedownEventName , listener : ( wasShown : boolean ) => void ) : void ;
179
179
removeEventListener ( event : SlidedownEventName , listener : ( wasShown : boolean ) => void ) : void ;
180
180
}
181
- interface IOneSignalDebug {
181
+ export interface IOneSignalDebug {
182
182
setLogLevel ( logLevel : string ) : void ;
183
183
}
184
- interface IOneSignalSession {
184
+ export interface IOneSignalSession {
185
185
sendOutcome ( outcomeName : string , outcomeWeight ?: number ) : Promise < void > ;
186
186
sendUniqueOutcome ( outcomeName : string ) : Promise < void > ;
187
187
}
188
- interface IOneSignalUser {
188
+ export interface IOneSignalUser {
189
189
onesignalId : string | undefined ;
190
190
externalId : string | undefined ;
191
191
PushSubscription : IOneSignalPushSubscription ;
@@ -207,7 +207,7 @@ interface IOneSignalUser {
207
207
setLanguage ( language : string ) : void ;
208
208
getLanguage ( ) : string ;
209
209
}
210
- interface IOneSignalPushSubscription {
210
+ export interface IOneSignalPushSubscription {
211
211
id : string | null | undefined ;
212
212
token : string | null | undefined ;
213
213
optedIn : boolean | undefined ;
@@ -705,7 +705,7 @@ declare global {
705
705
}
706
706
}
707
707
708
- interface IOneSignalOneSignal {
708
+ export interface IOneSignalOneSignal {
709
709
[ key : string ] : any ;
710
710
}
711
711
0 commit comments