Skip to content

Commit

Permalink
Document ReactHostDelegate (facebook#37562)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#37562

Add documentation for ReactHostDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D45717674

fbshipit-source-id: e0d6d70edf4f4cf70b53807732b35f5fda917fc3
  • Loading branch information
mdvacca authored and facebook-github-bot committed May 25, 2023
1 parent cd71a71 commit 20808b5
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20808b5

Please sign in to comment.