react-dev-inspector
Version:
dev-tool for inspect react components and jump to local IDE for component code.
44 lines (43 loc) • 1.29 kB
TypeScript
/**
* mirror from https://github.com/facebook/react/blob/v16.13.1/packages/react-devtools-shared/src/backend/views/utils.js
*/
import { type Rect, type BoxSizing } from './utils';
interface Box {
top: number;
left: number;
width: number;
height: number;
}
declare class OverlayRect {
node: HTMLElement;
border: HTMLElement;
padding: HTMLElement;
content: HTMLElement;
constructor(doc: Document, container: HTMLElement);
remove(): void;
update(box: Rect, dims: BoxSizing): void;
}
declare class OverlayTip {
tip: HTMLElement;
nameSpan: HTMLElement;
titleDiv: HTMLElement;
infoDiv: HTMLElement;
dimSpan: HTMLElement;
constructor(doc: Document, container: HTMLElement);
remove(): void;
updateText(name: string, info: string | undefined, width: number, height: number): void;
updatePosition(dims: Box, bounds: Box): void;
}
export declare class Overlay {
window: Window;
tipBoundsWindow: Window;
container: HTMLElement;
tip: OverlayTip;
rects: Array<OverlayRect>;
removeCallback: (this: Overlay) => void;
constructor();
remove(): void;
setRemoveCallback(callback: () => void): void;
inspect(nodes: Array<HTMLElement>, name?: string, info?: string): void;
}
export {};