DefinitelyTyped/types/graphlib-dot/index.d.ts
Nathan Shively-Sanders f0ce987bc1 Update project urls to match NPM url
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.

This PR is unfinished! Please do not merge it yet.
2019-02-11 17:10:55 -08:00

57 lines
1.8 KiB
TypeScript

// Type definitions for graphlib-dot 0.6
// Project: https://github.com/dagrejs/graphlib-dot, https://github.com/cpettitt/graphlib-dot
// Definitions by: Dom Parfitt <https://github.com/DomParfitt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Graph } from 'graphlib';
/**
* Reads a single DOT graph from the str and returns it a Graph representation.
* @param str a string in the DOT language representing a graph
*/
export function read(str: string): Graph;
/**
* Parses one or more DOT graphs from str in a manner similar to that used by parse for individual graphs.
* @param str a string in the DOT language representing one or more graphs
*/
export function readMany(str: string): Graph[];
/**
* Writes a String representation of the given graph in the DOT language.
* @param g a graphlib Graph object
*/
export function write(g: Graph): string;
/**
* Contains the version of the graphlib library used by graphlib-dot.
*/
export const graphlib: any;
declare global {
namespace graphlibDot {
/**
* Reads a single DOT graph from the str and returns it a Graph representation.
* @param str a string in the DOT language representing a graph
*/
function read(str: string): Graph;
/**
* Parses one or more DOT graphs from str in a manner similar to that used by parse for individual graphs.
* @param str a string in the DOT language representing one or more graphs
*/
function readMany(str: string): Graph[];
/**
* Writes a String representation of the given graph in the DOT language.
* @param g a graphlib Graph object
*/
function write(g: Graph): string;
/**
* Contains the version of the graphlib library used by graphlib-dot.
*/
const graphlib: any;
}
}