Files
flipper/desktop/plugins/public/reactdevtools/react-devtools-core.d.tsx
Juan Tejada e75238cbd2 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
2021-12-07 10:53:06 -08:00

36 lines
851 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
type ServerOptions = {
key?: string;
cert?: string;
};
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;
startServer(
port?: number,
host?: string,
httpsOptions?: ServerOptions,
loggerOptions?: LoggerOptions,
): {close: () => void};
setStatusListener(listener: StatusListener): this;
}
const DevTools: DevTools;
export default DevTools;
}