@hpcc-js/comms
Version:
hpcc-js - Communications
101 lines (100 loc) • 3.11 kB
TypeScript
export declare function safeAssign(obj: {
[id: string]: any;
}, key: string, value: string): void;
declare enum GRAPH_TYPE {
UNKNOWN = 0,
GRAPH = 1,
SUBGRAPH = 2,
VERTEX = 3,
EDGE = 4,
LAST = 5
}
declare enum GRAPH_TYPE_STRING {
UNKNOWN = "Unknown",
GRAPH = "Graph",
SUBGRAPH = "Cluster",
VERTEX = "Vertex",
EDGE = "Edge",
LAST = "Last"
}
declare abstract class GraphItem {
abstract _globalType: "Graph" | "Cluster" | "Vertex" | "Edge";
__hpcc_graph: QueryGraph;
__hpcc_parent: Subgraph;
__widget: any;
__hpcc_id: string;
_globalID: string;
constructor(graph: QueryGraph, id: string);
getProperties(): {
[id: string]: any;
};
}
declare class Subgraph extends GraphItem {
_globalType: "Graph" | "Cluster" | "Vertex" | "Edge";
__hpcc_subgraphs: any[];
__hpcc_vertices: any[];
__hpcc_edges: any[];
id: string;
constructor(graph: QueryGraph, id: string);
addSubgraph(subgraph: any): void;
addVertex(vertex: any): void;
removeVertex(vertex: any): void;
addEdge(edge: any): void;
removeEdge(edge: any): void;
remove(): void;
walkSubgraphs(visitor: {
subgraphVisited: (arg0: Subgraph) => boolean;
}): void;
walkVertices(visitor: {
vertexVisited: (arg0: Vertex) => void;
}): void;
}
declare class Vertex extends GraphItem {
_globalType: "Graph" | "Cluster" | "Vertex" | "Edge";
_isSpill: boolean;
constructor(graph: QueryGraph, id: string);
isSpill(): boolean;
remove(): void;
getInVertices(): Vertex[];
getInEdges(): Edge[];
getOutVertices(): Vertex[];
getOutEdges(): Edge[];
}
declare class Edge extends GraphItem {
_globalType: "Graph" | "Cluster" | "Vertex" | "Edge";
_sourceActivity: any;
source: any;
_targetActivity: any;
target: any;
constructor(graph: QueryGraph, id: string);
remove(): void;
getSource(): Vertex;
setSource(source: Vertex): void;
getTarget(): Vertex;
}
export declare class QueryGraph {
idx: {
[id: string]: Subgraph | Vertex | Edge;
};
subgraphs: Subgraph[];
vertices: Vertex[];
edges: Edge[];
xgmml: string;
constructor();
clear(): void;
load(xgmml: string): void;
merge(xgmml: string): void;
isSubgraph(item: GraphItem): item is Subgraph;
isVertex(item: GraphItem): item is Vertex;
isEdge(item: GraphItem): item is Edge;
getGlobalType(item: QueryGraph | Subgraph | Vertex | Edge): GRAPH_TYPE;
getGlobalTypeString(item: QueryGraph | Subgraph | Vertex | Edge): GRAPH_TYPE_STRING;
getItem(docNode: HTMLElement, id: string): Subgraph | Vertex | Edge;
removeItem(item: Subgraph | Vertex | Edge): void;
getChildByTagName(docNode: HTMLElement, tagName: string): HTMLElement | null;
walkDocument(docNode: HTMLElement, id: string): Subgraph | Vertex | Edge;
removeSubgraphs(): void;
removeSpillVertices(): void;
getLocalisedXGMML(items: GraphItem[], localisationDepth: number, localisationDistance: number, noSpills: boolean): string;
}
export {};