@rnpack/utils 0.1.0 → 0.1.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.
Files changed (67) hide show
  1. package/lib/commonjs/constants/index.js +28 -0
  2. package/lib/commonjs/constants/index.js.map +1 -0
  3. package/lib/commonjs/constants/permissions.js +20 -0
  4. package/lib/commonjs/constants/permissions.js.map +1 -0
  5. package/lib/commonjs/constants/settings.js +17 -0
  6. package/lib/commonjs/constants/settings.js.map +1 -0
  7. package/lib/commonjs/index.js +22 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/types/index.d.js +17 -0
  10. package/lib/commonjs/types/index.d.js.map +1 -0
  11. package/lib/commonjs/types/settings.d.js +2 -0
  12. package/lib/commonjs/types/settings.d.js.map +1 -0
  13. package/lib/commonjs/utils/index.js +22 -0
  14. package/lib/commonjs/utils/index.js.map +1 -1
  15. package/lib/commonjs/utils/permissions.js +55 -0
  16. package/lib/commonjs/utils/permissions.js.map +1 -0
  17. package/lib/commonjs/utils/settings.js +100 -0
  18. package/lib/commonjs/utils/settings.js.map +1 -0
  19. package/lib/commonjs/utils/string.js +5 -4
  20. package/lib/commonjs/utils/string.js.map +1 -1
  21. package/lib/module/constants/index.js +3 -0
  22. package/lib/module/constants/index.js.map +1 -0
  23. package/lib/module/constants/permissions.js +15 -0
  24. package/lib/module/constants/permissions.js.map +1 -0
  25. package/lib/module/constants/settings.js +12 -0
  26. package/lib/module/constants/settings.js.map +1 -0
  27. package/lib/module/index.js +2 -0
  28. package/lib/module/index.js.map +1 -1
  29. package/lib/module/types/index.d.js +2 -0
  30. package/lib/module/types/index.d.js.map +1 -0
  31. package/lib/module/types/settings.d.js +2 -0
  32. package/lib/module/types/settings.d.js.map +1 -0
  33. package/lib/module/utils/index.js +2 -0
  34. package/lib/module/utils/index.js.map +1 -1
  35. package/lib/module/utils/permissions.js +42 -0
  36. package/lib/module/utils/permissions.js.map +1 -0
  37. package/lib/module/utils/settings.js +87 -0
  38. package/lib/module/utils/settings.js.map +1 -0
  39. package/lib/module/utils/string.js +3 -2
  40. package/lib/module/utils/string.js.map +1 -1
  41. package/lib/typescript/src/constants/index.d.ts +3 -0
  42. package/lib/typescript/src/constants/index.d.ts.map +1 -0
  43. package/lib/typescript/src/constants/permissions.d.ts +14 -0
  44. package/lib/typescript/src/constants/permissions.d.ts.map +1 -0
  45. package/lib/typescript/src/constants/settings.d.ts +12 -0
  46. package/lib/typescript/src/constants/settings.d.ts.map +1 -0
  47. package/lib/typescript/src/index.d.ts +2 -0
  48. package/lib/typescript/src/index.d.ts.map +1 -1
  49. package/lib/typescript/src/utils/index.d.ts +2 -0
  50. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  51. package/lib/typescript/src/utils/permissions.d.ts +12 -0
  52. package/lib/typescript/src/utils/permissions.d.ts.map +1 -0
  53. package/lib/typescript/src/utils/settings.d.ts +11 -0
  54. package/lib/typescript/src/utils/settings.d.ts.map +1 -0
  55. package/lib/typescript/src/utils/string.d.ts +2 -2
  56. package/lib/typescript/src/utils/string.d.ts.map +1 -1
  57. package/package.json +3 -2
  58. package/src/constants/index.ts +2 -0
  59. package/src/constants/permissions.ts +16 -0
  60. package/src/constants/settings.ts +12 -0
  61. package/src/index.tsx +2 -0
  62. package/src/types/index.d.ts +1 -0
  63. package/src/types/settings.d.ts +6 -0
  64. package/src/utils/index.ts +2 -0
  65. package/src/utils/permissions.ts +88 -0
  66. package/src/utils/settings.tsx +124 -0
  67. package/src/utils/string.tsx +4 -2
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _settings = require("./settings.js");
7
+ Object.keys(_settings).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _settings[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _settings[key];
14
+ }
15
+ });
16
+ });
17
+ var _permissions = require("./permissions.js");
18
+ Object.keys(_permissions).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _permissions[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _permissions[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_settings","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_permissions"],"sourceRoot":"../../../src","sources":["constants/index.ts"],"mappings":";;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.permissions = void 0;
7
+ var _reactNative = require("react-native");
8
+ const permissions = exports.permissions = {
9
+ android: {
10
+ bluetooth: {
11
+ scan: _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
12
+ connect: _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT
13
+ },
14
+ location: {
15
+ fine: _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
16
+ coarse: _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION
17
+ }
18
+ }
19
+ };
20
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","permissions","exports","android","bluetooth","scan","PermissionsAndroid","PERMISSIONS","BLUETOOTH_SCAN","connect","BLUETOOTH_CONNECT","location","fine","ACCESS_FINE_LOCATION","coarse","ACCESS_COARSE_LOCATION"],"sourceRoot":"../../../src","sources":["constants/permissions.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAClBE,OAAO,EAAE;IACPC,SAAS,EAAE;MACTC,IAAI,EAAEC,+BAAkB,CAACC,WAAW,CAACC,cAAc;MACnDC,OAAO,EAAEH,+BAAkB,CAACC,WAAW,CAACG;IAC1C,CAAC;IACDC,QAAQ,EAAE;MACRC,IAAI,EAAEN,+BAAkB,CAACC,WAAW,CAACM,oBAAoB;MACzDC,MAAM,EAAER,+BAAkB,CAACC,WAAW,CAACQ;IACzC;EACF;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.settings = void 0;
7
+ const settings = exports.settings = {
8
+ android: {
9
+ bluetooth: 'android.settings.BLUETOOTH_SETTINGS',
10
+ location: 'android.settings.LOCATION_SOURCE_SETTINGS'
11
+ },
12
+ ios: {
13
+ bluetooth: 'App-Prefs:Bluetooth',
14
+ location: 'App-Prefs:Privacy&path=LOCATION'
15
+ }
16
+ };
17
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["settings","exports","android","bluetooth","location","ios"],"sourceRoot":"../../../src","sources":["constants/settings.ts"],"mappings":";;;;;;AAAA,MAAMA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG;EACfE,OAAO,EAAE;IACPC,SAAS,EAAE,qCAAqC;IAChDC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHF,SAAS,EAAE,qBAAqB;IAChCC,QAAQ,EAAE;EACZ;AACF,CAAC","ignoreList":[]}
@@ -25,4 +25,26 @@ Object.keys(_index2).forEach(function (key) {
25
25
  }
26
26
  });
27
27
  });
28
+ var _index3 = require("./constants/index.js");
29
+ Object.keys(_index3).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _index3[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _index3[key];
36
+ }
37
+ });
38
+ });
39
+ var _types = require("./types");
40
+ Object.keys(_types).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _types[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _types[key];
47
+ }
48
+ });
49
+ });
28
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_index2"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_index","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_index2","_index3","_types"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,OAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,OAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,OAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,OAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,MAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,MAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,MAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,MAAA,CAAAP,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _settings = require("./settings");
7
+ Object.keys(_settings).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _settings[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _settings[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_settings","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["types/index.d.ts"],"mappings":";;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=settings.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/settings.d.ts"],"mappings":"","ignoreList":[]}
@@ -47,4 +47,26 @@ Object.keys(_responsive).forEach(function (key) {
47
47
  }
48
48
  });
49
49
  });
50
+ var _settings = require("./settings.js");
51
+ Object.keys(_settings).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _settings[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _settings[key];
58
+ }
59
+ });
60
+ });
61
+ var _permissions = require("./permissions.js");
62
+ Object.keys(_permissions).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _permissions[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _permissions[key];
69
+ }
70
+ });
71
+ });
50
72
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_string","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_object","_utils","_responsive"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA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K,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,WAAA,CAAAP,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_string","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_object","_utils","_responsive","_settings","_permissions"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CA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 "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hasAndroidBluetoothConnectAuthorized = hasAndroidBluetoothConnectAuthorized;
7
+ exports.hasAndroidBluetoothScanAuthorized = hasAndroidBluetoothScanAuthorized;
8
+ exports.hasAndroidLocationCoarseAuthorized = hasAndroidLocationCoarseAuthorized;
9
+ exports.hasAndroidLocationFineAuthorized = hasAndroidLocationFineAuthorized;
10
+ exports.hasLocationAuthorized = hasLocationAuthorized;
11
+ exports.requestAndroidBluetoothConnectAuthorization = requestAndroidBluetoothConnectAuthorization;
12
+ exports.requestAndroidBluetoothScanAuthorization = requestAndroidBluetoothScanAuthorization;
13
+ exports.requestAndroidLocationCoarseAuthorization = requestAndroidLocationCoarseAuthorization;
14
+ exports.requestAndroidLocationFineAuthorization = requestAndroidLocationFineAuthorization;
15
+ var _reactNative = require("react-native");
16
+ var _index = require("../constants/index.js");
17
+ async function hasAndroidLocationFineAuthorized() {
18
+ const isAuthorized = await _reactNative.PermissionsAndroid?.check(_index.permissions?.android?.location?.fine);
19
+ return isAuthorized;
20
+ }
21
+ async function requestAndroidLocationFineAuthorization() {
22
+ const status = await _reactNative.PermissionsAndroid?.request(_index.permissions?.android?.location?.fine);
23
+ return status;
24
+ }
25
+ async function hasAndroidLocationCoarseAuthorized() {
26
+ const isAuthorized = await _reactNative.PermissionsAndroid?.check(_index.permissions?.android?.location?.coarse);
27
+ return isAuthorized;
28
+ }
29
+ async function requestAndroidLocationCoarseAuthorization() {
30
+ const status = await _reactNative.PermissionsAndroid?.request(_index.permissions?.android?.location?.coarse);
31
+ return status;
32
+ }
33
+ async function hasLocationAuthorized() {
34
+ if (_reactNative.Platform?.OS === 'android') {
35
+ return await hasAndroidLocationFineAuthorized();
36
+ }
37
+ return false;
38
+ }
39
+ async function hasAndroidBluetoothScanAuthorized() {
40
+ const isAuthorized = await _reactNative.PermissionsAndroid.check(_index.permissions?.android?.bluetooth?.scan);
41
+ return isAuthorized;
42
+ }
43
+ async function requestAndroidBluetoothScanAuthorization() {
44
+ const status = await _reactNative.PermissionsAndroid.request(_index.permissions?.android?.bluetooth?.scan);
45
+ return status;
46
+ }
47
+ async function hasAndroidBluetoothConnectAuthorized() {
48
+ const isAuthorized = await _reactNative.PermissionsAndroid.check(_index.permissions?.android?.bluetooth?.connect);
49
+ return isAuthorized;
50
+ }
51
+ async function requestAndroidBluetoothConnectAuthorization() {
52
+ const status = await _reactNative.PermissionsAndroid.request(_index.permissions?.android?.bluetooth?.connect);
53
+ return status;
54
+ }
55
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_index","hasAndroidLocationFineAuthorized","isAuthorized","PermissionsAndroid","check","permissions","android","location","fine","requestAndroidLocationFineAuthorization","status","request","hasAndroidLocationCoarseAuthorized","coarse","requestAndroidLocationCoarseAuthorization","hasLocationAuthorized","Platform","OS","hasAndroidBluetoothScanAuthorized","bluetooth","scan","requestAndroidBluetoothScanAuthorization","hasAndroidBluetoothConnectAuthorized","connect","requestAndroidBluetoothConnectAuthorization"],"sourceRoot":"../../../src","sources":["utils/permissions.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAEA,eAAeE,gCAAgCA,CAAA,EAAqB;EAClE,MAAMC,YAAqB,GAAG,MAAMC,+BAAkB,EAAEC,KAAK,CAC3DC,kBAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,IAClC,CAAC;EAED,OAAON,YAAY;AACrB;AAEA,eAAeO,uCAAuCA,CAAA,EAA8B;EAClF,MAAMC,MAAwB,GAAG,MAAMP,+BAAkB,EAAEQ,OAAO,CAChEN,kBAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,IAClC,CAAC;EAED,OAAOE,MAAM;AACf;AAEA,eAAeE,kCAAkCA,CAAA,EAAqB;EACpE,MAAMV,YAAqB,GAAG,MAAMC,+BAA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value: true
5
+ });
6
+ exports.canOpenUrl = canOpenUrl;
7
+ exports.openAndroidBluetoothSettings = openAndroidBluetoothSettings;
8
+ exports.openAndroidLocationSettings = openAndroidLocationSettings;
9
+ exports.openAppCustomSettings = openAppCustomSettings;
10
+ exports.openBluetoothSettings = openBluetoothSettings;
11
+ exports.openIOSBluetoothSettings = openIOSBluetoothSettings;
12
+ exports.openIOSLocationSettings = openIOSLocationSettings;
13
+ exports.openLocationSettings = openLocationSettings;
14
+ exports.openUrl = openUrl;
15
+ var _reactNative = require("react-native");
16
+ var _index = require("../constants/index.js");
17
+ async function canOpenUrl(url) {
18
+ try {
19
+ const isOpenable = await _reactNative.Linking?.canOpenURL(url);
20
+ return isOpenable;
21
+ } catch (error) {
22
+ const err = error;
23
+ console.error('Given url is not valid to open: ', url, err?.message);
24
+ return false;
25
+ }
26
+ }
27
+ async function openUrl(url) {
28
+ const isOpenable = await canOpenUrl(url);
29
+ if (isOpenable) {
30
+ try {
31
+ await _reactNative.Linking?.openURL(url);
32
+ console.log('Opened given url: ', url);
33
+ return true;
34
+ } catch (error) {
35
+ const err = error;
36
+ console.error('Can not open given url: ', url, err?.message);
37
+ return false;
38
+ }
39
+ }
40
+ console.warn('Given url is not openable: ', url);
41
+ return false;
42
+ }
43
+ async function sentIntentAndroid(args) {
44
+ try {
45
+ await _reactNative.Linking?.sendIntent(args?.action, args?.extras);
46
+ return true;
47
+ } catch (error) {
48
+ const err = error;
49
+ console.error('Sent android intent Error: ', args, err?.message);
50
+ return false;
51
+ }
52
+ }
53
+ async function openIOSBluetoothSettings() {
54
+ const status = await openUrl(_index.settings?.ios?.bluetooth);
55
+ return status;
56
+ }
57
+ async function openAndroidBluetoothSettings() {
58
+ return await sentIntentAndroid({
59
+ action: _index.settings?.android?.bluetooth
60
+ });
61
+ }
62
+ async function openBluetoothSettings() {
63
+ if (_reactNative.Platform?.OS === 'ios') {
64
+ return await openIOSBluetoothSettings();
65
+ }
66
+ if (_reactNative.Platform?.OS === 'android') {
67
+ return await openAndroidBluetoothSettings();
68
+ }
69
+ return false;
70
+ }
71
+ async function openAppCustomSettings() {
72
+ try {
73
+ await _reactNative.Linking?.openSettings();
74
+ return true;
75
+ } catch (error) {
76
+ const err = error;
77
+ console.error('Open app custom settings Error: ', err?.message);
78
+ return false;
79
+ }
80
+ }
81
+ async function openIOSLocationSettings() {
82
+ const status = await openUrl(_index.settings?.ios?.location);
83
+ return status;
84
+ }
85
+ async function openAndroidLocationSettings() {
86
+ const status = await sentIntentAndroid({
87
+ action: _index.settings?.android?.location
88
+ });
89
+ return status;
90
+ }
91
+ async function openLocationSettings() {
92
+ if (_reactNative.Platform?.OS === 'ios') {
93
+ return await openIOSLocationSettings();
94
+ }
95
+ if (_reactNative.Platform?.OS === 'android') {
96
+ return await openAndroidLocationSettings();
97
+ }
98
+ return false;
99
+ }
100
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_index","canOpenUrl","url","isOpenable","Linking","canOpenURL","error","err","console","message","openUrl","openURL","log","warn","sentIntentAndroid","args","sendIntent","action","extras","openIOSBluetoothSettings","status","settings","ios","bluetooth","openAndroidBluetoothSettings","android","openBluetoothSettings","Platform","OS","openAppCustomSettings","openSettings","openIOSLocationSettings","location","openAndroidLocationSettings","openLocationSettings"],"sourceRoot":"../../../src","sources":["utils/settings.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAGA,eAAeE,UAAUA,CAACC,GAAW,EAAoB;EACvD,IAAI;IACF,MAAMC,UAAmB,GAAG,MAAMC,oBAAO,EAAEC,UAAU,CAACH,GAAG,CAAC;IAE1D,OAAOC,UAAU;EACnB,CAAC,CAAC,OAAOG,KAAc,EAAE;IACvB,MAAMC,GAAU,GAAGD,KAAc;IACjCE,OAAO,CAACF,KAAK,CAAC,kCAAkC,EAAEJ,GAAG,EAAEK,GAAG,EAAEE,OAAO,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AqB;EACvD,IAAIC,qBAAQ,EAAEC,EAAE,KAAK,KAAK,EAAE;IAC1B,OAAO,MAAMT,wBAAwB,CAAC,CAAC;EACzC;EAEA,IAAIQ,qBAAQ,EAAEC,EAAE,KAAK,SAAS,EAAE;IAC9B,OAAO,MAAMJ,4BAA4B,CAAC,CAAC;EAC7C;EAEA,OAAO,KAAK;AACd;AAEA,eAAeK,qBAAqBA,CAAA,EAAqB;EACvD,IAAI;IACF,MAAMzB,oBAAO,EAAE0B,YAAY,CAAC,CAAC;IAE7B,OAAO,IAAI;EACb,CAAC,CAAC,OAAOxB,KAAc,EAAE;IACvB,MAAMC,GAAU,GAAGD,KAAc;IACjCE,OAAO,CAACF,KAAK,CAAC,kCAAkC,EAAEC,GAAG,EAAEE,OAAO,CAAC;IAE/D,OAAO,KAAK;EACd;AACF;AAEA,eAAesB,uBAAuBA,CAAA,EAAqB;EACzD,MAAMX,MAAe,GAAG,MAAMV,OAAO,CAACW,eAAQ,EAAEC,GAAG,EAAEU,QAAQ,CAAC;EAE9D,OAAOZ,MAAM;AACf;AAEA,eAAea,2BAA2BA,CAAA,EAAqB;EAC7D,MAAMb,MAAe,GAAG,MAAMN,iBAAiB,CAAC;IAC9CG,MAAM,EAAEI,eAAQ,EAAEI,OAAO,EAAEO;EAC7B,CAAC,CAAC;EAEF,OAAOZ,MAAM;AACf;AAEA,eAAec,oBAAoBA,CAAA,EAAqB;EACtD,IAAIP,qBAAQ,EAAEC,EAAE,KAAK,KAAK,EAAE;IAC1B,OAAO,MAAMG,uBAAuB,CAAC,CAAC;EACxC;EAEA,IAAIJ,qBAAQ,EAAEC,EAAE,KAAK,SAAS,EAAE;IAC9B,OAAO,MAAMK,2BAA2B,CAAC,CAAC;EAC5C;EAEA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -8,10 +8,11 @@ exports.byteArrayToString = byteArrayToString;
8
8
  exports.convertStringToNumber = convertStringToNumber;
9
9
  exports.isEmpty = isEmpty;
10
10
  exports.isNotEmpty = isNotEmpty;
11
- exports.removeNullCharactorsFromText = removeNullCharactorsFromText;
11
+ exports.removeNullCharactersFromText = removeNullCharactersFromText;
12
12
  exports.splitString = splitString;
13
13
  exports.stringToBase64 = stringToBase64;
14
14
  exports.stringToByteArray = stringToByteArray;
15
+ var _buffer = require("buffer");
15
16
  function isEmpty(text) {
16
17
  if (!text) {
17
18
  return true;
@@ -41,12 +42,12 @@ function stringToByteArray(data) {
41
42
  return newUint;
42
43
  }
43
44
  function base64ToString(input) {
44
- return Buffer?.from(input, 'base64').toString('utf8');
45
+ return _buffer.Buffer?.from(input, 'base64').toString('utf8');
45
46
  }
46
47
  function stringToBase64(input) {
47
- return Buffer?.from(input, 'utf8').toString('base64');
48
+ return _buffer.Buffer?.from(input, 'utf8').toString('base64');
48
49
  }
49
- function removeNullCharactorsFromText(text) {
50
+ function removeNullCharactersFromText(text) {
50
51
  const alphaNumericRegex = new RegExp(/[^a-z0-9]/gi);
51
52
  return text?.replaceAll('\0', '')?.replaceAll('%s', '')?.replace(alphaNumericRegex, '');
52
53
  }
@@ -1 +1 @@
1
- {"version":3,"names":["isEmpty","text","value","test","isNotEmpty","byteArrayToString","byteArray","result","i","length","String","fromCharCode","stringToByteArray","data","arrayBuffer","ArrayBuffer","newUint","Uint8Array","forEach","_","charCodeAt","base64ToString","input","Buffer","from","toString","stringToBase64","removeNullCharactorsFromText","alphaNumericRegex","RegExp","replaceAll","replace","convertStringToNumber","parseFloat","undefined","splitString","splitBy","split"],"sourceRoot":"../../../src","sources":["utils/string.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,OAAOA,CAACC,IAAa,EAAW;EACvC,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,MAAMC,KAAa,GAAGD,IAAc;EAEpC,OAAO,OAAO,CAACE,IAAI,CAACD,KAAK,CAAC;AAC5B;AAEA,SAASE,UAAUA,CAACH,IAAa,EAAW;EAC1C,OAAO,CAACD,OAAO,CAACC,IAAI,CAAC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AAE,CAAC;AACpC;AAEA,SAASI,qBAAqBA,CAAC9B,KAAa,EAAsB;EAChE,OAAO,CAACF,OAAO,CAACE,KAAK,CAAC,GAAG+B,UAAU,CAAC/B,KAAK,CAAC,GAAGgC,SAAS;AACxD;AAEA,SAASC,WAAWA,CAAClC,IAAY,EAAEmC,OAAe,EAAiB;EACjE,OAAOnC,IAAI,CAACoC,KAAK,CAACD,OAAO,CAAC;AAC5B","ignoreList":[]}
1
+ {"version":3,"names":["_buffer","require","isEmpty","text","value","test","isNotEmpty","byteArrayToString","byteArray","result","i","length","String","fromCharCode","stringToByteArray","data","arrayBuffer","ArrayBuffer","newUint","Uint8Array","forEach","_","charCodeAt","base64ToString","input","Buffer","from","toString","stringToBase64","removeNullCharactersFromText","alphaNumericRegex","RegExp","replaceAll","replace","convertStringToNumber","parseFloat","undefined","splitString","splitBy","split"],"sourceRoot":"../../../src","sources":["utils/string.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,SAASC,OAAOA,CAACC,IAAa,EAAW;EACvC,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,MAAMC,KAAa,GAAGD,IAAc;EAEpC,OAAO,OAAO,CAACE,IAAI,CAACD,KAAK,CAAC;AAC5B;AAEA,SAASE,UAAUA,CAACH,IAAa,EAAW;EAC1C,OAAO,CAACD,OAAO,CAACC,IAAI,CAAC;AACvB;AAEA,SAASI,iBAAiBA,CAACC,SAAwB,EAAU;EAC3D,IAAIC,MAAM,GAAG,EAAE;EAEf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,SAAS,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACzC,IAAI,CAACF,SAAS,CAACE,CAAC,CAAC,EAAE;MACjB;IACF;IAEAD,MAAM,IAAIG,MAAM,CAACC,YAAY,CAACL,SAAS,CAACE,CAAC,CAAW,CAAC;EACvD;EAEA,OAAOD,MAAM;AACf;AAE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ourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["constants/index.ts"],"mappings":"AAAA,cAAc,eAAY;AAC1B,cAAc,kBAAe","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import { PermissionsAndroid } from 'react-native';
2
+ const permissions = {
3
+ android: {
4
+ bluetooth: {
5
+ scan: PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
6
+ connect: PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT
7
+ },
8
+ location: {
9
+ fine: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
10
+ coarse: PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION
11
+ }
12
+ }
13
+ };
14
+ export { permissions };
15
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PermissionsAndroid","permissions","android","bluetooth","scan","PERMISSIONS","BLUETOOTH_SCAN","connect","BLUETOOTH_CONNECT","location","fine","ACCESS_FINE_LOCATION","coarse","ACCESS_COARSE_LOCATION"],"sourceRoot":"../../../src","sources":["constants/permissions.ts"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAEjD,MAAMC,WAAW,GAAG;EAClBC,OAAO,EAAE;IACPC,SAAS,EAAE;MACTC,IAAI,EAAEJ,kBAAkB,CAACK,WAAW,CAACC,cAAc;MACnDC,OAAO,EAAEP,kBAAkB,CAACK,WAAW,CAACG;IAC1C,CAAC;IACDC,QAAQ,EAAE;MACRC,IAAI,EAAEV,kBAAkB,CAACK,WAAW,CAACM,oBAAoB;MACzDC,MAAM,EAAEZ,kBAAkB,CAACK,WAAW,CAACQ;IACzC;EACF;AACF,CAAC;AAED,SAASZ,WAAW","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ const settings = {
2
+ android: {
3
+ bluetooth: 'android.settings.BLUETOOTH_SETTINGS',
4
+ location: 'android.settings.LOCATION_SOURCE_SETTINGS'
5
+ },
6
+ ios: {
7
+ bluetooth: 'App-Prefs:Bluetooth',
8
+ location: 'App-Prefs:Privacy&path=LOCATION'
9
+ }
10
+ };
11
+ export { settings };
12
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["settings","android","bluetooth","location","ios"],"sourceRoot":"../../../src","sources":["constants/settings.ts"],"mappings":"AAAA,MAAMA,QAAQ,GAAG;EACfC,OAAO,EAAE;IACPC,SAAS,EAAE,qCAAqC;IAChDC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHF,SAAS,EAAE,qBAAqB;IAChCC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,SAASH,QAAQ","ignoreList":[]}
@@ -1,3 +1,5 @@
1
1
  export * from "./utils/index.js";
2
2
  export * from "./hooks/index.js";
3
+ export * from "./constants/index.js";
4
+ export * from './types';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,cAAc,kBAAS;AACvB,cAAc,kBAAS","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,SAAS","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from './settings';
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.d.ts"],"mappings":"AAAA,cAAc,YAAY","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=settings.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/settings.d.ts"],"mappings":"","ignoreList":[]}
@@ -2,4 +2,6 @@ export * from "./string.js";
2
2
  export * from "./object.js";
3
3
  export * from "./utils.js";
4
4
  export * from "./responsive.js";
5
+ export * from "./settings.js";
6
+ export * from "./permissions.js";
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,cAAc,aAAU;AACxB,cAAc,aAAU;AACxB,cAAc,YAAS;AACvB,cAAc,iBAAc","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,cAAc,aAAU;AACxB,cAAc,aAAU;AACxB,cAAc,YAAS;AACvB,cAAc,iBAAc;AAC5B,cAAc,eAAY;AAC1B,cAAc,kBAAe","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ import { PermissionsAndroid, Platform } from 'react-native';
2
+ import { permissions } from "../constants/index.js";
3
+ async function hasAndroidLocationFineAuthorized() {
4
+ const isAuthorized = await PermissionsAndroid?.check(permissions?.android?.location?.fine);
5
+ return isAuthorized;
6
+ }
7
+ async function requestAndroidLocationFineAuthorization() {
8
+ const status = await PermissionsAndroid?.request(permissions?.android?.location?.fine);
9
+ return status;
10
+ }
11
+ async function hasAndroidLocationCoarseAuthorized() {
12
+ const isAuthorized = await PermissionsAndroid?.check(permissions?.android?.location?.coarse);
13
+ return isAuthorized;
14
+ }
15
+ async function requestAndroidLocationCoarseAuthorization() {
16
+ const status = await PermissionsAndroid?.request(permissions?.android?.location?.coarse);
17
+ return status;
18
+ }
19
+ async function hasLocationAuthorized() {
20
+ if (Platform?.OS === 'android') {
21
+ return await hasAndroidLocationFineAuthorized();
22
+ }
23
+ return false;
24
+ }
25
+ async function hasAndroidBluetoothScanAuthorized() {
26
+ const isAuthorized = await PermissionsAndroid.check(permissions?.android?.bluetooth?.scan);
27
+ return isAuthorized;
28
+ }
29
+ async function requestAndroidBluetoothScanAuthorization() {
30
+ const status = await PermissionsAndroid.request(permissions?.android?.bluetooth?.scan);
31
+ return status;
32
+ }
33
+ async function hasAndroidBluetoothConnectAuthorized() {
34
+ const isAuthorized = await PermissionsAndroid.check(permissions?.android?.bluetooth?.connect);
35
+ return isAuthorized;
36
+ }
37
+ async function requestAndroidBluetoothConnectAuthorization() {
38
+ const status = await PermissionsAndroid.request(permissions?.android?.bluetooth?.connect);
39
+ return status;
40
+ }
41
+ export { hasAndroidLocationFineAuthorized, requestAndroidLocationFineAuthorization, hasAndroidLocationCoarseAuthorized, requestAndroidLocationCoarseAuthorization, hasLocationAuthorized, hasAndroidBluetoothScanAuthorized, requestAndroidBluetoothScanAuthorization, hasAndroidBluetoothConnectAuthorized, requestAndroidBluetoothConnectAuthorization };
42
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PermissionsAndroid","Platform","permissions","hasAndroidLocationFineAuthorized","isAuthorized","check","android","location","fine","requestAndroidLocationFineAuthorization","status","request","hasAndroidLocationCoarseAuthorized","coarse","requestAndroidLocationCoarseAuthorization","hasLocationAuthorized","OS","hasAndroidBluetoothScanAuthorized","bluetooth","scan","requestAndroidBluetoothScanAuthorization","hasAndroidBluetoothConnectAuthorized","connect","requestAndroidBluetoothConnectAuthorization"],"sourceRoot":"../../../src","sources":["utils/permissions.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAG3D,SAASC,WAAW,QAAQ,uBAAc;AAE1C,eAAeC,gCAAgCA,CAAA,EAAqB;EAClE,MAAMC,YAAqB,GAAG,MAAMJ,kBAAkB,EAAEK,KAAK,CAC3DH,WAAW,EAAEI,OAAO,EAAEC,QAAQ,EAAEC,IAClC,CAAC;EAED,OAAOJ,YAAY;AACrB;AAEA,eAAeK,uCAAuCA,CAAA,EAA8B;EAClF,MAAMC,MAAwB,GAAG,MAAMV,kBAAkB,EAAEW,OAAO,CAChET,WAAW,EAAEI,OAAO,EAAEC,QAAQ,EAAEC,IAClC,CAAC;EAED,OAAOE,MAAM;AACf;AAEA,eAAeE,kCAAkCA,CAAA,EAAqB;EACpE,MAAMR,YAAqB,GAAG,MAAMJ,kBAAkB,EA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,wCAAwC,EACxCC,oCAAoC,EACpCE,2CAA2C","ignoreList":[]}
@@ -0,0 +1,87 @@
1
+ import { Linking, Platform } from 'react-native';
2
+ import { settings } from "../constants/index.js";
3
+ async function canOpenUrl(url) {
4
+ try {
5
+ const isOpenable = await Linking?.canOpenURL(url);
6
+ return isOpenable;
7
+ } catch (error) {
8
+ const err = error;
9
+ console.error('Given url is not valid to open: ', url, err?.message);
10
+ return false;
11
+ }
12
+ }
13
+ async function openUrl(url) {
14
+ const isOpenable = await canOpenUrl(url);
15
+ if (isOpenable) {
16
+ try {
17
+ await Linking?.openURL(url);
18
+ console.log('Opened given url: ', url);
19
+ return true;
20
+ } catch (error) {
21
+ const err = error;
22
+ console.error('Can not open given url: ', url, err?.message);
23
+ return false;
24
+ }
25
+ }
26
+ console.warn('Given url is not openable: ', url);
27
+ return false;
28
+ }
29
+ async function sentIntentAndroid(args) {
30
+ try {
31
+ await Linking?.sendIntent(args?.action, args?.extras);
32
+ return true;
33
+ } catch (error) {
34
+ const err = error;
35
+ console.error('Sent android intent Error: ', args, err?.message);
36
+ return false;
37
+ }
38
+ }
39
+ async function openIOSBluetoothSettings() {
40
+ const status = await openUrl(settings?.ios?.bluetooth);
41
+ return status;
42
+ }
43
+ async function openAndroidBluetoothSettings() {
44
+ return await sentIntentAndroid({
45
+ action: settings?.android?.bluetooth
46
+ });
47
+ }
48
+ async function openBluetoothSettings() {
49
+ if (Platform?.OS === 'ios') {
50
+ return await openIOSBluetoothSettings();
51
+ }
52
+ if (Platform?.OS === 'android') {
53
+ return await openAndroidBluetoothSettings();
54
+ }
55
+ return false;
56
+ }
57
+ async function openAppCustomSettings() {
58
+ try {
59
+ await Linking?.openSettings();
60
+ return true;
61
+ } catch (error) {
62
+ const err = error;
63
+ console.error('Open app custom settings Error: ', err?.message);
64
+ return false;
65
+ }
66
+ }
67
+ async function openIOSLocationSettings() {
68
+ const status = await openUrl(settings?.ios?.location);
69
+ return status;
70
+ }
71
+ async function openAndroidLocationSettings() {
72
+ const status = await sentIntentAndroid({
73
+ action: settings?.android?.location
74
+ });
75
+ return status;
76
+ }
77
+ async function openLocationSettings() {
78
+ if (Platform?.OS === 'ios') {
79
+ return await openIOSLocationSettings();
80
+ }
81
+ if (Platform?.OS === 'android') {
82
+ return await openAndroidLocationSettings();
83
+ }
84
+ return false;
85
+ }
86
+ export { canOpenUrl, openUrl, openIOSBluetoothSettings, openAndroidBluetoothSettings, openAppCustomSettings, openIOSLocationSettings, openAndroidLocationSettings, openLocationSettings, openBluetoothSettings };
87
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Linking","Platform","settings","canOpenUrl","url","isOpenable","canOpenURL","error","err","console","message","openUrl","openURL","log","warn","sentIntentAndroid","args","sendIntent","action","extras","openIOSBluetoothSettings","status","ios","bluetooth","openAndroidBluetoothSettings","android","openBluetoothSettings","OS","openAppCustomSettings","openSettings","openIOSLocationSettings","location","openAndroidLocationSettings","openLocationSettings"],"sourceRoot":"../../../src","sources":["utils/settings.tsx"],"mappings":"AAAA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAEhD,SAASC,QAAQ,QAAQ,uBAAc;AAGvC,eAAeC,UAAUA,CAACC,GAAW,EAAoB;EACvD,IAAI;IACF,MAAMC,UAAmB,GAAG,MAAML,OAAO,EAAEM,UAAU,CAACF,GAAG,CAAC;IAE1D,OAAOC,UAAU;EACnB,CAAC,CAAC,OAAOE,KAAc,EAAE;IACvB,MAAMC,GAAU,GAAGD,KAAc;IACjCE,OAAO,CAACF,KAAK,CAAC,kCAAkC,EAAEH,GAAG,EAAEI,GAAG,EAAEE,OAAO,CAAC;IAEpE,OAAO,KAAK;EACd;AACF;AAEA,eAAeC,OAAOA,CAACP,GAAW,EAAoB;EACpD,MAAMC,UAAmB,GAAG,MAAMF,UAAU,CAACC,GAAG,CAAC;EAEjD,IAAIC,UAAU,EAAE;IACd,IAAI;MACF,MAAML,OAAO,EAAEY,OAAO,CAACR,GAA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EA,OAAO,KAAK;AACd;AAEA,eAAeI,qBAAqBA,CAAA,EAAqB;EACvD,IAAI;IACF,MAAM5B,OAAO,EAAE6B,YAAY,CAAC,CAAC;IAE7B,OAAO,IAAI;EACb,CAAC,CAAC,OAAOtB,KAAc,EAAE;IACvB,MAAMC,GAAU,GAAGD,KAAc;IACjCE,OAAO,CAACF,KAAK,CAAC,kCAAkC,EAAEC,GAAG,EAAEE,OAAO,CAAC;IAE/D,OAAO,KAAK;EACd;AACF;AAEA,eAAeoB,uBAAuBA,CAAA,EAAqB;EACzD,MAAMT,MAAe,GAAG,MAAMV,OAAO,CAACT,QAAQ,EAAEoB,GAAG,EAAES,QAAQ,CAAC;EAE9D,OAAOV,MAAM;AACf;AAEA,eAAeW,2BAA2BA,CAAA,EAAqB;EAC7D,MAAMX,MAAe,GAAG,MAAMN,iBAAiB,CAAC;IAC9CG,MAAM,EAAEhB,QAAQ,EAAEuB,OAAO,EAAEM;EAC7B,CAAC,CAAC;EAEF,OAAOV,MAAM;AACf;AAEA,eAAeY,oBAAoBA,CAAA,EAAqB;EACtD,IAAIhC,QAAQ,EAAE0B,EAAE,KAAK,KAAK,EAAE;IAC1B,OAAO,MAAMG,uBAAuB,CAAC,CAAC;EACxC;EAEA,IAAI7B,QAAQ,EAAE0B,EAAE,KAAK,SAAS,EAAE;IAC9B,OAAO,MAAMK,2BAA2B,CAAC,CAAC;EAC5C;EAEA,OAAO,KAAK;AACd;AAEA,SACE7B,UAAU,EACVQ,OAAO,EACPS,wBAAwB,EACxBI,4BAA4B,EAC5BI,qBAAqB,EACrBE,uBAAuB,EACvBE,2BAA2B,EAC3BC,oBAAoB,EACpBP,qBAAqB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ import { Buffer } from 'buffer';
1
2
  function isEmpty(text) {
2
3
  if (!text) {
3
4
  return true;
@@ -32,7 +33,7 @@ function base64ToString(input) {
32
33
  function stringToBase64(input) {
33
34
  return Buffer?.from(input, 'utf8').toString('base64');
34
35
  }
35
- function removeNullCharactorsFromText(text) {
36
+ function removeNullCharactersFromText(text) {
36
37
  const alphaNumericRegex = new RegExp(/[^a-z0-9]/gi);
37
38
  return text?.replaceAll('\0', '')?.replaceAll('%s', '')?.replace(alphaNumericRegex, '');
38
39
  }
@@ -42,5 +43,5 @@ function convertStringToNumber(value) {
42
43
  function splitString(text, splitBy) {
43
44
  return text.split(splitBy);
44
45
  }
45
- export { isEmpty, isNotEmpty, byteArrayToString, stringToByteArray, base64ToString, stringToBase64, removeNullCharactorsFromText, convertStringToNumber, splitString };
46
+ export { isEmpty, isNotEmpty, byteArrayToString, stringToByteArray, base64ToString, stringToBase64, removeNullCharactersFromText, convertStringToNumber, splitString };
46
47
  //# sourceMappingURL=string.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isEmpty","text","value","test","isNotEmpty","byteArrayToString","byteArray","result","i","length","String","fromCharCode","stringToByteArray","data","arrayBuffer","ArrayBuffer","newUint","Uint8Array","forEach","_","charCodeAt","base64ToString","input","Buffer","from","toString","stringToBase64","removeNullCharactorsFromText","alphaNumericRegex","RegExp","replaceAll","replace","convertStringToNumber","parseFloat","undefined","splitString","splitBy","split"],"sourceRoot":"../../../src","sources":["utils/string.tsx"],"mappings":"AAAA,SAASA,OAAOA,CAACC,IAAa,EAAW;EACvC,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,MAAMC,KAAa,GAAGD,IAAc;EAEpC,OAAO,OAAO,CAACE,IAAI,CAACD,KAAK,CAAC;AAC5B;AAEA,SAASE,UAAUA,CAACH,IAAa,EAAW;EAC1C,OAAO,CAACD,OAAO,CAACC,IAAI,CAAC;AACvB;AAEA,SAASI,iBAAiBA,CAACC,SAAwB,EAAU;EAC3D,IAAIC,MAAM,GAAG,EAAE;EAEf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,SAAS,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACzC,IAAI,CAACF,SAAS,CAACE,CAA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jE,OAAOnC,IAAI,CAACoC,KAAK,CAACD,OAAO,CAAC;AAC5B;AAEA,SACEpC,OAAO,EACPI,UAAU,EACVC,iBAAiB,EACjBO,iBAAiB,EACjBS,cAAc,EACdK,cAAc,EACdC,4BAA4B,EAC5BK,qBAAqB,EACrBG,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["Buffer","isEmpty","text","value","test","isNotEmpty","byteArrayToString","byteArray","result","i","length","String","fromCharCode","stringToByteArray","data","arrayBuffer","ArrayBuffer","newUint","Uint8Array","forEach","_","charCodeAt","base64ToString","input","from","toString","stringToBase64","removeNullCharactersFromText","alphaNumericRegex","RegExp","replaceAll","replace","convertStringToNumber","parseFloat","undefined","splitString","splitBy","split"],"sourceRoot":"../../../src","sources":["utils/string.tsx"],"mappings":"AAAA,SAASA,MAAM,QAAQ,QAAQ;AAE/B,SAASC,OAAOA,CAACC,IAAa,EAAW;EACvC,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,MAAMC,KAAa,GAAGD,IAAc;EAEpC,OAAO,OAAO,CAACE,IAAI,CAACD,KAAK,CAAC;AAC5B;AAEA,SAASE,UAAUA,CAACH,IAAa,EAAW;EAC1C,OAAO,CAACD,OAAO,CAACC,IAAI,CAAC;AACvB;AAEA,SAASI,iBAAiBA,CAACC,SAAwB,EAAU;EAC3D,IAAIC,MAAM,GAAG,EAAE;EAEf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,SAAS,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACzC,IAAI,CAACF,SAAS,CAACE,CAAC,CAAC,EAAE;MACjB;IACF;IAEAD,MAAM,IAAIG,MAAM,CAACC,YAAY,CAACL,SAAS,CAACE,CAAC,CAAW,CAAC;EACvD;EAEA,OAAOD,MAAM;AACf;AAEA,SAASK,iBAAiBA,CAACC,IAAY,EAAc;EACnD,MAAMC,WAAW,GAAG,IAAIC,WAAW,CAACF,IAAI,CAACJ,MAAM,GAAG,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 export * from './permissions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ declare const permissions: {
2
+ android: {
3
+ bluetooth: {
4
+ scan: import("react-native").Permission | undefined;
5
+ connect: import("react-native").Permission | undefined;
6
+ };
7
+ location: {
8
+ fine: import("react-native").Permission | undefined;
9
+ coarse: import("react-native").Permission | undefined;
10
+ };
11
+ };
12
+ };
13
+ export { permissions };
14
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../src/constants/permissions.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;;;;;;;;;;;CAWhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ declare const settings: {
2
+ android: {
3
+ bluetooth: string;
4
+ location: string;
5
+ };
6
+ ios: {
7
+ bluetooth: string;
8
+ location: string;
9
+ };
10
+ };
11
+ export { settings };
12
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/constants/settings.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ;;;;;;;;;CASb,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from './utils';
2
2
  export * from './hooks';
3
+ export * from './constants';
4
+ export * from './types';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -2,4 +2,6 @@ export * from './string';
2
2
  export * from './object';
3
3
  export * from './utils';
4
4
  export * from './responsive';
5
+ export * from './settings';
6
+ export * from './permissions';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { PermissionStatus } from 'react-native';
2
+ declare function hasAndroidLocationFineAuthorized(): Promise<boolean>;
3
+ declare function requestAndroidLocationFineAuthorization(): Promise<PermissionStatus>;
4
+ declare function hasAndroidLocationCoarseAuthorized(): Promise<boolean>;
5
+ declare function requestAndroidLocationCoarseAuthorization(): Promise<PermissionStatus>;
6
+ declare function hasLocationAuthorized(): Promise<boolean>;
7
+ declare function hasAndroidBluetoothScanAuthorized(): Promise<boolean>;
8
+ declare function requestAndroidBluetoothScanAuthorization(): Promise<PermissionStatus>;
9
+ declare function hasAndroidBluetoothConnectAuthorized(): Promise<boolean>;
10
+ declare function requestAndroidBluetoothConnectAuthorization(): Promise<PermissionStatus>;
11
+ export { hasAndroidLocationFineAuthorized, requestAndroidLocationFineAuthorization, hasAndroidLocationCoarseAuthorized, requestAndroidLocationCoarseAuthorization, hasLocationAuthorized, hasAndroidBluetoothScanAuthorized, requestAndroidBluetoothScanAuthorization, hasAndroidBluetoothConnectAuthorized, requestAndroidBluetoothConnectAuthorization, };
12
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../src/utils/permissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIjE,iBAAe,gCAAgC,IAAI,OAAO,CAAC,OAAO,CAAC,CAMlE;AAED,iBAAe,uCAAuC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMlF;AAED,iBAAe,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC,CAMpE;AAED,iBAAe,yCAAyC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMpF;AAED,iBAAe,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAMvD;AAED,iBAAe,iCAAiC,IAAI,OAAO,CAAC,OAAO,CAAC,CAMnE;AAED,iBAAe,wCAAwC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMnF;AAED,iBAAe,oCAAoC,IAAI,OAAO,CAAC,OAAO,CAAC,CAMtE;AAED,iBAAe,2CAA2C,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMtF;AAED,OAAO,EACL,gCAAgC,EAChC,uCAAuC,EACvC,kCAAkC,EAClC,yCAAyC,EACzC,qBAAqB,EACrB,iCAAiC,EACjC,wCAAwC,EACxC,oCAAoC,EACpC,2CAA2C,GAC5C,CAAC"}
@@ -0,0 +1,11 @@
1
+ declare function canOpenUrl(url: string): Promise<boolean>;
2
+ declare function openUrl(url: string): Promise<boolean>;
3
+ declare function openIOSBluetoothSettings(): Promise<boolean>;
4
+ declare function openAndroidBluetoothSettings(): Promise<boolean>;
5
+ declare function openBluetoothSettings(): Promise<boolean>;
6
+ declare function openAppCustomSettings(): Promise<boolean>;
7
+ declare function openIOSLocationSettings(): Promise<boolean>;
8
+ declare function openAndroidLocationSettings(): Promise<boolean>;
9
+ declare function openLocationSettings(): Promise<boolean>;
10
+ export { canOpenUrl, openUrl, openIOSBluetoothSettings, openAndroidBluetoothSettings, openAppCustomSettings, openIOSLocationSettings, openAndroidLocationSettings, openLocationSettings, openBluetoothSettings, };
11
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/utils/settings.tsx"],"names":[],"mappings":"AAKA,iBAAe,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWvD;AAED,iBAAe,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBpD;AAgBD,iBAAe,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CAI1D;AAED,iBAAe,4BAA4B,IAAI,OAAO,CAAC,OAAO,CAAC,CAE9D;AAED,iBAAe,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAUvD;AAED,iBAAe,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAWvD;AAED,iBAAe,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAIzD;AAED,iBAAe,2BAA2B,IAAI,OAAO,CAAC,OAAO,CAAC,CAM7D;AAED,iBAAe,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAUtD;AAED,OAAO,EACL,UAAU,EACV,OAAO,EACP,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,GACtB,CAAC"}
@@ -4,8 +4,8 @@ declare function byteArrayToString(byteArray: Array<number>): string;
4
4
  declare function stringToByteArray(data: string): Uint8Array;
5
5
  declare function base64ToString(input: string): string;
6
6
  declare function stringToBase64(input: string): string;
7
- declare function removeNullCharactorsFromText(text: string): string;
7
+ declare function removeNullCharactersFromText(text: string): string;
8
8
  declare function convertStringToNumber(value: string): number | undefined;
9
9
  declare function splitString(text: string, splitBy: string): Array<string>;
10
- export { isEmpty, isNotEmpty, byteArrayToString, stringToByteArray, base64ToString, stringToBase64, removeNullCharactorsFromText, convertStringToNumber, splitString, };
10
+ export { isEmpty, isNotEmpty, byteArrayToString, stringToByteArray, base64ToString, stringToBase64, removeNullCharactersFromText, convertStringToNumber, splitString, };
11
11
  //# sourceMappingURL=string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/utils/string.tsx"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAQvC;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAE1C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAY3D;AAED,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAQnD;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,iBAAS,4BAA4B,CAAC,IAAI,EAAE,MAAM,UAMjD;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhE;AAED,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEjE;AAED,OAAO,EACL,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,qBAAqB,EACrB,WAAW,GACZ,CAAC"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/utils/string.tsx"],"names":[],"mappings":"AAEA,iBAAS,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAQvC;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAE1C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAY3D;AAED,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAQnD;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,iBAAS,4BAA4B,CAAC,IAAI,EAAE,MAAM,UAMjD;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhE;AAED,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEjE;AAED,OAAO,EACL,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,qBAAqB,EACrB,WAAW,GACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnpack/utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Basic utilities will be available and ready to use",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -56,7 +56,8 @@
56
56
  },
57
57
  "homepage": "https://github.com/rnpack/utils#readme",
58
58
  "publishConfig": {
59
- "registry": "https://registry.npmjs.org/"
59
+ "registry": "https://registry.npmjs.org/",
60
+ "access": "public"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@commitlint/config-conventional": "^17.0.2",
@@ -0,0 +1,2 @@
1
+ export * from './settings';
2
+ export * from './permissions';
@@ -0,0 +1,16 @@
1
+ import { PermissionsAndroid } from 'react-native';
2
+
3
+ const permissions = {
4
+ android: {
5
+ bluetooth: {
6
+ scan: PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
7
+ connect: PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
8
+ },
9
+ location: {
10
+ fine: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
11
+ coarse: PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
12
+ },
13
+ },
14
+ };
15
+
16
+ export { permissions };
@@ -0,0 +1,12 @@
1
+ const settings = {
2
+ android: {
3
+ bluetooth: 'android.settings.BLUETOOTH_SETTINGS',
4
+ location: 'android.settings.LOCATION_SOURCE_SETTINGS',
5
+ },
6
+ ios: {
7
+ bluetooth: 'App-Prefs:Bluetooth',
8
+ location: 'App-Prefs:Privacy&path=LOCATION',
9
+ },
10
+ };
11
+
12
+ export { settings };
package/src/index.tsx CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './utils';
2
2
  export * from './hooks';
3
+ export * from './constants';
4
+ export * from './types';
@@ -0,0 +1 @@
1
+ export * from './settings';
@@ -0,0 +1,6 @@
1
+ interface SentIntentAndroid {
2
+ action: string;
3
+ extras?: Array<{ key: string; value: string | number | boolean }>;
4
+ }
5
+
6
+ export type { SentIntentAndroid };
@@ -2,3 +2,5 @@ export * from './string';
2
2
  export * from './object';
3
3
  export * from './utils';
4
4
  export * from './responsive';
5
+ export * from './settings';
6
+ export * from './permissions';
@@ -0,0 +1,88 @@
1
+ import { PermissionsAndroid, Platform } from 'react-native';
2
+ import type { Permission, PermissionStatus } from 'react-native';
3
+
4
+ import { permissions } from '../constants';
5
+
6
+ async function hasAndroidLocationFineAuthorized(): Promise<boolean> {
7
+ const isAuthorized: boolean = await PermissionsAndroid?.check(
8
+ permissions?.android?.location?.fine as Permission
9
+ );
10
+
11
+ return isAuthorized;
12
+ }
13
+
14
+ async function requestAndroidLocationFineAuthorization(): Promise<PermissionStatus> {
15
+ const status: PermissionStatus = await PermissionsAndroid?.request(
16
+ permissions?.android?.location?.fine as Permission
17
+ );
18
+
19
+ return status;
20
+ }
21
+
22
+ async function hasAndroidLocationCoarseAuthorized(): Promise<boolean> {
23
+ const isAuthorized: boolean = await PermissionsAndroid?.check(
24
+ permissions?.android?.location?.coarse as Permission
25
+ );
26
+
27
+ return isAuthorized;
28
+ }
29
+
30
+ async function requestAndroidLocationCoarseAuthorization(): Promise<PermissionStatus> {
31
+ const status: PermissionStatus = await PermissionsAndroid?.request(
32
+ permissions?.android?.location?.coarse as Permission
33
+ );
34
+
35
+ return status;
36
+ }
37
+
38
+ async function hasLocationAuthorized(): Promise<boolean> {
39
+ if (Platform?.OS === 'android') {
40
+ return await hasAndroidLocationFineAuthorized();
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ async function hasAndroidBluetoothScanAuthorized(): Promise<boolean> {
47
+ const isAuthorized: boolean = await PermissionsAndroid.check(
48
+ permissions?.android?.bluetooth?.scan as Permission
49
+ );
50
+
51
+ return isAuthorized;
52
+ }
53
+
54
+ async function requestAndroidBluetoothScanAuthorization(): Promise<PermissionStatus> {
55
+ const status: PermissionStatus = await PermissionsAndroid.request(
56
+ permissions?.android?.bluetooth?.scan as Permission
57
+ );
58
+
59
+ return status;
60
+ }
61
+
62
+ async function hasAndroidBluetoothConnectAuthorized(): Promise<boolean> {
63
+ const isAuthorized: boolean = await PermissionsAndroid.check(
64
+ permissions?.android?.bluetooth?.connect as Permission
65
+ );
66
+
67
+ return isAuthorized;
68
+ }
69
+
70
+ async function requestAndroidBluetoothConnectAuthorization(): Promise<PermissionStatus> {
71
+ const status: PermissionStatus = await PermissionsAndroid.request(
72
+ permissions?.android?.bluetooth?.connect as Permission
73
+ );
74
+
75
+ return status;
76
+ }
77
+
78
+ export {
79
+ hasAndroidLocationFineAuthorized,
80
+ requestAndroidLocationFineAuthorization,
81
+ hasAndroidLocationCoarseAuthorized,
82
+ requestAndroidLocationCoarseAuthorization,
83
+ hasLocationAuthorized,
84
+ hasAndroidBluetoothScanAuthorized,
85
+ requestAndroidBluetoothScanAuthorization,
86
+ hasAndroidBluetoothConnectAuthorized,
87
+ requestAndroidBluetoothConnectAuthorization,
88
+ };
@@ -0,0 +1,124 @@
1
+ import { Linking, Platform } from 'react-native';
2
+
3
+ import { settings } from '../constants';
4
+ import type { SentIntentAndroid } from '../types';
5
+
6
+ async function canOpenUrl(url: string): Promise<boolean> {
7
+ try {
8
+ const isOpenable: boolean = await Linking?.canOpenURL(url);
9
+
10
+ return isOpenable;
11
+ } catch (error: unknown) {
12
+ const err: Error = error as Error;
13
+ console.error('Given url is not valid to open: ', url, err?.message);
14
+
15
+ return false;
16
+ }
17
+ }
18
+
19
+ async function openUrl(url: string): Promise<boolean> {
20
+ const isOpenable: boolean = await canOpenUrl(url);
21
+
22
+ if (isOpenable) {
23
+ try {
24
+ await Linking?.openURL(url);
25
+ console.log('Opened given url: ', url);
26
+ return true;
27
+ } catch (error: unknown) {
28
+ const err: Error = error as Error;
29
+ console.error('Can not open given url: ', url, err?.message);
30
+
31
+ return false;
32
+ }
33
+ }
34
+
35
+ console.warn('Given url is not openable: ', url);
36
+ return false;
37
+ }
38
+
39
+ async function sentIntentAndroid(args: SentIntentAndroid) {
40
+ try {
41
+ await Linking?.sendIntent(args?.action, args?.extras);
42
+
43
+ return true;
44
+ } catch (error: unknown) {
45
+ const err: Error = error as Error;
46
+
47
+ console.error('Sent android intent Error: ', args, err?.message);
48
+
49
+ return false;
50
+ }
51
+ }
52
+
53
+ async function openIOSBluetoothSettings(): Promise<boolean> {
54
+ const status: boolean = await openUrl(settings?.ios?.bluetooth);
55
+
56
+ return status;
57
+ }
58
+
59
+ async function openAndroidBluetoothSettings(): Promise<boolean> {
60
+ return await sentIntentAndroid({ action: settings?.android?.bluetooth });
61
+ }
62
+
63
+ async function openBluetoothSettings(): Promise<boolean> {
64
+ if (Platform?.OS === 'ios') {
65
+ return await openIOSBluetoothSettings();
66
+ }
67
+
68
+ if (Platform?.OS === 'android') {
69
+ return await openAndroidBluetoothSettings();
70
+ }
71
+
72
+ return false;
73
+ }
74
+
75
+ async function openAppCustomSettings(): Promise<boolean> {
76
+ try {
77
+ await Linking?.openSettings();
78
+
79
+ return true;
80
+ } catch (error: unknown) {
81
+ const err: Error = error as Error;
82
+ console.error('Open app custom settings Error: ', err?.message);
83
+
84
+ return false;
85
+ }
86
+ }
87
+
88
+ async function openIOSLocationSettings(): Promise<boolean> {
89
+ const status: boolean = await openUrl(settings?.ios?.location);
90
+
91
+ return status;
92
+ }
93
+
94
+ async function openAndroidLocationSettings(): Promise<boolean> {
95
+ const status: boolean = await sentIntentAndroid({
96
+ action: settings?.android?.location,
97
+ });
98
+
99
+ return status;
100
+ }
101
+
102
+ async function openLocationSettings(): Promise<boolean> {
103
+ if (Platform?.OS === 'ios') {
104
+ return await openIOSLocationSettings();
105
+ }
106
+
107
+ if (Platform?.OS === 'android') {
108
+ return await openAndroidLocationSettings();
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ export {
115
+ canOpenUrl,
116
+ openUrl,
117
+ openIOSBluetoothSettings,
118
+ openAndroidBluetoothSettings,
119
+ openAppCustomSettings,
120
+ openIOSLocationSettings,
121
+ openAndroidLocationSettings,
122
+ openLocationSettings,
123
+ openBluetoothSettings,
124
+ };
@@ -1,3 +1,5 @@
1
+ import { Buffer } from 'buffer';
2
+
1
3
  function isEmpty(text: unknown): boolean {
2
4
  if (!text) {
3
5
  return true;
@@ -44,7 +46,7 @@ function stringToBase64(input: string): string {
44
46
  return Buffer?.from(input, 'utf8').toString('base64');
45
47
  }
46
48
 
47
- function removeNullCharactorsFromText(text: string) {
49
+ function removeNullCharactersFromText(text: string) {
48
50
  const alphaNumericRegex = new RegExp(/[^a-z0-9]/gi);
49
51
  return text
50
52
  ?.replaceAll('\0', '')
@@ -67,7 +69,7 @@ export {
67
69
  stringToByteArray,
68
70
  base64ToString,
69
71
  stringToBase64,
70
- removeNullCharactorsFromText,
72
+ removeNullCharactersFromText,
71
73
  convertStringToNumber,
72
74
  splitString,
73
75
  };