forked from mablack/cordova-diagnostic-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 361
/
cordova.plugins.diagnostic.d.ts
1259 lines (1136 loc) · 37.3 KB
/
cordova.plugins.diagnostic.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
// Type definitions for cordova.plugins.diagnostic v4
// Project: https://github.com/dpa99c/cordova-diagnostic-plugin
// Definitions by: Dave Alden <https://github.com/dpa99c/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="cordova" />
/**
* Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
*/
interface Diagnostic {
/**
* ANDROID ONLY
* "Dangerous" permissions that need to be requested at run-time (Android 6.0/API 23 and above)
* See http://developer.android.com/guide/topics/security/permissions.html#perm-groups
* @type {Object}
*/
permission: {
"ACCEPT_HANDOVER": "ACCEPT_HANDOVER";
"ACCESS_BACKGROUND_LOCATION": "ACCESS_BACKGROUND_LOCATION";
"ACCESS_COARSE_LOCATION": "ACCESS_COARSE_LOCATION";
"ACCESS_FINE_LOCATION": "ACCESS_FINE_LOCATION";
"ACCESS_MEDIA_LOCATION": "ACCESS_MEDIA_LOCATION";
"ACTIVITY_RECOGNITION": "ACTIVITY_RECOGNITION";
"ADD_VOICEMAIL": "ADD_VOICEMAIL";
"ANSWER_PHONE_CALLS": "ANSWER_PHONE_CALLS";
"BLUETOOTH_ADVERTISE": "BLUETOOTH_ADVERTISE";
"BLUETOOTH_CONNECT": "BLUETOOTH_CONNECT";
"BLUETOOTH_SCAN": "BLUETOOTH_SCAN";
"BODY_SENSORS": "BODY_SENSORS";
"BODY_SENSORS_BACKGROUND": "BODY_SENSORS_BACKGROUND";
"CALL_PHONE": "CALL_PHONE";
"CAMERA": "CAMERA";
"GET_ACCOUNTS": "GET_ACCOUNTS";
"NEARBY_WIFI_DEVICES": "NEARBY_WIFI_DEVICES";
"POST_NOTIFICATIONS": "POST_NOTIFICATIONS";
"PROCESS_OUTGOING_CALLS": "PROCESS_OUTGOING_CALLS";
"READ_CALENDAR": "READ_CALENDAR";
"READ_CALL_LOG": "READ_CALL_LOG";
"READ_CONTACTS": "READ_CONTACTS";
"READ_EXTERNAL_STORAGE": "READ_EXTERNAL_STORAGE";
"READ_MEDIA_AUDIO": "READ_MEDIA_AUDIO";
"READ_MEDIA_IMAGES": "READ_MEDIA_IMAGES";
"READ_MEDIA_VIDEO": "READ_MEDIA_VIDEO";
"READ_PHONE_NUMBERS": "READ_PHONE_NUMBERS";
"READ_PHONE_STATE": "READ_PHONE_STATE";
"READ_SMS": "READ_SMS";
"RECEIVE_MMS": "RECEIVE_MMS";
"RECEIVE_SMS": "RECEIVE_SMS";
"RECEIVE_WAP_PUSH": "RECEIVE_WAP_PUSH";
"RECORD_AUDIO": "RECORD_AUDIO";
"SEND_SMS": "SEND_SMS";
"USE_SIP": "USE_SIP";
"UWB_RANGING": "UWB_RANGING";
"WRITE_CALENDAR": "WRITE_CALENDAR";
"WRITE_CALL_LOG": "WRITE_CALL_LOG";
"WRITE_CONTACTS": "WRITE_CONTACTS";
"WRITE_EXTERNAL_STORAGE": "WRITE_EXTERNAL_STORAGE";
};
/**
* Constants for requesting and reporting the various permission states.
* @type {Object}
*/
permissionStatus: {
// Android only
"DENIED_ONCE": "DENIED_ONCE";
// iOS only
"RESTRICTED": "restricted";
"EPHEMERAL": "ephemeral";
"PROVISIONAL": "provisional";
// Both iOS and Android
"GRANTED": "authorized"|"GRANTED";
"GRANTED_WHEN_IN_USE": "authorized_when_in_use";
"NOT_REQUESTED": "not_determined"|"NOT_REQUESTED";
"DENIED_ALWAYS": "denied_always"|"DENIED_ALWAYS";
};
/**
* iOS ONLY
* Constants for requesting and reporting the various motion states.
* @type {Object}
*/
motionStatus: {
UNKNOWN: "unknown";
NOT_REQUESTED: "not_requested";
DENIED_ALWAYS: "denied_always";
RESTRICTED: "restricted";
GRANTED: "authorized";
NOT_AVAILABLE: "not_available";
NOT_DETERMINED: "not_determined";
};
/**
* Location authorization mode
* @type {Object}
*/
locationAuthorizationMode: {
"ALWAYS": "always";
"WHEN_IN_USE": "when_in_use";
};
/**
* Location accuracy authorization
* @type {Object}
*/
locationAccuracyAuthorization: {
"FULL": "full";
"REDUCED": "reduced";
};
/**
* ANDROID ONLY
* Constants for the various location modes on Android.
* @type {Object}
*/
locationMode: {
"HIGH_ACCURACY": "high_accuracy";
"DEVICE_ONLY": "device_only";
"BATTERY_SAVING": "battery_saving";
"LOCATION_OFF": "location_off";
};
/**
* Constants for the various Bluetooth hardware states.
* @type {Object}
*/
bluetoothState: {
// iOS only
"RESETTING": "resetting";
"UNSUPPORTED": "unsupported";
"UNAUTHORIZED": "unauthorized";
// Android only
"POWERING_OFF": "powering_off";
"POWERING_ON": "powering_on";
// Both iOS and Android
"UNKNOWN": "unknown";
"POWERED_OFF": "powered_off";
"POWERED_ON": "powered_on";
};
/**
* ANDROID ONLY
* Constants for the various NFC power states.
* @type {Object}
*/
NFCState: {
"UNKNOWN": "unknown";
"POWERED_OFF": "powered_off";
"POWERING_ON": "powering_on";
"POWERED_ON": "powered_on";
"POWERING_OFF": "powering_off";
};
/**
* ANDROID ONLY
* Constants for the various CPU architectures.
* @type {Object}
*/
cpuArchitecture: {
// Android only
MIPS: "MIPS";
MIPS_64: "MIPS_64";
// Both iOS and Android
UNKNOWN: "unknown";
ARMv6: "ARMv6";
ARMv7: "ARMv7";
ARMv8: "ARMv8";
X86: "X86";
X86_64: "X86_64";
};
/**
* iOS ONLY
* Constants for requesting/reporting the various types of remote notification permission types on iOS devices.
* @type {Object}
*/
remoteNotificationType: {
ALERT: "alert";
SOUND: "sound";
BADGE: "badge";
};
/**
* Checks if app is able to access device location.
* @param successCallback
* @param errorCallback
*/
isLocationAvailable: (
successCallback: (available: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if Wifi is available.
* On iOS this returns true if the device is connected to a network by WiFi.
* On Android this returns true if the WiFi setting is set to enabled, and is the same as isWifiEnabled()
* @param successCallback
* @param errorCallback
*/
isWifiAvailable: (
successCallback: (available: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if camera is available.
* On Android & iOS this returns true if the device has a camera AND the application is authorized to use it.
* @param successCallbackOrParams
* @param errorCallback
* @param externalStorageOrParams
*/
isCameraAvailable: (
successCallbackOrParams?: (available: boolean) => void|{},
errorCallback?: (error: string) => void,
externalStorageOrParams?: boolean|{}
) => void;
/**
* Checks if Bluetooth is available to the app.
* Returns true if the device has Bluetooth capabilities AND if Bluetooth setting is switched on (same on Android, iOS)
* @param successCallback
* @param errorCallback
*/
isBluetoothAvailable: (
successCallback: (available: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Displays the device location settings to allow user to enable location services/change location mode.
*/
switchToLocationSettings?: () => void;
/**
* ANDROID ONLY
* Displays mobile settings to allow user to enable mobile data.
*/
switchToMobileDataSettings?: () => void;
/**
* ANDROID ONLY
* Displays Bluetooth settings to allow user to enable Bluetooth.
*/
switchToBluetoothSettings?: () => void;
/**
* ANDROID ONLY
* Displays WiFi settings to allow user to enable WiFi.
*/
switchToWifiSettings?: () => void;
/**
* ANDROID ONLY
* Returns true if the WiFi setting is set to enabled, and is the same as isWifiAvailable()
* @param successCallback
* @param errorCallback
*/
isWifiEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Enables/disables WiFi on the device.
* @param successCallback
* @param errorCallback
* @param state
*/
setWifiState?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void,
state: boolean
) => void;
/**
* ANDROID ONLY
* Enables/disables Bluetooth on the device.
* @param successCallback
* @param errorCallback
* @param state
*/
setBluetoothState?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void,
state: boolean
) => void;
/**
* Enables debug mode, which logs native plugin debug messages to the native and JS consoles.
* Debug mode is initially disabled on plugin initialisation.
*/
enableDebug?: (
successCallback: () => void
) => void;
/**
* Returns true if the current build is a debug build.
* @param successCallback
* @param errorCallback
*/
isDebugBuild?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
*
* Checks if airplane mode is enabled on device.
*
* @param successCallback
* @param errorCallback
*/
isAirplaneModeEnabled?: (
successCallback: () => boolean,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
*
* Checks if mobile data is enabled on device.
*
* @param successCallback
* @param errorCallback
*/
isMobileDataEnabled?: (
successCallback: () => boolean,
errorCallback: (error: string) => void
) => void;
/**
* IOS ONLY
*
* Checks if mobile data is authorized for this app.
*
* @param successCallback
* @param errorCallback
*/
isMobileDataAuthorized?: (
successCallback: () => boolean,
errorCallback: (error: string) => void
) => void;
/**
*
* Checks if accessibility mode is enabled on device.
*
* @param successCallback
* @param errorCallback
*/
isAccessibilityModeEnabled?: (
successCallback: () => boolean,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
*
* Checks if touch exploration of accessibility mode is enabled on device.
*
* @param successCallback
* @param errorCallback
*/
isTouchExplorationEnabled?: (
successCallback: () => boolean,
errorCallback: (error: string) => void
) => void;
/**
* Returns details of the OS of the device on which the app is currently running
*
* @param successCallback
* @param errorCallback
*/
getDeviceOSVersion?: (
successCallback: (details: {version: string, apiLevel: number, apiName: string}) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns details of the SDK levels used to build the app.
*
* @param successCallback
* @param errorCallback
*/
getBuildOSVersion?: (
successCallback: (details: {targetApiLevel: number, targetApiName: string, minApiLevel: number, minApiName: string}) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns true if the device setting for location is on.
* On Android this returns true if Location Mode is switched on.
* On iOS this returns true if Location Services is switched on.
* @param successCallback
* @param errorCallback
*/
isLocationEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if the application is authorized to use location.
* @param successCallback
* @param errorCallback
*/
isLocationAuthorized?: (
successCallback: (authorized: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the location authorization status for the application.
* @param successCallback
* @param errorCallback
*/
getLocationAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Android ONLY
* Returns the individual location authorization status for each type of location access (FINE, COARSE and BACKGROUND).
* @param successCallback
* @param errorCallback
*/
getLocationAuthorizationStatuses?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Requests location authorization for the application.
* @param successCallback
* @param errorCallback
* @param mode - (optional / iOS & Android >= 10) location authorization mode specified as a locationAuthorizationMode constant. If not specified, defaults to WHEN_IN_USE.
* @param accuracy
*/
requestLocationAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void,
mode?: string,
accuracy?: string
) => void;
/**
* Returns the location accuracy authorization for the application.
* @param successCallback
* @param errorCallback
*/
getLocationAccuracyAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* iOS ONLY
* Requests temporary access to full location accuracy for the application.
* @param purpose
* @param successCallback
* @param errorCallback
*/
requestTemporaryFullAccuracyAuthorization?: (
purpose: string,
successCallback?: (status: string) => void,
errorCallback?: (error: string) => void
) => void;
/**
* Checks if camera hardware is present on device.
* @param successCallback
* @param errorCallback
*/
isCameraPresent?: (
successCallback: (present: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if the application is authorized to use the camera.
* @param successCallback
* @param errorCallback
* @param externalStorageOrParams
*/
isCameraAuthorized?: (
successCallbackOrParams?: (authorized: boolean) => void|{},
errorCallback?: (error: string) => void,
externalStorageOrParams?: boolean|{}
) => void;
/**
* Returns the camera authorization status for the application.
* @param successCallback
* @param errorCallback
* @param externalStorageOrParams
*/
getCameraAuthorizationStatus?: (
successCallbackOrParams?: (status: string) => void|{},
errorCallback?: (error: string) => void,
externalStorageOrParams?: boolean|{}
) => void;
/**
* Requests camera authorization for the application.
* @param successCallback
* @param errorCallback
* @param externalStorageOrParams
*/
requestCameraAuthorization?: (
successCallbackOrParams?: (status: string) => void|{},
errorCallback?: (error: string) => void,
externalStorageOrParams?: boolean|{}
) => void;
/**
* Checks if the application is authorized to use the microphone.
* @param successCallback
* @param errorCallback
*/
isMicrophoneAuthorized?: (
successCallback: (authorized: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the microphone authorization status for the application.
* @param successCallback
* @param errorCallback
*/
getMicrophoneAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Requests microphone authorization for the application.
* @param successCallback
* @param errorCallback
*/
requestMicrophoneAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if the application is authorized to use contacts (address book).
* @param successCallback
* @param errorCallback
*/
isContactsAuthorized?: (
successCallback: (authorized: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the contacts authorization status for the application.
* @param successCallback
* @param errorCallback
*/
getContactsAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Requests contacts authorization for the application.
* @param successCallback
* @param errorCallback
*/
requestContactsAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Checks if the application is authorized to use the calendar.
* @param successCallback
* @param errorCallback
*/
isCalendarAuthorized?: (
successCallback: (authorized: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the calendar authorization status for the application.
* @param successCallback
* @param errorCallback
*/
getCalendarAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Requests calendar authorization for the application.
* @param successCallback
* @param errorCallback
*/
requestCalendarAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Opens settings page for this app.
* On Android, this opens the "App Info" page in the Settings app.
* On iOS, this opens the app settings page in the Settings app.
*/
switchToSettings?: (
successCallback: () => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the state of Bluetooth on the device.
* @param successCallback
* @param errorCallback
*/
getBluetoothState?: (
successCallback: (state: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Registers a function to be called when a change in Bluetooth state occurs. Pass in a falsey value to de-register the currently registered function.
* @param successCallback
*/
registerBluetoothStateChangeHandler?: (
successCallback?: (state: string|null) => void
) => void;
/**
* Registers a function to be called when a change in Location state occurs. Pass in a falsey value to de-register the currently registered function.
* On Android, this occurs when the Location Mode is changed.
* On iOS, this occurs when location authorization status is changed. This can be triggered either by the user's response to a location permission authorization dialog, by the user turning on/off Location Services, or by the user changing the Location authorization state specifically for your app.
* @param successCallback
*/
registerLocationStateChangeHandler?: (
successCallback?: (state: string) => void
) => void;
/**
* iOS ONLY
* Registers a function to be called when a change in location accuracy authorization occurs.
* @param successCallback
*/
registerLocationAccuracyAuthorizationChangeHandler?: (
successCallback: (state: string) => void
) => void;
/**
* ANDROID ONLY
* Restarts the application.
* By default, a "warm" restart will be performed in which the main Cordova activity is immediately restarted, causing the Webview instance to be recreated.
* However, if the `cold` parameter is set to true, then the application will be "cold" restarted, meaning a system exit will be performed, causing the entire application to be restarted.
* This is useful if you want to fully reset the native application state but will cause the application to briefly disappear and re-appear.
*
* Note: There is no successCallback() since if the operation is successful, the application will restart immediately before any success callback can be applied.
* @param {(error: string) => void} errorCallback
* @param {boolean} cold
*/
restart?: (
errorCallback: (error: string) => void,
cold: boolean
) => void;
/**
* Returns CPU architecture of the current device.
* @param successCallback
* @param errorCallback
*/
getArchitecture?: (
successCallback: (state: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the current battery level of the device as a percentage.
* @param successCallback
* @param errorCallback
*/
getCurrentBatteryLevel?: (
successCallback: (level: number) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if high-accuracy locations are available to the app from GPS hardware.
* Returns true if Location mode is enabled and is set to "Device only" or "High accuracy" AND if the app is authorised to use location.
* @param successCallback
* @param errorCallback
*/
isGpsLocationAvailable?: (
successCallback: (available: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device location setting is set to return high-accuracy locations from GPS hardware.
* Returns true if Location mode is enabled and is set to either Device only or High accuracy
* @param successCallback
* @param errorCallback
*/
isGpsLocationEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if low-accuracy locations are available to the app from network triangulation/WiFi access points.
* Returns true if Location mode is enabled and is set to "Battery saving" or "High accuracy" AND if the app is authorised to use location.
* @param successCallback
* @param errorCallback
*/
isNetworkLocationAvailable?: (
successCallback: (available: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device location setting is set to return high-accuracy locations from GPS hardware.
* Returns true if Location mode is enabled and is set to either Battery saving or High accuracy
* @param successCallback
* @param errorCallback
*/
isNetworkLocationEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device data roaming setting is enabled.
* Returns true if data roaming is enabled.
* @param successCallback
* @param errorCallback
*/
isDataRoamingEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Returns the current location mode setting for the device.
* @param successCallback
* @param errorCallback
*/
getLocationMode?: (
successCallback: (mode: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Returns the current authorisation status for a given permission.
* @param successCallback
* @param errorCallback
* @param permission
*/
getPermissionAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void,
permission: string
) => void;
/**
* ANDROID ONLY
* Returns the current authorisation status for multiple permissions.
* @param successCallback
* @param errorCallback
* @param permissions
*/
getPermissionsAuthorizationStatus?: (
successCallback: (status: Record<string,string>) => void,
errorCallback: (error: string) => void,
permissions: string[]
) => void;
/**
* ANDROID ONLY
* Requests app to be granted authorisation for a runtime permission.
* @param successCallback
* @param errorCallback
* @param permission
*/
requestRuntimePermission?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void,
permission: string
) => void;
/**
* ANDROID ONLY
* Requests app to be granted authorisation for multiple runtime permissions.
* @param successCallback
* @param errorCallback
* @param permissions
*/
requestRuntimePermissions?: (
successCallback: (status: Record<string,string>) => void,
errorCallback: (error: string) => void,
permissions: string[]
) => void;
/**
* ANDROID ONLY
* Indicates if the plugin is currently requesting a runtime permission via the native API.
*/
isRequestingPermission?: () => boolean;
/**
* ANDROID ONLY
* Registers a function to be called when a runtime permission request has completed. Pass in a falsey value to de-register the currently registered function.
* @param successCallback
*/
registerPermissionRequestCompleteHandler?: (
successCallback?: (statuses: any) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device setting for Bluetooth is switched on.
* @param successCallback
* @param errorCallback
*/
isBluetoothEnabled?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device has Bluetooth capabilities.
* @param successCallback
* @param errorCallback
*/
hasBluetoothSupport?: (
successCallback: (supported: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device has Bluetooth Low Energy (LE) capabilities.
* @param successCallback
* @param errorCallback
*/
hasBluetoothLESupport?: (
successCallback: (supported: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device supports Bluetooth Low Energy (LE) Peripheral mode.
* @param successCallback
* @param errorCallback
*/
hasBluetoothLEPeripheralSupport?: (
successCallback: (supported: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* Returns the Bluetooth authorization status of the application on the device.
* @param successCallback
* @param errorCallback
*/
getBluetoothAuthorizationStatus: (
successCallback: (statuses: [{string: boolean}]) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Returns the authorization statuses for various Bluetooth run-time permissions on Android 12+ / API 31+
* On Android 11 / API 30 and below, all will be returned as GRANTED if the manifest has BLUETOOTH since they are implicitly granted at build-time.
* @param successCallback
* @param errorCallback
*/
getBluetoothAuthorizationStatuses?: (
successCallback: (statuses: [{string: boolean}]) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device setting for Airplane Mode is switched on.
* @param successCallback
* @param errorCallback
*/
isAirplaneModeOn?: (
successCallback: (enabled: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the application is authorized to use external storage.
* @param successCallback
* @param errorCallback
*/
isExternalStorageAuthorized?: (
successCallback: (authorized: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Returns the authorisation status for runtime permission to use the external storage.
* @param successCallback
* @param errorCallback
*/
getExternalStorageAuthorizationStatus?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Requests authorisation for runtime permission to use the external storage.
* @param successCallback
* @param errorCallback
*/
requestExternalStorageAuthorization?: (
successCallback: (status: string) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Returns details of external SD card(s): absolute path, is writable, free space
* @param successCallback
* @param errorCallback
*/
getExternalSdCardDetails?: (
successCallback: (status: any) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if NFC hardware is present on device.
* @param successCallback
* @param errorCallback
*/
isNFCPresent?: (
successCallback: (present: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if the device setting for NFC is switched on.
* @param successCallback
* @param errorCallback
*/
isNFCEnabled?: (
successCallback: (present: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**
* ANDROID ONLY
* Checks if NFC is available to the app.
* @param successCallback
* @param errorCallback
*/
isNFCAvailable?: (
successCallback: (present: boolean) => void,
errorCallback: (error: string) => void
) => void;
/**