mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
clean up comments and imports in RCTHost header
Summary: Changelog: [Internal] now that we've wrapped up the first iteration of the venice stable apis, let's clean up old comments and reorganize things to prepare this header for documentation. bypass-github-export-checks Reviewed By: mdvacca Differential Revision: D46334662 fbshipit-source-id: 68d6d2e41d7f7c5b1c69f3bb72482c418e771f72
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5062553c62
commit
7b763cd3db
@@ -10,7 +10,6 @@
|
||||
#import <PikaOptimizationsMacros/PikaOptimizationsMacros.h>
|
||||
#import <React/RCTDefines.h>
|
||||
#import <react/bridgeless/JSEngineInstance.h>
|
||||
#import <react/bridgeless/ReactInstance.h>
|
||||
#import <react/renderer/core/ReactPrimitives.h>
|
||||
|
||||
#import "RCTInstance.h"
|
||||
@@ -21,11 +20,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class RCTHost;
|
||||
@class RCTJSThreadManager;
|
||||
@class RCTModuleRegistry;
|
||||
@protocol RCTInstanceDelegate;
|
||||
FB_RUNTIME_PROTOCOL
|
||||
@protocol RCTTurboModuleManagerDelegate;
|
||||
|
||||
typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProvider)(void);
|
||||
// Runtime API
|
||||
|
||||
@protocol RCTHostDelegate <NSObject>
|
||||
|
||||
@@ -34,15 +32,13 @@ typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProv
|
||||
message:(NSString *)message
|
||||
exceptionId:(NSUInteger)exceptionId
|
||||
isFatal:(BOOL)isFatal;
|
||||
|
||||
- (void)hostDidStart:(RCTHost *)host;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* RCTHost is an object which is responsible for managing the lifecycle of a single RCTInstance.
|
||||
* RCTHost is long lived, while an instance may be deallocated and re-initialized. Some examples of when this happens:
|
||||
* CMD+R reload in DEV or a JS crash. The host should be the single owner of an RCTInstance.
|
||||
*/
|
||||
typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProvider)(void);
|
||||
|
||||
@interface RCTHost : NSObject
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
@@ -50,13 +46,12 @@ typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProv
|
||||
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
|
||||
jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER FB_OBJC_DIRECT;
|
||||
|
||||
/**
|
||||
* This function initializes an RCTInstance if one does not yet exist. This function is currently only called on the
|
||||
* main thread, but it should be threadsafe.
|
||||
* TODO T74233481 - Verify if this function is threadsafe.
|
||||
*/
|
||||
- (void)start;
|
||||
|
||||
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
|
||||
|
||||
// Renderer API
|
||||
|
||||
- (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName
|
||||
mode:(facebook::react::DisplayMode)displayMode
|
||||
initialProperties:(NSDictionary *)properties FB_OBJC_DIRECT;
|
||||
@@ -64,15 +59,11 @@ typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProv
|
||||
- (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName
|
||||
initialProperties:(NSDictionary *)properties FB_OBJC_DIRECT;
|
||||
|
||||
- (RCTModuleRegistry *)getModuleRegistry FB_OBJC_DIRECT;
|
||||
|
||||
- (RCTSurfacePresenter *)getSurfacePresenter FB_OBJC_DIRECT;
|
||||
|
||||
/**
|
||||
* Calls a method on a JS module that has been registered with `registerCallableModule`. Used to invoke a JS function
|
||||
* from platform code.
|
||||
*/
|
||||
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
|
||||
// Native module API
|
||||
|
||||
- (RCTModuleRegistry *)getModuleRegistry FB_OBJC_DIRECT;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user