mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[to-semver] Add types
This commit is contained in:
26
types/to-semver/index.d.ts
vendored
Normal file
26
types/to-semver/index.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Type definitions for to-semver 1.1
|
||||
// Project: https://github.com/sindresorhus/to-semver#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = toSemver;
|
||||
|
||||
/**
|
||||
* Get an array of valid, sorted, and cleaned [semver](http://semver.org/) versions from an array of strings.
|
||||
*/
|
||||
declare function toSemver(versions: string[], options?: toSemver.Options): string[];
|
||||
|
||||
declare namespace toSemver {
|
||||
interface Options {
|
||||
/**
|
||||
* Include prereleases, like `1.2.3-alpha.3`.
|
||||
* @default true
|
||||
*/
|
||||
includePrereleases?: boolean;
|
||||
/**
|
||||
* Clean versions. For example `v1.3.0` → `1.3.0`.
|
||||
* @default true
|
||||
*/
|
||||
clean?: boolean;
|
||||
}
|
||||
}
|
||||
3
types/to-semver/to-semver-tests.ts
Normal file
3
types/to-semver/to-semver-tests.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import toSemver = require('to-semver');
|
||||
|
||||
toSemver(['v1.3.16', 'v1.7.0', 'test', 'v1.6.9']); // $ExpectType string[]
|
||||
23
types/to-semver/tsconfig.json
Normal file
23
types/to-semver/tsconfig.json
Normal 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",
|
||||
"to-semver-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/to-semver/tslint.json
Normal file
1
types/to-semver/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user