UNPKG

1.04 kBTypeScriptView Raw
1import { DOMNode } from './dom-node';
2
3export interface InspectorCommands {
4 // DevTools -> Application communication. Methods that devtools calls when needed.
5 getDocument(): string | DOMNode;
6 removeNode(nodeId: number): void;
7 getComputedStylesForNode(nodeId: number): string | Array<{ name: string; value: string }>;
8 setAttributeAsText(nodeId: number, text: string, name: string): void;
9}
10
11export interface InspectorEvents {
12 // Application -> DevTools communication. Methods that the app should call when needed.
13 childNodeInserted(parentId: number, lastId: number, node: DOMNode): void;
14 childNodeRemoved(parentId: number, nodeId: number): void;
15 attributeModified(nodeId: number, attrName: string, attrValue: string): void;
16 attributeRemoved(nodeId: number, attrName: string): void;
17}
18
19export function attachDOMInspectorEventCallbacks(inspector: InspectorEvents);
20
21export function attachDOMInspectorCommandCallbacks(inspector: InspectorCommands);
22
23export function attachCSSInspectorCommandCallbacks(inspector: InspectorCommands);