react-native-nitro-geolocation 1.1.3 → 1.2.0

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 (186) hide show
  1. package/README.md +316 -0
  2. package/android/build.gradle +6 -0
  3. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidAccuracy.kt +105 -0
  4. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidHeadingManager.kt +313 -0
  5. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidLocationSettings.kt +313 -0
  6. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/GetCurrentPosition.kt +46 -45
  7. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/LocationMetadata.kt +26 -0
  8. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/LocationValues.kt +31 -0
  9. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +1025 -140
  10. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocationCompat.kt +11 -11
  11. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/RequestAuthorization.kt +6 -6
  12. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/WatchPosition.kt +46 -45
  13. package/ios/CLLocation+GeolocationMetadata.swift +32 -0
  14. package/ios/LocationManager.swift +205 -51
  15. package/ios/NitroGeolocation.swift +949 -110
  16. package/ios/NitroGeolocationCompat.swift +7 -7
  17. package/nitrogen/generated/android/c++/JAccuracyAuthorization.hpp +61 -0
  18. package/nitrogen/generated/android/c++/JAndroidAccuracyPreset.hpp +64 -0
  19. package/nitrogen/generated/android/c++/JAndroidGranularity.hpp +61 -0
  20. package/nitrogen/generated/android/c++/{JRNConfigurationInternal.hpp → JCompatGeolocationConfigurationInternal.hpp} +10 -10
  21. package/nitrogen/generated/android/c++/{JGeolocationError.hpp → JCompatGeolocationError.hpp} +10 -10
  22. package/nitrogen/generated/android/c++/JCompatGeolocationOptions.hpp +105 -0
  23. package/nitrogen/generated/android/c++/JCompatGeolocationResponse.hpp +67 -0
  24. package/nitrogen/generated/android/c++/JFunc_void_AccuracyAuthorization.hpp +77 -0
  25. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationError.hpp +78 -0
  26. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationResponse.hpp +84 -0
  27. package/nitrogen/generated/android/c++/JFunc_void_GeolocationResponse.hpp +2 -0
  28. package/nitrogen/generated/android/c++/JFunc_void_Heading.hpp +78 -0
  29. package/nitrogen/generated/android/c++/JFunc_void_LocationProviderStatus.hpp +78 -0
  30. package/nitrogen/generated/android/c++/JFunc_void_PermissionStatus.hpp +77 -0
  31. package/nitrogen/generated/android/c++/JFunc_void_std__vector_GeocodedLocation_.hpp +97 -0
  32. package/nitrogen/generated/android/c++/JFunc_void_std__vector_ReverseGeocodedAddress_.hpp +98 -0
  33. package/nitrogen/generated/android/c++/JGeocodedLocation.hpp +65 -0
  34. package/nitrogen/generated/android/c++/JGeocodingCoordinates.hpp +61 -0
  35. package/nitrogen/generated/android/c++/{JModernGeolocationConfiguration.hpp → JGeolocationConfiguration.hpp} +10 -10
  36. package/nitrogen/generated/android/c++/JGeolocationResponse.hpp +13 -3
  37. package/nitrogen/generated/android/c++/JHeading.hpp +69 -0
  38. package/nitrogen/generated/android/c++/JHeadingOptions.hpp +57 -0
  39. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp +46 -30
  40. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.hpp +4 -4
  41. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp +169 -33
  42. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.hpp +14 -3
  43. package/nitrogen/generated/android/c++/JIOSAccuracyPreset.hpp +73 -0
  44. package/nitrogen/generated/android/c++/JIOSActivityType.hpp +67 -0
  45. package/nitrogen/generated/android/c++/JLocationAccuracyOptions.hpp +65 -0
  46. package/nitrogen/generated/android/c++/JLocationAvailability.hpp +62 -0
  47. package/nitrogen/generated/android/c++/JLocationProviderStatus.hpp +77 -0
  48. package/nitrogen/generated/android/c++/JLocationProviderUsed.hpp +67 -0
  49. package/nitrogen/generated/android/c++/JLocationRequestOptions.hpp +49 -3
  50. package/nitrogen/generated/android/c++/{JGeolocationOptions.hpp → JLocationSettingsOptions.hpp} +28 -22
  51. package/nitrogen/generated/android/c++/JReverseGeocodedAddress.hpp +82 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AccuracyAuthorization.kt +24 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidAccuracyPreset.kt +25 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidGranularity.kt +24 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{RNConfigurationInternal.kt → CompatGeolocationConfigurationInternal.kt} +5 -5
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{GeolocationError.kt → CompatGeolocationError.kt} +5 -5
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationOptions.kt +68 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationResponse.kt +41 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_AccuracyAuthorization.kt +80 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{Func_void_GeolocationError.kt → Func_void_CompatGeolocationError.kt} +9 -9
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_CompatGeolocationResponse.kt +80 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_Heading.kt +80 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_LocationProviderStatus.kt +80 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_PermissionStatus.kt +80 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_std__vector_GeocodedLocation_.kt +80 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_std__vector_ReverseGeocodedAddress_.kt +80 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodedLocation.kt +44 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodingCoordinates.kt +41 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{ModernGeolocationConfiguration.kt → GeolocationConfiguration.kt} +5 -5
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationResponse.kt +9 -3
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Heading.kt +47 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HeadingOptions.kt +38 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationCompatSpec.kt +7 -7
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationSpec.kt +92 -3
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSAccuracyPreset.kt +28 -0
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSActivityType.kt +26 -0
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAccuracyOptions.kt +41 -0
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAvailability.kt +41 -0
  79. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderStatus.kt +53 -0
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderUsed.kt +26 -0
  81. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationRequestOptions.kt +30 -3
  82. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{GeolocationOptions.kt → LocationSettingsOptions.kt} +11 -11
  83. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ReverseGeocodedAddress.kt +56 -0
  84. package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +18 -4
  85. package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.cpp +76 -12
  86. package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +519 -77
  87. package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Umbrella.hpp +61 -12
  88. package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.hpp +28 -16
  89. package/nitrogen/generated/ios/c++/HybridNitroGeolocationSpecSwift.hpp +131 -13
  90. package/nitrogen/generated/ios/swift/AccuracyAuthorization.swift +44 -0
  91. package/nitrogen/generated/ios/swift/AndroidAccuracyPreset.swift +48 -0
  92. package/nitrogen/generated/ios/swift/AndroidGranularity.swift +44 -0
  93. package/nitrogen/generated/ios/swift/{RNConfigurationInternal.swift → CompatGeolocationConfigurationInternal.swift} +5 -5
  94. package/nitrogen/generated/ios/swift/{GeolocationError.swift → CompatGeolocationError.swift} +5 -5
  95. package/nitrogen/generated/ios/swift/CompatGeolocationOptions.swift +208 -0
  96. package/nitrogen/generated/ios/swift/CompatGeolocationResponse.swift +34 -0
  97. package/nitrogen/generated/ios/swift/Func_void_AccuracyAuthorization.swift +46 -0
  98. package/nitrogen/generated/ios/swift/Func_void_CompatGeolocationError.swift +46 -0
  99. package/nitrogen/generated/ios/swift/Func_void_CompatGeolocationResponse.swift +46 -0
  100. package/nitrogen/generated/ios/swift/{Func_void_GeolocationError.swift → Func_void_Heading.swift} +11 -11
  101. package/nitrogen/generated/ios/swift/Func_void_LocationAvailability.swift +46 -0
  102. package/nitrogen/generated/ios/swift/Func_void_LocationProviderStatus.swift +46 -0
  103. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  104. package/nitrogen/generated/ios/swift/Func_void_std__vector_GeocodedLocation_.swift +46 -0
  105. package/nitrogen/generated/ios/swift/Func_void_std__vector_ReverseGeocodedAddress_.swift +46 -0
  106. package/nitrogen/generated/ios/swift/GeocodedLocation.swift +52 -0
  107. package/nitrogen/generated/ios/swift/GeocodingCoordinates.swift +34 -0
  108. package/nitrogen/generated/ios/swift/{ModernGeolocationConfiguration.swift → GeolocationConfiguration.swift} +5 -5
  109. package/nitrogen/generated/ios/swift/GeolocationResponse.swift +31 -2
  110. package/nitrogen/generated/ios/swift/Heading.swift +70 -0
  111. package/nitrogen/generated/ios/swift/HeadingOptions.swift +42 -0
  112. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec.swift +4 -4
  113. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec_cxx.swift +28 -28
  114. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec.swift +14 -3
  115. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec_cxx.swift +318 -15
  116. package/nitrogen/generated/ios/swift/IOSAccuracyPreset.swift +60 -0
  117. package/nitrogen/generated/ios/swift/IOSActivityType.swift +52 -0
  118. package/nitrogen/generated/ios/swift/LocationAccuracyOptions.swift +46 -0
  119. package/nitrogen/generated/ios/swift/LocationAvailability.swift +47 -0
  120. package/nitrogen/generated/ios/swift/LocationProviderStatus.swift +106 -0
  121. package/nitrogen/generated/ios/swift/LocationProviderUsed.swift +52 -0
  122. package/nitrogen/generated/ios/swift/LocationRequestOptions.swift +142 -1
  123. package/nitrogen/generated/ios/swift/{GeolocationOptions.swift → LocationSettingsOptions.swift} +39 -46
  124. package/nitrogen/generated/ios/swift/ReverseGeocodedAddress.swift +150 -0
  125. package/nitrogen/generated/shared/c++/AccuracyAuthorization.hpp +80 -0
  126. package/nitrogen/generated/shared/c++/AndroidAccuracyPreset.hpp +84 -0
  127. package/nitrogen/generated/shared/c++/AndroidGranularity.hpp +80 -0
  128. package/nitrogen/generated/shared/c++/{RNConfigurationInternal.hpp → CompatGeolocationConfigurationInternal.hpp} +11 -11
  129. package/nitrogen/generated/shared/c++/{GeolocationError.hpp → CompatGeolocationError.hpp} +11 -11
  130. package/nitrogen/generated/shared/c++/CompatGeolocationOptions.hpp +128 -0
  131. package/nitrogen/generated/shared/c++/CompatGeolocationResponse.hpp +88 -0
  132. package/nitrogen/generated/shared/c++/GeocodedLocation.hpp +91 -0
  133. package/nitrogen/generated/shared/c++/GeocodingCoordinates.hpp +87 -0
  134. package/nitrogen/generated/shared/c++/{ModernGeolocationConfiguration.hpp → GeolocationConfiguration.hpp} +11 -11
  135. package/nitrogen/generated/shared/c++/GeolocationResponse.hpp +14 -2
  136. package/nitrogen/generated/shared/c++/Heading.hpp +95 -0
  137. package/nitrogen/generated/shared/c++/HeadingOptions.hpp +83 -0
  138. package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.hpp +16 -16
  139. package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.cpp +11 -0
  140. package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.hpp +51 -12
  141. package/nitrogen/generated/shared/c++/IOSAccuracyPreset.hpp +96 -0
  142. package/nitrogen/generated/shared/c++/IOSActivityType.hpp +88 -0
  143. package/nitrogen/generated/shared/c++/LocationAccuracyOptions.hpp +92 -0
  144. package/nitrogen/generated/shared/c++/LocationAvailability.hpp +88 -0
  145. package/nitrogen/generated/shared/c++/LocationProviderStatus.hpp +103 -0
  146. package/nitrogen/generated/shared/c++/LocationProviderUsed.hpp +88 -0
  147. package/nitrogen/generated/shared/c++/LocationRequestOptions.hpp +47 -3
  148. package/nitrogen/generated/shared/c++/{GeolocationOptions.hpp → LocationSettingsOptions.hpp} +26 -24
  149. package/nitrogen/generated/shared/c++/ReverseGeocodedAddress.hpp +108 -0
  150. package/package.json +1 -1
  151. package/src/NitroGeolocation.nitro.ts +291 -17
  152. package/src/NitroGeolocationCompat.nitro.ts +12 -12
  153. package/src/api/geocode.ts +18 -0
  154. package/src/api/getAccuracyAuthorization.ts +12 -0
  155. package/src/api/getCurrentPosition.ts +5 -3
  156. package/src/api/getHeading.ts +13 -0
  157. package/src/api/getLastKnownPosition.ts +28 -0
  158. package/src/api/getLocationAvailability.ts +11 -0
  159. package/src/api/getProviderStatus.ts +16 -0
  160. package/src/api/hasServicesEnabled.ts +13 -0
  161. package/src/api/index.ts +11 -0
  162. package/src/api/requestLocationSettings.ts +29 -0
  163. package/src/api/requestPermission.ts +3 -1
  164. package/src/api/requestTemporaryFullAccuracy.ts +21 -0
  165. package/src/api/reverseGeocode.ts +23 -0
  166. package/src/api/setConfiguration.ts +8 -4
  167. package/src/api/watchHeading.ts +19 -0
  168. package/src/api/watchPosition.ts +2 -2
  169. package/src/compat/getCurrentPosition.ts +7 -7
  170. package/src/compat/index.tsx +5 -5
  171. package/src/compat/requestAuthorization.ts +2 -2
  172. package/src/compat/setRNConfiguration.ts +7 -5
  173. package/src/compat/watchPosition.ts +7 -7
  174. package/src/devtools/getCurrentPosition.ts +5 -3
  175. package/src/devtools/index.ts +1 -1
  176. package/src/devtools/watchPosition.ts +6 -7
  177. package/src/hooks/useWatchPosition.ts +2 -2
  178. package/src/index.tsx +35 -6
  179. package/src/publicTypes.ts +96 -0
  180. package/src/types.ts +113 -37
  181. package/src/utils/errors.test.ts +65 -0
  182. package/src/utils/errors.ts +45 -18
  183. package/src/utils/index.ts +2 -2
  184. package/src/utils/provider.test.ts +172 -1
  185. package/src/utils/provider.ts +50 -5
  186. package/nitrogen/generated/android/c++/JFunc_void_GeolocationError.hpp +0 -78
@@ -8,53 +8,101 @@
8
8
  #pragma once
9
9
 
10
10
  // Forward declarations of C++ defined types
11
+ // Forward declaration of `AccuracyAuthorization` to properly resolve imports.
12
+ namespace margelo::nitro::nitrogeolocation { enum class AccuracyAuthorization; }
13
+ // Forward declaration of `AndroidAccuracyPreset` to properly resolve imports.
14
+ namespace margelo::nitro::nitrogeolocation { enum class AndroidAccuracyPreset; }
15
+ // Forward declaration of `AndroidGranularity` to properly resolve imports.
16
+ namespace margelo::nitro::nitrogeolocation { enum class AndroidGranularity; }
11
17
  // Forward declaration of `AuthorizationLevelInternal` to properly resolve imports.
12
18
  namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevelInternal; }
13
19
  // Forward declaration of `AuthorizationLevel` to properly resolve imports.
14
20
  namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevel; }
21
+ // Forward declaration of `CompatGeolocationConfigurationInternal` to properly resolve imports.
22
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationConfigurationInternal; }
23
+ // Forward declaration of `CompatGeolocationError` to properly resolve imports.
24
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationError; }
25
+ // Forward declaration of `CompatGeolocationOptions` to properly resolve imports.
26
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationOptions; }
27
+ // Forward declaration of `CompatGeolocationResponse` to properly resolve imports.
28
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationResponse; }
29
+ // Forward declaration of `GeocodedLocation` to properly resolve imports.
30
+ namespace margelo::nitro::nitrogeolocation { struct GeocodedLocation; }
31
+ // Forward declaration of `GeocodingCoordinates` to properly resolve imports.
32
+ namespace margelo::nitro::nitrogeolocation { struct GeocodingCoordinates; }
33
+ // Forward declaration of `GeolocationConfiguration` to properly resolve imports.
34
+ namespace margelo::nitro::nitrogeolocation { struct GeolocationConfiguration; }
15
35
  // Forward declaration of `GeolocationCoordinates` to properly resolve imports.
16
36
  namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
17
- // Forward declaration of `GeolocationError` to properly resolve imports.
18
- namespace margelo::nitro::nitrogeolocation { struct GeolocationError; }
19
- // Forward declaration of `GeolocationOptions` to properly resolve imports.
20
- namespace margelo::nitro::nitrogeolocation { struct GeolocationOptions; }
21
37
  // Forward declaration of `GeolocationResponse` to properly resolve imports.
22
38
  namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
39
+ // Forward declaration of `HeadingOptions` to properly resolve imports.
40
+ namespace margelo::nitro::nitrogeolocation { struct HeadingOptions; }
41
+ // Forward declaration of `Heading` to properly resolve imports.
42
+ namespace margelo::nitro::nitrogeolocation { struct Heading; }
23
43
  // Forward declaration of `HybridNitroGeolocationCompatSpec` to properly resolve imports.
24
44
  namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationCompatSpec; }
25
45
  // Forward declaration of `HybridNitroGeolocationSpec` to properly resolve imports.
26
46
  namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationSpec; }
47
+ // Forward declaration of `IOSAccuracyPreset` to properly resolve imports.
48
+ namespace margelo::nitro::nitrogeolocation { enum class IOSAccuracyPreset; }
49
+ // Forward declaration of `IOSActivityType` to properly resolve imports.
50
+ namespace margelo::nitro::nitrogeolocation { enum class IOSActivityType; }
51
+ // Forward declaration of `LocationAccuracyOptions` to properly resolve imports.
52
+ namespace margelo::nitro::nitrogeolocation { struct LocationAccuracyOptions; }
53
+ // Forward declaration of `LocationAvailability` to properly resolve imports.
54
+ namespace margelo::nitro::nitrogeolocation { struct LocationAvailability; }
27
55
  // Forward declaration of `LocationError` to properly resolve imports.
28
56
  namespace margelo::nitro::nitrogeolocation { struct LocationError; }
29
57
  // Forward declaration of `LocationProviderInternal` to properly resolve imports.
30
58
  namespace margelo::nitro::nitrogeolocation { enum class LocationProviderInternal; }
59
+ // Forward declaration of `LocationProviderStatus` to properly resolve imports.
60
+ namespace margelo::nitro::nitrogeolocation { struct LocationProviderStatus; }
61
+ // Forward declaration of `LocationProviderUsed` to properly resolve imports.
62
+ namespace margelo::nitro::nitrogeolocation { enum class LocationProviderUsed; }
31
63
  // Forward declaration of `LocationProvider` to properly resolve imports.
32
64
  namespace margelo::nitro::nitrogeolocation { enum class LocationProvider; }
33
65
  // Forward declaration of `LocationRequestOptions` to properly resolve imports.
34
66
  namespace margelo::nitro::nitrogeolocation { struct LocationRequestOptions; }
35
- // Forward declaration of `ModernGeolocationConfiguration` to properly resolve imports.
36
- namespace margelo::nitro::nitrogeolocation { struct ModernGeolocationConfiguration; }
67
+ // Forward declaration of `LocationSettingsOptions` to properly resolve imports.
68
+ namespace margelo::nitro::nitrogeolocation { struct LocationSettingsOptions; }
37
69
  // Forward declaration of `PermissionStatus` to properly resolve imports.
38
70
  namespace margelo::nitro::nitrogeolocation { enum class PermissionStatus; }
39
- // Forward declaration of `RNConfigurationInternal` to properly resolve imports.
40
- namespace margelo::nitro::nitrogeolocation { struct RNConfigurationInternal; }
71
+ // Forward declaration of `ReverseGeocodedAddress` to properly resolve imports.
72
+ namespace margelo::nitro::nitrogeolocation { struct ReverseGeocodedAddress; }
41
73
 
42
74
  // Include C++ defined types
75
+ #include "AccuracyAuthorization.hpp"
76
+ #include "AndroidAccuracyPreset.hpp"
77
+ #include "AndroidGranularity.hpp"
43
78
  #include "AuthorizationLevel.hpp"
44
79
  #include "AuthorizationLevelInternal.hpp"
80
+ #include "CompatGeolocationConfigurationInternal.hpp"
81
+ #include "CompatGeolocationError.hpp"
82
+ #include "CompatGeolocationOptions.hpp"
83
+ #include "CompatGeolocationResponse.hpp"
84
+ #include "GeocodedLocation.hpp"
85
+ #include "GeocodingCoordinates.hpp"
86
+ #include "GeolocationConfiguration.hpp"
45
87
  #include "GeolocationCoordinates.hpp"
46
- #include "GeolocationError.hpp"
47
- #include "GeolocationOptions.hpp"
48
88
  #include "GeolocationResponse.hpp"
89
+ #include "Heading.hpp"
90
+ #include "HeadingOptions.hpp"
49
91
  #include "HybridNitroGeolocationCompatSpec.hpp"
50
92
  #include "HybridNitroGeolocationSpec.hpp"
93
+ #include "IOSAccuracyPreset.hpp"
94
+ #include "IOSActivityType.hpp"
95
+ #include "LocationAccuracyOptions.hpp"
96
+ #include "LocationAvailability.hpp"
51
97
  #include "LocationError.hpp"
52
98
  #include "LocationProvider.hpp"
53
99
  #include "LocationProviderInternal.hpp"
100
+ #include "LocationProviderStatus.hpp"
101
+ #include "LocationProviderUsed.hpp"
54
102
  #include "LocationRequestOptions.hpp"
55
- #include "ModernGeolocationConfiguration.hpp"
103
+ #include "LocationSettingsOptions.hpp"
56
104
  #include "PermissionStatus.hpp"
57
- #include "RNConfigurationInternal.hpp"
105
+ #include "ReverseGeocodedAddress.hpp"
58
106
  #include <NitroModules/Null.hpp>
59
107
  #include <NitroModules/Promise.hpp>
60
108
  #include <NitroModules/Result.hpp>
@@ -64,6 +112,7 @@ namespace margelo::nitro::nitrogeolocation { struct RNConfigurationInternal; }
64
112
  #include <optional>
65
113
  #include <string>
66
114
  #include <variant>
115
+ #include <vector>
67
116
 
68
117
  // C++ helpers for Swift
69
118
  #include "NitroGeolocation-Swift-Cxx-Bridge.hpp"
@@ -12,33 +12,45 @@
12
12
  // Forward declaration of `HybridNitroGeolocationCompatSpec_cxx` to properly resolve imports.
13
13
  namespace NitroGeolocation { class HybridNitroGeolocationCompatSpec_cxx; }
14
14
 
15
- // Forward declaration of `RNConfigurationInternal` to properly resolve imports.
16
- namespace margelo::nitro::nitrogeolocation { struct RNConfigurationInternal; }
15
+ // Forward declaration of `CompatGeolocationConfigurationInternal` to properly resolve imports.
16
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationConfigurationInternal; }
17
17
  // Forward declaration of `AuthorizationLevelInternal` to properly resolve imports.
18
18
  namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevelInternal; }
19
19
  // Forward declaration of `LocationProviderInternal` to properly resolve imports.
20
20
  namespace margelo::nitro::nitrogeolocation { enum class LocationProviderInternal; }
21
- // Forward declaration of `GeolocationError` to properly resolve imports.
22
- namespace margelo::nitro::nitrogeolocation { struct GeolocationError; }
23
- // Forward declaration of `GeolocationResponse` to properly resolve imports.
24
- namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
21
+ // Forward declaration of `CompatGeolocationError` to properly resolve imports.
22
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationError; }
23
+ // Forward declaration of `CompatGeolocationResponse` to properly resolve imports.
24
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationResponse; }
25
25
  // Forward declaration of `GeolocationCoordinates` to properly resolve imports.
26
26
  namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
27
- // Forward declaration of `GeolocationOptions` to properly resolve imports.
28
- namespace margelo::nitro::nitrogeolocation { struct GeolocationOptions; }
27
+ // Forward declaration of `CompatGeolocationOptions` to properly resolve imports.
28
+ namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationOptions; }
29
+ // Forward declaration of `LocationAccuracyOptions` to properly resolve imports.
30
+ namespace margelo::nitro::nitrogeolocation { struct LocationAccuracyOptions; }
31
+ // Forward declaration of `AndroidAccuracyPreset` to properly resolve imports.
32
+ namespace margelo::nitro::nitrogeolocation { enum class AndroidAccuracyPreset; }
33
+ // Forward declaration of `IOSAccuracyPreset` to properly resolve imports.
34
+ namespace margelo::nitro::nitrogeolocation { enum class IOSAccuracyPreset; }
35
+ // Forward declaration of `IOSActivityType` to properly resolve imports.
36
+ namespace margelo::nitro::nitrogeolocation { enum class IOSActivityType; }
29
37
 
30
- #include "RNConfigurationInternal.hpp"
38
+ #include "CompatGeolocationConfigurationInternal.hpp"
31
39
  #include "AuthorizationLevelInternal.hpp"
32
40
  #include <optional>
33
41
  #include "LocationProviderInternal.hpp"
34
42
  #include <functional>
35
- #include "GeolocationError.hpp"
43
+ #include "CompatGeolocationError.hpp"
36
44
  #include <string>
37
- #include "GeolocationResponse.hpp"
45
+ #include "CompatGeolocationResponse.hpp"
38
46
  #include "GeolocationCoordinates.hpp"
39
47
  #include <NitroModules/Null.hpp>
40
48
  #include <variant>
41
- #include "GeolocationOptions.hpp"
49
+ #include "CompatGeolocationOptions.hpp"
50
+ #include "LocationAccuracyOptions.hpp"
51
+ #include "AndroidAccuracyPreset.hpp"
52
+ #include "IOSAccuracyPreset.hpp"
53
+ #include "IOSActivityType.hpp"
42
54
 
43
55
  #include "NitroGeolocation-Swift-Cxx-Umbrella.hpp"
44
56
 
@@ -90,25 +102,25 @@ namespace margelo::nitro::nitrogeolocation {
90
102
 
91
103
  public:
92
104
  // Methods
93
- inline void setRNConfiguration(const RNConfigurationInternal& config) override {
105
+ inline void setRNConfiguration(const CompatGeolocationConfigurationInternal& config) override {
94
106
  auto __result = _swiftPart.setRNConfiguration(std::forward<decltype(config)>(config));
95
107
  if (__result.hasError()) [[unlikely]] {
96
108
  std::rethrow_exception(__result.error());
97
109
  }
98
110
  }
99
- inline void requestAuthorization(const std::optional<std::function<void()>>& success, const std::optional<std::function<void(const GeolocationError& /* error */)>>& error) override {
111
+ inline void requestAuthorization(const std::optional<std::function<void()>>& success, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error) override {
100
112
  auto __result = _swiftPart.requestAuthorization(success, error);
101
113
  if (__result.hasError()) [[unlikely]] {
102
114
  std::rethrow_exception(__result.error());
103
115
  }
104
116
  }
105
- inline void getCurrentPosition(const std::function<void(const GeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const GeolocationError& /* error */)>>& error, const std::optional<GeolocationOptions>& options) override {
117
+ inline void getCurrentPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error, const std::optional<CompatGeolocationOptions>& options) override {
106
118
  auto __result = _swiftPart.getCurrentPosition(success, error, options);
107
119
  if (__result.hasError()) [[unlikely]] {
108
120
  std::rethrow_exception(__result.error());
109
121
  }
110
122
  }
111
- inline double watchPosition(const std::function<void(const GeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const GeolocationError& /* error */)>>& error, const std::optional<GeolocationOptions>& options) override {
123
+ inline double watchPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error, const std::optional<CompatGeolocationOptions>& options) override {
112
124
  auto __result = _swiftPart.watchPosition(success, error, options);
113
125
  if (__result.hasError()) [[unlikely]] {
114
126
  std::rethrow_exception(__result.error());
@@ -12,37 +12,83 @@
12
12
  // Forward declaration of `HybridNitroGeolocationSpec_cxx` to properly resolve imports.
13
13
  namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
14
14
 
15
- // Forward declaration of `ModernGeolocationConfiguration` to properly resolve imports.
16
- namespace margelo::nitro::nitrogeolocation { struct ModernGeolocationConfiguration; }
15
+ // Forward declaration of `GeolocationConfiguration` to properly resolve imports.
16
+ namespace margelo::nitro::nitrogeolocation { struct GeolocationConfiguration; }
17
17
  // Forward declaration of `AuthorizationLevel` to properly resolve imports.
18
18
  namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevel; }
19
19
  // Forward declaration of `LocationProvider` to properly resolve imports.
20
20
  namespace margelo::nitro::nitrogeolocation { enum class LocationProvider; }
21
21
  // Forward declaration of `PermissionStatus` to properly resolve imports.
22
22
  namespace margelo::nitro::nitrogeolocation { enum class PermissionStatus; }
23
+ // Forward declaration of `LocationError` to properly resolve imports.
24
+ namespace margelo::nitro::nitrogeolocation { struct LocationError; }
25
+ // Forward declaration of `LocationProviderStatus` to properly resolve imports.
26
+ namespace margelo::nitro::nitrogeolocation { struct LocationProviderStatus; }
27
+ // Forward declaration of `LocationAvailability` to properly resolve imports.
28
+ namespace margelo::nitro::nitrogeolocation { struct LocationAvailability; }
29
+ // Forward declaration of `LocationSettingsOptions` to properly resolve imports.
30
+ namespace margelo::nitro::nitrogeolocation { struct LocationSettingsOptions; }
31
+ // Forward declaration of `LocationAccuracyOptions` to properly resolve imports.
32
+ namespace margelo::nitro::nitrogeolocation { struct LocationAccuracyOptions; }
33
+ // Forward declaration of `AndroidAccuracyPreset` to properly resolve imports.
34
+ namespace margelo::nitro::nitrogeolocation { enum class AndroidAccuracyPreset; }
35
+ // Forward declaration of `IOSAccuracyPreset` to properly resolve imports.
36
+ namespace margelo::nitro::nitrogeolocation { enum class IOSAccuracyPreset; }
37
+ // Forward declaration of `AccuracyAuthorization` to properly resolve imports.
38
+ namespace margelo::nitro::nitrogeolocation { enum class AccuracyAuthorization; }
23
39
  // Forward declaration of `GeolocationResponse` to properly resolve imports.
24
40
  namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
25
41
  // Forward declaration of `GeolocationCoordinates` to properly resolve imports.
26
42
  namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
43
+ // Forward declaration of `LocationProviderUsed` to properly resolve imports.
44
+ namespace margelo::nitro::nitrogeolocation { enum class LocationProviderUsed; }
27
45
  // Forward declaration of `LocationRequestOptions` to properly resolve imports.
28
46
  namespace margelo::nitro::nitrogeolocation { struct LocationRequestOptions; }
29
- // Forward declaration of `LocationError` to properly resolve imports.
30
- namespace margelo::nitro::nitrogeolocation { struct LocationError; }
47
+ // Forward declaration of `AndroidGranularity` to properly resolve imports.
48
+ namespace margelo::nitro::nitrogeolocation { enum class AndroidGranularity; }
49
+ // Forward declaration of `IOSActivityType` to properly resolve imports.
50
+ namespace margelo::nitro::nitrogeolocation { enum class IOSActivityType; }
51
+ // Forward declaration of `GeocodedLocation` to properly resolve imports.
52
+ namespace margelo::nitro::nitrogeolocation { struct GeocodedLocation; }
53
+ // Forward declaration of `GeocodingCoordinates` to properly resolve imports.
54
+ namespace margelo::nitro::nitrogeolocation { struct GeocodingCoordinates; }
55
+ // Forward declaration of `ReverseGeocodedAddress` to properly resolve imports.
56
+ namespace margelo::nitro::nitrogeolocation { struct ReverseGeocodedAddress; }
57
+ // Forward declaration of `Heading` to properly resolve imports.
58
+ namespace margelo::nitro::nitrogeolocation { struct Heading; }
59
+ // Forward declaration of `HeadingOptions` to properly resolve imports.
60
+ namespace margelo::nitro::nitrogeolocation { struct HeadingOptions; }
31
61
 
32
- #include "ModernGeolocationConfiguration.hpp"
62
+ #include "GeolocationConfiguration.hpp"
33
63
  #include <optional>
34
64
  #include "AuthorizationLevel.hpp"
35
65
  #include "LocationProvider.hpp"
36
66
  #include "PermissionStatus.hpp"
37
67
  #include <NitroModules/Promise.hpp>
68
+ #include <functional>
69
+ #include "LocationError.hpp"
70
+ #include <string>
71
+ #include "LocationProviderStatus.hpp"
72
+ #include "LocationAvailability.hpp"
73
+ #include "LocationSettingsOptions.hpp"
74
+ #include "LocationAccuracyOptions.hpp"
75
+ #include "AndroidAccuracyPreset.hpp"
76
+ #include "IOSAccuracyPreset.hpp"
77
+ #include "AccuracyAuthorization.hpp"
38
78
  #include "GeolocationResponse.hpp"
39
79
  #include "GeolocationCoordinates.hpp"
40
80
  #include <NitroModules/Null.hpp>
41
81
  #include <variant>
82
+ #include "LocationProviderUsed.hpp"
42
83
  #include "LocationRequestOptions.hpp"
43
- #include <string>
44
- #include <functional>
45
- #include "LocationError.hpp"
84
+ #include "AndroidGranularity.hpp"
85
+ #include "IOSActivityType.hpp"
86
+ #include "GeocodedLocation.hpp"
87
+ #include <vector>
88
+ #include "GeocodingCoordinates.hpp"
89
+ #include "ReverseGeocodedAddress.hpp"
90
+ #include "Heading.hpp"
91
+ #include "HeadingOptions.hpp"
46
92
 
47
93
  #include "NitroGeolocation-Swift-Cxx-Umbrella.hpp"
48
94
 
@@ -94,7 +140,7 @@ namespace margelo::nitro::nitrogeolocation {
94
140
 
95
141
  public:
96
142
  // Methods
97
- inline void setConfiguration(const ModernGeolocationConfiguration& config) override {
143
+ inline void setConfiguration(const GeolocationConfiguration& config) override {
98
144
  auto __result = _swiftPart.setConfiguration(std::forward<decltype(config)>(config));
99
145
  if (__result.hasError()) [[unlikely]] {
100
146
  std::rethrow_exception(__result.error());
@@ -108,16 +154,88 @@ namespace margelo::nitro::nitrogeolocation {
108
154
  auto __value = std::move(__result.value());
109
155
  return __value;
110
156
  }
111
- inline std::shared_ptr<Promise<PermissionStatus>> requestPermission() override {
112
- auto __result = _swiftPart.requestPermission();
157
+ inline void requestPermission(const std::function<void(PermissionStatus /* status */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error) override {
158
+ auto __result = _swiftPart.requestPermission(success, error);
159
+ if (__result.hasError()) [[unlikely]] {
160
+ std::rethrow_exception(__result.error());
161
+ }
162
+ }
163
+ inline std::shared_ptr<Promise<bool>> hasServicesEnabled() override {
164
+ auto __result = _swiftPart.hasServicesEnabled();
165
+ if (__result.hasError()) [[unlikely]] {
166
+ std::rethrow_exception(__result.error());
167
+ }
168
+ auto __value = std::move(__result.value());
169
+ return __value;
170
+ }
171
+ inline std::shared_ptr<Promise<LocationProviderStatus>> getProviderStatus() override {
172
+ auto __result = _swiftPart.getProviderStatus();
173
+ if (__result.hasError()) [[unlikely]] {
174
+ std::rethrow_exception(__result.error());
175
+ }
176
+ auto __value = std::move(__result.value());
177
+ return __value;
178
+ }
179
+ inline std::shared_ptr<Promise<LocationAvailability>> getLocationAvailability() override {
180
+ auto __result = _swiftPart.getLocationAvailability();
181
+ if (__result.hasError()) [[unlikely]] {
182
+ std::rethrow_exception(__result.error());
183
+ }
184
+ auto __value = std::move(__result.value());
185
+ return __value;
186
+ }
187
+ inline void requestLocationSettings(const std::function<void(const LocationProviderStatus& /* status */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error, const std::optional<LocationSettingsOptions>& options) override {
188
+ auto __result = _swiftPart.requestLocationSettings(success, error, options);
189
+ if (__result.hasError()) [[unlikely]] {
190
+ std::rethrow_exception(__result.error());
191
+ }
192
+ }
193
+ inline std::shared_ptr<Promise<AccuracyAuthorization>> getAccuracyAuthorization() override {
194
+ auto __result = _swiftPart.getAccuracyAuthorization();
113
195
  if (__result.hasError()) [[unlikely]] {
114
196
  std::rethrow_exception(__result.error());
115
197
  }
116
198
  auto __value = std::move(__result.value());
117
199
  return __value;
118
200
  }
119
- inline std::shared_ptr<Promise<GeolocationResponse>> getCurrentPosition(const std::optional<LocationRequestOptions>& options) override {
120
- auto __result = _swiftPart.getCurrentPosition(options);
201
+ inline void requestTemporaryFullAccuracy(const std::string& purposeKey, const std::function<void(AccuracyAuthorization /* authorization */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error) override {
202
+ auto __result = _swiftPart.requestTemporaryFullAccuracy(purposeKey, success, error);
203
+ if (__result.hasError()) [[unlikely]] {
204
+ std::rethrow_exception(__result.error());
205
+ }
206
+ }
207
+ inline void getCurrentPosition(const std::function<void(const GeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error, const std::optional<LocationRequestOptions>& options) override {
208
+ auto __result = _swiftPart.getCurrentPosition(success, error, options);
209
+ if (__result.hasError()) [[unlikely]] {
210
+ std::rethrow_exception(__result.error());
211
+ }
212
+ }
213
+ inline void getLastKnownPosition(const std::function<void(const GeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error, const std::optional<LocationRequestOptions>& options) override {
214
+ auto __result = _swiftPart.getLastKnownPosition(success, error, options);
215
+ if (__result.hasError()) [[unlikely]] {
216
+ std::rethrow_exception(__result.error());
217
+ }
218
+ }
219
+ inline void geocode(const std::string& address, const std::function<void(const std::vector<GeocodedLocation>& /* locations */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error) override {
220
+ auto __result = _swiftPart.geocode(address, success, error);
221
+ if (__result.hasError()) [[unlikely]] {
222
+ std::rethrow_exception(__result.error());
223
+ }
224
+ }
225
+ inline void reverseGeocode(const GeocodingCoordinates& coords, const std::function<void(const std::vector<ReverseGeocodedAddress>& /* addresses */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error) override {
226
+ auto __result = _swiftPart.reverseGeocode(std::forward<decltype(coords)>(coords), success, error);
227
+ if (__result.hasError()) [[unlikely]] {
228
+ std::rethrow_exception(__result.error());
229
+ }
230
+ }
231
+ inline void getHeading(const std::function<void(const Heading& /* heading */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error) override {
232
+ auto __result = _swiftPart.getHeading(success, error);
233
+ if (__result.hasError()) [[unlikely]] {
234
+ std::rethrow_exception(__result.error());
235
+ }
236
+ }
237
+ inline std::string watchHeading(const std::function<void(const Heading& /* heading */)>& success, const std::optional<std::function<void(const LocationError& /* error */)>>& error, const std::optional<HeadingOptions>& options) override {
238
+ auto __result = _swiftPart.watchHeading(success, error, options);
121
239
  if (__result.hasError()) [[unlikely]] {
122
240
  std::rethrow_exception(__result.error());
123
241
  }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// AccuracyAuthorization.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ /**
9
+ * Represents the JS union `AccuracyAuthorization`, backed by a C++ enum.
10
+ */
11
+ public typealias AccuracyAuthorization = margelo.nitro.nitrogeolocation.AccuracyAuthorization
12
+
13
+ public extension AccuracyAuthorization {
14
+ /**
15
+ * Get a AccuracyAuthorization for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "reduced":
21
+ self = .reduced
22
+ case "full":
23
+ self = .full
24
+ case "unknown":
25
+ self = .unknown
26
+ default:
27
+ return nil
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Get the String value this AccuracyAuthorization represents.
33
+ */
34
+ var stringValue: String {
35
+ switch self {
36
+ case .reduced:
37
+ return "reduced"
38
+ case .full:
39
+ return "full"
40
+ case .unknown:
41
+ return "unknown"
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,48 @@
1
+ ///
2
+ /// AndroidAccuracyPreset.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ /**
9
+ * Represents the JS union `AndroidAccuracyPreset`, backed by a C++ enum.
10
+ */
11
+ public typealias AndroidAccuracyPreset = margelo.nitro.nitrogeolocation.AndroidAccuracyPreset
12
+
13
+ public extension AndroidAccuracyPreset {
14
+ /**
15
+ * Get a AndroidAccuracyPreset for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "high":
21
+ self = .high
22
+ case "balanced":
23
+ self = .balanced
24
+ case "low":
25
+ self = .low
26
+ case "passive":
27
+ self = .passive
28
+ default:
29
+ return nil
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Get the String value this AndroidAccuracyPreset represents.
35
+ */
36
+ var stringValue: String {
37
+ switch self {
38
+ case .high:
39
+ return "high"
40
+ case .balanced:
41
+ return "balanced"
42
+ case .low:
43
+ return "low"
44
+ case .passive:
45
+ return "passive"
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// AndroidGranularity.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ /**
9
+ * Represents the JS union `AndroidGranularity`, backed by a C++ enum.
10
+ */
11
+ public typealias AndroidGranularity = margelo.nitro.nitrogeolocation.AndroidGranularity
12
+
13
+ public extension AndroidGranularity {
14
+ /**
15
+ * Get a AndroidGranularity for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "permission":
21
+ self = .permission
22
+ case "coarse":
23
+ self = .coarse
24
+ case "fine":
25
+ self = .fine
26
+ default:
27
+ return nil
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Get the String value this AndroidGranularity represents.
33
+ */
34
+ var stringValue: String {
35
+ switch self {
36
+ case .permission:
37
+ return "permission"
38
+ case .coarse:
39
+ return "coarse"
40
+ case .fine:
41
+ return "fine"
42
+ }
43
+ }
44
+ }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// RNConfigurationInternal.swift
2
+ /// CompatGeolocationConfigurationInternal.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © Marc Rousavy @ Margelo
@@ -8,15 +8,15 @@
8
8
  import NitroModules
9
9
 
10
10
  /**
11
- * Represents an instance of `RNConfigurationInternal`, backed by a C++ struct.
11
+ * Represents an instance of `CompatGeolocationConfigurationInternal`, backed by a C++ struct.
12
12
  */
13
- public typealias RNConfigurationInternal = margelo.nitro.nitrogeolocation.RNConfigurationInternal
13
+ public typealias CompatGeolocationConfigurationInternal = margelo.nitro.nitrogeolocation.CompatGeolocationConfigurationInternal
14
14
 
15
- public extension RNConfigurationInternal {
15
+ public extension CompatGeolocationConfigurationInternal {
16
16
  private typealias bridge = margelo.nitro.nitrogeolocation.bridge.swift
17
17
 
18
18
  /**
19
- * Create a new instance of `RNConfigurationInternal`.
19
+ * Create a new instance of `CompatGeolocationConfigurationInternal`.
20
20
  */
21
21
  init(skipPermissionRequests: Bool, authorizationLevel: AuthorizationLevelInternal?, enableBackgroundLocationUpdates: Bool?, locationProvider: LocationProviderInternal?) {
22
22
  self.init(skipPermissionRequests, { () -> bridge.std__optional_AuthorizationLevelInternal_ in
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// GeolocationError.swift
2
+ /// CompatGeolocationError.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © Marc Rousavy @ Margelo
@@ -8,15 +8,15 @@
8
8
  import NitroModules
9
9
 
10
10
  /**
11
- * Represents an instance of `GeolocationError`, backed by a C++ struct.
11
+ * Represents an instance of `CompatGeolocationError`, backed by a C++ struct.
12
12
  */
13
- public typealias GeolocationError = margelo.nitro.nitrogeolocation.GeolocationError
13
+ public typealias CompatGeolocationError = margelo.nitro.nitrogeolocation.CompatGeolocationError
14
14
 
15
- public extension GeolocationError {
15
+ public extension CompatGeolocationError {
16
16
  private typealias bridge = margelo.nitro.nitrogeolocation.bridge.swift
17
17
 
18
18
  /**
19
- * Create a new instance of `GeolocationError`.
19
+ * Create a new instance of `CompatGeolocationError`.
20
20
  */
21
21
  init(code: Double, message: String, PERMISSION_DENIED: Double, POSITION_UNAVAILABLE: Double, TIMEOUT: Double) {
22
22
  self.init(code, std.string(message), PERMISSION_DENIED, POSITION_UNAVAILABLE, TIMEOUT)