Document ReactHostDelegate (#37562)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37562

Add documentation for ReactHostDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D45717674

fbshipit-source-id: e0d6d70edf4f4cf70b53807732b35f5fda917fc3
This commit is contained in:
David Vacca
2023-05-25 10:29:01 -07:00
committed by Facebook GitHub Bot
parent cd71a71ad1
commit 20808b5eb5
@@ -16,24 +16,51 @@ import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.fabric.ReactNativeConfig
import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate
/** TODO: add javadoc for class and methods */
/**
* [ReactHostDelegate] is an interface that defines parameters required to initialize React Native.
* This interface works in combination with [ReactHost]
*/
@ThreadSafe
@UnstableReactNativeAPI
interface ReactHostDelegate {
/**
* Path to your app's main module on Metro. This is used when reloading JS during development. All
* paths are relative to the root folder the packager is serving files from. Examples:
* `index.android` or `subdirectory/index.android`
*/
val jSMainModulePath: String
/**
* Object that holds a native C++ references that allow host applications to install C++ objects
* into jsi::Runtime during the initialization of React Native
*/
val bindingsInstaller: BindingsInstaller?
/** list of [ReactPackage] to expose Native Modules and View Components to JS */
val reactPackages: List<ReactPackage>
/** Object that holds a native reference to the javascript engine */
val jSEngineInstance: JSEngineInstance
/**
* Bundle loader to use when setting up JS environment. <p>Example:
* [JSBundleLoader.createFileLoader(application, bundleFile)]
*/
val jSBundleLoader: JSBundleLoader
/** TODO: combine getTurboModuleManagerDelegate inside [ReactPackage] */
fun getTurboModuleManagerDelegate(context: ReactApplicationContext): TurboModuleManagerDelegate
/**
* Callback that can be used by React Native host applications to react to exceptions thrown by
* the internals of React Native.
*/
fun handleInstanceException(error: Exception)
/**
* ReactNative Configuration that allows to customize the behavior of key/value pairs used by the
* framework to enable/disable experimental capabilities
*/
fun getReactNativeConfig(context: ReactContext): ReactNativeConfig
@UnstableReactNativeAPI