[semver-truncate] Add types

This commit is contained in:
Dimitri Benin 2019-01-16 00:56:31 +01:00
parent e155ce25dc
commit dadf587ca5
4 changed files with 37 additions and 0 deletions

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

@ -0,0 +1,8 @@
// Type definitions for semver-truncate 1.1
// Project: https://github.com/sindresorhus/semver-truncate#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = semverTruncate;
declare function semverTruncate(version: string, type: 'patch' | 'minor' | 'major'): string;

View File

@ -0,0 +1,5 @@
import semverTruncate = require('semver-truncate');
semverTruncate('1.2.3-foo', 'patch'); // $ExpectType string
semverTruncate('1.2.3', 'minor'); // $ExpectType string
semverTruncate('1.2.3', 'major'); // $ExpectType string

View File

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

View File

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