-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.d.ts
More file actions
166 lines (149 loc) · 5.2 KB
/
index.d.ts
File metadata and controls
166 lines (149 loc) · 5.2 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
declare module 'cleverpush-react-native' {
export default class CleverPush {
static init(channelId: string, options?: InitOptions): void;
static enableDevelopmentMode(): void;
static requestLocationPermission(): void;
static isSubscribed(callback: (error, isSubscribed: boolean) => void): void;
static getSubscriptionId(callback: (error, subscriptionId: string) => void): void;
static areNotificationsEnabled(callback: (error, notificationsEnabled: boolean) => void): void;
static subscribe(): void;
static unsubscribe(): void;
static showTopicsDialog(): void;
static setShowNotificationsInForeground(show: boolean): void;
static setIncrementBadge(increment: boolean): void;
static setAutoClearBadge(autoClear: boolean): void;
static setAutoResubscribe(autoResubscribe: boolean): void;
static setBadgeCount(count: number): void;
static getBadgeCount(callback: (error, count: number) => void): void;
static clearNotificationsFromNotificationCenter(): void;
static addEventListener(
type: 'received' | 'opened',
handler: (result: { notification: Notification; subscription: Subscription }) => void
): void;
static addEventListener(
type: 'subscribed',
handler: (result: { id: string }) => void
): void;
static addEventListener(
type: 'appBannerOpened',
handler: (result: { appBannerOpened: AppBannerOpenedEvent }) => void
): void;
static removeEventListener(
type: 'received' | 'opened',
handler: (result: { notification: Notification; subscription: Subscription }) => void
): void;
static removeEventListener(
type: 'subscribed',
handler: (result: { id: string }) => void
): void;
static removeEventListener(
type: 'appBannerOpened',
handler: (result: { appBannerOpened: AppBannerOpenedEvent }) => void
): void;
static clearListeners(): void;
static getAvailableTags(callback: (error, channelTags: Tag[]) => void): void;
static getSubscriptionTags(callback: (error, tagIds: string[]) => void): void;
static addSubscriptionTag(tagId: string): void;
static removeSubscriptionTag(tagId: string): void;
static hasSubscriptionTag(tagId: string, callback: (error, hasTag: boolean) => void): void;
static getAvailableAttributes(callback: (error, channelAttribute: Attribute[]) => void): void;
static getSubscriptionAttributes(callback: (error, attributes: Record<string, string>) => void): void;
static setSubscriptionAttribute(attributeId: string, value: string): void;
static getSubscriptionAttribute(attributeId: string, callback: (error, attributeValue: string) => void): void;
static getSubscriptionTopics(callback: (error, topics: string[]) => void): void;
static getAvailableTopics(callback: (error, channelTopics: Topic[]) => void): void;
static setSubscriptionTopics(topicIds: string[]): void;
static addSubscriptionTopic(topicId: string): void;
static removeSubscriptionTopic(topicId: string): void;
static trackEvent(url: string, properties: Record<string, any>): void;
static trackEvent(url: string): void;
static setSubscriptionLanguage(value: string): void;
static setSubscriptionCountry(value: string): void;
static trackPageView(url: string, params: Record<string, any>): void;
static getNotifications(callback: (error, notifications: Notification[]) => void): void;
static removeNotification(notificationId: string, removeFromNotificationCenter?: boolean): void;
static enableAppBanners(): void;
static disableAppBanners(): void;
static getDeviceToken(callback: (error, deviceToken: string) => void): void;
static removeAllNotifications(): void;
}
export type InitOptions = {
autoRegister?: boolean;
};
type EventType = 'received' | 'opened' | 'subscribed' | 'appBannerOpened';
export interface Tag {
id: string;
name: string;
}
export interface Topic {
id: string;
name: string;
}
export interface Attribute {
id: string;
name: string;
}
export interface Subscription {
id: string;
}
export interface Notification {
id: string;
tag: string;
title: string;
text: string;
url: string;
iconUrl: string;
mediaUrl: string;
actions?: NotificationAction[];
customData: Record<string, any>;
chatNotification: boolean;
carouselEnabled: boolean;
carouselItems?: NotificationCarouselItem[];
category?: NotificationCategory;
soundFilename?: string;
silent: boolean;
createdAt: string;
appBanner: string;
inboxAppBanner?: string;
voucherCode?: string;
autoHandleDeepLink?: boolean;
}
export interface NotificationAction {
title: string;
url: string;
icon: string;
phone: string;
id: string;
type: string;
}
export interface NotificationCategory {
id: string;
group: NotificationCategoryGroup;
name: string;
description: string;
soundEnabled: boolean;
soundFilename: string;
vibrationEnabled: boolean;
vibrationPattern: string;
ledColorEnabled: boolean;
ledColor: string;
lockScreen: string;
importance: string;
badgeDisabled: boolean;
backgroundColor: string;
foregroundColor: string;
}
export interface NotificationCategoryGroup {
id: string;
name: string;
}
export interface NotificationCarouselItem {
mediaUrl: string;
}
export interface AppBannerOpenedEvent {
type: string;
name: string;
url: string;
urlType: string;
}
}