diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index ebc53a090d..c66709ca29 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -11,22 +11,27 @@ export namespace graphlib { edge(id: any): any; nodes(): string[]; node(id: any): any; - setDefaultEdgeLabel(callback: () => void): Graph; - setDefaultNodeLabel(callback: () => void): Graph; + setDefaultEdgeLabel(callback: string|(() => string)): Graph; + setDefaultNodeLabel(callback: string|(() => string)): Graph; setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph; - setGraph(options: { [key: string]: any }): Graph; + setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph; + setGraph(label: GraphLabel): Graph; setNode(id: string, node: { [key: string]: any }): Graph; - graph(): GraphOptions; + graph(): GraphLabel; - constructor(opt?: {}); + constructor(opt?: {directed?: boolean, multigraph?: boolean, compound?: boolean}); setParent(name: string, parentName: string): void; hasNode(name: string): boolean; } } -export interface GraphOptions { - width: number; - height: number; +export interface GraphLabel { + width?: number; + height?: number; + compound: boolean; + rankdir: string; + nodesep: number; + edgesep: number; } export function layout(graph: graphlib.Graph): void;