adds typings for the 'toposort' package

This commit is contained in:
Daniel Byrne 2018-08-25 13:30:06 -07:00
parent 1f4678fb27
commit 86f0182f17
2 changed files with 6 additions and 14 deletions

View File

@ -3,4 +3,5 @@
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default function toposort(graph: ReadonlyArray<[string, string]>): ReadonlyArray<string>;
declare function toposort(graph: ReadonlyArray<[string, string]>): ReadonlyArray<string>;
export = toposort;

View File

@ -1,18 +1,9 @@
import toposort from 'toposort';
import toposort = require('toposort');
const testGraph: ReadonlyArray<[string, string]> = [
[
'string1',
'string2',
],
[
'string2',
'string3',
],
[
'string3',
'string1',
],
["string1", "string2"],
["string2", "string3"],
["string3", "string1"]
];
// $ExpectType ReadonlyArray<string>