mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d0599ac56b
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/35089 Changelog: [General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule" This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation Reviewed By: cipolleschi Differential Revision: D40714320 fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
48 lines
1.4 KiB
Objective-C
48 lines
1.4 KiB
Objective-C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#import <cxxreact/CxxModule.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/**
|
|
* A sample CxxModule (legacy system) implementation.
|
|
*/
|
|
class SampleTurboCxxModuleLegacyImpl
|
|
: public facebook::xplat::module::CxxModule {
|
|
public:
|
|
SampleTurboCxxModuleLegacyImpl();
|
|
|
|
std::string getName() override;
|
|
std::map<std::string, folly::dynamic> getConstants() override;
|
|
std::vector<facebook::xplat::module::CxxModule::Method> getMethods() override;
|
|
|
|
// API
|
|
void voidFunc();
|
|
bool getBool(bool arg);
|
|
double getNumber(double arg);
|
|
std::string getString(const std::string &arg);
|
|
folly::dynamic getArray(const folly::dynamic &arg);
|
|
folly::dynamic getObject(const folly::dynamic &arg);
|
|
folly::dynamic getUnsafeObject(const folly::dynamic &arg);
|
|
double getRootTag(double arg);
|
|
folly::dynamic
|
|
getValue(double x, const std::string &y, const folly::dynamic &z);
|
|
void getValueWithCallback(
|
|
const facebook::xplat::module::CxxModule::Callback &callback);
|
|
void getValueWithPromise(
|
|
bool error,
|
|
const facebook::xplat::module::CxxModule::Callback &resolve,
|
|
const facebook::xplat::module::CxxModule::Callback &reject);
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|