npm.io
0.6.4 • Published 2 years ago

@types/graphlib-dot

Licence
MIT
Version
0.6.4
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/graphlib-dot

Summary

This package contains type definitions for graphlib-dot (https://github.com/dagrejs/graphlib-dot).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graphlib-dot.

index.d.ts

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;
    }
}

Additional Details

Credits

These definitions were written by Dom Parfitt.