Properly make use of status events provided by DevTools server
Summary: Uses the new statuses emitted by DevTools in https://github.com/facebook/react/pull/22848 to better handle the connection state when connecting to DevTools from Flipper. Reviewed By: bvaughn Differential Revision: D32891240 fbshipit-source-id: 142d9996e05b5113e6dca28074c461d5a5acd38f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
297697c209
commit
e75238cbd2
@@ -16,6 +16,9 @@ type LoggerOptions = {
|
||||
surface?: string;
|
||||
};
|
||||
|
||||
type StatusTypes = 'server-connected' | 'devtools-connected' | 'error';
|
||||
type StatusListener = (message: string, status: StatusTypes) => void;
|
||||
|
||||
declare module 'react-devtools-core/standalone' {
|
||||
interface DevTools {
|
||||
setContentDOMNode(node: HTMLElement): this;
|
||||
@@ -25,7 +28,7 @@ declare module 'react-devtools-core/standalone' {
|
||||
httpsOptions?: ServerOptions,
|
||||
loggerOptions?: LoggerOptions,
|
||||
): {close: () => void};
|
||||
setStatusListener(listener: (message: string) => void): this;
|
||||
setStatusListener(listener: StatusListener): this;
|
||||
}
|
||||
const DevTools: DevTools;
|
||||
export default DevTools;
|
||||
|
||||
Reference in New Issue
Block a user