forked from NativeScript/firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
81 lines (49 loc) · 2.12 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
export * from './common';
import { AuthorizationStatus } from './common';
export interface AndroidPermissions {}
export interface IOSPermissions {
alert?: undefined | false | true;
announcement?: undefined | false | true;
badge?: undefined | false | true;
carPlay?: undefined | false | true;
criticalAlert?: undefined | false | true;
provisional?: undefined | false | true;
sound?: undefined | false | true;
}
export interface Permissions {
ios?: IOSPermissions;
android?: AndroidPermissions;
}
export interface IMessagingCore {
readonly isDeviceRegisteredForRemoteMessages: boolean;
showNotificationsWhenInForeground: boolean;
getCurrentToken(): Promise<string>;
hasPermission(): Promise<AuthorizationStatus>;
addOnMessage(listener: (message: any) => any);
removeOnMessage(listener: (message: any) => any): boolean;
addOnToken(listener: (token: string) => any);
removeOnToken(listener: (token: string) => any): boolean;
addOnNotificationTap(listener: (message: any) => any);
removeOnNotificationTap(listener: (message: any) => any): boolean;
registerDeviceForRemoteMessages(): Promise<void>;
requestPermission(permissions?: Permissions): Promise<AuthorizationStatus>;
unregisterDeviceForRemoteMessages(): Promise<void>;
}
export declare class MessagingCore implements IMessagingCore {
static getInstance(): MessagingCore;
static readonly inForeground: boolean;
static readonly appDidLaunch: boolean;
getCurrentToken(): Promise<string>;
hasPermission(): Promise<AuthorizationStatus>;
addOnMessage(listener: (message: any) => any);
removeOnMessage(listener: (message: any) => any): boolean;
addOnToken(listener: (token: string) => any);
removeOnToken(listener: (token: string) => any): boolean;
addOnNotificationTap(listener: (message: any) => any);
removeOnNotificationTap(listener: (message: any) => any): boolean;
registerDeviceForRemoteMessages(): Promise<void>;
requestPermission(permissions?: Permissions): Promise<AuthorizationStatus>;
unregisterDeviceForRemoteMessages(): Promise<void>;
readonly isDeviceRegisteredForRemoteMessages: boolean;
showNotificationsWhenInForeground: boolean;
}