@@ -14,30 +14,30 @@ import {
1414 SUBSCRIPTION_CHANGED ,
1515 USER_STATE_CHANGED ,
1616} from './events/events' ;
17- import {
18- NotificationEventName ,
19- NotificationEventTypeMap ,
20- NotificationClickEvent ,
21- } from './models/NotificationEvents' ;
22- import {
23- PushSubscriptionState ,
24- OSNotificationPermission ,
25- PushSubscriptionChangedState ,
26- } from './models/Subscription' ;
27- import { UserState , UserChangedState } from './models/User' ;
2817import NotificationWillDisplayEvent from './events/NotificationWillDisplayEvent' ;
29- import { LiveActivitySetupOptions } from './models/LiveActivities ' ;
30- import {
18+ import { isNativeModuleLoaded , isValidCallback } from './helpers ' ;
19+ import type {
3120 InAppMessage ,
32- InAppMessageEventTypeMap ,
33- InAppMessageEventName ,
3421 InAppMessageClickEvent ,
35- InAppMessageWillDisplayEvent ,
22+ InAppMessageDidDismissEvent ,
3623 InAppMessageDidDisplayEvent ,
24+ InAppMessageEventName ,
25+ InAppMessageEventTypeMap ,
3726 InAppMessageWillDismissEvent ,
38- InAppMessageDidDismissEvent ,
27+ InAppMessageWillDisplayEvent ,
3928} from './models/InAppMessage' ;
40- import { isValidCallback , isNativeModuleLoaded } from './helpers' ;
29+ import type { LiveActivitySetupOptions } from './models/LiveActivities' ;
30+ import type {
31+ NotificationClickEvent ,
32+ NotificationEventName ,
33+ NotificationEventTypeMap ,
34+ } from './models/NotificationEvents' ;
35+ import {
36+ OSNotificationPermission ,
37+ type PushSubscriptionChangedState ,
38+ type PushSubscriptionState ,
39+ } from './models/Subscription' ;
40+ import type { UserChangedState , UserState } from './models/User' ;
4141
4242const RNOneSignal = NativeModules . OneSignal ;
4343const eventManager = new EventManager ( RNOneSignal ) ;
@@ -288,7 +288,7 @@ export namespace OneSignal {
288288 export namespace pushSubscription {
289289 /** Add a callback that fires when the OneSignal subscription state changes. */
290290 export function addEventListener (
291- event : 'change' ,
291+ _event : 'change' ,
292292 listener : ( event : PushSubscriptionChangedState ) => void ,
293293 ) {
294294 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
@@ -303,7 +303,7 @@ export namespace OneSignal {
303303
304304 /** Clears current subscription observers. */
305305 export function removeEventListener (
306- event : 'change' ,
306+ _event : 'change' ,
307307 listener : ( event : PushSubscriptionChangedState ) => void ,
308308 ) {
309309 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
@@ -410,7 +410,7 @@ export namespace OneSignal {
410410 * Important: When using the observer to retrieve the onesignalId, check the externalId as well to confirm the values are associated with the expected user.
411411 */
412412 export function addEventListener (
413- event : 'change' ,
413+ _event : 'change' ,
414414 listener : ( event : UserChangedState ) => void ,
415415 ) {
416416 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
@@ -425,7 +425,7 @@ export namespace OneSignal {
425425
426426 /** Clears current user state observers. */
427427 export function removeEventListener (
428- event : 'change' ,
428+ _event : 'change' ,
429429 listener : ( event : UserChangedState ) => void ,
430430 ) {
431431 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
@@ -1002,20 +1002,20 @@ export namespace OneSignal {
10021002
10031003export {
10041004 NotificationWillDisplayEvent ,
1005- NotificationClickEvent ,
1006- InAppMessage ,
1007- InAppMessageClickEvent ,
1008- InAppMessageWillDisplayEvent ,
1009- InAppMessageDidDisplayEvent ,
1010- InAppMessageWillDismissEvent ,
1011- InAppMessageDidDismissEvent ,
1012- PushSubscriptionState ,
1013- PushSubscriptionChangedState ,
1014- UserState ,
1015- UserChangedState ,
10161005 OSNotificationPermission ,
1006+ type InAppMessage ,
1007+ type InAppMessageClickEvent ,
1008+ type InAppMessageDidDismissEvent ,
1009+ type InAppMessageDidDisplayEvent ,
1010+ type InAppMessageWillDismissEvent ,
1011+ type InAppMessageWillDisplayEvent ,
1012+ type NotificationClickEvent ,
1013+ type PushSubscriptionChangedState ,
1014+ type PushSubscriptionState ,
1015+ type UserChangedState ,
1016+ type UserState ,
10171017} ;
10181018
1019+ export type { InAppMessageClickResult } from './models/InAppMessage' ;
1020+ export type { NotificationClickResult } from './models/NotificationEvents' ;
10191021export { default as OSNotification } from './OSNotification' ;
1020- export { NotificationClickResult } from './models/NotificationEvents' ;
1021- export { InAppMessageClickResult } from './models/InAppMessage' ;
0 commit comments