mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Add types for semver-utils (#41734)
This commit is contained in:
committed by
Eli Barzilay
parent
b5a1267b5e
commit
78c13f520c
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for semver-utils 1.1
|
||||
// Project: https://git.coolaj86.com/coolaj86/semver-utils.js
|
||||
// Definitions by: Jamie Magee <https://github.com/JamieMagee>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface SemVer {
|
||||
semver?: string;
|
||||
version?: string;
|
||||
major?: string;
|
||||
minor?: string;
|
||||
patch?: string;
|
||||
release?: string;
|
||||
build?: string;
|
||||
operator?: string;
|
||||
}
|
||||
|
||||
export function parse(version: string): SemVer;
|
||||
export function stringify(version: SemVer): string;
|
||||
export function parseRange(range: string): SemVer[];
|
||||
export function stringifyRange(version: SemVer[]): string;
|
||||
@@ -0,0 +1,10 @@
|
||||
import { stringify, SemVer, parse } from 'semver-utils';
|
||||
|
||||
const version: SemVer = {
|
||||
major: '1',
|
||||
minor: '0',
|
||||
patch: '0',
|
||||
};
|
||||
|
||||
stringify(version); // $ExpectType string
|
||||
parse('1.0.0'); // $ExpectType SemVer
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"semver-utils-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user