RCTCxxModule.h 830 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <memory>
  8. #import <Foundation/Foundation.h>
  9. #import <React/RCTBridgeModule.h>
  10. namespace facebook {
  11. namespace xplat {
  12. namespace module {
  13. class CxxModule;
  14. }
  15. }
  16. }
  17. /**
  18. * Subclass RCTCxxModule to use cross-platform CxxModule on iOS.
  19. *
  20. * Subclasses must implement the createModule method to lazily produce the module. When running under the Cxx bridge
  21. * modules will be accessed directly, under the Objective-C bridge method access is wrapped through RCTCxxMethod.
  22. */
  23. @interface RCTCxxModule : NSObject <RCTBridgeModule>
  24. // To be implemented by subclasses
  25. - (std::unique_ptr<facebook::xplat::module::CxxModule>)createModule;
  26. @end