mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This defines various sub specs to support building TurboModules that implement the codegen'ed specs. Reviewed By: PeteTheHeat Differential Revision: D16043221 fbshipit-source-id: 27ed532be929c11c8fe648632da8a72061cbc8b0
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
|
|
#ifdef RN_TURBO_MODULE_ENABLED
|
|
|
|
#import "RNTesterTurboModuleProvider.h"
|
|
|
|
#import <jsireact/SampleTurboCxxModule.h>
|
|
#import <jsireact/RCTSampleTurboModule.h>
|
|
|
|
// NOTE: This entire file should be codegen'ed.
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
Class RNTesterTurboModuleClassProvider(const char *name) {
|
|
return nil;
|
|
}
|
|
|
|
std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name, std::shared_ptr<JSCallInvoker> jsInvoker) {
|
|
if (name == "SampleTurboCxxModule") {
|
|
return std::make_shared<SampleTurboCxxModule>(jsInvoker);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name,
|
|
id<RCTTurboModule> instance,
|
|
std::shared_ptr<JSCallInvoker> jsInvoker) {
|
|
if (name == "SampleTurboModule") {
|
|
return std::make_shared<NativeSampleTurboModuleSpecJSI>(instance, jsInvoker);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|
|
|
|
#endif
|