mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
chore: remove critical circular dependencies (#8114)
* chore: remove critical circular dependencies * chore: fix tslint errors * chore: remove platform specific types from interfaces * chore: update unit tests polyfills * fix: incorrect null check * chore: update api.md file * test: improve test case * chore: apply comments * test: avoid page style leaks in tests
This commit is contained in:

committed by
Alexander Vakrilov

parent
5b647bd809
commit
0ffc790d82
18
nativescript-core/debugger/devtools-elements-interfaces.ts
Normal file
18
nativescript-core/debugger/devtools-elements-interfaces.ts
Normal file
@ -0,0 +1,18 @@
|
||||
//Types
|
||||
import { DOMNode } from "./dom-node";
|
||||
|
||||
export interface InspectorCommands {
|
||||
// DevTools -> Application communication. Methods that devtools calls when needed.
|
||||
getDocument(): string | DOMNode;
|
||||
removeNode(nodeId: number): void;
|
||||
getComputedStylesForNode(nodeId: number): string | Array<{ name: string, value: string }>;
|
||||
setAttributeAsText(nodeId: number, text: string, name: string): void;
|
||||
}
|
||||
|
||||
export interface InspectorEvents {
|
||||
// Application -> DevTools communication. Methods that the app should call when needed.
|
||||
childNodeInserted(parentId: number, lastId: number, node: DOMNode): void;
|
||||
childNodeRemoved(parentId: number, nodeId: number): void;
|
||||
attributeModified(nodeId: number, attrName: string, attrValue: string): void;
|
||||
attributeRemoved(nodeId: number, attrName: string): void;
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
import { InspectorEvents, InspectorCommands } from "./devtools-elements";
|
||||
// Types
|
||||
import { InspectorEvents, InspectorCommands } from "./devtools-elements-interfaces";
|
||||
|
||||
// Requires
|
||||
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);
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { getNodeById } from "./dom-node";
|
||||
|
||||
// Needed for typings only
|
||||
// Types
|
||||
import { ViewBase } from "../ui/core/view-base";
|
||||
|
||||
//Requires
|
||||
import { getNodeById } from "./dom-node";
|
||||
import { mainThreadify } from "../utils/utils";
|
||||
|
||||
// Use lazy requires for core modules
|
||||
|
@ -1,7 +1,12 @@
|
||||
import { InspectorEvents, InspectorCommands } from "./devtools-elements";
|
||||
// Types
|
||||
import { InspectorEvents, InspectorCommands } from "./devtools-elements-interfaces";
|
||||
|
||||
// Requires
|
||||
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);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { CSSComputedStyleProperty } from "./css-agent";
|
||||
import { InspectorEvents } from "./devtools-elements";
|
||||
import { InspectorEvents } from "./devtools-elements-interfaces";
|
||||
|
||||
// Needed for typings only
|
||||
import { ViewBase } from "../ui/core/view";
|
||||
|
Reference in New Issue
Block a user