-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathCountly.d.ts
1350 lines (1207 loc) · 47.5 KB
/
Countly.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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
interface Segmentation {
[key: string]: number | string | boolean;
}
interface CountlyEventOptions {
eventName: string;
eventCount?: number;
eventSum?: number | string;
segments?: Segmentation;
}
interface FeedbackWidget {
id: string;
type: string;
name?: string;
}
interface FeedbackWidgetResultObject {
error: string,
data: FeedbackWidget[],
}
interface CountlyUserData {
name?: string;
username?: string;
email?: string;
organization?: string;
phone?: string;
picture?: string;
gender?: string;
byear?: number | string;
custom?: Record<string, any>;
}
type CountlyCallback = (message: string) => void;
type CountlyErrorCallback = (error: string | null) => void;
type WidgetCallback = () => void;
type FeedbackWidgetCallback = (retrievedWidgets: FeedbackWidget[], error: string | null) => void;
type WidgetInfoCallback = (widgetInfo: FeedbackWidget[], error: string | null) => void;
interface RatingWidgetResult {
rating: number,
comment: string,
}
interface CustomMetric {
[key: string]: string;
}
interface TraceCustomMetric {
[key: string]: number | string;
}
type ValidationFunction = (
stringValue: string,
stringName: string,
functionName: string
) => Promise<string | null>;
interface ResultObject {
error: string,
data: object,
}
interface ErrorObject { error: string | null }
declare module "countly-sdk-react-native-bridge" {
import type CountlyConfig from "countly-sdk-react-native-bridge/CountlyConfig";
namespace Countly {
string;
string;
any;
any;
boolean;
boolean;
boolean;
string;
string;
string;
string;
export const TemporaryDeviceIDString: string;
export interface messagingMode {
DEVELOPMENT: string;
PRODUCTION: string;
ADHOC: string;
}
/**
* Countly Feedback Module
*/
namespace feedback {
/**
* Get a list of available feedback widgets as an array of objects.
* @param {FeedbackWidgetCallback} [onFinished] - returns (retrievedWidgets, error). This parameter is optional.
* @return {FeedbackWidgetResultObject} object {error: string or null, data: FeedbackWidget[] or null }
*/
export function getAvailableFeedbackWidgets(onFinished?: FeedbackWidgetCallback): Promise<FeedbackWidgetResultObject>;
/**
* Present a chosen feedback widget
*
* @param {object} feedbackWidget - feedback Widget with id, type and name
* @param {string} closeButtonText - text for cancel/close button
* @param {callback} [widgetShownCallback] - Callback to be executed when feedback widget is displayed. This parameter is optional.
* @param {callback} [widgetClosedCallback] - Callback to be executed when feedback widget is closed. This parameter is optional.
*
* @return {ErrorObject} object {error: string or null}
*/
export function presentFeedbackWidget(feedbackWidget: FeedbackWidget, closeButtonText: string, widgetShownCallback: callback, widgetClosedCallback: callback): ErrorObject;
/**
* Get a feedback widget's data as an object.
* @param {FeedbackWidget} widgetInfo - widget to get data for. You should get this from 'getAvailableFeedbackWidgets' method.
* @param {WidgetInfoCallback} [onFinished] - returns (object retrievedWidgetData, error). This parameter is optional.
* @return {ResultObject} object {error: string, data: object or null}
*/
export function getFeedbackWidgetData(widgetInfo: FeedbackWidget, onFinished?: WidgetInfoCallback): Promise<ResultObject>;
/**
* Report manually for a feedback widget.
* @param {FeedbackWidget} widgetInfo - the widget you are targeting. You should get this from 'getAvailableFeedbackWidgets' method.
* @param {object} widgetData - data of that widget. You should get this from 'getFeedbackWidgetData' method.
* @param {RatingWidgetResult | object} widgetResult - Information you want to report.
* @return {ErrorObject} object {error: string}
*/
export function reportFeedbackWidgetManually(widgetInfo: FeedbackWidget, widgetData: object, widgetResult: RatingWidgetResult | object): Promise<ErrorObject>;
}
/**
* Countly Event Module
*/
namespace events {
/**
* Records an event.
* Event will be saved to the internal queue and will be sent to the server with the next trigger.
*
* @param {string} eventName - Name of the event (This will be displayed on the dashboard)
* @param {Segmentation} segmentation - Extra information to send with your event as key/value pairs
* @param {number} eventCount - Indicates how many times this event has happened (Default is 1)
* @param {number} eventSum - A numerical value that is attached to this event (Will be summed up on the dashboard for all events with the same name)
* @return {void}
*/
export function recordEvent(eventName: string, segmentation?: Segmentation, eventCount?: number, eventSum?: number): void;
/**
*
* Starts a Timed Event
* If 'endEvent' is not called (with the same event name) no event will be recorded.
*
* @param {string} eventName - name of the event
* @return {void}
*/
export function startEvent(eventName: string): void;
/**
*
* Ends a Timed Event if it is started.
* Should be called after startEvent.
* This will behave like recordEvent.
*
* @param {string} eventName - Name of the event (This will be displayed on the dashboard)
* @param {Segmentation} segmentation - Extra information to send with your event as key/value pairs
* @param {number} eventCount - Indicates how many times this event has happened (Default is 1)
* @param {number} eventSum - A numerical value that is attached to this event (Will be summed up on the dashboard for all events with the same name)
* @return {void} void
*/
export function endEvent(eventName: string, segmentation?: Segmentation, eventCount?: number, eventSum?: number): void;
/**
*
* Cancels a Timed Event if it is started.
*
* @param {string} eventName - name of the event
* @return {void}
*/
export function cancelEvent(eventName: string): void;
}
/**
* Initialize Countly
*
* @deprecated in 23.02.0 : use 'initWithConfig' instead of 'init'.
*
* @function Countly.init should be used to initialize countly
* @param {string} serverURL server url
* @param {string} appKey application key
* @param {string | null} deviceId device ID
*/
export function init(serverUrl: string, appKey: string, deviceId: string | null): Promise<void>;
/**
* Initialize Countly
*
* @function Countly.initWithConfig should be used to initialize countly with config
* @param {CountlyConfig} countlyConfig countly config object
*/
export function initWithConfig(countlyConfig: CountlyConfig): Promise<void>;
/**
*
* Checks if the sdk is initialized;
*
* @return {Promise<boolean>} if true, countly sdk has been initialized
*/
export function isInitialized(): Promise<boolean>;
/**
*
* Checks if the Countly SDK onStart function has been called
*
* @deprecated in 23.6.0. This will be removed.
*
* @return {Promise<string> | string} boolean or error message
*/
export function hasBeenCalledOnStart(): Promise<string> | string;
/**
*
* Used to send various types of event;
* @deprecated in 24.4.0 : use 'Countly.events.recordEvent' instead of this.
*
* @param {CountlyEventOptions} options event
* @return {string | void} error message or void
*/
export function sendEvent(options: CountlyEventOptions): string | void;
/**
* Record custom view to Countly.
*
* @param {string} recordView - name of the view
* @param {Segmentation} segments - allows to add optional segmentation,
* Supported data type for segments values are string, int, double and boolean
* @return {string | null} error message or void
*/
export function recordView(recordView: string, segments?: Segmentation): string | null;
/**
* Disable push notifications feature, by default it is enabled.
* Currently implemented for iOS only
* Should be called before Countly init
*
* @return {string | void} error message or void
*/
export function disablePushNotifications(): string | void;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.pushTokenType' instead of 'pushTokenType'.
*
* @param {string} tokenType - Token type
* @param {string} channelName - Channel name
* @param {string} channelDescription - Description for the channel
* Set messaging mode for push notifications
* Should be called before Countly init
*
* @return {string | void} error message or void
*/
export function pushTokenType(tokenType: string, channelName: string, channelDescription: string): Promise<string> | string;
/**
*
* Send push token
* @param {object} options - object containing the push token
* {token: string}
*
* @return {string | void} error message or void
*/
export function sendPushToken(options: { readonly token?: string }): void;
/**
* This method will ask for permission, enables push notification and send push token to countly server.
*
* @param {string} customSoundPath - name of custom sound for push notifications (Only for Android)
* Custom sound should be place at 'your_project_root/android/app/src/main/res/raw'
* Should be called after Countly init
*
* @return {string | void} error message or void
*/
export function askForNotificationPermission(customSoundPath?: string): string | void;
/**
*
* Set callback to receive push notifications
* @param {callback listener } theListener
* @return {NativeEventEmitter} event
*/
export function registerForNotification(theListener: (theNotification: string) => void): any; // The return type should be adjusted to the actual event subscription type
/**
* @deprecated in 23.02.0 : use 'countlyConfig.configureIntentRedirectionCheck' instead of 'configureIntentRedirectionCheck'.
*
* Configure intent redirection checks for push notification
* Should be called before Countly "askForNotificationPermission"
*
* @param {string[]} allowedIntentClassNames allowed intent class names
* @param {string[]} allowedIntentPackageNames allowed intent package names
* @param {boolean} useAdditionalIntentRedirectionChecks to check additional intent checks. It is by default its true
* @return {string | void} error message or void
*/
export function configureIntentRedirectionCheck(
allowedIntentClassNames?: string[],
allowedIntentPackageNames?: string[],
useAdditionalIntentRedirectionChecks?: boolean
): string | void;
/**
* @deprecated at 23.6.0 - Automatic sessions are handled by underlying SDK, this function will do nothing.
*
* Countly start for android
*
*/
export function start(): void;
/**
* @deprecated at 23.6.0 - Automatic sessions are handled by underlying SDK, this function will do nothing.
*
* Countly stop for android
*
*/
export function stop(): void;
/**
* Enable countly internal debugging logs
* Should be called before Countly init
*
* @deprecated in 20.04.6
*
* @function Countly.setLoggingEnabled should be used to enable/disable countly internal debugging logs
*/
export function enableLogging(): void;
/**
* Disable countly internal debugging logs
*
* @deprecated in 20.04.6
*
* @function Countly.setLoggingEnabled should be used to enable/disable countly internal debugging logs
*/
export function disableLogging(): void;
/**
* Set to true if you want to enable countly internal debugging logs
* Should be called before Countly init
*
* @param {[boolean = true]} enabled server url
*/
export function setLoggingEnabled(enabled?: boolean): void;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.setLocation' instead of 'setLocationInit'.
*
* Set user initial location
* Should be called before init
* @param {string | null} countryCode ISO Country code for the user's country
* @param {string | null} city Name of the user's city
* @param {string | null} location comma separate lat and lng values. For example, "56.42345,123.45325"
* @param {string | null} ipAddress IP address of user's
*/
export function setLocationInit(
countryCode: string | null,
city: string | null,
location: string | null,
ipAddress: string | null,
): void;
/**
*
* Set user location
* @param {string | null} countryCode ISO Country code for the user's country
* @param {string | null} city Name of the user's city
* @param {string | null} location comma separate lat and lng values. For example, "56.42345,123.45325"
* @param {string | null} ipAddress IP address of user's
* @return {string | void} error message or void
*/
export function setLocation(
countryCode: string | null,
city: string | null,
location: string | null,
ipAddress: string | null
): string | void;
/**
*
* Disable user location
*
* @return {string | void} error message or void
*/
export function disableLocation(): string | void;
/**
*
* Get currently used device Id.
* Should be called after Countly init
*
* @return {string} device id or error message
*/
export function getCurrentDeviceId(): Promise<string> | string;
/**
* Get currently used device Id type.
* Should be called after Countly init
*
* @return {DeviceIdType | null} deviceIdType or null
*/
export function getDeviceIDType(): Promise<DeviceIdType> | null;
/**
* Change the current device id
*
* @param {string} newDeviceID id new device id
* @param {boolean} onServer merge device id
* @return {string | void} error message or void
*/
export function changeDeviceId(newDeviceID: string, onServer: boolean): string | void;
/**
*
* Set to "true" if you want HTTP POST to be used for all requests
* Should be called before Countly init
* @param {boolean} forceHttp force http post for all requests. Default value is true
*/
export function setHttpPostForced(boolean?: boolean): void;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.enableCrashReporting' instead of 'enableCrashReporting'.
*
* Enable crash reporting to report unhandled crashes to Countly
* Should be called before Countly init
*/
export function enableCrashReporting(): void;
/**
*
* Add crash log for Countly
*
* @param {string} crashLog crash log
* @return {string | void} error message or void
*/
export function addCrashLog(crashLog: string): string | void;
/**
*
* Log exception for Countly
*
* @param {string} exception exception
* @param {boolean} nonfatal nonfatal
* @param {object} segments segments
* @return {string | void} error message or void
*/
export function logException(exception: string, nonfatal: boolean, segments: Record<string, any>): string | void;
/**
*
* Set custom crash segment for Countly
*
* @param {Map} segments segments
*/
export function setCustomCrashSegments(segments: Record<string, any>): void;
/**
*
* Start session tracking
*
* @return {string | void} error message or void
*/
export function startSession(): string | void;
/**
*
* End session tracking
*
* @return {string | void} error message or void
*/
export function endSession(): string | void;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.enableParameterTamperingProtection' instead of 'enableParameterTamperingProtection'.
*
* Set the optional salt to be used for calculating the checksum of requested data which will be sent with each request, using the &checksum field
* Should be called before Countly init
*
* @param {string} salt salt
* @return {string | void} error message or void
*/
export function enableParameterTamperingProtection(salt: string): string | void;
/**
*
* It will ensure that connection is made with one of the public keys specified
* Should be called before Countly init
*
* @return {string | void} error message or void
*/
export function pinnedCertificates(certificateName: string): string | void;
/**
*
* Start Event
* @deprecated in 24.4.0 : use 'Countly.events.startEvent' instead of this.
*
* @param {string} eventName name of event
* @return {string | void} error message or void
*/
export function startEvent(eventName: string): string | void;
/**
*
* Cancel Event
* @deprecated in 24.4.0 : use 'Countly.events.cancelEvent' instead of this.
*
* @param {string} eventName name of event
* @return {string | void} error message or void
*/
export function cancelEvent(eventName: string): string | void;
/**
*
* End Event
* @deprecated in 24.4.0 : use 'Countly.events.endEvent' instead of this.
*
* @param {string | object} options event options
* @return {string | void} error message or void
*/
export function endEvent(options: string | CountlyEventOptions): string | void;
/**
*
* Used to send user data
*
* @param {object} userData user data
* @return {string | void} error message or void
*/
export function setUserData(userData: CountlyUserData): string | Promise<void>;
namespace userData {
/**
*
* Set custom key and value pair for the current user.
*
* @param {string} keyName user property key
* @param {object} keyValue user property value
* @return {string | void} error message or void
*/
export function setProperty(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Increment custom user data by 1
*
* @param {string} keyName user property key
* @return {string | void} error message or void
*/
export function increment(keyName: string): Promise<void> | string;
/**
*
* Increment custom user data by a specified value
*
* @param {string} keyName user property key
* @param {string} keyValue value to increment user property by
* @return {string | void} error message or void
*/
export function incrementBy(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Multiply custom user data by a specified value
*
* @param {string} keyName user property key
* @param {string} keyValue value to multiply user property by
* @return {string | void} error message or void
*/
export function multiply(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Save the max value between current and provided value.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function saveMax(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Save the min value between current and provided value.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function saveMin(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Set the property value if it does not exist.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function setOnce(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Add value to custom property (array) if value does not exist within.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pushUniqueValue(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Add value to custom property (array).
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pushValue(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Remove value to custom property (array).
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pullValue(keyName: string, keyValue: any): Promise<void> | string;
}
namespace userDataBulk {
/**
*
* Custom key and value pairs for the current user.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {object} customAndPredefined custom key value pairs
* @return {string | void} error message or void
*/
export function setUserProperties(properties: object): Promise<void> | string;
/**
*
* Save user data and send to server.
*
* @return {string | void} error message or void
*/
export function save(): Promise<void>;
/**
*
* Set custom key and value pair for the current user.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName custom user data key
* @param {string} keyValue custom user data value
* @return {string | void} error message or void
*/
export function setProperty(keyName: string, keyValue: any): Promise<string> | string;
/**
*
* Increment custom user data by 1
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @return {string | void} error message or void
*/
export function increment(keyName: string): Promise<void> | string;
/**
*
* Increment custom user data by a specified value
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue value to increment user property by
* @return {string | void} error message or void
*/
export function incrementBy(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Multiply custom user data by a specified value
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue value to multiply user property by
* @return {string | void} error message or void
*/
export function multiply(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Save the max value between current and provided value.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function saveMax(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Save the min value between current and provided value.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function saveMin(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Set the property value if it does not exist.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function setOnce(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Add value to custom property (array) if value does not exist within.
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pushUniqueValue(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Add value to custom property (array).
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pushValue(keyName: string, keyValue: any): Promise<void> | string;
/**
*
* Remove value to custom property (array).
* Remember to call Countly.userDataBulk.save() after calling all userDataBulk methods to send the bulk data to server.
*
* @param {string} keyName user property key
* @param {string} keyValue user property value
* @return {string | void} error message or void
*/
export function pullValue(keyName: string, keyValue: any): Promise<void> | string;
}
/**
* @deprecated in 23.02.0 : use 'countlyConfig.setRequiresConsent' instead of 'setRequiresConsent'.
*
* Set that consent should be required for features to work.
* Should be called before Countly init
*
* @param {boolean} flag if true, consent is required for features to work.
*/
export function setRequiresConsent(flag: boolean): void;
/**
*
* Give consent for some features
* Should be called after Countly init
*
* @param {string[] | string} args list of consents
* @return {string | void} error message or void
*/
export function giveConsent(args: string[] | string): string | void;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.giveConsent' instead of 'giveConsentInit'.
*
* Give consent for specific features before init.
* Should be called after Countly init
*
* @param {string[] | string} args list of consents
*/
export function giveConsentInit(args: string[] | string): Promise<void>;
/**
*
* Remove consent for some features
* Should be called after Countly init
*
* @param {string[] | string} args list of consents
* @return {string | void} error message or void
*/
export function removeConsent(args: string[] | string): string | void;
/**
*
* Give consent for all features
* Should be called after Countly init
*
* @return {string | void} error message or void
*/
export function giveAllConsent(): string | void;
/**
*
* Remove consent for all features
* Should be called after Countly init
*
* @return {string | void} error message or void
*/
export function removeAllConsent(): string | void;
/**
*
* Replaces all stored Remote Config values with new values from server.
*
* @param {function} callback function to be called after fetching values.
* @return {string | void} error message or void
*/
export function remoteConfigUpdate(callback: CountlyCallback): string | void;
/**
*
* Replace specific Remote Config key value pairs with new values from server.
*
* @param {string[]} keyNames array of keys to replace.
* @param {function} callback function to be called after fetching values.
* @return {string | void} error message or void
*/
export function updateRemoteConfigForKeysOnly(keyNames: readonly string[], callback: CountlyCallback): string | void;
/**
*
* Replace all except specific Remote Config key value pairs with new values from server.
*
* @param {string[]} keyNames array of keys to skip.
* @param {function} callback function to be called after fetching values.
* @return {string | void} error message or void
*/
export function updateRemoteConfigExceptKeys(keyNames: readonly string[], callback: CountlyCallback): string | void;
/**
*
* Replace Remote Config key value for a specific key with new values from server.
* This takes in a callback that is called after new values are fetched.
*
* @param {string} keyNames key to fetch.
* @param {function} callback function to be called after fetching new values.
* @return {string | void} error message or void
*/
export function getRemoteConfigValueForKey(keyName: string, callback: (value: any) => void): string | void;
/**
*
* Replace Remote Config key value for a specific key with new values from server. This returns a promise that can be listened to.
*
* @param {string} keyName key to fetch.
* @return {string | promise} error message or promise
*/
export function getRemoteConfigValueForKeyP(keyName: string): string | Promise<any>;
/**
*
* Clear all Remote Config values downloaded from the server.
*
* @return {string | promise} error message or promise
*/
export function remoteConfigClearValues(): string | Promise<string>;
/**
* @deprecated in 23.02.0 : use 'countlyConfig.setStarRatingDialogTexts' instead of 'setStarRatingDialogTexts'.
*
* Set's the text's for the different fields in the star rating dialog. Set value null if for some field you want to keep the old value
*
* @param {string} starRatingTextTitle - dialog's title text (Only for Android)
* @param {string} starRatingTextMessage - dialog's message text
* @param {string} starRatingTextDismiss - dialog's dismiss buttons text (Only for Android)
* @return {string | void} error message or void
*/
export function setStarRatingDialogTexts(
starRatingTextTitle: string,
starRatingTextMessage: string,
starRatingTextDismiss: string,
): void;
/**
*
* For getting brief feedback from your users to be displayed on the
Countly dashboard.
*
* @param {function} callback function to be called after it completes.
* @return {string | void} error message or void
*/
export function showStarRating(callback?: CountlyCallback): string | void;
/**
* Present a Rating Popup using rating widget Id
*
* @param {string} widgetId - id of rating widget to present
* @param {string} closeButtonText - text for cancel/close button
* @param {callback listener} [ratingWidgetCallback] This parameter is optional.
* @return {string | void} error message or void
*/
export function presentRatingWidgetWithID(widgetId: string, closeButtonText: string, ratingWidgetCallback?: CountlyErrorCallback): string | void;
/**
* Get a list of available feedback widgets as array of object to handle multiple widgets of same type.
* @deprecated in 23.8.0 : use 'Countly.feedback.getAvailableFeedbackWidgets' instead of 'getFeedbackWidgets'.
* @param {callback listener} [onFinished] - returns (retrievedWidgets, error). This parameter is optional.
* @return {string | []} error message or array of feedback widgets
*/
export function getFeedbackWidgets(onFinished?: FeedbackWidgetCallback): Promise<any> | string;
/**
* Present a chosen feedback widget
*
* @deprecated in 23.8.0 : use 'Countly.feedback.presentFeedbackWidget' instead of 'presentFeedbackWidgetObject'.
* @param {FeedbackWidget} feedbackWidget - feeback Widget with id, type and name
* @param {string} closeButtonText - text for cancel/close button
* @param {callback listener} [widgetShownCallback] - Callback to be executed when feedback widget is displayed. This parameter is optional.
* @param {callback listener} [widgetClosedCallback] - Callback to be executed when feedback widget is closed. This parameter is optional.
*
* @return {string | void} error message or void
*/
export function presentFeedbackWidgetObject(
feedbackWidget: FeedbackWidget,
closeButtonText: string,
widgetShownCallback: WidgetCallback,
widgetClosedCallback: WidgetCallback
): string | void;
/**
*
* Events get grouped together and are sent either every minute or after the unsent event count reaches a threshold. By default it is 10
* Should be called before Countly init
*
* @param {number} size - event count
*/
export function setEventSendThreshold(size: number): void;
/**
*
* Measure and record time taken by any operation.
*
* @param {string} traceKey name of trace
* @return {string | void} error message or void
*/
export function startTrace(traceKey: string): string | void;
/**
*
* Cancel custom trace.
*
* @param {string} traceKey name of trace
* @return {string | void} error message or void
*/
export function cancelTrace(traceKey: string): string | void;
/**
*
* Cancel all custom traces.
*
* @return {string | void} error message or void
*/
export function clearAllTraces(): string | void;
/**
*
* End a custom trace.
*
* @param {string} traceKey name of trace
* @param {object} customMetric metric with key/value pair
* @return {string | void} error message or void
*/
export function endTrace(traceKey: string, customMetric?: TraceCustomMetric): string | void;
/**
*
* Manually record a custom trace
*
* @param {string} networkTraceKey name of trace
* @param {number} responseCode HTTP status code of the received
response
* @param {number} requestPayloadSize Size of the request's
payload in bytes
* @param {number} responsePayloadSize Size
of the received response's payload in bytes
* @param {number} startTime UNIX timestamp in milliseconds for
the starting time of the request
* @param {number} endTime UNIX timestamp in milliseconds for
the ending time of the request