From aaab1da998f31e8f73308724f2cf3444e09be3d6 Mon Sep 17 00:00:00 2001 From: Paito Anderson Date: Wed, 15 Nov 2017 10:30:01 -0500 Subject: [PATCH] Adhere to rules --- .../react-native-push-notification/index.d.ts | 164 +++++++++--------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/types/react-native-push-notification/index.d.ts b/types/react-native-push-notification/index.d.ts index e7fcffed05..bec39b8be8 100644 --- a/types/react-native-push-notification/index.d.ts +++ b/types/react-native-push-notification/index.d.ts @@ -4,86 +4,86 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare module "react-native-push-notification" { - - interface PushNotificationPermissions { - alert?: boolean - badge?: boolean - sound?: boolean - } - - interface IPushNotification { - foreground: boolean; - userInteraction: boolean; - message: string|Object; - data: Object; - badge: number; - alert: Object; - sound: string; - } - - export class PushNotificationOptions { - onRegister?: (token: { os: string, token: string }) => void; - onNotification?: (notification: IPushNotification) => void; - senderID?: string; - popInitialNotification?: boolean; - requestPermissions?: boolean; - } - - export type RepeatType = 'week' | 'day' | 'hour' | 'minute' | 'time'; - - export class PushNotificationObject { - - /* Android only properties */ - id?: string; - ticker?: string; - autoCancel?: boolean; - largeIcon?: string; - smallIcon?: string; - bigText?: string; - subText?: string; - color?: string; - vibrate?: boolean; - vibration?: number; - tag?: string; - group?: string; - ongoing?: boolean; - - /* iOS only properties */ - alertAction?: any; - category?: any; - userInfo?: any; - - /* iOS and Android properties */ - title?: string; - message: string; - playSound?: boolean; - soundName?: string; - number?: string; - repeatType?: RepeatType; - actions?: string; - } - - export class PushNotificationScheduleObject extends PushNotificationObject { - Date: Date; - } - - export default class PushNotification { - static configure(options: PushNotificationOptions): void; - static unregister(): void; - static localNotification(details: PushNotificationObject): void; - static localNotificationSchedule(details: PushNotificationScheduleObject): void; - static requestPermissions(): void; - static presentLocalNotification(details: PushNotificationObject): void; - static scheduleLocalNotification(details: PushNotificationScheduleObject): void; - static cancelLocalNotifications(details: object): void; - static cancelAllLocalNotifications(): void; - static setApplicationIconBadgeNumber(badgeCount: number): void; - static getApplicationIconBadgeNumber(callback: (badgeCount: number) => void): void - static popInitialNotification(): Promise; - static abandonPermissions(): void; - static checkPermissions(callback: (permissions: PushNotificationPermissions) => void): void - static registerNotificationActions(actions: string[]): void; - static clearAllNotifications(): void; - } +export interface PushNotificationPermissions { + alert?: boolean; + badge?: boolean; + sound?: boolean; } + +export interface PushNotification { + foreground: boolean; + userInteraction: boolean; + message: string|object; + data: object; + badge: number; + alert: object; + sound: string; +} + +export class PushNotificationOptions { + onRegister?: (token: { os: string, token: string }) => void; + onNotification?: (notification: PushNotification) => void; + senderID?: string; + popInitialNotification?: boolean; + requestPermissions?: boolean; +} + +export type RepeatType = 'week' | 'day' | 'hour' | 'minute' | 'time'; + +export class PushNotificationObject { + /* Android only properties */ + id?: string; + ticker?: string; + autoCancel?: boolean; + largeIcon?: string; + smallIcon?: string; + bigText?: string; + subText?: string; + color?: string; + vibrate?: boolean; + vibration?: number; + tag?: string; + group?: string; + ongoing?: boolean; + + /* iOS only properties */ + alertAction?: any; + category?: any; + userInfo?: any; + + /* iOS and Android properties */ + title?: string; + message: string; + playSound?: boolean; + soundName?: string; + number?: string; + repeatType?: RepeatType; + actions?: string; +} + +export class PushNotificationScheduleObject extends PushNotificationObject { + Date: Date; +} + +export interface PushNotification { + configure(options: PushNotificationOptions): void; + unregister(): void; + localNotification(details: PushNotificationObject): void; + localNotificationSchedule(details: PushNotificationScheduleObject): void; + requestPermissions(): void; + presentLocalNotification(details: PushNotificationObject): void; + scheduleLocalNotification(details: PushNotificationScheduleObject): void; + cancelLocalNotifications(details: object): void; + cancelAllLocalNotifications(): void; + setApplicationIconBadgeNumber(badgeCount: number): void; + getApplicationIconBadgeNumber(callback: (badgeCount: number) => void): void; + popInitialNotification(): Promise; + abandonPermissions(): void; + checkPermissions(callback: (permissions: PushNotificationPermissions) => void): void; + registerNotificationActions(actions: string[]): void; + clearAllNotifications(): void; +} + +declare const PushNotification: PushNotification; + +export default PushNotification;