react-native-nitro-geolocation 0.1.1 → 0.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.
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/GetCurrentPosition.kt +4 -4
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +642 -50
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocationCompat.kt +81 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/WatchPosition.kt +4 -4
- package/ios/LocationManager.swift +113 -128
- package/ios/NitroGeolocation.swift +546 -61
- package/ios/NitroGeolocationCompat.swift +109 -0
- package/nitrogen/generated/android/c++/JAuthorizationLevel.hpp +61 -0
- package/nitrogen/generated/android/c++/JAuthorizationLevelInternal.hpp +3 -4
- package/nitrogen/generated/android/c++/JFunc_void.hpp +2 -1
- package/nitrogen/generated/android/c++/JFunc_void_GeolocationError.hpp +2 -1
- package/nitrogen/generated/android/c++/JFunc_void_GeolocationResponse.hpp +6 -1
- package/nitrogen/generated/android/c++/JFunc_void_LocationError.hpp +78 -0
- package/nitrogen/generated/android/c++/JGeolocationCoordinates.hpp +25 -17
- package/nitrogen/generated/android/c++/JGeolocationError.hpp +5 -1
- package/nitrogen/generated/android/c++/JGeolocationOptions.hpp +5 -1
- package/nitrogen/generated/android/c++/JGeolocationResponse.hpp +9 -1
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp +109 -0
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp +98 -42
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.hpp +7 -5
- package/nitrogen/generated/android/c++/JLocationError.hpp +61 -0
- package/nitrogen/generated/android/c++/JLocationProvider.hpp +61 -0
- package/nitrogen/generated/android/c++/JLocationProviderInternal.hpp +3 -4
- package/nitrogen/generated/android/c++/JLocationRequestOptions.hpp +81 -0
- package/nitrogen/generated/android/c++/JModernGeolocationConfiguration.hpp +73 -0
- package/nitrogen/generated/android/c++/JNullableDouble.cpp +26 -0
- package/nitrogen/generated/android/c++/JNullableDouble.hpp +69 -0
- package/nitrogen/generated/android/c++/JPermissionStatus.hpp +64 -0
- package/nitrogen/generated/android/c++/JRNConfigurationInternal.hpp +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AuthorizationLevel.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AuthorizationLevelInternal.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_GeolocationError.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_GeolocationResponse.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_LocationError.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationCoordinates.kt +34 -25
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationError.kt +27 -18
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationOptions.kt +33 -24
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationResponse.kt +18 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationCompatSpec.kt +92 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationSpec.kt +17 -17
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationError.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProvider.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderInternal.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationRequestOptions.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ModernGeolocationConfiguration.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/NullableDouble.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/PermissionStatus.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/RNConfigurationInternal.kt +24 -15
- package/nitrogen/generated/android/nitrogeolocation+autolinking.cmake +3 -0
- package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +14 -2
- package/nitrogen/generated/ios/NitroGeolocation+autolinking.rb +1 -1
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.cpp +55 -13
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +325 -68
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Umbrella.hpp +26 -0
- package/nitrogen/generated/ios/NitroGeolocationAutolinking.mm +8 -0
- package/nitrogen/generated/ios/NitroGeolocationAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.hpp +130 -0
- package/nitrogen/generated/ios/c++/HybridNitroGeolocationSpecSwift.hpp +47 -26
- package/nitrogen/generated/ios/swift/AuthorizationLevel.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_GeolocationError.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_GeolocationResponse.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_LocationError.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_PermissionStatus.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/GeolocationCoordinates.swift +132 -93
- package/nitrogen/generated/ios/swift/GeolocationError.swift +11 -40
- package/nitrogen/generated/ios/swift/GeolocationOptions.swift +29 -98
- package/nitrogen/generated/ios/swift/GeolocationResponse.swift +5 -16
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec.swift +61 -0
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec_cxx.swift +244 -0
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec.swift +13 -5
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec_cxx.swift +66 -64
- package/nitrogen/generated/ios/swift/LocationError.swift +35 -0
- package/nitrogen/generated/ios/swift/LocationProvider.swift +44 -0
- package/nitrogen/generated/ios/swift/LocationRequestOptions.swift +116 -0
- package/nitrogen/generated/ios/swift/ModernGeolocationConfiguration.swift +83 -0
- package/nitrogen/generated/ios/swift/NullableDouble.swift +18 -0
- package/nitrogen/generated/ios/swift/PermissionStatus.swift +48 -0
- package/nitrogen/generated/ios/swift/RNConfigurationInternal.swift +16 -50
- package/nitrogen/generated/shared/c++/AuthorizationLevel.hpp +80 -0
- package/nitrogen/generated/shared/c++/GeolocationCoordinates.hpp +45 -27
- package/nitrogen/generated/shared/c++/GeolocationError.hpp +32 -16
- package/nitrogen/generated/shared/c++/GeolocationOptions.hpp +38 -22
- package/nitrogen/generated/shared/c++/GeolocationResponse.hpp +23 -7
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.cpp +4 -3
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.hpp +22 -16
- package/nitrogen/generated/shared/c++/LocationError.hpp +87 -0
- package/nitrogen/generated/shared/c++/LocationProvider.hpp +80 -0
- package/nitrogen/generated/shared/c++/LocationRequestOptions.hpp +107 -0
- package/nitrogen/generated/shared/c++/ModernGeolocationConfiguration.hpp +100 -0
- package/nitrogen/generated/shared/c++/PermissionStatus.hpp +84 -0
- package/nitrogen/generated/shared/c++/RNConfigurationInternal.hpp +29 -13
- package/package.json +16 -7
- package/src/GeolocationClient.ts +116 -0
- package/src/NitroGeolocation.nitro.ts +177 -30
- package/src/NitroGeolocationCompat.nitro.ts +41 -0
- package/src/NitroGeolocationModule.ts +6 -0
- package/src/compat/clearWatch.ts +9 -0
- package/src/{getCurrentPosition.ts → compat/getCurrentPosition.ts} +7 -3
- package/src/compat/index.tsx +34 -0
- package/src/compat/requestAuthorization.ts +9 -0
- package/src/{setRNConfiguration.ts → compat/setRNConfiguration.ts} +6 -4
- package/src/{stopObserving.ts → compat/stopObserving.ts} +4 -2
- package/src/{watchPosition.ts → compat/watchPosition.ts} +7 -6
- package/src/components/GeolocationProvider.tsx +91 -0
- package/src/components/index.ts +13 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useCheckPermission.ts +46 -0
- package/src/hooks/useGetCurrentPosition.ts +44 -0
- package/src/hooks/useRequestPermission.ts +38 -0
- package/src/hooks/useWatchPosition.ts +127 -0
- package/src/index.tsx +72 -27
- package/src/types.ts +32 -4
- package/src/utils/cache.ts +25 -0
- package/src/utils/config.ts +93 -0
- package/src/utils/errors.ts +82 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/provider.ts +61 -0
- package/src/utils/quality.ts +98 -0
- package/README.md +0 -318
- package/src/clearWatch.ts +0 -13
- package/src/requestAuthorization.ts +0 -9
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `AuthorizationLevelInternal` to properly resolve imports.
|
|
12
12
|
namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevelInternal; }
|
|
13
|
+
// Forward declaration of `AuthorizationLevel` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevel; }
|
|
13
15
|
// Forward declaration of `GeolocationCoordinates` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
|
|
15
17
|
// Forward declaration of `GeolocationError` to properly resolve imports.
|
|
@@ -18,29 +20,51 @@ namespace margelo::nitro::nitrogeolocation { struct GeolocationError; }
|
|
|
18
20
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationOptions; }
|
|
19
21
|
// Forward declaration of `GeolocationResponse` to properly resolve imports.
|
|
20
22
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
|
|
23
|
+
// Forward declaration of `HybridNitroGeolocationCompatSpec` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationCompatSpec; }
|
|
21
25
|
// Forward declaration of `HybridNitroGeolocationSpec` to properly resolve imports.
|
|
22
26
|
namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationSpec; }
|
|
27
|
+
// Forward declaration of `LocationError` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitrogeolocation { struct LocationError; }
|
|
23
29
|
// Forward declaration of `LocationProviderInternal` to properly resolve imports.
|
|
24
30
|
namespace margelo::nitro::nitrogeolocation { enum class LocationProviderInternal; }
|
|
31
|
+
// Forward declaration of `LocationProvider` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitrogeolocation { enum class LocationProvider; }
|
|
33
|
+
// Forward declaration of `LocationRequestOptions` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::nitrogeolocation { struct LocationRequestOptions; }
|
|
35
|
+
// Forward declaration of `PermissionStatus` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::nitrogeolocation { enum class PermissionStatus; }
|
|
25
37
|
|
|
26
38
|
// Forward declarations of Swift defined types
|
|
39
|
+
// Forward declaration of `HybridNitroGeolocationCompatSpec_cxx` to properly resolve imports.
|
|
40
|
+
namespace NitroGeolocation { class HybridNitroGeolocationCompatSpec_cxx; }
|
|
27
41
|
// Forward declaration of `HybridNitroGeolocationSpec_cxx` to properly resolve imports.
|
|
28
42
|
namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
|
|
29
43
|
|
|
30
44
|
// Include C++ defined types
|
|
45
|
+
#include "AuthorizationLevel.hpp"
|
|
31
46
|
#include "AuthorizationLevelInternal.hpp"
|
|
32
47
|
#include "GeolocationCoordinates.hpp"
|
|
33
48
|
#include "GeolocationError.hpp"
|
|
34
49
|
#include "GeolocationOptions.hpp"
|
|
35
50
|
#include "GeolocationResponse.hpp"
|
|
51
|
+
#include "HybridNitroGeolocationCompatSpec.hpp"
|
|
36
52
|
#include "HybridNitroGeolocationSpec.hpp"
|
|
53
|
+
#include "LocationError.hpp"
|
|
54
|
+
#include "LocationProvider.hpp"
|
|
37
55
|
#include "LocationProviderInternal.hpp"
|
|
56
|
+
#include "LocationRequestOptions.hpp"
|
|
57
|
+
#include "PermissionStatus.hpp"
|
|
58
|
+
#include <NitroModules/Null.hpp>
|
|
59
|
+
#include <NitroModules/Promise.hpp>
|
|
60
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
38
61
|
#include <NitroModules/Result.hpp>
|
|
39
62
|
#include <exception>
|
|
40
63
|
#include <functional>
|
|
41
64
|
#include <memory>
|
|
42
65
|
#include <optional>
|
|
43
66
|
#include <string>
|
|
67
|
+
#include <variant>
|
|
44
68
|
|
|
45
69
|
/**
|
|
46
70
|
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
@@ -48,33 +72,312 @@ namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
|
|
|
48
72
|
*/
|
|
49
73
|
namespace margelo::nitro::nitrogeolocation::bridge::swift {
|
|
50
74
|
|
|
51
|
-
// pragma MARK: std::optional<
|
|
75
|
+
// pragma MARK: std::optional<bool>
|
|
52
76
|
/**
|
|
53
|
-
* Specialized version of `std::optional<
|
|
77
|
+
* Specialized version of `std::optional<bool>`.
|
|
54
78
|
*/
|
|
55
|
-
using
|
|
56
|
-
inline std::optional<
|
|
57
|
-
return std::optional<
|
|
79
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
80
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
81
|
+
return std::optional<bool>(value);
|
|
58
82
|
}
|
|
59
|
-
inline bool
|
|
83
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
60
84
|
return optional.has_value();
|
|
61
85
|
}
|
|
62
|
-
inline
|
|
86
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
63
87
|
return *optional;
|
|
64
88
|
}
|
|
65
89
|
|
|
66
|
-
// pragma MARK: std::optional<
|
|
90
|
+
// pragma MARK: std::optional<AuthorizationLevel>
|
|
67
91
|
/**
|
|
68
|
-
* Specialized version of `std::optional<
|
|
92
|
+
* Specialized version of `std::optional<AuthorizationLevel>`.
|
|
69
93
|
*/
|
|
70
|
-
using
|
|
71
|
-
inline std::optional<
|
|
72
|
-
return std::optional<
|
|
94
|
+
using std__optional_AuthorizationLevel_ = std::optional<AuthorizationLevel>;
|
|
95
|
+
inline std::optional<AuthorizationLevel> create_std__optional_AuthorizationLevel_(const AuthorizationLevel& value) noexcept {
|
|
96
|
+
return std::optional<AuthorizationLevel>(value);
|
|
73
97
|
}
|
|
74
|
-
inline bool
|
|
98
|
+
inline bool has_value_std__optional_AuthorizationLevel_(const std::optional<AuthorizationLevel>& optional) noexcept {
|
|
75
99
|
return optional.has_value();
|
|
76
100
|
}
|
|
77
|
-
inline
|
|
101
|
+
inline AuthorizationLevel get_std__optional_AuthorizationLevel_(const std::optional<AuthorizationLevel>& optional) noexcept {
|
|
102
|
+
return *optional;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// pragma MARK: std::optional<LocationProvider>
|
|
106
|
+
/**
|
|
107
|
+
* Specialized version of `std::optional<LocationProvider>`.
|
|
108
|
+
*/
|
|
109
|
+
using std__optional_LocationProvider_ = std::optional<LocationProvider>;
|
|
110
|
+
inline std::optional<LocationProvider> create_std__optional_LocationProvider_(const LocationProvider& value) noexcept {
|
|
111
|
+
return std::optional<LocationProvider>(value);
|
|
112
|
+
}
|
|
113
|
+
inline bool has_value_std__optional_LocationProvider_(const std::optional<LocationProvider>& optional) noexcept {
|
|
114
|
+
return optional.has_value();
|
|
115
|
+
}
|
|
116
|
+
inline LocationProvider get_std__optional_LocationProvider_(const std::optional<LocationProvider>& optional) noexcept {
|
|
117
|
+
return *optional;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// pragma MARK: std::shared_ptr<Promise<PermissionStatus>>
|
|
121
|
+
/**
|
|
122
|
+
* Specialized version of `std::shared_ptr<Promise<PermissionStatus>>`.
|
|
123
|
+
*/
|
|
124
|
+
using std__shared_ptr_Promise_PermissionStatus__ = std::shared_ptr<Promise<PermissionStatus>>;
|
|
125
|
+
inline std::shared_ptr<Promise<PermissionStatus>> create_std__shared_ptr_Promise_PermissionStatus__() noexcept {
|
|
126
|
+
return Promise<PermissionStatus>::create();
|
|
127
|
+
}
|
|
128
|
+
inline PromiseHolder<PermissionStatus> wrap_std__shared_ptr_Promise_PermissionStatus__(std::shared_ptr<Promise<PermissionStatus>> promise) noexcept {
|
|
129
|
+
return PromiseHolder<PermissionStatus>(std::move(promise));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// pragma MARK: std::function<void(PermissionStatus /* result */)>
|
|
133
|
+
/**
|
|
134
|
+
* Specialized version of `std::function<void(PermissionStatus)>`.
|
|
135
|
+
*/
|
|
136
|
+
using Func_void_PermissionStatus = std::function<void(PermissionStatus /* result */)>;
|
|
137
|
+
/**
|
|
138
|
+
* Wrapper class for a `std::function<void(PermissionStatus / * result * /)>`, this can be used from Swift.
|
|
139
|
+
*/
|
|
140
|
+
class Func_void_PermissionStatus_Wrapper final {
|
|
141
|
+
public:
|
|
142
|
+
explicit Func_void_PermissionStatus_Wrapper(std::function<void(PermissionStatus /* result */)>&& func): _function(std::make_unique<std::function<void(PermissionStatus /* result */)>>(std::move(func))) {}
|
|
143
|
+
inline void call(int result) const noexcept {
|
|
144
|
+
_function->operator()(static_cast<PermissionStatus>(result));
|
|
145
|
+
}
|
|
146
|
+
private:
|
|
147
|
+
std::unique_ptr<std::function<void(PermissionStatus /* result */)>> _function;
|
|
148
|
+
} SWIFT_NONCOPYABLE;
|
|
149
|
+
Func_void_PermissionStatus create_Func_void_PermissionStatus(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
150
|
+
inline Func_void_PermissionStatus_Wrapper wrap_Func_void_PermissionStatus(Func_void_PermissionStatus value) noexcept {
|
|
151
|
+
return Func_void_PermissionStatus_Wrapper(std::move(value));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
155
|
+
/**
|
|
156
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
157
|
+
*/
|
|
158
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
159
|
+
/**
|
|
160
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
161
|
+
*/
|
|
162
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
163
|
+
public:
|
|
164
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
165
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
166
|
+
_function->operator()(error);
|
|
167
|
+
}
|
|
168
|
+
private:
|
|
169
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
170
|
+
} SWIFT_NONCOPYABLE;
|
|
171
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
172
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
173
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// pragma MARK: std::variant<nitro::NullType, double>
|
|
177
|
+
/**
|
|
178
|
+
* Wrapper struct for `std::variant<nitro::NullType, double>`.
|
|
179
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
180
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
181
|
+
*/
|
|
182
|
+
struct std__variant_nitro__NullType__double_ final {
|
|
183
|
+
std::variant<nitro::NullType, double> variant;
|
|
184
|
+
std__variant_nitro__NullType__double_(std::variant<nitro::NullType, double> variant): variant(variant) { }
|
|
185
|
+
operator std::variant<nitro::NullType, double>() const noexcept {
|
|
186
|
+
return variant;
|
|
187
|
+
}
|
|
188
|
+
inline size_t index() const noexcept {
|
|
189
|
+
return variant.index();
|
|
190
|
+
}
|
|
191
|
+
inline nitro::NullType get_0() const noexcept {
|
|
192
|
+
return std::get<0>(variant);
|
|
193
|
+
}
|
|
194
|
+
inline double get_1() const noexcept {
|
|
195
|
+
return std::get<1>(variant);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
inline std__variant_nitro__NullType__double_ create_std__variant_nitro__NullType__double_(nitro::NullType value) noexcept {
|
|
199
|
+
return std__variant_nitro__NullType__double_(value);
|
|
200
|
+
}
|
|
201
|
+
inline std__variant_nitro__NullType__double_ create_std__variant_nitro__NullType__double_(double value) noexcept {
|
|
202
|
+
return std__variant_nitro__NullType__double_(value);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// pragma MARK: std::optional<std::variant<nitro::NullType, double>>
|
|
206
|
+
/**
|
|
207
|
+
* Specialized version of `std::optional<std::variant<nitro::NullType, double>>`.
|
|
208
|
+
*/
|
|
209
|
+
using std__optional_std__variant_nitro__NullType__double__ = std::optional<std::variant<nitro::NullType, double>>;
|
|
210
|
+
inline std::optional<std::variant<nitro::NullType, double>> create_std__optional_std__variant_nitro__NullType__double__(const std::variant<nitro::NullType, double>& value) noexcept {
|
|
211
|
+
return std::optional<std::variant<nitro::NullType, double>>(value);
|
|
212
|
+
}
|
|
213
|
+
inline bool has_value_std__optional_std__variant_nitro__NullType__double__(const std::optional<std::variant<nitro::NullType, double>>& optional) noexcept {
|
|
214
|
+
return optional.has_value();
|
|
215
|
+
}
|
|
216
|
+
inline std::variant<nitro::NullType, double> get_std__optional_std__variant_nitro__NullType__double__(const std::optional<std::variant<nitro::NullType, double>>& optional) noexcept {
|
|
217
|
+
return *optional;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// pragma MARK: std::shared_ptr<Promise<GeolocationResponse>>
|
|
221
|
+
/**
|
|
222
|
+
* Specialized version of `std::shared_ptr<Promise<GeolocationResponse>>`.
|
|
223
|
+
*/
|
|
224
|
+
using std__shared_ptr_Promise_GeolocationResponse__ = std::shared_ptr<Promise<GeolocationResponse>>;
|
|
225
|
+
inline std::shared_ptr<Promise<GeolocationResponse>> create_std__shared_ptr_Promise_GeolocationResponse__() noexcept {
|
|
226
|
+
return Promise<GeolocationResponse>::create();
|
|
227
|
+
}
|
|
228
|
+
inline PromiseHolder<GeolocationResponse> wrap_std__shared_ptr_Promise_GeolocationResponse__(std::shared_ptr<Promise<GeolocationResponse>> promise) noexcept {
|
|
229
|
+
return PromiseHolder<GeolocationResponse>(std::move(promise));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// pragma MARK: std::function<void(const GeolocationResponse& /* result */)>
|
|
233
|
+
/**
|
|
234
|
+
* Specialized version of `std::function<void(const GeolocationResponse&)>`.
|
|
235
|
+
*/
|
|
236
|
+
using Func_void_GeolocationResponse = std::function<void(const GeolocationResponse& /* result */)>;
|
|
237
|
+
/**
|
|
238
|
+
* Wrapper class for a `std::function<void(const GeolocationResponse& / * result * /)>`, this can be used from Swift.
|
|
239
|
+
*/
|
|
240
|
+
class Func_void_GeolocationResponse_Wrapper final {
|
|
241
|
+
public:
|
|
242
|
+
explicit Func_void_GeolocationResponse_Wrapper(std::function<void(const GeolocationResponse& /* result */)>&& func): _function(std::make_unique<std::function<void(const GeolocationResponse& /* result */)>>(std::move(func))) {}
|
|
243
|
+
inline void call(GeolocationResponse result) const noexcept {
|
|
244
|
+
_function->operator()(result);
|
|
245
|
+
}
|
|
246
|
+
private:
|
|
247
|
+
std::unique_ptr<std::function<void(const GeolocationResponse& /* result */)>> _function;
|
|
248
|
+
} SWIFT_NONCOPYABLE;
|
|
249
|
+
Func_void_GeolocationResponse create_Func_void_GeolocationResponse(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
250
|
+
inline Func_void_GeolocationResponse_Wrapper wrap_Func_void_GeolocationResponse(Func_void_GeolocationResponse value) noexcept {
|
|
251
|
+
return Func_void_GeolocationResponse_Wrapper(std::move(value));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// pragma MARK: std::optional<double>
|
|
255
|
+
/**
|
|
256
|
+
* Specialized version of `std::optional<double>`.
|
|
257
|
+
*/
|
|
258
|
+
using std__optional_double_ = std::optional<double>;
|
|
259
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
260
|
+
return std::optional<double>(value);
|
|
261
|
+
}
|
|
262
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
263
|
+
return optional.has_value();
|
|
264
|
+
}
|
|
265
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
266
|
+
return *optional;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// pragma MARK: std::optional<LocationRequestOptions>
|
|
270
|
+
/**
|
|
271
|
+
* Specialized version of `std::optional<LocationRequestOptions>`.
|
|
272
|
+
*/
|
|
273
|
+
using std__optional_LocationRequestOptions_ = std::optional<LocationRequestOptions>;
|
|
274
|
+
inline std::optional<LocationRequestOptions> create_std__optional_LocationRequestOptions_(const LocationRequestOptions& value) noexcept {
|
|
275
|
+
return std::optional<LocationRequestOptions>(value);
|
|
276
|
+
}
|
|
277
|
+
inline bool has_value_std__optional_LocationRequestOptions_(const std::optional<LocationRequestOptions>& optional) noexcept {
|
|
278
|
+
return optional.has_value();
|
|
279
|
+
}
|
|
280
|
+
inline LocationRequestOptions get_std__optional_LocationRequestOptions_(const std::optional<LocationRequestOptions>& optional) noexcept {
|
|
281
|
+
return *optional;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// pragma MARK: std::function<void(const LocationError& /* error */)>
|
|
285
|
+
/**
|
|
286
|
+
* Specialized version of `std::function<void(const LocationError&)>`.
|
|
287
|
+
*/
|
|
288
|
+
using Func_void_LocationError = std::function<void(const LocationError& /* error */)>;
|
|
289
|
+
/**
|
|
290
|
+
* Wrapper class for a `std::function<void(const LocationError& / * error * /)>`, this can be used from Swift.
|
|
291
|
+
*/
|
|
292
|
+
class Func_void_LocationError_Wrapper final {
|
|
293
|
+
public:
|
|
294
|
+
explicit Func_void_LocationError_Wrapper(std::function<void(const LocationError& /* error */)>&& func): _function(std::make_unique<std::function<void(const LocationError& /* error */)>>(std::move(func))) {}
|
|
295
|
+
inline void call(LocationError error) const noexcept {
|
|
296
|
+
_function->operator()(error);
|
|
297
|
+
}
|
|
298
|
+
private:
|
|
299
|
+
std::unique_ptr<std::function<void(const LocationError& /* error */)>> _function;
|
|
300
|
+
} SWIFT_NONCOPYABLE;
|
|
301
|
+
Func_void_LocationError create_Func_void_LocationError(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
302
|
+
inline Func_void_LocationError_Wrapper wrap_Func_void_LocationError(Func_void_LocationError value) noexcept {
|
|
303
|
+
return Func_void_LocationError_Wrapper(std::move(value));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// pragma MARK: std::optional<std::function<void(const LocationError& /* error */)>>
|
|
307
|
+
/**
|
|
308
|
+
* Specialized version of `std::optional<std::function<void(const LocationError& / * error * /)>>`.
|
|
309
|
+
*/
|
|
310
|
+
using std__optional_std__function_void_const_LocationError_____error______ = std::optional<std::function<void(const LocationError& /* error */)>>;
|
|
311
|
+
inline std::optional<std::function<void(const LocationError& /* error */)>> create_std__optional_std__function_void_const_LocationError_____error______(const std::function<void(const LocationError& /* error */)>& value) noexcept {
|
|
312
|
+
return std::optional<std::function<void(const LocationError& /* error */)>>(value);
|
|
313
|
+
}
|
|
314
|
+
inline bool has_value_std__optional_std__function_void_const_LocationError_____error______(const std::optional<std::function<void(const LocationError& /* error */)>>& optional) noexcept {
|
|
315
|
+
return optional.has_value();
|
|
316
|
+
}
|
|
317
|
+
inline std::function<void(const LocationError& /* error */)> get_std__optional_std__function_void_const_LocationError_____error______(const std::optional<std::function<void(const LocationError& /* error */)>>& optional) noexcept {
|
|
318
|
+
return *optional;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// pragma MARK: std::shared_ptr<HybridNitroGeolocationSpec>
|
|
322
|
+
/**
|
|
323
|
+
* Specialized version of `std::shared_ptr<HybridNitroGeolocationSpec>`.
|
|
324
|
+
*/
|
|
325
|
+
using std__shared_ptr_HybridNitroGeolocationSpec_ = std::shared_ptr<HybridNitroGeolocationSpec>;
|
|
326
|
+
std::shared_ptr<HybridNitroGeolocationSpec> create_std__shared_ptr_HybridNitroGeolocationSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
327
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroGeolocationSpec_(std__shared_ptr_HybridNitroGeolocationSpec_ cppType);
|
|
328
|
+
|
|
329
|
+
// pragma MARK: std::weak_ptr<HybridNitroGeolocationSpec>
|
|
330
|
+
using std__weak_ptr_HybridNitroGeolocationSpec_ = std::weak_ptr<HybridNitroGeolocationSpec>;
|
|
331
|
+
inline std__weak_ptr_HybridNitroGeolocationSpec_ weakify_std__shared_ptr_HybridNitroGeolocationSpec_(const std::shared_ptr<HybridNitroGeolocationSpec>& strong) noexcept { return strong; }
|
|
332
|
+
|
|
333
|
+
// pragma MARK: Result<void>
|
|
334
|
+
using Result_void_ = Result<void>;
|
|
335
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
336
|
+
return Result<void>::withValue();
|
|
337
|
+
}
|
|
338
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
339
|
+
return Result<void>::withError(error);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// pragma MARK: Result<std::shared_ptr<Promise<PermissionStatus>>>
|
|
343
|
+
using Result_std__shared_ptr_Promise_PermissionStatus___ = Result<std::shared_ptr<Promise<PermissionStatus>>>;
|
|
344
|
+
inline Result_std__shared_ptr_Promise_PermissionStatus___ create_Result_std__shared_ptr_Promise_PermissionStatus___(const std::shared_ptr<Promise<PermissionStatus>>& value) noexcept {
|
|
345
|
+
return Result<std::shared_ptr<Promise<PermissionStatus>>>::withValue(value);
|
|
346
|
+
}
|
|
347
|
+
inline Result_std__shared_ptr_Promise_PermissionStatus___ create_Result_std__shared_ptr_Promise_PermissionStatus___(const std::exception_ptr& error) noexcept {
|
|
348
|
+
return Result<std::shared_ptr<Promise<PermissionStatus>>>::withError(error);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// pragma MARK: Result<std::shared_ptr<Promise<GeolocationResponse>>>
|
|
352
|
+
using Result_std__shared_ptr_Promise_GeolocationResponse___ = Result<std::shared_ptr<Promise<GeolocationResponse>>>;
|
|
353
|
+
inline Result_std__shared_ptr_Promise_GeolocationResponse___ create_Result_std__shared_ptr_Promise_GeolocationResponse___(const std::shared_ptr<Promise<GeolocationResponse>>& value) noexcept {
|
|
354
|
+
return Result<std::shared_ptr<Promise<GeolocationResponse>>>::withValue(value);
|
|
355
|
+
}
|
|
356
|
+
inline Result_std__shared_ptr_Promise_GeolocationResponse___ create_Result_std__shared_ptr_Promise_GeolocationResponse___(const std::exception_ptr& error) noexcept {
|
|
357
|
+
return Result<std::shared_ptr<Promise<GeolocationResponse>>>::withError(error);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// pragma MARK: Result<std::string>
|
|
361
|
+
using Result_std__string_ = Result<std::string>;
|
|
362
|
+
inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept {
|
|
363
|
+
return Result<std::string>::withValue(value);
|
|
364
|
+
}
|
|
365
|
+
inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept {
|
|
366
|
+
return Result<std::string>::withError(error);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// pragma MARK: std::optional<AuthorizationLevelInternal>
|
|
370
|
+
/**
|
|
371
|
+
* Specialized version of `std::optional<AuthorizationLevelInternal>`.
|
|
372
|
+
*/
|
|
373
|
+
using std__optional_AuthorizationLevelInternal_ = std::optional<AuthorizationLevelInternal>;
|
|
374
|
+
inline std::optional<AuthorizationLevelInternal> create_std__optional_AuthorizationLevelInternal_(const AuthorizationLevelInternal& value) noexcept {
|
|
375
|
+
return std::optional<AuthorizationLevelInternal>(value);
|
|
376
|
+
}
|
|
377
|
+
inline bool has_value_std__optional_AuthorizationLevelInternal_(const std::optional<AuthorizationLevelInternal>& optional) noexcept {
|
|
378
|
+
return optional.has_value();
|
|
379
|
+
}
|
|
380
|
+
inline AuthorizationLevelInternal get_std__optional_AuthorizationLevelInternal_(const std::optional<AuthorizationLevelInternal>& optional) noexcept {
|
|
78
381
|
return *optional;
|
|
79
382
|
}
|
|
80
383
|
|
|
@@ -167,43 +470,6 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
|
|
|
167
470
|
return *optional;
|
|
168
471
|
}
|
|
169
472
|
|
|
170
|
-
// pragma MARK: std::optional<double>
|
|
171
|
-
/**
|
|
172
|
-
* Specialized version of `std::optional<double>`.
|
|
173
|
-
*/
|
|
174
|
-
using std__optional_double_ = std::optional<double>;
|
|
175
|
-
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
176
|
-
return std::optional<double>(value);
|
|
177
|
-
}
|
|
178
|
-
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
179
|
-
return optional.has_value();
|
|
180
|
-
}
|
|
181
|
-
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
182
|
-
return *optional;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// pragma MARK: std::function<void(const GeolocationResponse& /* position */)>
|
|
186
|
-
/**
|
|
187
|
-
* Specialized version of `std::function<void(const GeolocationResponse&)>`.
|
|
188
|
-
*/
|
|
189
|
-
using Func_void_GeolocationResponse = std::function<void(const GeolocationResponse& /* position */)>;
|
|
190
|
-
/**
|
|
191
|
-
* Wrapper class for a `std::function<void(const GeolocationResponse& / * position * /)>`, this can be used from Swift.
|
|
192
|
-
*/
|
|
193
|
-
class Func_void_GeolocationResponse_Wrapper final {
|
|
194
|
-
public:
|
|
195
|
-
explicit Func_void_GeolocationResponse_Wrapper(std::function<void(const GeolocationResponse& /* position */)>&& func): _function(std::make_unique<std::function<void(const GeolocationResponse& /* position */)>>(std::move(func))) {}
|
|
196
|
-
inline void call(GeolocationResponse position) const noexcept {
|
|
197
|
-
_function->operator()(position);
|
|
198
|
-
}
|
|
199
|
-
private:
|
|
200
|
-
std::unique_ptr<std::function<void(const GeolocationResponse& /* position */)>> _function;
|
|
201
|
-
} SWIFT_NONCOPYABLE;
|
|
202
|
-
Func_void_GeolocationResponse create_Func_void_GeolocationResponse(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
203
|
-
inline Func_void_GeolocationResponse_Wrapper wrap_Func_void_GeolocationResponse(Func_void_GeolocationResponse value) noexcept {
|
|
204
|
-
return Func_void_GeolocationResponse_Wrapper(std::move(value));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
473
|
// pragma MARK: std::optional<GeolocationOptions>
|
|
208
474
|
/**
|
|
209
475
|
* Specialized version of `std::optional<GeolocationOptions>`.
|
|
@@ -219,26 +485,17 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
|
|
|
219
485
|
return *optional;
|
|
220
486
|
}
|
|
221
487
|
|
|
222
|
-
// pragma MARK: std::shared_ptr<
|
|
488
|
+
// pragma MARK: std::shared_ptr<HybridNitroGeolocationCompatSpec>
|
|
223
489
|
/**
|
|
224
|
-
* Specialized version of `std::shared_ptr<
|
|
490
|
+
* Specialized version of `std::shared_ptr<HybridNitroGeolocationCompatSpec>`.
|
|
225
491
|
*/
|
|
226
|
-
using
|
|
227
|
-
std::shared_ptr<
|
|
228
|
-
void* NON_NULL
|
|
492
|
+
using std__shared_ptr_HybridNitroGeolocationCompatSpec_ = std::shared_ptr<HybridNitroGeolocationCompatSpec>;
|
|
493
|
+
std::shared_ptr<HybridNitroGeolocationCompatSpec> create_std__shared_ptr_HybridNitroGeolocationCompatSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
494
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroGeolocationCompatSpec_(std__shared_ptr_HybridNitroGeolocationCompatSpec_ cppType);
|
|
229
495
|
|
|
230
|
-
// pragma MARK: std::weak_ptr<
|
|
231
|
-
using
|
|
232
|
-
inline
|
|
233
|
-
|
|
234
|
-
// pragma MARK: Result<void>
|
|
235
|
-
using Result_void_ = Result<void>;
|
|
236
|
-
inline Result_void_ create_Result_void_() noexcept {
|
|
237
|
-
return Result<void>::withValue();
|
|
238
|
-
}
|
|
239
|
-
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
240
|
-
return Result<void>::withError(error);
|
|
241
|
-
}
|
|
496
|
+
// pragma MARK: std::weak_ptr<HybridNitroGeolocationCompatSpec>
|
|
497
|
+
using std__weak_ptr_HybridNitroGeolocationCompatSpec_ = std::weak_ptr<HybridNitroGeolocationCompatSpec>;
|
|
498
|
+
inline std__weak_ptr_HybridNitroGeolocationCompatSpec_ weakify_std__shared_ptr_HybridNitroGeolocationCompatSpec_(const std::shared_ptr<HybridNitroGeolocationCompatSpec>& strong) noexcept { return strong; }
|
|
242
499
|
|
|
243
500
|
// pragma MARK: Result<double>
|
|
244
501
|
using Result_double_ = Result<double>;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `AuthorizationLevelInternal` to properly resolve imports.
|
|
12
12
|
namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevelInternal; }
|
|
13
|
+
// Forward declaration of `AuthorizationLevel` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevel; }
|
|
13
15
|
// Forward declaration of `GeolocationCoordinates` to properly resolve imports.
|
|
14
16
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
|
|
15
17
|
// Forward declaration of `GeolocationError` to properly resolve imports.
|
|
@@ -18,28 +20,50 @@ namespace margelo::nitro::nitrogeolocation { struct GeolocationError; }
|
|
|
18
20
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationOptions; }
|
|
19
21
|
// Forward declaration of `GeolocationResponse` to properly resolve imports.
|
|
20
22
|
namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
|
|
23
|
+
// Forward declaration of `HybridNitroGeolocationCompatSpec` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationCompatSpec; }
|
|
21
25
|
// Forward declaration of `HybridNitroGeolocationSpec` to properly resolve imports.
|
|
22
26
|
namespace margelo::nitro::nitrogeolocation { class HybridNitroGeolocationSpec; }
|
|
27
|
+
// Forward declaration of `LocationError` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitrogeolocation { struct LocationError; }
|
|
23
29
|
// Forward declaration of `LocationProviderInternal` to properly resolve imports.
|
|
24
30
|
namespace margelo::nitro::nitrogeolocation { enum class LocationProviderInternal; }
|
|
31
|
+
// Forward declaration of `LocationProvider` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitrogeolocation { enum class LocationProvider; }
|
|
33
|
+
// Forward declaration of `LocationRequestOptions` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::nitrogeolocation { struct LocationRequestOptions; }
|
|
35
|
+
// Forward declaration of `ModernGeolocationConfiguration` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::nitrogeolocation { struct ModernGeolocationConfiguration; }
|
|
37
|
+
// Forward declaration of `PermissionStatus` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::nitrogeolocation { enum class PermissionStatus; }
|
|
25
39
|
// Forward declaration of `RNConfigurationInternal` to properly resolve imports.
|
|
26
40
|
namespace margelo::nitro::nitrogeolocation { struct RNConfigurationInternal; }
|
|
27
41
|
|
|
28
42
|
// Include C++ defined types
|
|
43
|
+
#include "AuthorizationLevel.hpp"
|
|
29
44
|
#include "AuthorizationLevelInternal.hpp"
|
|
30
45
|
#include "GeolocationCoordinates.hpp"
|
|
31
46
|
#include "GeolocationError.hpp"
|
|
32
47
|
#include "GeolocationOptions.hpp"
|
|
33
48
|
#include "GeolocationResponse.hpp"
|
|
49
|
+
#include "HybridNitroGeolocationCompatSpec.hpp"
|
|
34
50
|
#include "HybridNitroGeolocationSpec.hpp"
|
|
51
|
+
#include "LocationError.hpp"
|
|
52
|
+
#include "LocationProvider.hpp"
|
|
35
53
|
#include "LocationProviderInternal.hpp"
|
|
54
|
+
#include "LocationRequestOptions.hpp"
|
|
55
|
+
#include "ModernGeolocationConfiguration.hpp"
|
|
56
|
+
#include "PermissionStatus.hpp"
|
|
36
57
|
#include "RNConfigurationInternal.hpp"
|
|
58
|
+
#include <NitroModules/Null.hpp>
|
|
59
|
+
#include <NitroModules/Promise.hpp>
|
|
37
60
|
#include <NitroModules/Result.hpp>
|
|
38
61
|
#include <exception>
|
|
39
62
|
#include <functional>
|
|
40
63
|
#include <memory>
|
|
41
64
|
#include <optional>
|
|
42
65
|
#include <string>
|
|
66
|
+
#include <variant>
|
|
43
67
|
|
|
44
68
|
// C++ helpers for Swift
|
|
45
69
|
#include "NitroGeolocation-Swift-Cxx-Bridge.hpp"
|
|
@@ -51,6 +75,8 @@ namespace margelo::nitro::nitrogeolocation { struct RNConfigurationInternal; }
|
|
|
51
75
|
#include <NitroModules/DateToChronoDate.hpp>
|
|
52
76
|
|
|
53
77
|
// Forward declarations of Swift defined types
|
|
78
|
+
// Forward declaration of `HybridNitroGeolocationCompatSpec_cxx` to properly resolve imports.
|
|
79
|
+
namespace NitroGeolocation { class HybridNitroGeolocationCompatSpec_cxx; }
|
|
54
80
|
// Forward declaration of `HybridNitroGeolocationSpec_cxx` to properly resolve imports.
|
|
55
81
|
namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
|
|
56
82
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#import <type_traits>
|
|
12
12
|
|
|
13
13
|
#include "HybridNitroGeolocationSpecSwift.hpp"
|
|
14
|
+
#include "HybridNitroGeolocationCompatSpecSwift.hpp"
|
|
14
15
|
|
|
15
16
|
@interface NitroGeolocationAutolinking : NSObject
|
|
16
17
|
@end
|
|
@@ -28,6 +29,13 @@
|
|
|
28
29
|
return hybridObject;
|
|
29
30
|
}
|
|
30
31
|
);
|
|
32
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
33
|
+
"NitroGeolocationCompat",
|
|
34
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
35
|
+
std::shared_ptr<HybridNitroGeolocationCompatSpec> hybridObject = NitroGeolocation::NitroGeolocationAutolinking::createNitroGeolocationCompat();
|
|
36
|
+
return hybridObject;
|
|
37
|
+
}
|
|
38
|
+
);
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
@end
|
|
@@ -22,4 +22,19 @@ public final class NitroGeolocationAutolinking {
|
|
|
22
22
|
return __cxxWrapped.getCxxPart()
|
|
23
23
|
}()
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates an instance of a Swift class that implements `HybridNitroGeolocationCompatSpec`,
|
|
28
|
+
* and wraps it in a Swift class that can directly interop with C++ (`HybridNitroGeolocationCompatSpec_cxx`)
|
|
29
|
+
*
|
|
30
|
+
* This is generated by Nitrogen and will initialize the class specified
|
|
31
|
+
* in the `"autolinking"` property of `nitro.json` (in this case, `NitroGeolocationCompat`).
|
|
32
|
+
*/
|
|
33
|
+
public static func createNitroGeolocationCompat() -> bridge.std__shared_ptr_HybridNitroGeolocationCompatSpec_ {
|
|
34
|
+
let hybridObject = NitroGeolocationCompat()
|
|
35
|
+
return { () -> bridge.std__shared_ptr_HybridNitroGeolocationCompatSpec_ in
|
|
36
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
37
|
+
return __cxxWrapped.getCxxPart()
|
|
38
|
+
}()
|
|
39
|
+
}
|
|
25
40
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroGeolocationCompatSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridNitroGeolocationCompatSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
11
|
+
} // namespace margelo::nitro::nitrogeolocation
|