adds typings for the 'toposort' package

This commit is contained in:
Daniel Byrne 2018-08-25 13:30:06 -07:00
parent e6568c65f5
commit 45baf1fcd5
4 changed files with 51 additions and 0 deletions

6
types/toposort/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
// Type definitions for toposort 2.0
// Project: https://github.com/marcelklehr/toposort
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default function toposort(graph: ReadonlyArray<[string, string]>): ReadonlyArray<string>;

View File

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

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"toposort-tests.ts"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}