Skip to content

Commit

Permalink
馃 Merge PR #55829 fix types graphviz by @koorya
Browse files Browse the repository at this point in the history
* fix types graphviz

* fix type reference. Buffer is recognised now

* missing whitespace
  • Loading branch information
koorya committed Sep 19, 2021
1 parent edfa968 commit 033ff82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions types/graphviz/graphviz-tests.ts
Expand Up @@ -10,6 +10,9 @@ n1.set("style", "filled");
// Add node (ID: World)
g.addNode("World");

const g_h: graphviz.Node = g.getNode("Hello");
g_h.set("shape", "star");

// Add edge between the two nodes
const e: graphviz.Edge = g.addEdge(n1, "World");
e.set("color", "red");
Expand Down
6 changes: 5 additions & 1 deletion types/graphviz/index.d.ts
Expand Up @@ -2,8 +2,11 @@
// Project: https://github.com/glejeune/node-graphviz
// Definitions by: Matt Frantz <https://github.com/mhfrantz>,
// Kamontat Chantrachirathumrong <https://github.com/kamontat>
// Kirill Ivanov <https://github.com/koorya>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

export type PossibleValue = string | number | boolean;

export type RenderType = string;
Expand All @@ -27,7 +30,7 @@ export interface Node extends HasAttributes {
export interface Edge extends HasAttributes {}

export interface OutputCallback {
(data: string): void;
(data: Buffer): void;
}

export interface ErrorCallback {
Expand Down Expand Up @@ -72,6 +75,7 @@ export interface Graph extends HasAttributes {
use: RenderEngine;

addNode(id: string, attrs?: any): Node;
getNode(id: string): Node;
nodeCount(): number;

addEdge(nodeOne: string | Node, nodeTwo: string | Node, attrs?: Options): Edge;
Expand Down

0 comments on commit 033ff82

Please sign in to comment.