@hxa-rn/react-native-background-actions 4.1.0 → 4.1.1

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.
@@ -1,76 +1,76 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- *
7
- * @generatorVersion: 1
8
- */
9
-
10
- #pragma once
11
-
12
- #include "RNOH/Package.h"
13
- #include "RNOH/ArkTSTurboModule.h"
14
- #include "generated/RNBackgroundActions.h"
15
-
16
- namespace rnoh {
17
-
18
- class RNOHGeneratedPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
19
- public:
20
- SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
21
- if (name == "RNBackgroundActions") {
22
- return std::make_shared<RNBackgroundActions>(ctx, name);
23
- }
24
- return nullptr;
25
- };
26
- };
27
-
28
- class GeneratedEventEmitRequestHandler : public EventEmitRequestHandler {
29
- public:
30
- void handleEvent(Context const &ctx) override {
31
- auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
32
- auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
33
-
34
- if (eventEmitter == nullptr) {
35
- return;
36
- }
37
-
38
- std::vector<std::string> supportedComponentNames = {
39
- };
40
-
41
- std::vector<std::string> supportedEventNames = {
42
- };
43
-
44
- if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
45
- std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
46
- eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
47
- }
48
- }
49
- };
50
-
51
- class RNOHGeneratedPackage : public Package {
52
- public:
53
- RNOHGeneratedPackage(Package::Context ctx) : Package(ctx){};
54
-
55
- std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
56
- return std::make_unique<RNOHGeneratedPackageTurboModuleFactoryDelegate>();
57
- }
58
-
59
- std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
60
- return {
61
- };
62
- }
63
-
64
- ComponentJSIBinderByString createComponentJSIBinderByName() override {
65
- return {
66
- };
67
- };
68
-
69
- EventEmitRequestHandlers createEventEmitRequestHandlers() override {
70
- return {
71
- std::make_shared<GeneratedEventEmitRequestHandler>(),
72
- };
73
- }
74
- };
75
-
76
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-harmony"
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be
5
+ * lost once the code is regenerated.
6
+ *
7
+ * @generatorVersion: 1
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include "RNOH/Package.h"
13
+ #include "RNOH/ArkTSTurboModule.h"
14
+ #include "generated/RNBackgroundActions.h"
15
+
16
+ namespace rnoh {
17
+
18
+ class RNOHGeneratedPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
19
+ public:
20
+ SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
21
+ if (name == "RNBackgroundActions") {
22
+ return std::make_shared<RNBackgroundActions>(ctx, name);
23
+ }
24
+ return nullptr;
25
+ };
26
+ };
27
+
28
+ class GeneratedEventEmitRequestHandler : public EventEmitRequestHandler {
29
+ public:
30
+ void handleEvent(Context const &ctx) override {
31
+ auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
32
+ auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
33
+
34
+ if (eventEmitter == nullptr) {
35
+ return;
36
+ }
37
+
38
+ std::vector<std::string> supportedComponentNames = {
39
+ };
40
+
41
+ std::vector<std::string> supportedEventNames = {
42
+ };
43
+
44
+ if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
45
+ std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
46
+ eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
47
+ }
48
+ }
49
+ };
50
+
51
+ class RNOHGeneratedPackage : public Package {
52
+ public:
53
+ RNOHGeneratedPackage(Package::Context ctx) : Package(ctx){};
54
+
55
+ std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
56
+ return std::make_unique<RNOHGeneratedPackageTurboModuleFactoryDelegate>();
57
+ }
58
+
59
+ std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
60
+ return {
61
+ };
62
+ }
63
+
64
+ ComponentJSIBinderByString createComponentJSIBinderByName() override {
65
+ return {
66
+ };
67
+ };
68
+
69
+ EventEmitRequestHandlers createEventEmitRequestHandlers() override {
70
+ return {
71
+ std::make_shared<GeneratedEventEmitRequestHandler>(),
72
+ };
73
+ }
74
+ };
75
+
76
+ } // namespace rnoh