@secondts/bark-react-native 0.1.0-beta.6

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 (117) hide show
  1. package/BarkReactNative.podspec +44 -0
  2. package/README.md +46 -0
  3. package/android/CMakeLists.txt +76 -0
  4. package/android/build.gradle +144 -0
  5. package/android/cpp-adapter.cpp +42 -0
  6. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBarkReactNativeSpec.java +41 -0
  7. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  8. package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec-generated.cpp +38 -0
  9. package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec.h +31 -0
  10. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  11. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
  12. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
  13. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
  14. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
  15. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
  16. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
  17. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI.h +76 -0
  18. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
  19. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
  21. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
  22. package/android/src/main/AndroidManifest.xml +5 -0
  23. package/android/src/main/java/com/barkreactnative/BarkReactNativeModule.kt +43 -0
  24. package/android/src/main/java/com/barkreactnative/BarkReactNativePackage.kt +34 -0
  25. package/app.plugin.js +1 -0
  26. package/cpp/bark-react-native.cpp +16 -0
  27. package/cpp/bark-react-native.h +15 -0
  28. package/cpp/generated/bark.cpp +6665 -0
  29. package/cpp/generated/bark.hpp +212 -0
  30. package/cpp/secondts-bark-react-native.cpp +16 -0
  31. package/cpp/secondts-bark-react-native.h +15 -0
  32. package/ios/BarkReactNative.h +16 -0
  33. package/ios/BarkReactNative.mm +66 -0
  34. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2321 -0
  35. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2761 -0
  36. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +2923 -0
  37. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +7718 -0
  38. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
  39. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +33 -0
  40. package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec-generated.mm +46 -0
  41. package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec.h +60 -0
  42. package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
  43. package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI.h +76 -0
  44. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  45. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
  46. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
  47. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
  48. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
  49. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
  50. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
  51. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
  52. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
  53. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
  54. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
  55. package/lib/commonjs/NativeBarkReactNative.js +10 -0
  56. package/lib/commonjs/NativeBarkReactNative.js.map +1 -0
  57. package/lib/commonjs/generated/bark-ffi.js +44 -0
  58. package/lib/commonjs/generated/bark-ffi.js.map +1 -0
  59. package/lib/commonjs/generated/bark.js +3175 -0
  60. package/lib/commonjs/generated/bark.js.map +1 -0
  61. package/lib/commonjs/index.js +63 -0
  62. package/lib/commonjs/index.js.map +1 -0
  63. package/lib/commonjs/package.json +1 -0
  64. package/lib/module/NativeBarkReactNative.js +7 -0
  65. package/lib/module/NativeBarkReactNative.js.map +1 -0
  66. package/lib/module/generated/bark-ffi.js +43 -0
  67. package/lib/module/generated/bark-ffi.js.map +1 -0
  68. package/lib/module/generated/bark.js +3164 -0
  69. package/lib/module/generated/bark.js.map +1 -0
  70. package/lib/module/index.js +43 -0
  71. package/lib/module/index.js.map +1 -0
  72. package/lib/module/package.json +1 -0
  73. package/lib/typescript/commonjs/package.json +1 -0
  74. package/lib/typescript/commonjs/plugin/src/index.d.ts +11 -0
  75. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +6 -0
  77. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +7 -0
  79. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts +8 -0
  81. package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +264 -0
  83. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/src/generated/bark.d.ts +2963 -0
  85. package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  87. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  88. package/lib/typescript/module/package.json +1 -0
  89. package/lib/typescript/module/plugin/src/index.d.ts +11 -0
  90. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  91. package/lib/typescript/module/plugin/src/withAndroid.d.ts +6 -0
  92. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  93. package/lib/typescript/module/plugin/src/withIOS.d.ts +7 -0
  94. package/lib/typescript/module/plugin/src/withIOS.d.ts.map +1 -0
  95. package/lib/typescript/module/src/NativeBarkReactNative.d.ts +8 -0
  96. package/lib/typescript/module/src/NativeBarkReactNative.d.ts.map +1 -0
  97. package/lib/typescript/module/src/generated/bark-ffi.d.ts +264 -0
  98. package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -0
  99. package/lib/typescript/module/src/generated/bark.d.ts +2963 -0
  100. package/lib/typescript/module/src/generated/bark.d.ts.map +1 -0
  101. package/lib/typescript/module/src/index.d.ts +8 -0
  102. package/lib/typescript/module/src/index.d.ts.map +1 -0
  103. package/package.json +154 -0
  104. package/plugin/build/index.d.ts +10 -0
  105. package/plugin/build/index.js +16 -0
  106. package/plugin/build/withAndroid.d.ts +5 -0
  107. package/plugin/build/withAndroid.js +26 -0
  108. package/plugin/build/withIOS.d.ts +6 -0
  109. package/plugin/build/withIOS.js +13 -0
  110. package/plugin/tsconfig.json +9 -0
  111. package/plugin/tsconfig.tsbuildinfo +1 -0
  112. package/react-native.config.js +12 -0
  113. package/scripts/postinstall.js +233 -0
  114. package/src/NativeBarkReactNative.ts +10 -0
  115. package/src/generated/bark-ffi.ts +694 -0
  116. package/src/generated/bark.ts +6068 -0
  117. package/src/index.tsx +41 -0
@@ -0,0 +1,76 @@
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
+ class JSI_EXPORT NativeBarkReactNativeCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeBarkReactNativeCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual bool installRustCrate(jsi::Runtime &rt) = 0;
24
+ virtual bool cleanupRustCrate(jsi::Runtime &rt) = 0;
25
+
26
+ };
27
+
28
+ template <typename T>
29
+ class JSI_EXPORT NativeBarkReactNativeCxxSpec : public TurboModule {
30
+ public:
31
+ jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
32
+ return delegate_.get(rt, propName);
33
+ }
34
+
35
+ static constexpr std::string_view kModuleName = "BarkReactNative";
36
+
37
+ protected:
38
+ NativeBarkReactNativeCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
39
+ : TurboModule(std::string{NativeBarkReactNativeCxxSpec::kModuleName}, jsInvoker),
40
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
41
+
42
+
43
+ private:
44
+ class Delegate : public NativeBarkReactNativeCxxSpecJSI {
45
+ public:
46
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
47
+ NativeBarkReactNativeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
48
+
49
+ }
50
+
51
+ bool installRustCrate(jsi::Runtime &rt) override {
52
+ static_assert(
53
+ bridging::getParameterCount(&T::installRustCrate) == 1,
54
+ "Expected installRustCrate(...) to have 1 parameters");
55
+
56
+ return bridging::callFromJs<bool>(
57
+ rt, &T::installRustCrate, jsInvoker_, instance_);
58
+ }
59
+ bool cleanupRustCrate(jsi::Runtime &rt) override {
60
+ static_assert(
61
+ bridging::getParameterCount(&T::cleanupRustCrate) == 1,
62
+ "Expected cleanupRustCrate(...) to have 1 parameters");
63
+
64
+ return bridging::callFromJs<bool>(
65
+ rt, &T::cleanupRustCrate, jsInvoker_, instance_);
66
+ }
67
+
68
+ private:
69
+ friend class NativeBarkReactNativeCxxSpec;
70
+ T *instance_;
71
+ };
72
+
73
+ Delegate delegate_;
74
+ };
75
+
76
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
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 <react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h>
12
+
13
+ namespace facebook::react {
14
+
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,23 @@
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 <react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h>
14
+ #include <react/renderer/components/RNBarkReactNativeSpec/Props.h>
15
+ #include <react/renderer/components/RNBarkReactNativeSpec/States.h>
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+
22
+
23
+ } // 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 <react/renderer/components/RNBarkReactNativeSpec/States.h>
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
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
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,5 @@
1
+
2
+ <!-- Generated by uniffi-bindgen-react-native -->
3
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
4
+ package="com.barkreactnative">
5
+ </manifest>
@@ -0,0 +1,43 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ package com.barkreactnative
3
+
4
+ import com.facebook.react.bridge.ReactApplicationContext
5
+ import com.facebook.react.module.annotations.ReactModule
6
+ import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
7
+
8
+ @ReactModule(name = BarkReactNativeModule.NAME)
9
+ class BarkReactNativeModule(reactContext: ReactApplicationContext) :
10
+ NativeBarkReactNativeSpec(reactContext) {
11
+
12
+ override fun getName(): String {
13
+ return NAME
14
+ }
15
+
16
+ // Two native methods implemented in cpp-adapter.cpp, and ultimately
17
+ // secondts-bark-react-native.cpp
18
+
19
+ external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean
20
+ external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean
21
+
22
+ override fun installRustCrate(): Boolean {
23
+ val context = this.reactApplicationContext
24
+ return nativeInstallRustCrate(
25
+ context.javaScriptContextHolder!!.get(),
26
+ context.jsCallInvokerHolder!!
27
+ )
28
+ }
29
+
30
+ override fun cleanupRustCrate(): Boolean {
31
+ return nativeCleanupRustCrate(
32
+ this.reactApplicationContext.javaScriptContextHolder!!.get()
33
+ )
34
+ }
35
+
36
+ companion object {
37
+ const val NAME = "BarkReactNative"
38
+
39
+ init {
40
+ System.loadLibrary("secondts-bark-react-native")
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,34 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ package com.barkreactnative
3
+
4
+ import com.facebook.react.TurboReactPackage
5
+ import com.facebook.react.bridge.NativeModule
6
+ import com.facebook.react.bridge.ReactApplicationContext
7
+ import com.facebook.react.module.model.ReactModuleInfo
8
+ import com.facebook.react.module.model.ReactModuleInfoProvider
9
+ import java.util.HashMap
10
+
11
+ class BarkReactNativePackage : TurboReactPackage() {
12
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
13
+ return if (name == BarkReactNativeModule.NAME) {
14
+ BarkReactNativeModule(reactContext)
15
+ } else {
16
+ null
17
+ }
18
+ }
19
+
20
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
21
+ return ReactModuleInfoProvider {
22
+ val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
23
+ moduleInfos[BarkReactNativeModule.NAME] = ReactModuleInfo(
24
+ BarkReactNativeModule.NAME,
25
+ BarkReactNativeModule.NAME,
26
+ false, // canOverrideExistingModule
27
+ false, // needsEagerInit
28
+ false, // isCxxModule
29
+ true // isTurboModule
30
+ )
31
+ moduleInfos
32
+ }
33
+ }
34
+ }
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build');
@@ -0,0 +1,16 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ #include "bark-react-native.h"
3
+ #include "generated/bark.hpp"
4
+
5
+ namespace barkreactnative {
6
+ using namespace facebook;
7
+
8
+ uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker) {
9
+ NativeBark::registerModule(runtime, callInvoker);
10
+ return true;
11
+ }
12
+
13
+ uint8_t cleanupRustCrate(jsi::Runtime &runtime) {
14
+ return false;
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ #ifndef BARKREACTNATIVE_H
2
+ #define BARKREACTNATIVE_H
3
+ // Generated by uniffi-bindgen-react-native
4
+ #include <cstdint>
5
+ #include <jsi/jsi.h>
6
+ #include <ReactCommon/CallInvoker.h>
7
+
8
+ namespace barkreactnative {
9
+ using namespace facebook;
10
+
11
+ uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker);
12
+ uint8_t cleanupRustCrate(jsi::Runtime &runtime);
13
+ }
14
+
15
+ #endif /* BARKREACTNATIVE_H */