Commit 164d055d authored by William Candillon's avatar William Candillon Committed by Libin Lu

Add Notification type (#382)

* More typings

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts
parent de0849e8
...@@ -24,6 +24,35 @@ declare module "react-native-fcm" { ...@@ -24,6 +24,35 @@ declare module "react-native-fcm" {
const Local = "local_notification"; const Local = "local_notification";
} }
export interface Notification {
collapse_key: string;
opened_from_tray: boolean;
from: string;
notification: {
title?: string
body: string;
icon: string;
};
_notificationType: string;
finish(type?: string): void;
}
export interface LocalNotification {
title?: string;
body: string;
icon?: string;
vibrate?: number;
sound?: boolean;
big_text?: string;
large_icon?: string;
priority?: string
}
export interface ScheduleLocalNotification extends LocalNotification{
id: string;
fire_date: number
}
export interface Subscription { export interface Subscription {
remove(): void; remove(): void;
} }
...@@ -32,14 +61,14 @@ declare module "react-native-fcm" { ...@@ -32,14 +61,14 @@ declare module "react-native-fcm" {
static requestPermissions(): void; static requestPermissions(): void;
static getFCMToken(): Promise<string>; static getFCMToken(): Promise<string>;
static on(event: "FCMTokenRefreshed", handler: (token: string) => void): Subscription; static on(event: "FCMTokenRefreshed", handler: (token: string) => void): Subscription;
static on(event: "FCMNotificationReceived", handler: (notification: any) => void): Subscription; static on(event: "FCMNotificationReceived", handler: (notification: Notification) => void): Subscription;
static subscribeToTopic(topic: string): void; static subscribeToTopic(topic: string): void;
static unsubscribeFromTopic(topic: string): void; static unsubscribeFromTopic(topic: string): void;
static getInitialNotification(): Promise<any>; static getInitialNotification(): Promise<Notification>;
static presentLocalNotification(notification: any): void; static presentLocalNotification(notification: LocalNotification): void;
static scheduleLocalNotification(schedule: any): void; static scheduleLocalNotification(schedule: LocalNotification): void;
static getScheduledLocalNotifications(): Promise<any>; static getScheduledLocalNotifications(): Promise<LocalNotification>;
static removeAllDeliveredNotifications(): void; static removeAllDeliveredNotifications(): void;
static removeDeliveredNotification(id: string): void; static removeDeliveredNotification(id: string): void;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment