gt-react-native 0.0.1-alpha.1 → 0.0.1-alpha.2
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/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeGtReactNativeSpec.java +2 -2
- package/android/app/build/generated/source/codegen/jni/GtReactNativeSpec-generated.cpp +6 -6
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI-generated.cpp +6 -6
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/GtReactNativeSpec/GtReactNativeSpecJSI.h +10 -10
- package/package.json +2 -2
|
@@ -43,9 +43,9 @@ public abstract class NativeGtReactNativeSpec extends ReactContextBaseJavaModule
|
|
|
43
43
|
|
|
44
44
|
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
45
45
|
@DoNotStrip
|
|
46
|
-
public abstract @Nullable String
|
|
46
|
+
public abstract @Nullable String nativeStoreGet(String key);
|
|
47
47
|
|
|
48
48
|
@ReactMethod
|
|
49
49
|
@DoNotStrip
|
|
50
|
-
public abstract void
|
|
50
|
+
public abstract void nativeStoreSet(String key, String value);
|
|
51
51
|
}
|
|
@@ -22,22 +22,22 @@ static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_getNativeL
|
|
|
22
22
|
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ArrayKind, "getNativeLocales", "()Lcom/facebook/react/bridge/WritableArray;", args, count, cachedMethodId);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
static facebook::jsi::Value
|
|
25
|
+
static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreGet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
26
26
|
static jmethodID cachedMethodId = nullptr;
|
|
27
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "
|
|
27
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "nativeStoreGet", "(Ljava/lang/String;)Ljava/lang/String;", args, count, cachedMethodId);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
static facebook::jsi::Value
|
|
30
|
+
static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreSet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
31
31
|
static jmethodID cachedMethodId = nullptr;
|
|
32
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "
|
|
32
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "nativeStoreSet", "(Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
NativeGtReactNativeSpecJSI::NativeGtReactNativeSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
36
36
|
: JavaTurboModule(params) {
|
|
37
37
|
methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeSpecJSI_multiply};
|
|
38
38
|
methodMap_["getNativeLocales"] = MethodMetadata {0, __hostFunction_NativeGtReactNativeSpecJSI_getNativeLocales};
|
|
39
|
-
methodMap_["
|
|
40
|
-
methodMap_["
|
|
39
|
+
methodMap_["nativeStoreGet"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreGet};
|
|
40
|
+
methodMap_["nativeStoreSet"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreSet};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
std::shared_ptr<TurboModule> GtReactNativeSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
@@ -23,15 +23,15 @@ static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_getNativeLocales(
|
|
|
23
23
|
rt
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
static jsi::Value
|
|
27
|
-
auto result = static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->
|
|
26
|
+
static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreGet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
27
|
+
auto result = static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->nativeStoreGet(
|
|
28
28
|
rt,
|
|
29
29
|
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
30
30
|
);
|
|
31
31
|
return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
|
|
32
32
|
}
|
|
33
|
-
static jsi::Value
|
|
34
|
-
static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->
|
|
33
|
+
static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreSet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
34
|
+
static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->nativeStoreSet(
|
|
35
35
|
rt,
|
|
36
36
|
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
37
37
|
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
|
@@ -43,8 +43,8 @@ NativeGtReactNativeCxxSpecJSI::NativeGtReactNativeCxxSpecJSI(std::shared_ptr<Cal
|
|
|
43
43
|
: TurboModule("GtReactNative", jsInvoker) {
|
|
44
44
|
methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeCxxSpecJSI_multiply};
|
|
45
45
|
methodMap_["getNativeLocales"] = MethodMetadata {0, __hostFunction_NativeGtReactNativeCxxSpecJSI_getNativeLocales};
|
|
46
|
-
methodMap_["
|
|
47
|
-
methodMap_["
|
|
46
|
+
methodMap_["nativeStoreGet"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreGet};
|
|
47
|
+
methodMap_["nativeStoreSet"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreSet};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
|
|
@@ -22,8 +22,8 @@ protected:
|
|
|
22
22
|
public:
|
|
23
23
|
virtual double multiply(jsi::Runtime &rt, double a, double b) = 0;
|
|
24
24
|
virtual jsi::Array getNativeLocales(jsi::Runtime &rt) = 0;
|
|
25
|
-
virtual std::optional<jsi::String>
|
|
26
|
-
virtual void
|
|
25
|
+
virtual std::optional<jsi::String> nativeStoreGet(jsi::Runtime &rt, jsi::String key) = 0;
|
|
26
|
+
virtual void nativeStoreSet(jsi::Runtime &rt, jsi::String key, jsi::String value) = 0;
|
|
27
27
|
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -70,21 +70,21 @@ private:
|
|
|
70
70
|
return bridging::callFromJs<jsi::Array>(
|
|
71
71
|
rt, &T::getNativeLocales, jsInvoker_, instance_);
|
|
72
72
|
}
|
|
73
|
-
std::optional<jsi::String>
|
|
73
|
+
std::optional<jsi::String> nativeStoreGet(jsi::Runtime &rt, jsi::String key) override {
|
|
74
74
|
static_assert(
|
|
75
|
-
bridging::getParameterCount(&T::
|
|
76
|
-
"Expected
|
|
75
|
+
bridging::getParameterCount(&T::nativeStoreGet) == 2,
|
|
76
|
+
"Expected nativeStoreGet(...) to have 2 parameters");
|
|
77
77
|
|
|
78
78
|
return bridging::callFromJs<std::optional<jsi::String>>(
|
|
79
|
-
rt, &T::
|
|
79
|
+
rt, &T::nativeStoreGet, jsInvoker_, instance_, std::move(key));
|
|
80
80
|
}
|
|
81
|
-
void
|
|
81
|
+
void nativeStoreSet(jsi::Runtime &rt, jsi::String key, jsi::String value) override {
|
|
82
82
|
static_assert(
|
|
83
|
-
bridging::getParameterCount(&T::
|
|
84
|
-
"Expected
|
|
83
|
+
bridging::getParameterCount(&T::nativeStoreSet) == 3,
|
|
84
|
+
"Expected nativeStoreSet(...) to have 3 parameters");
|
|
85
85
|
|
|
86
86
|
return bridging::callFromJs<void>(
|
|
87
|
-
rt, &T::
|
|
87
|
+
rt, &T::nativeStoreSet, jsInvoker_, instance_, std::move(key), std::move(value));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
private:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react-native",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
4
|
"description": "An i18n package for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"codegenConfig": {
|
|
146
146
|
"name": "GtReactNativeSpec",
|
|
147
147
|
"type": "modules",
|
|
148
|
-
"jsSrcsDir": "src",
|
|
148
|
+
"jsSrcsDir": "./src",
|
|
149
149
|
"android": {
|
|
150
150
|
"javaPackageName": "com.gtreactnative"
|
|
151
151
|
}
|