@inoxialabs/react-native-nitro-location-geocoder 0.1.0 → 1.0.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/NitroLocationGeocoder.podspec +28 -28
- package/README.md +118 -78
- package/android/CMakeLists.txt +25 -25
- package/android/build.gradle +129 -129
- package/android/fix-prefab.gradle +44 -44
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/cpp/cpp-adapter.cpp +6 -6
- package/android/src/main/java/com/margelo/nitro/locationgeocoder/HybridLocationGeocoder.kt +85 -57
- package/android/src/main/java/com/margelo/nitro/locationgeocoder/NitroLocationGeocoderPackage.kt +18 -18
- package/ios/Bridge.h +1 -1
- package/ios/HybridLocationGeocoder.swift +62 -19
- package/nitro.json +24 -24
- package/nitrogen/generated/.gitattributes +1 -1
- package/nitrogen/generated/android/NitroLocationGeocoder+autolinking.cmake +81 -81
- package/nitrogen/generated/android/NitroLocationGeocoder+autolinking.gradle +27 -27
- package/nitrogen/generated/android/NitroLocationGeocoderOnLoad.cpp +54 -54
- package/nitrogen/generated/android/NitroLocationGeocoderOnLoad.hpp +34 -34
- package/nitrogen/generated/android/c++/JHybridLocationGeocoderSpec.cpp +69 -69
- package/nitrogen/generated/android/c++/JHybridLocationGeocoderSpec.hpp +63 -63
- package/nitrogen/generated/android/c++/JLocationGeocoderResult.hpp +77 -77
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/HybridLocationGeocoderSpec.kt +55 -55
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/LocationGeocoderResult.kt +53 -53
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/locationgeocoder/NitroLocationGeocoderOnLoad.kt +35 -35
- package/nitrogen/generated/ios/NitroLocationGeocoder+autolinking.rb +60 -60
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.cpp +49 -49
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Bridge.hpp +114 -114
- package/nitrogen/generated/ios/NitroLocationGeocoder-Swift-Cxx-Umbrella.hpp +48 -48
- package/nitrogen/generated/ios/NitroLocationGeocoderAutolinking.mm +33 -33
- package/nitrogen/generated/ios/NitroLocationGeocoderAutolinking.swift +26 -26
- package/nitrogen/generated/ios/c++/HybridLocationGeocoderSpecSwift.cpp +11 -11
- package/nitrogen/generated/ios/c++/HybridLocationGeocoderSpecSwift.hpp +85 -85
- package/nitrogen/generated/ios/swift/Func_void_LocationGeocoderResult.swift +46 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -46
- package/nitrogen/generated/ios/swift/HybridLocationGeocoderSpec.swift +55 -55
- package/nitrogen/generated/ios/swift/HybridLocationGeocoderSpec_cxx.swift +145 -145
- package/nitrogen/generated/ios/swift/LocationGeocoderResult.swift +54 -54
- package/nitrogen/generated/shared/c++/HybridLocationGeocoderSpec.cpp +21 -21
- package/nitrogen/generated/shared/c++/HybridLocationGeocoderSpec.hpp +65 -65
- package/nitrogen/generated/shared/c++/LocationGeocoderResult.hpp +103 -103
- package/package.json +65 -65
- package/react-native.config.js +8 -8
- package/src/index.ts +39 -7
- package/src/specs/LocationGeocoder.nitro.ts +14 -14
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// LocationGeocoderResult.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
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents an instance of `LocationGeocoderResult`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias LocationGeocoderResult = margelo.nitro.locationgeocoder.LocationGeocoderResult
|
|
14
|
-
|
|
15
|
-
public extension LocationGeocoderResult {
|
|
16
|
-
private typealias bridge = margelo.nitro.locationgeocoder.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `LocationGeocoderResult`.
|
|
20
|
-
*/
|
|
21
|
-
init(countryCode: String, country: String, locality: String, administrativeArea: String, subAdministrativeArea: String, subLocality: String) {
|
|
22
|
-
self.init(std.string(countryCode), std.string(country), std.string(locality), std.string(administrativeArea), std.string(subAdministrativeArea), std.string(subLocality))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@inline(__always)
|
|
26
|
-
var countryCode: String {
|
|
27
|
-
return String(self.__countryCode)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@inline(__always)
|
|
31
|
-
var country: String {
|
|
32
|
-
return String(self.__country)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@inline(__always)
|
|
36
|
-
var locality: String {
|
|
37
|
-
return String(self.__locality)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@inline(__always)
|
|
41
|
-
var administrativeArea: String {
|
|
42
|
-
return String(self.__administrativeArea)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@inline(__always)
|
|
46
|
-
var subAdministrativeArea: String {
|
|
47
|
-
return String(self.__subAdministrativeArea)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@inline(__always)
|
|
51
|
-
var subLocality: String {
|
|
52
|
-
return String(self.__subLocality)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
///
|
|
2
|
+
/// LocationGeocoderResult.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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `LocationGeocoderResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias LocationGeocoderResult = margelo.nitro.locationgeocoder.LocationGeocoderResult
|
|
14
|
+
|
|
15
|
+
public extension LocationGeocoderResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.locationgeocoder.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `LocationGeocoderResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(countryCode: String, country: String, locality: String, administrativeArea: String, subAdministrativeArea: String, subLocality: String) {
|
|
22
|
+
self.init(std.string(countryCode), std.string(country), std.string(locality), std.string(administrativeArea), std.string(subAdministrativeArea), std.string(subLocality))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@inline(__always)
|
|
26
|
+
var countryCode: String {
|
|
27
|
+
return String(self.__countryCode)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@inline(__always)
|
|
31
|
+
var country: String {
|
|
32
|
+
return String(self.__country)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@inline(__always)
|
|
36
|
+
var locality: String {
|
|
37
|
+
return String(self.__locality)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@inline(__always)
|
|
41
|
+
var administrativeArea: String {
|
|
42
|
+
return String(self.__administrativeArea)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@inline(__always)
|
|
46
|
+
var subAdministrativeArea: String {
|
|
47
|
+
return String(self.__subAdministrativeArea)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@inline(__always)
|
|
51
|
+
var subLocality: String {
|
|
52
|
+
return String(self.__subLocality)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridLocationGeocoderSpec.cpp
|
|
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
|
-
#include "HybridLocationGeocoderSpec.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::locationgeocoder {
|
|
11
|
-
|
|
12
|
-
void HybridLocationGeocoderSpec::loadHybridMethods() {
|
|
13
|
-
// load base methods/properties
|
|
14
|
-
HybridObject::loadHybridMethods();
|
|
15
|
-
// load custom methods/properties
|
|
16
|
-
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridMethod("reverseGeocode", &HybridLocationGeocoderSpec::reverseGeocode);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
} // namespace margelo::nitro::locationgeocoder
|
|
1
|
+
///
|
|
2
|
+
/// HybridLocationGeocoderSpec.cpp
|
|
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
|
+
#include "HybridLocationGeocoderSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::locationgeocoder {
|
|
11
|
+
|
|
12
|
+
void HybridLocationGeocoderSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("reverseGeocode", &HybridLocationGeocoderSpec::reverseGeocode);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace margelo::nitro::locationgeocoder
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridLocationGeocoderSpec.hpp
|
|
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
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
-
#include <NitroModules/HybridObject.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
// Forward declaration of `LocationGeocoderResult` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::locationgeocoder { struct LocationGeocoderResult; }
|
|
18
|
-
|
|
19
|
-
#include "LocationGeocoderResult.hpp"
|
|
20
|
-
#include <NitroModules/Promise.hpp>
|
|
21
|
-
#include <string>
|
|
22
|
-
|
|
23
|
-
namespace margelo::nitro::locationgeocoder {
|
|
24
|
-
|
|
25
|
-
using namespace margelo::nitro;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* An abstract base class for `LocationGeocoder`
|
|
29
|
-
* Inherit this class to create instances of `HybridLocationGeocoderSpec` in C++.
|
|
30
|
-
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
31
|
-
* @example
|
|
32
|
-
* ```cpp
|
|
33
|
-
* class HybridLocationGeocoder: public HybridLocationGeocoderSpec {
|
|
34
|
-
* public:
|
|
35
|
-
* HybridLocationGeocoder(...): HybridObject(TAG) { ... }
|
|
36
|
-
* // ...
|
|
37
|
-
* };
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
class HybridLocationGeocoderSpec: public virtual HybridObject {
|
|
41
|
-
public:
|
|
42
|
-
// Constructor
|
|
43
|
-
explicit HybridLocationGeocoderSpec(): HybridObject(TAG) { }
|
|
44
|
-
|
|
45
|
-
// Destructor
|
|
46
|
-
~HybridLocationGeocoderSpec() override = default;
|
|
47
|
-
|
|
48
|
-
public:
|
|
49
|
-
// Properties
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
public:
|
|
53
|
-
// Methods
|
|
54
|
-
virtual std::shared_ptr<Promise<LocationGeocoderResult>> reverseGeocode(double latitude, double longitude, const std::string& locale) = 0;
|
|
55
|
-
|
|
56
|
-
protected:
|
|
57
|
-
// Hybrid Setup
|
|
58
|
-
void loadHybridMethods() override;
|
|
59
|
-
|
|
60
|
-
protected:
|
|
61
|
-
// Tag for logging
|
|
62
|
-
static constexpr auto TAG = "LocationGeocoder";
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
} // namespace margelo::nitro::locationgeocoder
|
|
1
|
+
///
|
|
2
|
+
/// HybridLocationGeocoderSpec.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `LocationGeocoderResult` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::locationgeocoder { struct LocationGeocoderResult; }
|
|
18
|
+
|
|
19
|
+
#include "LocationGeocoderResult.hpp"
|
|
20
|
+
#include <NitroModules/Promise.hpp>
|
|
21
|
+
#include <string>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::locationgeocoder {
|
|
24
|
+
|
|
25
|
+
using namespace margelo::nitro;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An abstract base class for `LocationGeocoder`
|
|
29
|
+
* Inherit this class to create instances of `HybridLocationGeocoderSpec` in C++.
|
|
30
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
31
|
+
* @example
|
|
32
|
+
* ```cpp
|
|
33
|
+
* class HybridLocationGeocoder: public HybridLocationGeocoderSpec {
|
|
34
|
+
* public:
|
|
35
|
+
* HybridLocationGeocoder(...): HybridObject(TAG) { ... }
|
|
36
|
+
* // ...
|
|
37
|
+
* };
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class HybridLocationGeocoderSpec: public virtual HybridObject {
|
|
41
|
+
public:
|
|
42
|
+
// Constructor
|
|
43
|
+
explicit HybridLocationGeocoderSpec(): HybridObject(TAG) { }
|
|
44
|
+
|
|
45
|
+
// Destructor
|
|
46
|
+
~HybridLocationGeocoderSpec() override = default;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
// Properties
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Methods
|
|
54
|
+
virtual std::shared_ptr<Promise<LocationGeocoderResult>> reverseGeocode(double latitude, double longitude, const std::string& locale) = 0;
|
|
55
|
+
|
|
56
|
+
protected:
|
|
57
|
+
// Hybrid Setup
|
|
58
|
+
void loadHybridMethods() override;
|
|
59
|
+
|
|
60
|
+
protected:
|
|
61
|
+
// Tag for logging
|
|
62
|
+
static constexpr auto TAG = "LocationGeocoder";
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::locationgeocoder
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// LocationGeocoderResult.hpp
|
|
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
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#include <string>
|
|
34
|
-
|
|
35
|
-
namespace margelo::nitro::locationgeocoder {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A struct which can be represented as a JavaScript object (LocationGeocoderResult).
|
|
39
|
-
*/
|
|
40
|
-
struct LocationGeocoderResult final {
|
|
41
|
-
public:
|
|
42
|
-
std::string countryCode SWIFT_PRIVATE;
|
|
43
|
-
std::string country SWIFT_PRIVATE;
|
|
44
|
-
std::string locality SWIFT_PRIVATE;
|
|
45
|
-
std::string administrativeArea SWIFT_PRIVATE;
|
|
46
|
-
std::string subAdministrativeArea SWIFT_PRIVATE;
|
|
47
|
-
std::string subLocality SWIFT_PRIVATE;
|
|
48
|
-
|
|
49
|
-
public:
|
|
50
|
-
LocationGeocoderResult() = default;
|
|
51
|
-
explicit LocationGeocoderResult(std::string countryCode, std::string country, std::string locality, std::string administrativeArea, std::string subAdministrativeArea, std::string subLocality): countryCode(countryCode), country(country), locality(locality), administrativeArea(administrativeArea), subAdministrativeArea(subAdministrativeArea), subLocality(subLocality) {}
|
|
52
|
-
|
|
53
|
-
public:
|
|
54
|
-
friend bool operator==(const LocationGeocoderResult& lhs, const LocationGeocoderResult& rhs) = default;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
} // namespace margelo::nitro::locationgeocoder
|
|
58
|
-
|
|
59
|
-
namespace margelo::nitro {
|
|
60
|
-
|
|
61
|
-
// C++ LocationGeocoderResult <> JS LocationGeocoderResult (object)
|
|
62
|
-
template <>
|
|
63
|
-
struct JSIConverter<margelo::nitro::locationgeocoder::LocationGeocoderResult> final {
|
|
64
|
-
static inline margelo::nitro::locationgeocoder::LocationGeocoderResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
-
return margelo::nitro::locationgeocoder::LocationGeocoderResult(
|
|
67
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCode"))),
|
|
68
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "country"))),
|
|
69
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locality"))),
|
|
70
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea"))),
|
|
71
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea"))),
|
|
72
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subLocality")))
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::locationgeocoder::LocationGeocoderResult& arg) {
|
|
76
|
-
jsi::Object obj(runtime);
|
|
77
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "countryCode"), JSIConverter<std::string>::toJSI(runtime, arg.countryCode));
|
|
78
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "country"), JSIConverter<std::string>::toJSI(runtime, arg.country));
|
|
79
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "locality"), JSIConverter<std::string>::toJSI(runtime, arg.locality));
|
|
80
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea"), JSIConverter<std::string>::toJSI(runtime, arg.administrativeArea));
|
|
81
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea"), JSIConverter<std::string>::toJSI(runtime, arg.subAdministrativeArea));
|
|
82
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subLocality"), JSIConverter<std::string>::toJSI(runtime, arg.subLocality));
|
|
83
|
-
return obj;
|
|
84
|
-
}
|
|
85
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
86
|
-
if (!value.isObject()) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
jsi::Object obj = value.getObject(runtime);
|
|
90
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCode")))) return false;
|
|
94
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "country")))) return false;
|
|
95
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locality")))) return false;
|
|
96
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea")))) return false;
|
|
97
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea")))) return false;
|
|
98
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subLocality")))) return false;
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
} // namespace margelo::nitro
|
|
1
|
+
///
|
|
2
|
+
/// LocationGeocoderResult.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::locationgeocoder {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (LocationGeocoderResult).
|
|
39
|
+
*/
|
|
40
|
+
struct LocationGeocoderResult final {
|
|
41
|
+
public:
|
|
42
|
+
std::string countryCode SWIFT_PRIVATE;
|
|
43
|
+
std::string country SWIFT_PRIVATE;
|
|
44
|
+
std::string locality SWIFT_PRIVATE;
|
|
45
|
+
std::string administrativeArea SWIFT_PRIVATE;
|
|
46
|
+
std::string subAdministrativeArea SWIFT_PRIVATE;
|
|
47
|
+
std::string subLocality SWIFT_PRIVATE;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
LocationGeocoderResult() = default;
|
|
51
|
+
explicit LocationGeocoderResult(std::string countryCode, std::string country, std::string locality, std::string administrativeArea, std::string subAdministrativeArea, std::string subLocality): countryCode(countryCode), country(country), locality(locality), administrativeArea(administrativeArea), subAdministrativeArea(subAdministrativeArea), subLocality(subLocality) {}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
friend bool operator==(const LocationGeocoderResult& lhs, const LocationGeocoderResult& rhs) = default;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::locationgeocoder
|
|
58
|
+
|
|
59
|
+
namespace margelo::nitro {
|
|
60
|
+
|
|
61
|
+
// C++ LocationGeocoderResult <> JS LocationGeocoderResult (object)
|
|
62
|
+
template <>
|
|
63
|
+
struct JSIConverter<margelo::nitro::locationgeocoder::LocationGeocoderResult> final {
|
|
64
|
+
static inline margelo::nitro::locationgeocoder::LocationGeocoderResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
+
return margelo::nitro::locationgeocoder::LocationGeocoderResult(
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCode"))),
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "country"))),
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locality"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea"))),
|
|
71
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea"))),
|
|
72
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subLocality")))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::locationgeocoder::LocationGeocoderResult& arg) {
|
|
76
|
+
jsi::Object obj(runtime);
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "countryCode"), JSIConverter<std::string>::toJSI(runtime, arg.countryCode));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "country"), JSIConverter<std::string>::toJSI(runtime, arg.country));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "locality"), JSIConverter<std::string>::toJSI(runtime, arg.locality));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea"), JSIConverter<std::string>::toJSI(runtime, arg.administrativeArea));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea"), JSIConverter<std::string>::toJSI(runtime, arg.subAdministrativeArea));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subLocality"), JSIConverter<std::string>::toJSI(runtime, arg.subLocality));
|
|
83
|
+
return obj;
|
|
84
|
+
}
|
|
85
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
86
|
+
if (!value.isObject()) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
jsi::Object obj = value.getObject(runtime);
|
|
90
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCode")))) return false;
|
|
94
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "country")))) return false;
|
|
95
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locality")))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "administrativeArea")))) return false;
|
|
97
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subAdministrativeArea")))) return false;
|
|
98
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subLocality")))) return false;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@inoxialabs/react-native-nitro-location-geocoder",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "React Native Nitro module for reverse geocoding coordinates into country and locality context.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"author": "Inoxia Labs",
|
|
7
|
-
"main": "src/index",
|
|
8
|
-
"source": "src/index",
|
|
9
|
-
"types": "src/index.ts",
|
|
10
|
-
"react-native": "src/index",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/inoxIALabs/react-native-nitro-location-geocoder.git"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/inoxIALabs/react-native-nitro-location-geocoder#readme",
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/inoxIALabs/react-native-nitro-location-geocoder/issues"
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
"react-native",
|
|
24
|
-
"nitro",
|
|
25
|
-
"geocoder",
|
|
26
|
-
"location",
|
|
27
|
-
"country",
|
|
28
|
-
"locality",
|
|
29
|
-
"reverse-geocoding",
|
|
30
|
-
"ios",
|
|
31
|
-
"android"
|
|
32
|
-
],
|
|
33
|
-
"files": [
|
|
34
|
-
"src",
|
|
35
|
-
"react-native.config.js",
|
|
36
|
-
"nitro.json",
|
|
37
|
-
"nitrogen",
|
|
38
|
-
"android/build.gradle",
|
|
39
|
-
"android/fix-prefab.gradle",
|
|
40
|
-
"android/gradle.properties",
|
|
41
|
-
"android/CMakeLists.txt",
|
|
42
|
-
"android/src/**/*",
|
|
43
|
-
"ios/**/*.h",
|
|
44
|
-
"ios/**/*.m",
|
|
45
|
-
"ios/**/*.mm",
|
|
46
|
-
"ios/**/*.cpp",
|
|
47
|
-
"ios/**/*.swift",
|
|
48
|
-
"*.podspec",
|
|
49
|
-
"README.md",
|
|
50
|
-
"LICENSE"
|
|
51
|
-
],
|
|
52
|
-
"scripts": {
|
|
53
|
-
"specs": "nitrogen --logLevel=debug",
|
|
54
|
-
"test": "vitest run"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"react": "*",
|
|
58
|
-
"react-native": "*",
|
|
59
|
-
"react-native-nitro-modules": "^0.35.0"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"nitrogen": "^0.35.0",
|
|
63
|
-
"vitest": "^3.2.4"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@inoxialabs/react-native-nitro-location-geocoder",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native Nitro module for reverse geocoding coordinates into country and locality context.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Inoxia Labs",
|
|
7
|
+
"main": "src/index",
|
|
8
|
+
"source": "src/index",
|
|
9
|
+
"types": "src/index.ts",
|
|
10
|
+
"react-native": "src/index",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/inoxIALabs/react-native-nitro-location-geocoder.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/inoxIALabs/react-native-nitro-location-geocoder#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/inoxIALabs/react-native-nitro-location-geocoder/issues"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"react-native",
|
|
24
|
+
"nitro",
|
|
25
|
+
"geocoder",
|
|
26
|
+
"location",
|
|
27
|
+
"country",
|
|
28
|
+
"locality",
|
|
29
|
+
"reverse-geocoding",
|
|
30
|
+
"ios",
|
|
31
|
+
"android"
|
|
32
|
+
],
|
|
33
|
+
"files": [
|
|
34
|
+
"src",
|
|
35
|
+
"react-native.config.js",
|
|
36
|
+
"nitro.json",
|
|
37
|
+
"nitrogen",
|
|
38
|
+
"android/build.gradle",
|
|
39
|
+
"android/fix-prefab.gradle",
|
|
40
|
+
"android/gradle.properties",
|
|
41
|
+
"android/CMakeLists.txt",
|
|
42
|
+
"android/src/**/*",
|
|
43
|
+
"ios/**/*.h",
|
|
44
|
+
"ios/**/*.m",
|
|
45
|
+
"ios/**/*.mm",
|
|
46
|
+
"ios/**/*.cpp",
|
|
47
|
+
"ios/**/*.swift",
|
|
48
|
+
"*.podspec",
|
|
49
|
+
"README.md",
|
|
50
|
+
"LICENSE"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"specs": "nitrogen --logLevel=debug",
|
|
54
|
+
"test": "vitest run"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": "*",
|
|
58
|
+
"react-native": "*",
|
|
59
|
+
"react-native-nitro-modules": "^0.35.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"nitrogen": "^0.35.0",
|
|
63
|
+
"vitest": "^3.2.4"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/react-native.config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
dependency: {
|
|
3
|
-
platforms: {
|
|
4
|
-
ios: {},
|
|
5
|
-
android: {},
|
|
6
|
-
},
|
|
7
|
-
},
|
|
8
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
dependency: {
|
|
3
|
+
platforms: {
|
|
4
|
+
ios: {},
|
|
5
|
+
android: {},
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
};
|