-
Notifications
You must be signed in to change notification settings - Fork 24k
/
DevSupportManager.kt
116 lines (81 loc) · 3.8 KB
/
DevSupportManager.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.devsupport.interfaces
import android.app.Activity
import android.util.Pair
import android.view.View
import com.facebook.react.bridge.JSExceptionHandler
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.common.SurfaceDelegate
import com.facebook.react.modules.debug.interfaces.DeveloperSettings
import java.io.File
/**
* Interface for accessing and interacting with development features. In dev mode, use the
* implementation [BridgeDevSupportManager]. In production mode, use the dummy implementation
* [ReleaseDevSupportManager].
*/
public interface DevSupportManager : JSExceptionHandler {
public val devSettings: DeveloperSettings?
public val redBoxHandler: RedBoxHandler?
public val sourceMapUrl: String?
public val sourceUrl: String?
public val jSBundleURLForRemoteDebugging: String?
public val downloadedJSBundleFile: String?
public val lastErrorTitle: String?
public val lastErrorStack: Array<StackFrame>?
public val lastErrorType: ErrorType?
public val lastErrorCookie: Int
public val currentActivity: Activity?
public var devSupportEnabled: Boolean
public fun showNewJavaError(message: String?, e: Throwable?)
public fun addCustomDevOption(optionName: String?, optionHandler: DevOptionHandler?)
public fun createRootView(appKey: String?): View?
public fun destroyRootView(rootView: View?)
public fun showNewJSError(message: String?, details: ReadableArray?, errorCookie: Int)
public fun updateJSError(message: String?, details: ReadableArray?, errorCookie: Int)
public fun hideRedboxDialog()
public fun showDevOptionsDialog()
public fun startInspector()
public fun stopInspector()
public fun onNewReactContextCreated(reactContext: ReactContext?)
public fun onReactInstanceDestroyed(reactContext: ReactContext?)
public fun hasUpToDateJSBundleInCache(): Boolean
public fun reloadSettings()
public fun handleReloadJS()
public fun reloadJSFromServer(bundleURL: String)
public fun reloadJSFromServer(bundleURL: String, callback: BundleLoadCallback)
public fun loadSplitBundleFromServer(bundlePath: String, callback: DevSplitBundleCallback)
public fun isPackagerRunning(callback: PackagerStatusCallback)
public fun setHotModuleReplacementEnabled(isHotModuleReplacementEnabled: Boolean)
public fun setRemoteJSDebugEnabled(isRemoteJSDebugEnabled: Boolean)
public fun setFpsDebugEnabled(isFpsDebugEnabled: Boolean)
public fun toggleElementInspector()
public fun downloadBundleResourceFromUrlSync(resourceURL: String, outputFile: File?): File?
public fun registerErrorCustomizer(errorCustomizer: ErrorCustomizer?)
public fun processErrorCustomizers(
errorInfo: Pair<String, Array<StackFrame>>?
): Pair<String, Array<StackFrame>>?
public fun setPackagerLocationCustomizer(packagerLocationCustomizer: PackagerLocationCustomizer?)
/**
* Create the surface delegate that the provided module should use to interact with
*
* @param moduleName the module name that helps decide which surface it should interact with
* @return a [SurfaceDelegate] instance
*/
public fun createSurfaceDelegate(moduleName: String?): SurfaceDelegate?
/** Attempt to open the JS debugger on the host machine. */
public fun openDebugger()
/**
* The PackagerLocationCustomizer allows you to have a dynamic packager location that is
* determined right before loading the packager. Your customizer must call |callback|, as loading
* will be blocked waiting for it to resolve.
*/
public fun interface PackagerLocationCustomizer {
public fun run(callback: Runnable?)
}
}