@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.
- package/BarkReactNative.podspec +44 -0
- package/README.md +46 -0
- package/android/CMakeLists.txt +76 -0
- package/android/build.gradle +144 -0
- package/android/cpp-adapter.cpp +42 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBarkReactNativeSpec.java +41 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec-generated.cpp +38 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec.h +31 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI.h +76 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/barkreactnative/BarkReactNativeModule.kt +43 -0
- package/android/src/main/java/com/barkreactnative/BarkReactNativePackage.kt +34 -0
- package/app.plugin.js +1 -0
- package/cpp/bark-react-native.cpp +16 -0
- package/cpp/bark-react-native.h +15 -0
- package/cpp/generated/bark.cpp +6665 -0
- package/cpp/generated/bark.hpp +212 -0
- package/cpp/secondts-bark-react-native.cpp +16 -0
- package/cpp/secondts-bark-react-native.h +15 -0
- package/ios/BarkReactNative.h +16 -0
- package/ios/BarkReactNative.mm +66 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2321 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2761 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +2923 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +7718 -0
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec-generated.mm +46 -0
- package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec.h +60 -0
- package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
- package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI.h +76 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
- package/lib/commonjs/NativeBarkReactNative.js +10 -0
- package/lib/commonjs/NativeBarkReactNative.js.map +1 -0
- package/lib/commonjs/generated/bark-ffi.js +44 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -0
- package/lib/commonjs/generated/bark.js +3175 -0
- package/lib/commonjs/generated/bark.js.map +1 -0
- package/lib/commonjs/index.js +63 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/NativeBarkReactNative.js +7 -0
- package/lib/module/NativeBarkReactNative.js.map +1 -0
- package/lib/module/generated/bark-ffi.js +43 -0
- package/lib/module/generated/bark-ffi.js.map +1 -0
- package/lib/module/generated/bark.js +3164 -0
- package/lib/module/generated/bark.js.map +1 -0
- package/lib/module/index.js +43 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/plugin/src/index.d.ts +11 -0
- package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +6 -0
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +7 -0
- package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts +8 -0
- package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +264 -0
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/generated/bark.d.ts +2963 -0
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/plugin/src/index.d.ts +11 -0
- package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/module/plugin/src/withAndroid.d.ts +6 -0
- package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
- package/lib/typescript/module/plugin/src/withIOS.d.ts +7 -0
- package/lib/typescript/module/plugin/src/withIOS.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeBarkReactNative.d.ts +8 -0
- package/lib/typescript/module/src/NativeBarkReactNative.d.ts.map +1 -0
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +264 -0
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -0
- package/lib/typescript/module/src/generated/bark.d.ts +2963 -0
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +8 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +154 -0
- package/plugin/build/index.d.ts +10 -0
- package/plugin/build/index.js +16 -0
- package/plugin/build/withAndroid.d.ts +5 -0
- package/plugin/build/withAndroid.js +26 -0
- package/plugin/build/withIOS.d.ts +6 -0
- package/plugin/build/withIOS.js +13 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/react-native.config.js +12 -0
- package/scripts/postinstall.js +233 -0
- package/src/NativeBarkReactNative.ts +10 -0
- package/src/generated/bark-ffi.ts +694 -0
- package/src/generated/bark.ts +6068 -0
- 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,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 */
|