chore: format

This commit is contained in:
Nathan Walker
2020-07-05 14:57:06 -07:00
parent 8f2900ad0b
commit da3c0b973d
379 changed files with 71587 additions and 54582 deletions

View File

@@ -1,35 +1,61 @@
// Types
import { InspectorEvents, InspectorCommands } from "./devtools-elements-interfaces";
import {
InspectorEvents,
InspectorCommands,
} from "./devtools-elements-interfaces";
// Requires
import { getDocument, getComputedStylesForNode, removeNode, setAttributeAsText } from "./devtools-elements.common";
import {
getDocument,
getComputedStylesForNode,
removeNode,
setAttributeAsText,
} from "./devtools-elements.common";
import { registerInspectorEvents, DOMNode } from "./dom-node";
export * from "./devtools-elements-interfaces";
export function attachDOMInspectorEventCallbacks(DOMDomainFrontend: InspectorEvents) {
registerInspectorEvents(DOMDomainFrontend);
export function attachDOMInspectorEventCallbacks(
DOMDomainFrontend: InspectorEvents
) {
registerInspectorEvents(DOMDomainFrontend);
const originalChildNodeInserted: (parentId: number, lastId: number, node: string | DOMNode) => void = DOMDomainFrontend.childNodeInserted;
const originalChildNodeInserted: (
parentId: number,
lastId: number,
node: string | DOMNode
) => void = DOMDomainFrontend.childNodeInserted;
DOMDomainFrontend.childNodeInserted = (parentId: number, lastId: number, node: DOMNode) => {
originalChildNodeInserted(parentId, lastId, JSON.stringify(node.toObject()));
};
DOMDomainFrontend.childNodeInserted = (
parentId: number,
lastId: number,
node: DOMNode
) => {
originalChildNodeInserted(
parentId,
lastId,
JSON.stringify(node.toObject())
);
};
}
export function attachDOMInspectorCommandCallbacks(DOMDomainBackend: InspectorCommands) {
DOMDomainBackend.getDocument = () => {
return JSON.stringify(getDocument());
};
export function attachDOMInspectorCommandCallbacks(
DOMDomainBackend: InspectorCommands
) {
DOMDomainBackend.getDocument = () => {
return JSON.stringify(getDocument());
};
DOMDomainBackend.getComputedStylesForNode = (nodeId) => {
return JSON.stringify(getComputedStylesForNode(nodeId));
};
DOMDomainBackend.getComputedStylesForNode = (nodeId) => {
return JSON.stringify(getComputedStylesForNode(nodeId));
};
DOMDomainBackend.removeNode = removeNode;
DOMDomainBackend.setAttributeAsText = setAttributeAsText;
DOMDomainBackend.removeNode = removeNode;
DOMDomainBackend.setAttributeAsText = setAttributeAsText;
}
export function attachCSSInspectorCommandCallbacks(CSSDomainFrontend: InspectorCommands) {
// no op
export function attachCSSInspectorCommandCallbacks(
CSSDomainFrontend: InspectorCommands
) {
// no op
}