-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathindex.d.ts
33 lines (28 loc) · 1.21 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
declare module 'react-native-voip-push-notification' {
export type NativeEvents = {
register: 'RNVoipPushRemoteNotificationsRegisteredEvent';
notification: 'RNVoipPushRemoteNotificationReceivedEvent';
didLoadWithEvents: 'RNVoipPushDidLoadWithEvents';
}
export type Events = keyof NativeEvents;
export type EventsPayload = {
register: string,
notification: object,
didLoadWithEvents: Array<InitialEvent>,
}
export type InitialEvent = {
[Event in Events]: { name: NativeEvents[Event], data: EventsPayload[Event] }
}[Events];
export default class RNVoipPushNotification {
static RNVoipPushRemoteNotificationsRegisteredEvent: NativeEvents['register']
static RNVoipPushRemoteNotificationReceivedEvent: NativeEvents['notification']
static RNVoipPushDidLoadWithEvents: NativeEvents['didLoadWithEvents']
static addEventListener<Event extends Events>(
type: Event,
handler: (args: EventsPayload[Event]) => void,
): void
static removeEventListener(type: Events): void
static registerVoipToken(): void;
static onVoipNotificationCompleted(uuid: string): void;
}
}