-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathindex.d.ts
95 lines (87 loc) · 3.77 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
declare module 'pushwoosh-react-native-plugin' {
interface PushwooshConfig {
pw_appid: string;
project_number: string;
pw_notification_handling?: string;
}
type LocalNotification = {
msg: string;
seconds: number;
userData?: Object;
}
type PushwooshTags = Record<string, string | number | string[] | number[] | boolean>
type InboxNotification = {
code: string;
title?: string;
message?: string;
imageUrl?: string;
sendDate?: string;
type?: number;
bannerUrl?: string;
customData?: Object;
isRead?: boolean;
actionParams?: Object;
isActionPerformed?: boolean;
}
interface Pushwoosh {
//general interaction with Pushwoosh
init(config: PushwooshConfig, success?: () => void, fail?: () => void): void;
createLocalNotification(notification: LocalNotification): void;
clearLocalNotification(): void;
clearNotificationCenter(): void;
register(success?: (token: string) => void, fail?: (error: Error) => void): void;
unregister(success?: (token: string) => void, fail?: (error: Error) => void): void;
onPushOpen(callback: () => void, fail?: ()=> void): void;
setTags(
tags: PushwooshTags,
success?: () => void,
fail?: (error: Error) => void
): void;
getTags(success: (tags: PushwooshTags) => void, fail?: (error: Error) => void): void;
setShowPushnotificationAlert(showAlert: boolean): void;
getShowPushnotificationAlert(callback: (willShow: boolean) => void): void;
getPushToken(success?: (token: string) => void): void;
getHwid(success: (hwid: string) => void): void;
getUserId(success: (userId: string) => void): void;
setUserId(userId: string, success?: ()=> void, fail?: (error: Error) => void): void;
postEvent(event: string, attributes?: Record<string, string>): void;
enableHuaweiPushNotifications(): void;
//email methods
setUserEmails(userId: string, emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
setEmails(emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
//badge methods
setApplicationIconBadgeNumber(badgeNumber: number): void;
getApplicationIconBadgeNumber(callback: (badge: number) => void): void;
addToApplicationIconBadgeNumber(badgeNumber: number): void;
//Notification appearance
setMultiNotificationMode(on: boolean): void;
setLightScreenOnNotification(on: boolean): void;
setEnableLED(on: boolean): void;
setColorLED(color: number): void;
setSoundType(type: number): void;
setVibrateType(type: number): void;
setNotificationIconBackgroundColor(color: string): void;
setLanguage(language: string): void;
//Inbox API
presentInboxUI(style?: Object): void;
messagesWithNoActionPerformedCount(callback: (result: number) => void): void;
unreadMessagesCount(callback: (result: number) => void): void;
messagesCount(callback: (result: number) => void): void;
loadMessages(success: (notifications: InboxNotification[]) => void, fail?: (error: Error) => void): void;
readMessage(id: string): void;
readMessages(ids: string[]): void;
deleteMessage(id: string): void;
deleteMessages(ids: string[]): void;
performAction(id: string): void;
//GDPR methods
showGDPRConsentUI(): void;
showGDPRDeletionUI(): void;
isDeviceDataRemoved(success: (isRemoved: boolean) => void): void;
isCommunicationEnabled(success: (isEnabled: boolean)=> void): void;
isAvailableGDPR(success: (isAvailable: boolean) => void): void;
setCommunicationEnabled(enabled: boolean, success?: () => void, fail?: (error: Error) => void): void;
removeAllDeviceData(success?: () => void, fail?: (error: Error) => void): void;
}
const Pushwoosh: Pushwoosh;
export = Pushwoosh;
}