@types/react-native-push-notification
Advanced tools
Comparing version 3.0.9 to 5.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for react-native-push-notification 3.0 | ||
// Type definitions for react-native-push-notification 5.0 | ||
// Project: https://github.com/zo0r/react-native-push-notification#readme | ||
@@ -30,3 +30,5 @@ // Definitions by: Paito Anderson <https://github.com/PaitoAnderson> | ||
onNotification?: (notification: PushNotification) => void; | ||
senderID?: string; | ||
onAction?: (notification: PushNotification) => void; | ||
onRegistrationError?: (error: any) => void; | ||
onRemoteFetch?: (notificationData: any) => void; | ||
permissions?: PushNotificationPermissions; | ||
@@ -37,16 +39,13 @@ popInitialNotification?: boolean; | ||
export type PriorityType = "max" | "high" | "low" | "min" | "default"; | ||
export type RepeatType = "week" | "day" | "hour" | "minute" | "time"; | ||
export type VisibilityType = "private" | "public" | "secret"; | ||
export type ImportanceType = "default" | "max" | "high" | "low" | "min" | "none" | "unspecified"; | ||
export class PushNotificationObject { | ||
/* Android only properties */ | ||
id?: string; | ||
ticker?: string; | ||
showWhen?: boolean; | ||
autoCancel?: boolean; | ||
largeIcon?: string; | ||
largeIconUrl?: string; | ||
smallIcon?: string; | ||
bigText?: string; | ||
subText?: string; | ||
bigPictureUrl?: string; | ||
color?: string; | ||
@@ -57,21 +56,31 @@ vibrate?: boolean; | ||
group?: string; | ||
groupSummary?: boolean; | ||
ongoing?: boolean; | ||
priority?: PriorityType; | ||
visibility?: VisibilityType; | ||
importance?: ImportanceType; | ||
priority?: "max" | "high" | "low" | "min" | "default"; | ||
visibility?: "private" | "public" | "secret"; | ||
importance?: "default" | "max" | "high" | "low" | "min" | "none" | "unspecified"; | ||
ignoreInForeground?: boolean; | ||
shortcutId?: string; | ||
channelId?: string; | ||
onlyAlertOnce?: boolean; | ||
messageId?: string; | ||
actions?: string; | ||
invokeApp?: boolean; | ||
/* iOS only properties */ | ||
alertAction?: any; | ||
category?: any; | ||
userInfo?: any; | ||
/* iOS and Android properties */ | ||
id?: number; | ||
title?: string; | ||
message: string; | ||
userInfo?: any; | ||
playSound?: boolean; | ||
soundName?: string; | ||
number?: string; | ||
repeatType?: RepeatType; | ||
repeatType?: "week" | "day" | "hour" | "minute" | "time"; | ||
repeatTime?: number; | ||
actions?: string; | ||
} | ||
@@ -83,7 +92,34 @@ | ||
export class PushNotificationDeliveredObject { | ||
identifier: string; | ||
title: string; | ||
body: string; | ||
tag: string; | ||
group: string; | ||
} | ||
export class PushNotificationScheduledLocalObject { | ||
id: number; | ||
date: Date; | ||
title: string; | ||
body: string; | ||
soundName: string; | ||
repeatInterval: number; | ||
number: number; | ||
} | ||
export class ChannelObject { | ||
channelId: string; | ||
channelName: string; | ||
channelDescription?: string; | ||
soundName?: string; | ||
importance?: number; | ||
vibrate?: boolean; | ||
} | ||
export interface PushNotification { | ||
configure(options: PushNotificationOptions): void; | ||
unregister(): void; | ||
localNotification(details: PushNotificationObject): void; | ||
localNotificationSchedule(details: PushNotificationScheduleObject): void; | ||
localNotification(notification: PushNotificationObject): void; | ||
localNotificationSchedule(notification: PushNotificationScheduleObject): void; | ||
requestPermissions( | ||
@@ -93,8 +129,12 @@ permissions?: Array<"alert" | "badge" | "sound"> | ||
subscribeToTopic(topic: string): void; | ||
presentLocalNotification(details: PushNotificationObject): void; | ||
scheduleLocalNotification(details: PushNotificationScheduleObject): void; | ||
cancelLocalNotifications(details: object): void; | ||
unsubscribeFromTopic(topic: string): void; | ||
presentLocalNotification(notification: PushNotificationObject): void; | ||
scheduleLocalNotification(notification: PushNotificationScheduleObject): void; | ||
cancelLocalNotifications(details: { id: string }): void; | ||
clearLocalNotification(tag: string, notificationID: number): void; | ||
cancelAllLocalNotifications(): void; | ||
setApplicationIconBadgeNumber(badgeCount: number): void; | ||
getApplicationIconBadgeNumber(callback: (badgeCount: number) => void): void; | ||
getApplicationIconBadgeNumber( | ||
callback: (badgeCount: number) => void | ||
): void; | ||
popInitialNotification( | ||
@@ -107,4 +147,26 @@ callback: (notification: PushNotification | null) => void | ||
): void; | ||
registerNotificationActions(actions: string[]): void; | ||
clearAllNotifications(): void; | ||
removeAllDeliveredNotifications(): void; | ||
getDeliveredNotifications( | ||
callback: (notifications: PushNotificationDeliveredObject[]) => void | ||
): void; | ||
getScheduledLocalNotifications( | ||
callback: (notifications: PushNotificationScheduledLocalObject[]) => void | ||
): void; | ||
removeDeliveredNotifications(identifiers: string[]): void; | ||
invokeApp(notification: PushNotificationObject): void; | ||
getChannels( | ||
callback: (channel_ids: string[]) => void | ||
): void; | ||
channelExists( | ||
callback: (exists: boolean) => void | ||
): void; | ||
createChannel( | ||
channel: ChannelObject, | ||
callback: (created: boolean) => void | ||
): void; | ||
channelBlocked( | ||
callback: (blocked: boolean) => void | ||
): void; | ||
deleteChannel(channel_id: string): void; | ||
} | ||
@@ -111,0 +173,0 @@ |
{ | ||
"name": "@types/react-native-push-notification", | ||
"version": "3.0.9", | ||
"version": "5.0.0", | ||
"description": "TypeScript definitions for react-native-push-notification", | ||
@@ -32,4 +32,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "ce79bd868c60b5b115f03b590fbfdcd9a3855251ddb869c351fd1f96f700b4cc", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "1235484395591c62642540afa5bc89eaba9c43adaf152a5eb788e5fe13523608", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 11 Apr 2020 03:17:11 GMT | ||
* Last updated: Wed, 19 Aug 2020 23:18:38 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8065
155