Updated definitions per API

This commit is contained in:
Dom Parfitt
2018-10-12 14:59:43 +01:00
parent 37a35d669c
commit 7acb2d656f
+27 -24
View File
@@ -7,6 +7,13 @@
import { ZoomBehavior } from 'd3-zoom'
import { Selection } from 'd3-selection'
//This should be extending d3-selection, need to check it is correct
export interface ISelection extends Selection<any, any, HTMLElement, any> {
graphviz(options?: IGraphvizOptions | boolean): IGraphviz;
selectWithoutDataPropagation(): ISelection;
}
/**
*
* @param selector
@@ -34,7 +41,7 @@ export interface IGraphvizOptions {
fit?: boolean,
}
export interface IEdgeAttributes {
export interface IDotAttributes {
style: any;
URL: any;
tooltip: any;
@@ -44,55 +51,51 @@ export interface IEdgeOptions {
shortening: number;
}
export interface INodeAttributes {
URL: any;
tooltip: any;
}
export interface INodeOptions {
}
export interface IGraphviz {
engine(engine: string): IGraphviz;
addImage(path: string, width: number, height: number): IGraphviz;
engine(engine: string): IGraphviz; //engine should be an enum
addImage(path: string, width: number, height: number): IGraphviz; //Width & height can be strings, i.e. '100px'
totalMemory(size: number): IGraphviz;
keyMode(keyMode: string): IGraphviz;
keyMode(keyMode: string): IGraphviz; //keyMode should be an enum
fade(enable: boolean): IGraphviz;
tweenPaths(enable: boolean): IGraphviz;
tweenShapes(enable: boolean): IGraphviz;
convertEqualSidedPolygons(enable: boolean): IGraphviz;
tweenPrecision(precision: number): IGraphviz;
tweenPrecision(precision: number): IGraphviz; //precision can be a string, i.e. '50%'
growEnteringEdges(enable: boolean): IGraphviz;
zoom(enable: boolean): IGraphviz;
resetZoom(transition: any): any;
resetZoom(transition?: any): any;
zoomBehavior(): ZoomBehavior<any, any> | null;
zoomSelection(): any | null;
zoomScaleExtent(extent: number[]): IGraphviz;
zoomTranslateExtent(extent: number[][]): IGraphviz;
render(callback: Function): IGraphviz;
dot(src: any, callback: () => void): any;
zoomScaleExtent(extent?: number[]): IGraphviz;
zoomTranslateExtent(extent?: number[][]): IGraphviz;
render(callback?: Function): IGraphviz;
dot(src: any, callback?: () => void): IGraphviz;
data(): any;
renderDot(src: string, callback?: any): IGraphviz;
transition: any;
active(name: any): any;
options(options: IGraphvizOptions | undefined): IGraphviz;
transition(name: any): IGraphviz;
active(name?: any): any; //Returns a transition, what type?
options(): IGraphvizOptions;
options(options: IGraphvizOptions): IGraphviz;
width(width: number): IGraphviz;
height(height: number): IGraphviz;
scale(scale: number): IGraphviz;
fit(fit: boolean): IGraphviz;
attributer(callback: any): any;
on(typenames: string, callback: () => void): any;
attributer(callback: Function | null): IGraphviz;
on(typenames: string, callback?: () => void): any;
onerror(callback: any): any;
logEvents(enable: boolean): IGraphviz;
drawEdge(x1: number, x2: number, y1: number, y2: number, attributes?: IEdgeAttributes, options?: IEdgeOptions): IGraphviz;
updateDrawnEdge(x1: number, x2: number, y1: number, y2: number, attributes?: IEdgeAttributes, options?: IEdgeOptions): IGraphviz;
drawEdge(x1: number, x2: number, y1: number, y2: number, attributes?: IDotAttributes, options?: IEdgeOptions): IGraphviz;
updateDrawnEdge(x1: number, x2: number, y1: number, y2: number, attributes?: IDotAttributes, options?: IEdgeOptions): IGraphviz;
moveDrawnEdgeEndPoint(x2: number, y2: number, options?: IEdgeOptions): IGraphviz;
insertDrawnEdge(name: string): IGraphviz;
removeDrawnEdge(): IGraphviz;
drawnEdgeSelection(): any;
drawNode(x: number, y: number, nodeId: string, attributes?: INodeAttributes, options?: INodeOptions): IGraphviz;
updateDrawnNode(x: number, y: number, nodeId: string, attributes?: INodeAttributes, options?: INodeOptions): IGraphviz;
drawNode(x: number, y: number, nodeId: string, attributes?: IDotAttributes, options?: INodeOptions): IGraphviz;
updateDrawnNode(x: number, y: number, nodeId: string, attributes?: IDotAttributes, options?: INodeOptions): IGraphviz;
moveDrawnNode(x: number, y: number, options?: INodeOptions): IGraphviz;
inserDrawnNode(nodeId: string): IGraphviz;
removeDrawnNode(): IGraphviz;