Add type definitions for semver-compare (#19451)

* Initial type definitions for semver-compare

* Fix definitions

* Fix tslint errors
This commit is contained in:
Kovács Vince
2017-08-31 02:01:32 +02:00
committed by Mohamed Hegazy
parent f2111f6347
commit 0f62f0016e
4 changed files with 45 additions and 0 deletions

8
types/semver-compare/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for semver-compare 1.0
// Project: https://github.com/substack/semver-compare
// Definitions by: Kovács Vince <https://github.com/vincekovacs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function semverCompare<T>(a: T, b: T): number;
export = semverCompare;

View File

@@ -0,0 +1,14 @@
import SemverCompare = require("semver-compare");
const versions = [
"1.2.3",
"4.11.6",
"4.2.0",
"1.5.19",
"1.5.5",
"4.1.3",
"2.3.1",
"10.5.5",
"11.3.0",
];
versions.sort(SemverCompare).join("\n");

View File

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

View File

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