smartmessage-react-native 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.d.ts ADDED
@@ -0,0 +1,451 @@
1
+ declare module 'smartmessage-react-native' {
2
+ export const PUSH_TYPE: {
3
+ BASIC: '0';
4
+ IMAGE: '1';
5
+ HTML_PUSH: '2';
6
+ GIF: '3';
7
+ VIDEO: '4';
8
+ AUDIO: '5';
9
+ BASIC_CAROUSEL: '6';
10
+ ROTARY_CAROUSEL: '7';
11
+ COVERFLOW_CAROUSEL: '8';
12
+ SLIDER: '9';
13
+ SMALL_DIALOG: '10';
14
+ MEDIUM_DIALOG: '11';
15
+ FULLSCREEN_DIALOG: '12';
16
+ INTERACTIVE_DIALOG: '13';
17
+ HTML_DIALOG: '14';
18
+ };
19
+
20
+ export const PERMISSION_TYPE: {
21
+ NOTIFICATION: 'notification';
22
+ LOCATION: 'location';
23
+ BACKGROUND_LOCATION: 'backgroundLocation';
24
+ APPROXIMATE_LOCATION: 'approx';
25
+ PRECISE_LOCATION: 'precise';
26
+ };
27
+
28
+ export const DEEPLINK_TYPE: {
29
+ NONE: 0;
30
+ WEB_LINK: 1;
31
+ APP_LINK: 2;
32
+ API_CALL: 3;
33
+ };
34
+
35
+ export class BaseResponseModel {
36
+ constructor(httpStatusCode: number, responseCode: string, explanation: string);
37
+ getExplanation(): string;
38
+ getResponseCode(): string;
39
+ getHttpStatusCode(): number;
40
+ static fromJson(json: string): BaseResponseModel;
41
+ static fromObj(obj: any): BaseResponseModel;
42
+ }
43
+
44
+ export class CreateCustomEventRequestModel {
45
+ constructor(eventIdentifier: string, uniqueId: string, parameters: any);
46
+ }
47
+
48
+ export class MatchContactDeviceRequestModel {
49
+ constructor(externalId: string, targetAddress: MatchContactDeviceTargetAddress);
50
+ }
51
+
52
+ export class MatchContactDeviceTargetAddress {
53
+ constructor(key: string, value: string);
54
+ }
55
+
56
+ export class UserInfoModel {
57
+ constructor(
58
+ id: string,
59
+ name: string,
60
+ surname: string,
61
+ email: string,
62
+ mobile: string,
63
+ birthdate: Date,
64
+ gender: string,
65
+ username: string,
66
+ rcvNot: boolean,
67
+ tags: string,
68
+ lang: string
69
+ );
70
+ static fromJson(json: string): UserInfoModel;
71
+ static fromObj(obj: any): UserInfoModel;
72
+ }
73
+
74
+ export class SMPButton {
75
+ constructor(
76
+ label: string,
77
+ link: string,
78
+ link_Id: string,
79
+ deepLinkType: number,
80
+ color: string,
81
+ textColor: string
82
+ );
83
+ static fromJson(json: string): SMPButton;
84
+ }
85
+
86
+ export class SlideModel {
87
+ constructor(title: string, message: string, imageUrl: string, buttons: SMPButton[]);
88
+ static fromJson(json: string): SlideModel;
89
+ }
90
+
91
+ export class BaseNotificationModel {
92
+ constructor(
93
+ type: string,
94
+ tags: string[],
95
+ id: string,
96
+ thumb: string,
97
+ sound: string,
98
+ title: string,
99
+ message: string,
100
+ link: string,
101
+ linkId: string,
102
+ buttons: SMPButton[]
103
+ );
104
+ static fromJson(json: string): BaseNotificationModel;
105
+ static fromObj(obj: any): BaseNotificationModel;
106
+ }
107
+
108
+ export class BasicNotificationModel extends BaseNotificationModel {
109
+ constructor(
110
+ type: string,
111
+ tags: string[],
112
+ id: string,
113
+ thumb: string,
114
+ sound: string,
115
+ title: string,
116
+ message: string,
117
+ link: string,
118
+ linkId: string,
119
+ buttons: SMPButton[]
120
+ );
121
+ static fromJson(json: string): BasicNotificationModel;
122
+ static fromObj(obj: any): BasicNotificationModel;
123
+ }
124
+
125
+ export class BaseRichNotificationModel extends BaseNotificationModel {
126
+ constructor(
127
+ type: string,
128
+ tags: string[],
129
+ id: string,
130
+ thumb: string,
131
+ sound: string,
132
+ title: string,
133
+ message: string,
134
+ link: string,
135
+ linkId: string,
136
+ buttons: SMPButton[],
137
+ mediaUrl: string
138
+ );
139
+ static fromJson(json: string): BaseRichNotificationModel;
140
+ static fromObj(obj: any): BaseRichNotificationModel;
141
+ }
142
+
143
+ export class ImageNotificationModel extends BaseRichNotificationModel {
144
+ constructor(
145
+ type: string,
146
+ tags: string[],
147
+ id: string,
148
+ thumb: string,
149
+ sound: string,
150
+ title: string,
151
+ message: string,
152
+ link: string,
153
+ linkId: string,
154
+ buttons: SMPButton[],
155
+ mediaUrl: string
156
+ );
157
+ static fromJson(json: string): ImageNotificationModel;
158
+ static fromObj(obj: any): ImageNotificationModel;
159
+ }
160
+
161
+ export class GifNotificationModel extends BaseRichNotificationModel {
162
+ constructor(
163
+ type: string,
164
+ tags: string[],
165
+ id: string,
166
+ thumb: string,
167
+ sound: string,
168
+ title: string,
169
+ message: string,
170
+ link: string,
171
+ linkId: string,
172
+ buttons: SMPButton[],
173
+ mediaUrl: string
174
+ );
175
+ static fromJson(json: string): GifNotificationModel;
176
+ static fromObj(obj: any): GifNotificationModel;
177
+ }
178
+
179
+ export class AudioNotificationModel extends BaseRichNotificationModel {
180
+ constructor(
181
+ type: string,
182
+ tags: string[],
183
+ id: string,
184
+ thumb: string,
185
+ sound: string,
186
+ title: string,
187
+ message: string,
188
+ link: string,
189
+ linkId: string,
190
+ buttons: SMPButton[],
191
+ mediaUrl: string
192
+ );
193
+ static fromJson(json: string): AudioNotificationModel;
194
+ static fromObj(obj: any): AudioNotificationModel;
195
+ }
196
+
197
+ export class VideoNotificationModel extends BaseRichNotificationModel {
198
+ constructor(
199
+ type: string,
200
+ tags: string[],
201
+ id: string,
202
+ thumb: string,
203
+ sound: string,
204
+ title: string,
205
+ message: string,
206
+ link: string,
207
+ linkId: string,
208
+ buttons: SMPButton[],
209
+ mediaUrl: string,
210
+ coverUrl: string
211
+ );
212
+ static fromJson(json: string): VideoNotificationModel;
213
+ static fromObj(obj: any): VideoNotificationModel;
214
+ }
215
+
216
+ export class HTMLNotificationModel extends BaseRichNotificationModel {
217
+ constructor(
218
+ type: string,
219
+ tags: string[],
220
+ id: string,
221
+ thumb: string,
222
+ sound: string,
223
+ title: string,
224
+ message: string,
225
+ link: string,
226
+ linkId: string,
227
+ buttons: SMPButton[],
228
+ mediaUrl: string
229
+ );
230
+ static fromJson(json: string): HTMLNotificationModel;
231
+ static fromObj(obj: any): HTMLNotificationModel;
232
+ }
233
+
234
+ export class BaseSliderNotificationModel extends BaseNotificationModel {
235
+ constructor(
236
+ type: string,
237
+ tags: string[],
238
+ id: string,
239
+ thumb: string,
240
+ sound: string,
241
+ title: string,
242
+ message: string,
243
+ link: string,
244
+ linkId: string,
245
+ buttons: SMPButton[],
246
+ slides: SlideModel[]
247
+ );
248
+ static fromJson(json: string): BaseSliderNotificationModel;
249
+ static fromObj(obj: any): BaseSliderNotificationModel;
250
+ }
251
+
252
+ export class BasicCarouselNotificationModel extends BaseSliderNotificationModel {
253
+ constructor(
254
+ type: string,
255
+ tags: string[],
256
+ id: string,
257
+ thumb: string,
258
+ sound: string,
259
+ title: string,
260
+ message: string,
261
+ link: string,
262
+ linkId: string,
263
+ buttons: SMPButton[],
264
+ slides: SlideModel[]
265
+ );
266
+ static fromJson(json: string): BasicCarouselNotificationModel;
267
+ static fromObj(obj: any): BasicCarouselNotificationModel;
268
+ }
269
+
270
+ export class RotaryCarouselNotificationModel extends BaseSliderNotificationModel {
271
+ constructor(
272
+ type: string,
273
+ tags: string[],
274
+ id: string,
275
+ thumb: string,
276
+ sound: string,
277
+ title: string,
278
+ message: string,
279
+ link: string,
280
+ linkId: string,
281
+ buttons: SMPButton[],
282
+ slides: SlideModel[]
283
+ );
284
+ static fromJson(json: string): RotaryCarouselNotificationModel;
285
+ static fromObj(obj: any): RotaryCarouselNotificationModel;
286
+ }
287
+
288
+ export class CoverflowCarouselNotificationModel extends BaseSliderNotificationModel {
289
+ constructor(
290
+ type: string,
291
+ tags: string[],
292
+ id: string,
293
+ thumb: string,
294
+ sound: string,
295
+ title: string,
296
+ message: string,
297
+ link: string,
298
+ linkId: string,
299
+ buttons: SMPButton[],
300
+ slides: SlideModel[]
301
+ );
302
+ static fromJson(json: string): CoverflowCarouselNotificationModel;
303
+ static fromObj(obj: any): CoverflowCarouselNotificationModel;
304
+ }
305
+
306
+ export class SliderNotificationModel extends BaseSliderNotificationModel {
307
+ constructor(
308
+ type: string,
309
+ tags: string[],
310
+ id: string,
311
+ thumb: string,
312
+ sound: string,
313
+ title: string,
314
+ message: string,
315
+ link: string,
316
+ linkId: string,
317
+ buttons: SMPButton[],
318
+ slides: SlideModel[]
319
+ );
320
+ static fromJson(json: string): SliderNotificationModel;
321
+ static fromObj(obj: any): SliderNotificationModel;
322
+ }
323
+
324
+ export class SmallDialogModel extends BaseNotificationModel {
325
+ constructor(
326
+ type: string,
327
+ tags: string[],
328
+ id: string,
329
+ thumb: string,
330
+ sound: string,
331
+ title: string,
332
+ message: string,
333
+ link: string,
334
+ linkId: string,
335
+ buttons: SMPButton[]
336
+ );
337
+ static fromJson(json: string): SmallDialogModel;
338
+ static fromObj(obj: any): SmallDialogModel;
339
+ }
340
+
341
+ export class MediumDialogModel extends BaseNotificationModel {
342
+ constructor(
343
+ type: string,
344
+ tags: string[],
345
+ id: string,
346
+ thumb: string,
347
+ sound: string,
348
+ title: string,
349
+ message: string,
350
+ link: string,
351
+ linkId: string,
352
+ buttons: SMPButton[]
353
+ );
354
+ static fromJson(json: string): MediumDialogModel;
355
+ static fromObj(obj: any): MediumDialogModel;
356
+ }
357
+
358
+ export class FullscreenDialogModel extends BaseNotificationModel {
359
+ constructor(
360
+ type: string,
361
+ tags: string[],
362
+ id: string,
363
+ thumb: string,
364
+ sound: string,
365
+ title: string,
366
+ message: string,
367
+ link: string,
368
+ linkId: string,
369
+ buttons: SMPButton[]
370
+ );
371
+ static fromJson(json: string): FullscreenDialogModel;
372
+ static fromObj(obj: any): FullscreenDialogModel;
373
+ }
374
+
375
+ export class InteractiveDialogModel extends BaseNotificationModel {
376
+ constructor(
377
+ type: string,
378
+ tags: string[],
379
+ id: string,
380
+ thumb: string,
381
+ sound: string,
382
+ title: string,
383
+ message: string,
384
+ link: string,
385
+ linkId: string,
386
+ buttons: SMPButton[]
387
+ );
388
+ static fromJson(json: string): InteractiveDialogModel;
389
+ static fromObj(obj: any): InteractiveDialogModel;
390
+ }
391
+
392
+ export class HTMLDialogModel extends BaseRichNotificationModel {
393
+ constructor(
394
+ type: string,
395
+ tags: string[],
396
+ id: string,
397
+ thumb: string,
398
+ sound: string,
399
+ title: string,
400
+ message: string,
401
+ link: string,
402
+ linkId: string,
403
+ buttons: SMPButton[],
404
+ mediaUrl: string
405
+ );
406
+ static fromJson(json: string): HTMLDialogModel;
407
+ static fromObj(obj: any): HTMLDialogModel;
408
+ }
409
+
410
+ export default class SmartMessage {
411
+
412
+ // Setters and getters
413
+ static getNotificationContent(contentUrl: string): Promise<any>;
414
+ static getToken(): Promise<string>;
415
+ static getUserInfo(): Promise<UserInfoModel>;
416
+ static setUserInfo(userInfo: UserInfoModel): void;
417
+ static setUserInfoWithPromise(userInfo: UserInfoModel): Promise<BaseResponseModel>;
418
+
419
+ // Dialog operations
420
+ static displayDialog(message: BaseNotificationModel): void;
421
+ static displayDialogWithPromise(message: BaseNotificationModel): Promise<any>;
422
+
423
+ // Configuration
424
+ static saveConfig(): void;
425
+ static saveConfigWithPromise(): Promise<any>;
426
+
427
+ // Contact matching operations
428
+ static matchContactDevice(matchContactDeviceRequestModel: MatchContactDeviceRequestModel): void;
429
+ static matchContactDeviceWithPromise(matchContactDeviceRequestModel: MatchContactDeviceRequestModel): Promise<any>;
430
+
431
+ // Event reporting
432
+ static reportCustomEvent(eventIdentifier: string, uniqueId: string, parameters: any): void;
433
+ static reportCustomEventWithPromise(eventIdentifier: string, uniqueId: string, parameters: any): Promise<any>;
434
+ static reportLoggedIn(): void;
435
+ static reportLoggedInWithPromise(): Promise<any>;
436
+ static reportLoggedOut(): void;
437
+ static reportLoggedOutWithPromise(): Promise<any>;
438
+
439
+ // Permission operations
440
+ static requestNotificationPermission(): void;
441
+ static requestNotificationPermissionWithPromise(): Promise<any>;
442
+ static permissionUpdate(permissionType: string, isGranted: boolean): void;
443
+ static permissionUpdateWithPromise(permissionType: string, isGranted: boolean): Promise<any>;
444
+ static requestLocationPermission(): void;
445
+ static requestLocationPermissionWithPromise(): Promise<any>;
446
+
447
+ // Location tracking
448
+ static startLocationTracking(): void;
449
+ static stopLocationTracking(): void;
450
+ }
451
+ }