Skip to content

Commit

Permalink
Updated dagre.d.ts to support fluent-chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wong Siang Kai committed Mar 20, 2015
1 parent 0d211fb commit 9acb366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 4 additions & 7 deletions dagre/dagre-tests.ts
@@ -1,13 +1,10 @@
/// <reference path="dagre.d.ts"/>
module DagreTests {
var gDagre = new dagre.graphlib.Graph();
gDagre.setGraph({});
gDagre.setDefaultEdgeLabel(function(){
return ;
});

gDagre.setNode("a", {});
gDagre.setEdge("b", "c");
gDagre.setGraph({})
.setDefaultEdgeLabel(function(){ return ; })
.setNode("a", {})
.setEdge("b", "c");

dagre.layout(gDagre);
}
10 changes: 5 additions & 5 deletions dagre/dagre.d.ts
Expand Up @@ -14,14 +14,14 @@ declare module Dagre{
edge(id: string): any;
nodes(): string[];
node(id: string): any;
setDefaultEdgeLabel(callback: () => void): void;
setEdge(sourceId: string, targetId: string): void;
setGraph(options: { [key: string]: any }): void;
setNode(id: string, node: { [key: string]: any }): void;
setDefaultEdgeLabel(callback: () => void): Graph;
setEdge(sourceId: string, targetId: string): Graph;
setGraph(options: { [key: string]: any }): Graph;
setNode(id: string, node: { [key: string]: any }): Graph;
}

interface GraphLib {
Graph: Graph
Graph: Graph;
}
}

Expand Down

0 comments on commit 9acb366

Please sign in to comment.