From c066174151ba593fcdfbc0d4d84fa9978aff4155 Mon Sep 17 00:00:00 2001 From: Tony Gaskell Date: Wed, 3 Oct 2018 08:50:28 -1000 Subject: [PATCH] @types/react-native-push-notification: Add missing permissions type on push notification options (#29257) * Add missing permissions type on push notification options * Refactor PushNotification Options to interface instead of class --- types/react-native-push-notification/index.d.ts | 3 ++- .../react-native-push-notification-tests.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-native-push-notification/index.d.ts b/types/react-native-push-notification/index.d.ts index 1c1577d7c1..4f58cd7385 100644 --- a/types/react-native-push-notification/index.d.ts +++ b/types/react-native-push-notification/index.d.ts @@ -22,10 +22,11 @@ export interface PushNotification { finish: (fetchResult: string) => void; } -export class PushNotificationOptions { +export interface PushNotificationOptions { onRegister?: (token: { os: string, token: string }) => void; onNotification?: (notification: PushNotification) => void; senderID?: string; + permissions?: PushNotificationPermissions; popInitialNotification?: boolean; requestPermissions?: boolean; } diff --git a/types/react-native-push-notification/react-native-push-notification-tests.ts b/types/react-native-push-notification/react-native-push-notification-tests.ts index c28779b855..60354e0cf7 100644 --- a/types/react-native-push-notification/react-native-push-notification-tests.ts +++ b/types/react-native-push-notification/react-native-push-notification-tests.ts @@ -6,6 +6,7 @@ PushNotification.configure({ }, onRegister: (token) => {}, senderID: 'XXX', + permissions: { alert: true, badge: true, sound: true }, popInitialNotification: false, requestPermissions: true, });