react-native-google-maps-plus 1.3.0-dev.2 → 1.3.0-dev.3
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/rngooglemapsplus/GoogleMapsViewImpl.kt +86 -5
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +0 -1
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +38 -4
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngBoundsExtension.kt +17 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSize.kt +7 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotFormat.kt +16 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotResultType.kt +9 -0
- package/ios/GoogleMapViewImpl.swift +261 -131
- package/ios/RNGoogleMapsPlusView.swift +72 -27
- package/ios/extensions/RNLatLngBounds+Extension.swift +16 -0
- package/ios/extensions/RNSize+Extension.swift +7 -0
- package/ios/extensions/RNSnapshotFormat+Extension.swift +28 -0
- package/ios/extensions/RNSnapshotResultType+Extension.swift +12 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +6 -3
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +13 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +51 -7
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +5 -2
- package/nitrogen/generated/android/c++/JRNLatLngBounds.hpp +58 -0
- package/nitrogen/generated/android/c++/JRNSize.hpp +57 -0
- package/nitrogen/generated/android/c++/JRNSnapshotFormat.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNSnapshotOptions.hpp +71 -0
- package/nitrogen/generated/android/c++/JRNSnapshotResultType.hpp +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +14 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLngBounds.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSize.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotFormat.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotOptions.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotResultType.kt +21 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +57 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +15 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +40 -5
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +5 -2
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +58 -4
- package/nitrogen/generated/ios/swift/RNLatLngBounds.swift +46 -0
- package/nitrogen/generated/ios/swift/RNSize.swift +46 -0
- package/nitrogen/generated/ios/swift/RNSnapshotFormat.swift +44 -0
- package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +87 -0
- package/nitrogen/generated/ios/swift/RNSnapshotResultType.swift +40 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +12 -3
- package/nitrogen/generated/shared/c++/RNLatLngBounds.hpp +72 -0
- package/nitrogen/generated/shared/c++/RNSize.hpp +71 -0
- package/nitrogen/generated/shared/c++/RNSnapshotFormat.hpp +80 -0
- package/nitrogen/generated/shared/c++/RNSnapshotOptions.hpp +87 -0
- package/nitrogen/generated/shared/c++/RNSnapshotResultType.hpp +76 -0
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +15 -2
- package/src/types.ts +24 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLatLngBounds.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNLatLngBounds`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNLatLngBounds = margelo.nitro.rngooglemapsplus.RNLatLngBounds
|
|
14
|
+
|
|
15
|
+
public extension RNLatLngBounds {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNLatLngBounds`.
|
|
20
|
+
*/
|
|
21
|
+
init(northEast: RNLatLng, southWest: RNLatLng) {
|
|
22
|
+
self.init(northEast, southWest)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var northEast: RNLatLng {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__northEast
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__northEast = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var southWest: RNLatLng {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__southWest
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__southWest = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSize.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNSize`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNSize = margelo.nitro.rngooglemapsplus.RNSize
|
|
14
|
+
|
|
15
|
+
public extension RNSize {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNSize`.
|
|
20
|
+
*/
|
|
21
|
+
init(width: Double, height: Double) {
|
|
22
|
+
self.init(width, height)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var width: Double {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__width
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__width = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var height: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__height
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__height = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotFormat.swift
|
|
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
|
+
/**
|
|
9
|
+
* Represents the JS union `RNSnapshotFormat`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias RNSnapshotFormat = margelo.nitro.rngooglemapsplus.RNSnapshotFormat
|
|
12
|
+
|
|
13
|
+
public extension RNSnapshotFormat {
|
|
14
|
+
/**
|
|
15
|
+
* Get a RNSnapshotFormat 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 "png":
|
|
21
|
+
self = .png
|
|
22
|
+
case "jpg":
|
|
23
|
+
self = .jpg
|
|
24
|
+
case "jpeg":
|
|
25
|
+
self = .jpeg
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this RNSnapshotFormat represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .png:
|
|
37
|
+
return "png"
|
|
38
|
+
case .jpg:
|
|
39
|
+
return "jpg"
|
|
40
|
+
case .jpeg:
|
|
41
|
+
return "jpeg"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotOptions.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNSnapshotOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNSnapshotOptions = margelo.nitro.rngooglemapsplus.RNSnapshotOptions
|
|
14
|
+
|
|
15
|
+
public extension RNSnapshotOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNSnapshotOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(size: RNSize?, format: RNSnapshotFormat, quality: Double, resultType: RNSnapshotResultType) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_RNSize_ in
|
|
23
|
+
if let __unwrappedValue = size {
|
|
24
|
+
return bridge.create_std__optional_RNSize_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), format, quality, resultType)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var size: RNSize? {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return { () -> RNSize? in
|
|
35
|
+
if bridge.has_value_std__optional_RNSize_(self.__size) {
|
|
36
|
+
let __unwrapped = bridge.get_std__optional_RNSize_(self.__size)
|
|
37
|
+
return __unwrapped
|
|
38
|
+
} else {
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}()
|
|
42
|
+
}
|
|
43
|
+
@inline(__always)
|
|
44
|
+
set {
|
|
45
|
+
self.__size = { () -> bridge.std__optional_RNSize_ in
|
|
46
|
+
if let __unwrappedValue = newValue {
|
|
47
|
+
return bridge.create_std__optional_RNSize_(__unwrappedValue)
|
|
48
|
+
} else {
|
|
49
|
+
return .init()
|
|
50
|
+
}
|
|
51
|
+
}()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var format: RNSnapshotFormat {
|
|
56
|
+
@inline(__always)
|
|
57
|
+
get {
|
|
58
|
+
return self.__format
|
|
59
|
+
}
|
|
60
|
+
@inline(__always)
|
|
61
|
+
set {
|
|
62
|
+
self.__format = newValue
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var quality: Double {
|
|
67
|
+
@inline(__always)
|
|
68
|
+
get {
|
|
69
|
+
return self.__quality
|
|
70
|
+
}
|
|
71
|
+
@inline(__always)
|
|
72
|
+
set {
|
|
73
|
+
self.__quality = newValue
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var resultType: RNSnapshotResultType {
|
|
78
|
+
@inline(__always)
|
|
79
|
+
get {
|
|
80
|
+
return self.__resultType
|
|
81
|
+
}
|
|
82
|
+
@inline(__always)
|
|
83
|
+
set {
|
|
84
|
+
self.__resultType = newValue
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotResultType.swift
|
|
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
|
+
/**
|
|
9
|
+
* Represents the JS union `RNSnapshotResultType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias RNSnapshotResultType = margelo.nitro.rngooglemapsplus.RNSnapshotResultType
|
|
12
|
+
|
|
13
|
+
public extension RNSnapshotResultType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a RNSnapshotResultType 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 "base64":
|
|
21
|
+
self = .base64
|
|
22
|
+
case "file":
|
|
23
|
+
self = .file
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this RNSnapshotResultType represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .base64:
|
|
35
|
+
return "base64"
|
|
36
|
+
case .file:
|
|
37
|
+
return "file"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -86,6 +86,9 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
86
86
|
prototype.registerHybridSetter("onCameraChangeComplete", &HybridRNGoogleMapsPlusViewSpec::setOnCameraChangeComplete);
|
|
87
87
|
prototype.registerHybridMethod("setCamera", &HybridRNGoogleMapsPlusViewSpec::setCamera);
|
|
88
88
|
prototype.registerHybridMethod("setCameraToCoordinates", &HybridRNGoogleMapsPlusViewSpec::setCameraToCoordinates);
|
|
89
|
+
prototype.registerHybridMethod("setCameraBounds", &HybridRNGoogleMapsPlusViewSpec::setCameraBounds);
|
|
90
|
+
prototype.registerHybridMethod("animateToBounds", &HybridRNGoogleMapsPlusViewSpec::animateToBounds);
|
|
91
|
+
prototype.registerHybridMethod("snapshot", &HybridRNGoogleMapsPlusViewSpec::snapshot);
|
|
89
92
|
prototype.registerHybridMethod("showLocationDialog", &HybridRNGoogleMapsPlusViewSpec::showLocationDialog);
|
|
90
93
|
prototype.registerHybridMethod("openLocationSettings", &HybridRNGoogleMapsPlusViewSpec::openLocationSettings);
|
|
91
94
|
prototype.registerHybridMethod("requestLocationPermission", &HybridRNGoogleMapsPlusViewSpec::requestLocationPermission);
|
|
@@ -55,6 +55,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
|
55
55
|
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
56
56
|
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
57
57
|
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
58
|
+
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
59
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
60
|
+
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
61
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNSnapshotOptions; }
|
|
58
62
|
// Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
|
|
59
63
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
|
|
60
64
|
|
|
@@ -83,8 +87,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
83
87
|
#include "RNIndoorLevel.hpp"
|
|
84
88
|
#include "RNRegion.hpp"
|
|
85
89
|
#include "RNCamera.hpp"
|
|
86
|
-
#include "
|
|
90
|
+
#include "RNLatLngBounds.hpp"
|
|
87
91
|
#include <NitroModules/Promise.hpp>
|
|
92
|
+
#include "RNSnapshotOptions.hpp"
|
|
93
|
+
#include "RNLocationPermissionResult.hpp"
|
|
88
94
|
|
|
89
95
|
namespace margelo::nitro::rngooglemapsplus {
|
|
90
96
|
|
|
@@ -186,8 +192,11 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
186
192
|
|
|
187
193
|
public:
|
|
188
194
|
// Methods
|
|
189
|
-
virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double>
|
|
190
|
-
virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double>
|
|
195
|
+
virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
196
|
+
virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
197
|
+
virtual void setCameraBounds(const std::optional<RNLatLngBounds>& bounds) = 0;
|
|
198
|
+
virtual void animateToBounds(const RNLatLngBounds& bounds, std::optional<double> padding, std::optional<double> durationMs, std::optional<bool> lockBounds) = 0;
|
|
199
|
+
virtual std::shared_ptr<Promise<std::optional<std::string>>> snapshot(const RNSnapshotOptions& options) = 0;
|
|
191
200
|
virtual void showLocationDialog() = 0;
|
|
192
201
|
virtual void openLocationSettings() = 0;
|
|
193
202
|
virtual std::shared_ptr<Promise<RNLocationPermissionResult>> requestLocationPermission() = 0;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLatLngBounds.hpp
|
|
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
|
+
#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
|
+
|
|
21
|
+
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
|
+
|
|
24
|
+
#include "RNLatLng.hpp"
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (RNLatLngBounds).
|
|
30
|
+
*/
|
|
31
|
+
struct RNLatLngBounds {
|
|
32
|
+
public:
|
|
33
|
+
RNLatLng northEast SWIFT_PRIVATE;
|
|
34
|
+
RNLatLng southWest SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNLatLngBounds() = default;
|
|
38
|
+
explicit RNLatLngBounds(RNLatLng northEast, RNLatLng southWest): northEast(northEast), southWest(southWest) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNLatLngBounds <> JS RNLatLngBounds (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLngBounds> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNLatLngBounds fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNLatLngBounds(
|
|
51
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "northEast")),
|
|
52
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "southWest"))
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLatLngBounds& arg) {
|
|
56
|
+
jsi::Object obj(runtime);
|
|
57
|
+
obj.setProperty(runtime, "northEast", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.northEast));
|
|
58
|
+
obj.setProperty(runtime, "southWest", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.southWest));
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
62
|
+
if (!value.isObject()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
jsi::Object obj = value.getObject(runtime);
|
|
66
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "northEast"))) return false;
|
|
67
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "southWest"))) return false;
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSize.hpp
|
|
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
|
+
#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
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNSize).
|
|
29
|
+
*/
|
|
30
|
+
struct RNSize {
|
|
31
|
+
public:
|
|
32
|
+
double width SWIFT_PRIVATE;
|
|
33
|
+
double height SWIFT_PRIVATE;
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
RNSize() = default;
|
|
37
|
+
explicit RNSize(double width, double height): width(width), height(height) {}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro {
|
|
43
|
+
|
|
44
|
+
// C++ RNSize <> JS RNSize (object)
|
|
45
|
+
template <>
|
|
46
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSize> final {
|
|
47
|
+
static inline margelo::nitro::rngooglemapsplus::RNSize fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
48
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
49
|
+
return margelo::nitro::rngooglemapsplus::RNSize(
|
|
50
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
|
|
51
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height"))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNSize& arg) {
|
|
55
|
+
jsi::Object obj(runtime);
|
|
56
|
+
obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
|
|
57
|
+
obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
|
|
58
|
+
return obj;
|
|
59
|
+
}
|
|
60
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
61
|
+
if (!value.isObject()) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
jsi::Object obj = value.getObject(runtime);
|
|
65
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
66
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotFormat.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (RNSnapshotFormat).
|
|
30
|
+
*/
|
|
31
|
+
enum class RNSnapshotFormat {
|
|
32
|
+
PNG SWIFT_NAME(png) = 0,
|
|
33
|
+
JPG SWIFT_NAME(jpg) = 1,
|
|
34
|
+
JPEG SWIFT_NAME(jpeg) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ RNSnapshotFormat <> JS RNSnapshotFormat (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat> final {
|
|
44
|
+
static inline margelo::nitro::rngooglemapsplus::RNSnapshotFormat fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("png"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::PNG;
|
|
48
|
+
case hashString("jpg"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPG;
|
|
49
|
+
case hashString("jpeg"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPEG;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNSnapshotFormat - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNSnapshotFormat arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::PNG: return JSIConverter<std::string>::toJSI(runtime, "png");
|
|
57
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPG: return JSIConverter<std::string>::toJSI(runtime, "jpg");
|
|
58
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPEG: return JSIConverter<std::string>::toJSI(runtime, "jpeg");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert RNSnapshotFormat to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("png"):
|
|
71
|
+
case hashString("jpg"):
|
|
72
|
+
case hashString("jpeg"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotOptions.hpp
|
|
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
|
+
#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
|
+
|
|
21
|
+
// Forward declaration of `RNSize` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNSize; }
|
|
23
|
+
// Forward declaration of `RNSnapshotFormat` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotFormat; }
|
|
25
|
+
// Forward declaration of `RNSnapshotResultType` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
|
|
27
|
+
|
|
28
|
+
#include "RNSize.hpp"
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include "RNSnapshotFormat.hpp"
|
|
31
|
+
#include "RNSnapshotResultType.hpp"
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A struct which can be represented as a JavaScript object (RNSnapshotOptions).
|
|
37
|
+
*/
|
|
38
|
+
struct RNSnapshotOptions {
|
|
39
|
+
public:
|
|
40
|
+
std::optional<RNSize> size SWIFT_PRIVATE;
|
|
41
|
+
RNSnapshotFormat format SWIFT_PRIVATE;
|
|
42
|
+
double quality SWIFT_PRIVATE;
|
|
43
|
+
RNSnapshotResultType resultType SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
RNSnapshotOptions() = default;
|
|
47
|
+
explicit RNSnapshotOptions(std::optional<RNSize> size, RNSnapshotFormat format, double quality, RNSnapshotResultType resultType): size(size), format(format), quality(quality), resultType(resultType) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
// C++ RNSnapshotOptions <> JS RNSnapshotOptions (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotOptions> final {
|
|
57
|
+
static inline margelo::nitro::rngooglemapsplus::RNSnapshotOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return margelo::nitro::rngooglemapsplus::RNSnapshotOptions(
|
|
60
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::fromJSI(runtime, obj.getProperty(runtime, "size")),
|
|
61
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::fromJSI(runtime, obj.getProperty(runtime, "format")),
|
|
62
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quality")),
|
|
63
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::fromJSI(runtime, obj.getProperty(runtime, "resultType"))
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNSnapshotOptions& arg) {
|
|
67
|
+
jsi::Object obj(runtime);
|
|
68
|
+
obj.setProperty(runtime, "size", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::toJSI(runtime, arg.size));
|
|
69
|
+
obj.setProperty(runtime, "format", JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::toJSI(runtime, arg.format));
|
|
70
|
+
obj.setProperty(runtime, "quality", JSIConverter<double>::toJSI(runtime, arg.quality));
|
|
71
|
+
obj.setProperty(runtime, "resultType", JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::toJSI(runtime, arg.resultType));
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
75
|
+
if (!value.isObject()) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::canConvert(runtime, obj.getProperty(runtime, "size"))) return false;
|
|
80
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::canConvert(runtime, obj.getProperty(runtime, "format"))) return false;
|
|
81
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quality"))) return false;
|
|
82
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::canConvert(runtime, obj.getProperty(runtime, "resultType"))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|