newsmemory-ios-sdk/Frameworks/ReactCodegen.xcframework/ios-arm64/Headers/RNFastImageSpecJSI.h

90 lines
2.7 KiB
C++

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
*/
#pragma once
#include <ReactCommon/TurboModule.h>
#include <react/bridging/Bridging.h>
namespace facebook::react {
class JSI_EXPORT NativeFastImageViewModuleCxxSpecJSI : public TurboModule {
protected:
NativeFastImageViewModuleCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
public:
virtual void preload(jsi::Runtime &rt, jsi::Array sources) = 0;
virtual jsi::Value clearMemoryCache(jsi::Runtime &rt) = 0;
virtual jsi::Value clearDiskCache(jsi::Runtime &rt) = 0;
};
template <typename T>
class JSI_EXPORT NativeFastImageViewModuleCxxSpec : public TurboModule {
public:
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
return delegate_.create(rt, propName);
}
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
return delegate_.getPropertyNames(runtime);
}
static constexpr std::string_view kModuleName = "FastImageViewModule";
protected:
NativeFastImageViewModuleCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
: TurboModule(std::string{NativeFastImageViewModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
private:
class Delegate : public NativeFastImageViewModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeFastImageViewModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
}
void preload(jsi::Runtime &rt, jsi::Array sources) override {
static_assert(
bridging::getParameterCount(&T::preload) == 2,
"Expected preload(...) to have 2 parameters");
return bridging::callFromJs<void>(
rt, &T::preload, jsInvoker_, instance_, std::move(sources));
}
jsi::Value clearMemoryCache(jsi::Runtime &rt) override {
static_assert(
bridging::getParameterCount(&T::clearMemoryCache) == 1,
"Expected clearMemoryCache(...) to have 1 parameters");
return bridging::callFromJs<jsi::Value>(
rt, &T::clearMemoryCache, jsInvoker_, instance_);
}
jsi::Value clearDiskCache(jsi::Runtime &rt) override {
static_assert(
bridging::getParameterCount(&T::clearDiskCache) == 1,
"Expected clearDiskCache(...) to have 1 parameters");
return bridging::callFromJs<jsi::Value>(
rt, &T::clearDiskCache, jsInvoker_, instance_);
}
private:
friend class NativeFastImageViewModuleCxxSpec;
T *instance_;
};
Delegate delegate_;
};
} // namespace facebook::react