diff --git a/wrappers/javascript/aries-askar-react-native/android/cpp-adapter.cpp b/wrappers/javascript/aries-askar-react-native/android/cpp-adapter.cpp index 4ff73844..64a8463f 100644 --- a/wrappers/javascript/aries-askar-react-native/android/cpp-adapter.cpp +++ b/wrappers/javascript/aries-askar-react-native/android/cpp-adapter.cpp @@ -25,7 +25,7 @@ struct AriesAskarModule : jni::JavaClass { auto runtime = reinterpret_cast(jsiRuntimePointer); auto jsCallInvoker = jsCallInvokerHolder->cthis()->getCallInvoker(); - turboModuleUtility::registerTurboModule(*runtime, jsCallInvoker); + ariesAskarTurboModuleUtility::registerTurboModule(*runtime, jsCallInvoker); } }; diff --git a/wrappers/javascript/aries-askar-react-native/cpp/HostObject.cpp b/wrappers/javascript/aries-askar-react-native/cpp/HostObject.cpp index 634db698..9d80348a 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/HostObject.cpp +++ b/wrappers/javascript/aries-askar-react-native/cpp/HostObject.cpp @@ -1,10 +1,10 @@ - #include #include #include -TurboModuleHostObject::TurboModuleHostObject(jsi::Runtime &rt) { return; } -FunctionMap TurboModuleHostObject::functionMapping(jsi::Runtime &rt) { + +AriesAskarTurboModuleHostObject::AriesAskarTurboModuleHostObject(jsi::Runtime &rt) { return; } +FunctionMap AriesAskarTurboModuleHostObject::functionMapping(jsi::Runtime &rt) { FunctionMap fMap; fMap.insert(std::make_tuple("version", &ariesAskar::version)); @@ -130,21 +130,21 @@ FunctionMap TurboModuleHostObject::functionMapping(jsi::Runtime &rt) { return fMap; } -jsi::Function TurboModuleHostObject::call(jsi::Runtime &rt, const char *name, +jsi::Function AriesAskarTurboModuleHostObject::call(jsi::Runtime &rt, const char *name, Cb cb) { return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, name), 1, [this, cb](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *arguments, size_t count) -> jsi::Value { const jsi::Value *val = &arguments[0]; - turboModuleUtility::assertValueIsObject(rt, val); + ariesAskarTurboModuleUtility::assertValueIsObject(rt, val); return (*cb)(rt, val->getObject(rt)); }); }; std::vector -TurboModuleHostObject::getPropertyNames(jsi::Runtime &rt) { - auto fMap = TurboModuleHostObject::functionMapping(rt); +AriesAskarTurboModuleHostObject::getPropertyNames(jsi::Runtime &rt) { + auto fMap = AriesAskarTurboModuleHostObject::functionMapping(rt); std::vector result; for (FunctionMap::iterator it = fMap.begin(); it != fMap.end(); ++it) { result.push_back(jsi::PropNameID::forUtf8(rt, it->first)); @@ -153,13 +153,13 @@ TurboModuleHostObject::getPropertyNames(jsi::Runtime &rt) { return result; } -jsi::Value TurboModuleHostObject::get(jsi::Runtime &rt, +jsi::Value AriesAskarTurboModuleHostObject::get(jsi::Runtime &rt, const jsi::PropNameID &propNameId) { auto propName = propNameId.utf8(rt); - auto fMap = TurboModuleHostObject::functionMapping(rt); + auto fMap = AriesAskarTurboModuleHostObject::functionMapping(rt); for (FunctionMap::iterator it = fMap.begin(); it != fMap.end(); ++it) { if (it->first == propName) { - return TurboModuleHostObject::call(rt, it->first, it->second); + return AriesAskarTurboModuleHostObject::call(rt, it->first, it->second); } } diff --git a/wrappers/javascript/aries-askar-react-native/cpp/HostObject.h b/wrappers/javascript/aries-askar-react-native/cpp/HostObject.h index 9e472858..66f04daf 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/HostObject.h +++ b/wrappers/javascript/aries-askar-react-native/cpp/HostObject.h @@ -12,9 +12,9 @@ using namespace facebook; typedef jsi::Value (*Cb)(jsi::Runtime &rt, jsi::Object options); typedef std::map FunctionMap; -class JSI_EXPORT TurboModuleHostObject : public jsi::HostObject { +class JSI_EXPORT AriesAskarTurboModuleHostObject : public jsi::HostObject { public: - TurboModuleHostObject(jsi::Runtime &rt); + AriesAskarTurboModuleHostObject(jsi::Runtime &rt); jsi::Function call(jsi::Runtime &rt, const char *name, Cb cb); FunctionMap functionMapping(jsi::Runtime &rt); diff --git a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp index b1b723b3..53758b33 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp +++ b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp @@ -2,7 +2,7 @@ #include -using namespace turboModuleUtility; +using namespace ariesAskarTurboModuleUtility; namespace ariesAskar { diff --git a/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.cpp b/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.cpp index 7a859667..a57e77f7 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.cpp +++ b/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.cpp @@ -2,7 +2,7 @@ #include -namespace turboModuleUtility { +namespace ariesAskarTurboModuleUtility { using byteVector = std::vector; @@ -13,7 +13,7 @@ void registerTurboModule(jsi::Runtime &rt, // Setting the callInvoker for async code invoker = jsCallInvoker; // Create a TurboModuleRustHostObject - auto instance = std::make_shared(rt); + auto instance = std::make_shared(rt); // Create a JS equivalent object of the instance jsi::Object jsInstance = jsi::Object::createFromHostObject(rt, instance); // Register the object on global @@ -325,4 +325,4 @@ jsi::ArrayBuffer secretBufferToArrayBuffer(jsi::Runtime &rt, SecretBuffer sb) { return arrayBuffer; } -} // namespace turboModuleUtility +} // namespace ariesAskarTurboModuleUtility diff --git a/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.h b/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.h index 85808152..663be9ba 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.h +++ b/wrappers/javascript/aries-askar-react-native/cpp/turboModuleUtility.h @@ -8,7 +8,7 @@ using namespace facebook; -namespace turboModuleUtility { +namespace ariesAskarTurboModuleUtility { static const std::string errorPrefix = "Value `"; static const std::string errorInfix = "` is not of type "; @@ -47,4 +47,4 @@ void callbackWithResponse(CallbackId result, ErrorCode code, T response); jsi::ArrayBuffer byteBufferToArrayBuffer(jsi::Runtime &rt, ByteBuffer bb); jsi::ArrayBuffer secretBufferToArrayBuffer(jsi::Runtime &rt, SecretBuffer sb); -} // namespace turboModuleUtility +} // namespace ariesAskarTurboModuleUtility diff --git a/wrappers/javascript/aries-askar-react-native/ios/AriesAskar.mm b/wrappers/javascript/aries-askar-react-native/ios/AriesAskar.mm index b9bf2082..635876de 100644 --- a/wrappers/javascript/aries-askar-react-native/ios/AriesAskar.mm +++ b/wrappers/javascript/aries-askar-react-native/ios/AriesAskar.mm @@ -26,7 +26,7 @@ @implementation AriesAskar } auto callInvoker = bridge.jsCallInvoker; - turboModuleUtility::registerTurboModule(*jsiRuntime, callInvoker); + ariesAskarTurboModuleUtility::registerTurboModule(*jsiRuntime, callInvoker); return @true; }