diff --git a/types/dagre/dagre-tests.ts b/types/dagre/dagre-tests.ts index d9a62a107b..ae81c2c896 100644 --- a/types/dagre/dagre-tests.ts +++ b/types/dagre/dagre-tests.ts @@ -1,6 +1,6 @@ const gDagre = new dagre.graphlib.Graph(); gDagre.setGraph({}) - .setDefaultEdgeLabel(() => {}) + .setDefaultEdgeLabel(() => ({})) .setNode("a", {}) .setEdge("b", "c") .setEdge("c", "d", {class: "class"}); diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index 6f008ad1c8..55d98b0535 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -1,7 +1,10 @@ // Type definitions for dagre 0.7 // Project: https://github.com/cpettitt/dagre -// Definitions by: Qinfeng Chen , Lisa Vallfors +// Definitions by: Qinfeng Chen +// Lisa Vallfors +// Pete Vilter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export as namespace dagre; @@ -11,8 +14,8 @@ export namespace graphlib { edge(id: any): any; nodes(): string[]; node(id: any): any; - setDefaultEdgeLabel(callback: string|(() => string|void)): Graph; - setDefaultNodeLabel(callback: string|(() => string|void)): Graph; + setDefaultEdgeLabel(callback: string|(() => string|object)): Graph; + setDefaultNodeLabel(callback: string|(() => string|object)): Graph; setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph; setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph; setGraph(label: GraphLabel): Graph;