react-native-maps 1.21.0-alpha.49 → 1.21.0-alpha.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/android/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
  2. package/android/generated/jni/CMakeLists.txt +36 -0
  3. package/android/generated/jni/RNMapsSpecs-generated.cpp +68 -0
  4. package/android/generated/jni/RNMapsSpecs.h +31 -0
  5. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +25 -0
  6. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +27 -0
  7. package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +896 -0
  8. package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +765 -0
  9. package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +146 -0
  10. package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1047 -0
  11. package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
  12. package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +264 -0
  13. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +20 -0
  14. package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +65 -0
  15. package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
  16. package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +65 -0
  17. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +25 -0
  18. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +27 -0
  19. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +896 -0
  20. package/ios/generated/RNMapsSpecs/EventEmitters.h +765 -0
  21. package/ios/generated/RNMapsSpecs/Props.cpp +146 -0
  22. package/ios/generated/RNMapsSpecs/Props.h +1047 -0
  23. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +549 -0
  24. package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
  25. package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +134 -0
  26. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +20 -0
  27. package/ios/generated/RNMapsSpecs/ShadowNodes.h +65 -0
  28. package/ios/generated/RNMapsSpecs/States.cpp +16 -0
  29. package/ios/generated/RNMapsSpecs/States.h +65 -0
  30. package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
  31. package/ios/generated/RNMapsSpecsJSI.h +264 -0
  32. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleObjCpp
8
+ *
9
+ * We create an umbrella header (and corresponding implementation) here since
10
+ * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
+ * must have a single output. More files => more genrule()s => slower builds.
12
+ */
13
+
14
+ #ifndef __cplusplus
15
+ #error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
16
+ #endif
17
+
18
+ // Avoid multiple includes of RNMapsSpecs symbols
19
+ #ifndef RNMapsSpecs_H
20
+ #define RNMapsSpecs_H
21
+
22
+ #import <Foundation/Foundation.h>
23
+ #import <RCTRequired/RCTRequired.h>
24
+ #import <RCTTypeSafety/RCTConvertHelpers.h>
25
+ #import <RCTTypeSafety/RCTTypedModuleConstants.h>
26
+ #import <React/RCTBridgeModule.h>
27
+ #import <React/RCTCxxConvert.h>
28
+ #import <React/RCTManagedPointer.h>
29
+ #import <ReactCommon/RCTTurboModule.h>
30
+ #import <optional>
31
+ #import <vector>
32
+
33
+ namespace JS {
34
+ namespace NativeAirMapsModule {
35
+ struct LatLng {
36
+ double latitude() const;
37
+ double longitude() const;
38
+
39
+ LatLng(NSDictionary *const v) : _v(v) {}
40
+ private:
41
+ NSDictionary *_v;
42
+ };
43
+ }
44
+ }
45
+
46
+ @interface RCTCxxConvert (NativeAirMapsModule_LatLng)
47
+ + (RCTManagedPointer *)JS_NativeAirMapsModule_LatLng:(id)json;
48
+ @end
49
+ namespace JS {
50
+ namespace NativeAirMapsModule {
51
+ struct Point {
52
+ double x() const;
53
+ double y() const;
54
+
55
+ Point(NSDictionary *const v) : _v(v) {}
56
+ private:
57
+ NSDictionary *_v;
58
+ };
59
+ }
60
+ }
61
+
62
+ @interface RCTCxxConvert (NativeAirMapsModule_Point)
63
+ + (RCTManagedPointer *)JS_NativeAirMapsModule_Point:(id)json;
64
+ @end
65
+ @protocol NativeAirMapsModuleSpec <RCTBridgeModule, RCTTurboModule>
66
+
67
+ - (void)getCamera:(double)tag
68
+ resolve:(RCTPromiseResolveBlock)resolve
69
+ reject:(RCTPromiseRejectBlock)reject;
70
+ - (void)getMarkersFrames:(double)tag
71
+ onlyVisible:(BOOL)onlyVisible
72
+ resolve:(RCTPromiseResolveBlock)resolve
73
+ reject:(RCTPromiseRejectBlock)reject;
74
+ - (void)getMapBoundaries:(double)tag
75
+ resolve:(RCTPromiseResolveBlock)resolve
76
+ reject:(RCTPromiseRejectBlock)reject;
77
+ - (void)takeSnapshot:(double)tag
78
+ config:(NSString *)config
79
+ resolve:(RCTPromiseResolveBlock)resolve
80
+ reject:(RCTPromiseRejectBlock)reject;
81
+ - (void)getAddressFromCoordinates:(double)tag
82
+ coordinate:(JS::NativeAirMapsModule::LatLng &)coordinate
83
+ resolve:(RCTPromiseResolveBlock)resolve
84
+ reject:(RCTPromiseRejectBlock)reject;
85
+ - (void)getPointForCoordinate:(double)tag
86
+ coordinate:(JS::NativeAirMapsModule::LatLng &)coordinate
87
+ resolve:(RCTPromiseResolveBlock)resolve
88
+ reject:(RCTPromiseRejectBlock)reject;
89
+ - (void)getCoordinateForPoint:(double)tag
90
+ point:(JS::NativeAirMapsModule::Point &)point
91
+ resolve:(RCTPromiseResolveBlock)resolve
92
+ reject:(RCTPromiseRejectBlock)reject;
93
+
94
+ @end
95
+
96
+ @interface NativeAirMapsModuleSpecBase : NSObject {
97
+ @protected
98
+ facebook::react::EventEmitterCallback _eventEmitterCallback;
99
+ }
100
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
101
+
102
+
103
+ @end
104
+
105
+ namespace facebook::react {
106
+ /**
107
+ * ObjC++ class for module 'NativeAirMapsModule'
108
+ */
109
+ class JSI_EXPORT NativeAirMapsModuleSpecJSI : public ObjCTurboModule {
110
+ public:
111
+ NativeAirMapsModuleSpecJSI(const ObjCTurboModule::InitParams &params);
112
+ };
113
+ } // namespace facebook::react
114
+ inline double JS::NativeAirMapsModule::LatLng::latitude() const
115
+ {
116
+ id const p = _v[@"latitude"];
117
+ return RCTBridgingToDouble(p);
118
+ }
119
+ inline double JS::NativeAirMapsModule::LatLng::longitude() const
120
+ {
121
+ id const p = _v[@"longitude"];
122
+ return RCTBridgingToDouble(p);
123
+ }
124
+ inline double JS::NativeAirMapsModule::Point::x() const
125
+ {
126
+ id const p = _v[@"x"];
127
+ return RCTBridgingToDouble(p);
128
+ }
129
+ inline double JS::NativeAirMapsModule::Point::y() const
130
+ {
131
+ id const p = _v[@"y"];
132
+ return RCTBridgingToDouble(p);
133
+ }
134
+ #endif // RNMapsSpecs_H
@@ -0,0 +1,20 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include "ShadowNodes.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ extern const char RNMapsGoogleMapViewComponentName[] = "RNMapsGoogleMapView";
16
+ extern const char RNMapsGooglePolygonComponentName[] = "RNMapsGooglePolygon";
17
+ extern const char RNMapsMapViewComponentName[] = "RNMapsMapView";
18
+ extern const char RNMapsMarkerComponentName[] = "RNMapsMarker";
19
+
20
+ } // namespace facebook::react
@@ -0,0 +1,65 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "EventEmitters.h"
14
+ #include "Props.h"
15
+ #include "States.h"
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+ JSI_EXPORT extern const char RNMapsGoogleMapViewComponentName[];
22
+
23
+ /*
24
+ * `ShadowNode` for <RNMapsGoogleMapView> component.
25
+ */
26
+ using RNMapsGoogleMapViewShadowNode = ConcreteViewShadowNode<
27
+ RNMapsGoogleMapViewComponentName,
28
+ RNMapsGoogleMapViewProps,
29
+ RNMapsGoogleMapViewEventEmitter,
30
+ RNMapsGoogleMapViewState>;
31
+
32
+ JSI_EXPORT extern const char RNMapsGooglePolygonComponentName[];
33
+
34
+ /*
35
+ * `ShadowNode` for <RNMapsGooglePolygon> component.
36
+ */
37
+ using RNMapsGooglePolygonShadowNode = ConcreteViewShadowNode<
38
+ RNMapsGooglePolygonComponentName,
39
+ RNMapsGooglePolygonProps,
40
+ RNMapsGooglePolygonEventEmitter,
41
+ RNMapsGooglePolygonState>;
42
+
43
+ JSI_EXPORT extern const char RNMapsMapViewComponentName[];
44
+
45
+ /*
46
+ * `ShadowNode` for <RNMapsMapView> component.
47
+ */
48
+ using RNMapsMapViewShadowNode = ConcreteViewShadowNode<
49
+ RNMapsMapViewComponentName,
50
+ RNMapsMapViewProps,
51
+ RNMapsMapViewEventEmitter,
52
+ RNMapsMapViewState>;
53
+
54
+ JSI_EXPORT extern const char RNMapsMarkerComponentName[];
55
+
56
+ /*
57
+ * `ShadowNode` for <RNMapsMarker> component.
58
+ */
59
+ using RNMapsMarkerShadowNode = ConcreteViewShadowNode<
60
+ RNMapsMarkerComponentName,
61
+ RNMapsMarkerProps,
62
+ RNMapsMarkerEventEmitter,
63
+ RNMapsMarkerState>;
64
+
65
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateStateCpp.js
9
+ */
10
+ #include "States.h"
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,65 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+ class RNMapsGoogleMapViewState {
18
+ public:
19
+ RNMapsGoogleMapViewState() = default;
20
+
21
+ #ifdef ANDROID
22
+ RNMapsGoogleMapViewState(RNMapsGoogleMapViewState const &previousState, folly::dynamic data){};
23
+ folly::dynamic getDynamic() const {
24
+ return {};
25
+ };
26
+ #endif
27
+ };
28
+
29
+ class RNMapsGooglePolygonState {
30
+ public:
31
+ RNMapsGooglePolygonState() = default;
32
+
33
+ #ifdef ANDROID
34
+ RNMapsGooglePolygonState(RNMapsGooglePolygonState const &previousState, folly::dynamic data){};
35
+ folly::dynamic getDynamic() const {
36
+ return {};
37
+ };
38
+ #endif
39
+ };
40
+
41
+ class RNMapsMapViewState {
42
+ public:
43
+ RNMapsMapViewState() = default;
44
+
45
+ #ifdef ANDROID
46
+ RNMapsMapViewState(RNMapsMapViewState const &previousState, folly::dynamic data){};
47
+ folly::dynamic getDynamic() const {
48
+ return {};
49
+ };
50
+ #endif
51
+ };
52
+
53
+ class RNMapsMarkerState {
54
+ public:
55
+ RNMapsMarkerState() = default;
56
+
57
+ #ifdef ANDROID
58
+ RNMapsMarkerState(RNMapsMarkerState const &previousState, folly::dynamic data){};
59
+ folly::dynamic getDynamic() const {
60
+ return {};
61
+ };
62
+ #endif
63
+ };
64
+
65
+ } // namespace facebook::react
@@ -0,0 +1,74 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleCpp.js
8
+ */
9
+
10
+ #include "RNMapsSpecsJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getCamera(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getCamera(
16
+ rt,
17
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
18
+ );
19
+ }
20
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getMarkersFrames(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
21
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getMarkersFrames(
22
+ rt,
23
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
24
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
25
+ );
26
+ }
27
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getMapBoundaries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
28
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getMapBoundaries(
29
+ rt,
30
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
31
+ );
32
+ }
33
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_takeSnapshot(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
34
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->takeSnapshot(
35
+ rt,
36
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
37
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
38
+ );
39
+ }
40
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getAddressFromCoordinates(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
41
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getAddressFromCoordinates(
42
+ rt,
43
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
44
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
45
+ );
46
+ }
47
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getPointForCoordinate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
48
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getPointForCoordinate(
49
+ rt,
50
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
51
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
52
+ );
53
+ }
54
+ static jsi::Value __hostFunction_NativeAirMapsModuleCxxSpecJSI_getCoordinateForPoint(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
55
+ return static_cast<NativeAirMapsModuleCxxSpecJSI *>(&turboModule)->getCoordinateForPoint(
56
+ rt,
57
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
58
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
59
+ );
60
+ }
61
+
62
+ NativeAirMapsModuleCxxSpecJSI::NativeAirMapsModuleCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
63
+ : TurboModule("RNMapsAirModule", jsInvoker) {
64
+ methodMap_["getCamera"] = MethodMetadata {1, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getCamera};
65
+ methodMap_["getMarkersFrames"] = MethodMetadata {2, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getMarkersFrames};
66
+ methodMap_["getMapBoundaries"] = MethodMetadata {1, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getMapBoundaries};
67
+ methodMap_["takeSnapshot"] = MethodMetadata {2, __hostFunction_NativeAirMapsModuleCxxSpecJSI_takeSnapshot};
68
+ methodMap_["getAddressFromCoordinates"] = MethodMetadata {2, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getAddressFromCoordinates};
69
+ methodMap_["getPointForCoordinate"] = MethodMetadata {2, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getPointForCoordinate};
70
+ methodMap_["getCoordinateForPoint"] = MethodMetadata {2, __hostFunction_NativeAirMapsModuleCxxSpecJSI_getCoordinateForPoint};
71
+ }
72
+
73
+
74
+ } // namespace facebook::react
@@ -0,0 +1,264 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ #pragma mark - NativeAirMapsModuleLatLng
20
+
21
+ template <typename P0, typename P1>
22
+ struct NativeAirMapsModuleLatLng {
23
+ P0 latitude;
24
+ P1 longitude;
25
+ bool operator==(const NativeAirMapsModuleLatLng &other) const {
26
+ return latitude == other.latitude && longitude == other.longitude;
27
+ }
28
+ };
29
+
30
+ template <typename T>
31
+ struct NativeAirMapsModuleLatLngBridging {
32
+ static T types;
33
+
34
+ static T fromJs(
35
+ jsi::Runtime &rt,
36
+ const jsi::Object &value,
37
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
38
+ T result{
39
+ bridging::fromJs<decltype(types.latitude)>(rt, value.getProperty(rt, "latitude"), jsInvoker),
40
+ bridging::fromJs<decltype(types.longitude)>(rt, value.getProperty(rt, "longitude"), jsInvoker)};
41
+ return result;
42
+ }
43
+
44
+ #ifdef DEBUG
45
+ static double latitudeToJs(jsi::Runtime &rt, decltype(types.latitude) value) {
46
+ return bridging::toJs(rt, value);
47
+ }
48
+
49
+ static double longitudeToJs(jsi::Runtime &rt, decltype(types.longitude) value) {
50
+ return bridging::toJs(rt, value);
51
+ }
52
+ #endif
53
+
54
+ static jsi::Object toJs(
55
+ jsi::Runtime &rt,
56
+ const T &value,
57
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
58
+ auto result = facebook::jsi::Object(rt);
59
+ result.setProperty(rt, "latitude", bridging::toJs(rt, value.latitude, jsInvoker));
60
+ result.setProperty(rt, "longitude", bridging::toJs(rt, value.longitude, jsInvoker));
61
+ return result;
62
+ }
63
+ };
64
+
65
+
66
+
67
+ #pragma mark - NativeAirMapsModuleMapBoundaries
68
+
69
+ template <typename P0, typename P1>
70
+ struct NativeAirMapsModuleMapBoundaries {
71
+ P0 northEast;
72
+ P1 southWest;
73
+ bool operator==(const NativeAirMapsModuleMapBoundaries &other) const {
74
+ return northEast == other.northEast && southWest == other.southWest;
75
+ }
76
+ };
77
+
78
+ template <typename T>
79
+ struct NativeAirMapsModuleMapBoundariesBridging {
80
+ static T types;
81
+
82
+ static T fromJs(
83
+ jsi::Runtime &rt,
84
+ const jsi::Object &value,
85
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
86
+ T result{
87
+ bridging::fromJs<decltype(types.northEast)>(rt, value.getProperty(rt, "northEast"), jsInvoker),
88
+ bridging::fromJs<decltype(types.southWest)>(rt, value.getProperty(rt, "southWest"), jsInvoker)};
89
+ return result;
90
+ }
91
+
92
+ #ifdef DEBUG
93
+ static jsi::Object northEastToJs(jsi::Runtime &rt, decltype(types.northEast) value) {
94
+ return bridging::toJs(rt, value);
95
+ }
96
+
97
+ static jsi::Object southWestToJs(jsi::Runtime &rt, decltype(types.southWest) value) {
98
+ return bridging::toJs(rt, value);
99
+ }
100
+ #endif
101
+
102
+ static jsi::Object toJs(
103
+ jsi::Runtime &rt,
104
+ const T &value,
105
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
106
+ auto result = facebook::jsi::Object(rt);
107
+ result.setProperty(rt, "northEast", bridging::toJs(rt, value.northEast, jsInvoker));
108
+ result.setProperty(rt, "southWest", bridging::toJs(rt, value.southWest, jsInvoker));
109
+ return result;
110
+ }
111
+ };
112
+
113
+
114
+
115
+ #pragma mark - NativeAirMapsModulePoint
116
+
117
+ template <typename P0, typename P1>
118
+ struct NativeAirMapsModulePoint {
119
+ P0 x;
120
+ P1 y;
121
+ bool operator==(const NativeAirMapsModulePoint &other) const {
122
+ return x == other.x && y == other.y;
123
+ }
124
+ };
125
+
126
+ template <typename T>
127
+ struct NativeAirMapsModulePointBridging {
128
+ static T types;
129
+
130
+ static T fromJs(
131
+ jsi::Runtime &rt,
132
+ const jsi::Object &value,
133
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
134
+ T result{
135
+ bridging::fromJs<decltype(types.x)>(rt, value.getProperty(rt, "x"), jsInvoker),
136
+ bridging::fromJs<decltype(types.y)>(rt, value.getProperty(rt, "y"), jsInvoker)};
137
+ return result;
138
+ }
139
+
140
+ #ifdef DEBUG
141
+ static double xToJs(jsi::Runtime &rt, decltype(types.x) value) {
142
+ return bridging::toJs(rt, value);
143
+ }
144
+
145
+ static double yToJs(jsi::Runtime &rt, decltype(types.y) value) {
146
+ return bridging::toJs(rt, value);
147
+ }
148
+ #endif
149
+
150
+ static jsi::Object toJs(
151
+ jsi::Runtime &rt,
152
+ const T &value,
153
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
154
+ auto result = facebook::jsi::Object(rt);
155
+ result.setProperty(rt, "x", bridging::toJs(rt, value.x, jsInvoker));
156
+ result.setProperty(rt, "y", bridging::toJs(rt, value.y, jsInvoker));
157
+ return result;
158
+ }
159
+ };
160
+
161
+ class JSI_EXPORT NativeAirMapsModuleCxxSpecJSI : public TurboModule {
162
+ protected:
163
+ NativeAirMapsModuleCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
164
+
165
+ public:
166
+ virtual jsi::Value getCamera(jsi::Runtime &rt, double tag) = 0;
167
+ virtual jsi::Value getMarkersFrames(jsi::Runtime &rt, double tag, bool onlyVisible) = 0;
168
+ virtual jsi::Value getMapBoundaries(jsi::Runtime &rt, double tag) = 0;
169
+ virtual jsi::Value takeSnapshot(jsi::Runtime &rt, double tag, jsi::String config) = 0;
170
+ virtual jsi::Value getAddressFromCoordinates(jsi::Runtime &rt, double tag, jsi::Object coordinate) = 0;
171
+ virtual jsi::Value getPointForCoordinate(jsi::Runtime &rt, double tag, jsi::Object coordinate) = 0;
172
+ virtual jsi::Value getCoordinateForPoint(jsi::Runtime &rt, double tag, jsi::Object point) = 0;
173
+
174
+ };
175
+
176
+ template <typename T>
177
+ class JSI_EXPORT NativeAirMapsModuleCxxSpec : public TurboModule {
178
+ public:
179
+ jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
180
+ return delegate_.get(rt, propName);
181
+ }
182
+
183
+ static constexpr std::string_view kModuleName = "RNMapsAirModule";
184
+
185
+ protected:
186
+ NativeAirMapsModuleCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
187
+ : TurboModule(std::string{NativeAirMapsModuleCxxSpec::kModuleName}, jsInvoker),
188
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
189
+
190
+
191
+ private:
192
+ class Delegate : public NativeAirMapsModuleCxxSpecJSI {
193
+ public:
194
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
195
+ NativeAirMapsModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
196
+
197
+ }
198
+
199
+ jsi::Value getCamera(jsi::Runtime &rt, double tag) override {
200
+ static_assert(
201
+ bridging::getParameterCount(&T::getCamera) == 2,
202
+ "Expected getCamera(...) to have 2 parameters");
203
+
204
+ return bridging::callFromJs<jsi::Value>(
205
+ rt, &T::getCamera, jsInvoker_, instance_, std::move(tag));
206
+ }
207
+ jsi::Value getMarkersFrames(jsi::Runtime &rt, double tag, bool onlyVisible) override {
208
+ static_assert(
209
+ bridging::getParameterCount(&T::getMarkersFrames) == 3,
210
+ "Expected getMarkersFrames(...) to have 3 parameters");
211
+
212
+ return bridging::callFromJs<jsi::Value>(
213
+ rt, &T::getMarkersFrames, jsInvoker_, instance_, std::move(tag), std::move(onlyVisible));
214
+ }
215
+ jsi::Value getMapBoundaries(jsi::Runtime &rt, double tag) override {
216
+ static_assert(
217
+ bridging::getParameterCount(&T::getMapBoundaries) == 2,
218
+ "Expected getMapBoundaries(...) to have 2 parameters");
219
+
220
+ return bridging::callFromJs<jsi::Value>(
221
+ rt, &T::getMapBoundaries, jsInvoker_, instance_, std::move(tag));
222
+ }
223
+ jsi::Value takeSnapshot(jsi::Runtime &rt, double tag, jsi::String config) override {
224
+ static_assert(
225
+ bridging::getParameterCount(&T::takeSnapshot) == 3,
226
+ "Expected takeSnapshot(...) to have 3 parameters");
227
+
228
+ return bridging::callFromJs<jsi::Value>(
229
+ rt, &T::takeSnapshot, jsInvoker_, instance_, std::move(tag), std::move(config));
230
+ }
231
+ jsi::Value getAddressFromCoordinates(jsi::Runtime &rt, double tag, jsi::Object coordinate) override {
232
+ static_assert(
233
+ bridging::getParameterCount(&T::getAddressFromCoordinates) == 3,
234
+ "Expected getAddressFromCoordinates(...) to have 3 parameters");
235
+
236
+ return bridging::callFromJs<jsi::Value>(
237
+ rt, &T::getAddressFromCoordinates, jsInvoker_, instance_, std::move(tag), std::move(coordinate));
238
+ }
239
+ jsi::Value getPointForCoordinate(jsi::Runtime &rt, double tag, jsi::Object coordinate) override {
240
+ static_assert(
241
+ bridging::getParameterCount(&T::getPointForCoordinate) == 3,
242
+ "Expected getPointForCoordinate(...) to have 3 parameters");
243
+
244
+ return bridging::callFromJs<jsi::Value>(
245
+ rt, &T::getPointForCoordinate, jsInvoker_, instance_, std::move(tag), std::move(coordinate));
246
+ }
247
+ jsi::Value getCoordinateForPoint(jsi::Runtime &rt, double tag, jsi::Object point) override {
248
+ static_assert(
249
+ bridging::getParameterCount(&T::getCoordinateForPoint) == 3,
250
+ "Expected getCoordinateForPoint(...) to have 3 parameters");
251
+
252
+ return bridging::callFromJs<jsi::Value>(
253
+ rt, &T::getCoordinateForPoint, jsInvoker_, instance_, std::move(tag), std::move(point));
254
+ }
255
+
256
+ private:
257
+ friend class NativeAirMapsModuleCxxSpec;
258
+ T *instance_;
259
+ };
260
+
261
+ Delegate delegate_;
262
+ };
263
+
264
+ } // namespace facebook::react
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
6
6
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
7
7
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
8
- "version": "1.21.0-alpha.49",
8
+ "version": "1.21.0-alpha.50",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",