|
| 1 | +/* |
| 2 | + * Copyright (c) Meta Platforms, Inc. and 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 | + |
| 8 | +package com.facebook.react.devsupport |
| 9 | + |
| 10 | +import android.content.Context |
| 11 | +import com.facebook.react.common.SurfaceDelegateFactory |
| 12 | +import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener |
| 13 | +import com.facebook.react.devsupport.interfaces.DevLoadingViewManager |
| 14 | +import com.facebook.react.devsupport.interfaces.DevSupportManager |
| 15 | +import com.facebook.react.devsupport.interfaces.PausedInDebuggerOverlayManager |
| 16 | +import com.facebook.react.devsupport.interfaces.RedBoxHandler |
| 17 | +import com.facebook.react.packagerconnection.RequestHandler |
| 18 | + |
| 19 | +public interface DevSupportManagerFactory { |
| 20 | + |
| 21 | + /** |
| 22 | + * Factory used by the Old Architecture flow to create a [DevSupportManager] and a |
| 23 | + * [BridgeDevSupportManager] |
| 24 | + */ |
| 25 | + public fun create( |
| 26 | + applicationContext: Context, |
| 27 | + reactInstanceManagerHelper: ReactInstanceDevHelper, |
| 28 | + packagerPathForJSBundleName: String?, |
| 29 | + enableOnCreate: Boolean, |
| 30 | + redBoxHandler: RedBoxHandler?, |
| 31 | + devBundleDownloadListener: DevBundleDownloadListener?, |
| 32 | + minNumShakes: Int, |
| 33 | + customPackagerCommandHandlers: Map<String, RequestHandler>?, |
| 34 | + surfaceDelegateFactory: SurfaceDelegateFactory?, |
| 35 | + devLoadingViewManager: DevLoadingViewManager?, |
| 36 | + pausedInDebuggerOverlayManager: PausedInDebuggerOverlayManager? |
| 37 | + ): DevSupportManager |
| 38 | + |
| 39 | + /** |
| 40 | + * Factory used by the New Architecture/Bridgeless flow to create a [DevSupportManager] and a |
| 41 | + * [BridgelessDevSupportManager] |
| 42 | + */ |
| 43 | + public fun create( |
| 44 | + applicationContext: Context, |
| 45 | + reactInstanceManagerHelper: ReactInstanceDevHelper, |
| 46 | + packagerPathForJSBundleName: String?, |
| 47 | + enableOnCreate: Boolean, |
| 48 | + redBoxHandler: RedBoxHandler?, |
| 49 | + devBundleDownloadListener: DevBundleDownloadListener?, |
| 50 | + minNumShakes: Int, |
| 51 | + customPackagerCommandHandlers: Map<String, RequestHandler>?, |
| 52 | + surfaceDelegateFactory: SurfaceDelegateFactory?, |
| 53 | + devLoadingViewManager: DevLoadingViewManager?, |
| 54 | + pausedInDebuggerOverlayManager: PausedInDebuggerOverlayManager?, |
| 55 | + useDevSupport: Boolean |
| 56 | + ): DevSupportManager |
| 57 | +} |
0 commit comments