@types/semver
Advanced tools
Comparing version 5.3.34 to 5.4.0
@@ -1,4 +0,5 @@ | ||
// Type definitions for semver 5.3 | ||
// Type definitions for semver 5.4 | ||
// Project: https://github.com/npm/node-semver | ||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds> | ||
// BendingBender <https://github.com/BendingBender> | ||
// Lucian Buzzo <https://github.com/LucianBuzzo> | ||
@@ -14,32 +15,31 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver | ||
*/ | ||
export function parse(version: string, loose?: boolean): SemVer | null; | ||
export function parse(v: string | SemVer, loose?: boolean): SemVer | null; | ||
/** | ||
* Return the parsed version, or null if it's not valid. | ||
*/ | ||
export function valid(v: string, loose?: boolean): string; | ||
export function valid(v: string | SemVer, loose?: boolean): string | null; | ||
/** | ||
* Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid. | ||
*/ | ||
export function clean(version: string, loose?: boolean): string; | ||
export function clean(version: string, loose?: boolean): string | null; | ||
/** | ||
* Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. | ||
*/ | ||
export function inc(v: string, release: ReleaseType, loose?: boolean, identifier?: string): string; | ||
export function inc(v: string | SemVer, release: ReleaseType, loose?: boolean, identifier?: string): string | null; | ||
/** | ||
* Return the major version number. | ||
*/ | ||
export function major(v: string, loose?: boolean): number; | ||
export function major(v: string | SemVer, loose?: boolean): number; | ||
/** | ||
* Return the minor version number. | ||
*/ | ||
export function minor(v: string, loose?: boolean): number; | ||
export function minor(v: string | SemVer, loose?: boolean): number; | ||
/** | ||
* Return the patch version number. | ||
*/ | ||
export function patch(v: string, loose?: boolean): number; | ||
export function patch(v: string | SemVer, loose?: boolean): number; | ||
/** | ||
* Returns an array of prerelease components, or null if none exist. | ||
*/ | ||
export function prerelease(v: string, loose?: boolean): string[]; | ||
export function prerelease(v: string | SemVer, loose?: boolean): string[] | null; | ||
@@ -50,23 +50,24 @@ // Comparison | ||
*/ | ||
export function gt(v1: string, v2: string, loose?: boolean): boolean; | ||
export function gt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
* v1 >= v2 | ||
*/ | ||
export function gte(v1: string, v2: string, loose?: boolean): boolean; | ||
export function gte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
* v1 < v2 | ||
*/ | ||
export function lt(v1: string, v2: string, loose?: boolean): boolean; | ||
export function lt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
* v1 <= v2 | ||
*/ | ||
export function lte(v1: string, v2: string, loose?: boolean): boolean; | ||
export function lte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
* v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. | ||
*/ | ||
export function eq(v1: string, v2: string, loose?: boolean): boolean; | ||
export function eq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
* v1 != v2 The opposite of eq. | ||
*/ | ||
export function neq(v1: string, v2: string, loose?: boolean): boolean; | ||
export function neq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; | ||
/** | ||
@@ -77,15 +78,36 @@ * Pass in a comparison string, and it'll call the corresponding semver comparison function. | ||
*/ | ||
export function cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; | ||
export function cmp(v1: string | SemVer, operator: Operator, v2: string | SemVer, loose?: boolean): boolean; | ||
export type Operator = '===' | '!==' | '' | '=' | '==' | '!=' | '>' | '>=' | '<' | '<='; | ||
/** | ||
* Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). | ||
*/ | ||
export function compare(v1: string, v2: string, loose?: boolean): number; | ||
export function compare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; | ||
/** | ||
* The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). | ||
*/ | ||
export function rcompare(v1: string, v2: string, loose?: boolean): number; | ||
export function rcompare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; | ||
/** | ||
* Compares two identifiers, must be numeric strings or truthy/falsy values. Sorts in ascending order if passed to Array.sort(). | ||
*/ | ||
export function compareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; | ||
/** | ||
* The reverse of compareIdentifiers. Sorts in descending order when passed to Array.sort(). | ||
*/ | ||
export function rcompareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; | ||
/** | ||
* Sorts an array of semver entries in ascending order. | ||
*/ | ||
export function sort(list: Array<string | SemVer>, loose?: boolean): Array<string | SemVer>; | ||
/** | ||
* Sorts an array of semver entries in descending order. | ||
*/ | ||
export function rsort(list: Array<string | SemVer>, loose?: boolean): Array<string | SemVer>; | ||
/** | ||
* Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same. | ||
*/ | ||
export function diff(v1: string, v2: string, loose?: boolean): ReleaseType; | ||
export function diff(v1: string, v2: string, loose?: boolean): ReleaseType | null; | ||
@@ -96,23 +118,23 @@ // Ranges | ||
*/ | ||
export function validRange(range: string, loose?: boolean): string; | ||
export function validRange(range: string | Range, loose?: boolean): string; | ||
/** | ||
* Return true if the version satisfies the range. | ||
*/ | ||
export function satisfies(version: string, range: string, loose?: boolean): boolean; | ||
export function satisfies(version: string | SemVer, range: string | Range, loose?: boolean): boolean; | ||
/** | ||
* Return the highest version in the list that satisfies the range, or null if none of them do. | ||
*/ | ||
export function maxSatisfying(versions: string[], range: string, loose?: boolean): string; | ||
export function maxSatisfying(versions: Array<string | SemVer>, range: string | Range, loose?: boolean): string; | ||
/** | ||
* Return the lowest version in the list that satisfies the range, or null if none of them do. | ||
*/ | ||
export function minSatisfying(versions: string[], range: string, loose?: boolean): string; | ||
export function minSatisfying(versions: Array<string | SemVer>, range: string, loose?: boolean): string; | ||
/** | ||
* Return true if version is greater than all the versions possible in the range. | ||
*/ | ||
export function gtr(version: string, range: string, loose?: boolean): boolean; | ||
export function gtr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; | ||
/** | ||
* Return true if version is less than all the versions possible in the range. | ||
*/ | ||
export function ltr(version: string, range: string, loose?: boolean): boolean; | ||
export function ltr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; | ||
/** | ||
@@ -122,6 +144,10 @@ * Return true if the version is outside the bounds of the range in either the high or low direction. | ||
*/ | ||
export function outside(version: string, range: string, hilo: string, loose?: boolean): boolean; | ||
export function outside(version: string | SemVer, range: string | Range, hilo: '>' | '<', loose?: boolean): boolean; | ||
/** | ||
* Return true if any of the ranges comparators intersect | ||
*/ | ||
export function intersects(range1: string | Range, range2: string | Range, loose?: boolean): boolean; | ||
export class SemVer { | ||
constructor(version: string, loose?: boolean); | ||
constructor(version: string | SemVer, loose?: boolean); | ||
@@ -140,5 +166,5 @@ raw: string; | ||
compare(other: SemVer): number; | ||
compareMain(other: SemVer): number; | ||
comparePre(other: SemVer): number; | ||
compare(other: string | SemVer): 1 | 0 | -1; | ||
compareMain(other: string | SemVer): 1 | 0 | -1; | ||
comparePre(other: string | SemVer): 1 | 0 | -1; | ||
inc(release: ReleaseType, identifier?: string): SemVer; | ||
@@ -148,3 +174,3 @@ } | ||
export class Comparator { | ||
constructor(comp: string, loose?: boolean); | ||
constructor(comp: string | Comparator, loose?: boolean); | ||
@@ -155,8 +181,10 @@ semver: SemVer; | ||
parse(comp: string): void; | ||
test(version: SemVer): boolean; | ||
test(version: string | SemVer): boolean; | ||
intersects(comp: Comparator, loose?: boolean): boolean; | ||
} | ||
export class Range { | ||
constructor(range: string, loose?: boolean); | ||
constructor(range: string | Range, loose?: boolean); | ||
range: string; | ||
raw: string; | ||
@@ -169,3 +197,4 @@ loose: boolean; | ||
parseRange(range: string): Comparator[]; | ||
test(version: SemVer): boolean; | ||
test(version: string | SemVer): boolean; | ||
intersects(range: Range, loose?: boolean): boolean; | ||
} |
{ | ||
"name": "@types/semver", | ||
"version": "5.3.34", | ||
"version": "5.4.0", | ||
"description": "TypeScript definitions for semver", | ||
@@ -12,2 +12,6 @@ "license": "MIT", | ||
{ | ||
"name": "BendingBender", | ||
"url": "https://github.com/BendingBender" | ||
}, | ||
{ | ||
"name": "Lucian Buzzo", | ||
@@ -24,4 +28,4 @@ "url": "https://github.com/LucianBuzzo" | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "c181e3f337bd2f6e27173155fd4cd87ade979fe45945fcda2bf6562ae7ac229e", | ||
"typesPublisherContentHash": "4987eb5a67b0aad64d34115e7359875348141b5544a015bc98fb2bb28e71d826", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 17 Aug 2017 18:10:34 GMT | ||
* Last updated: Tue, 22 Aug 2017 15:52:36 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Bart van der Schoor <https://github.com/Bartvds>, Lucian Buzzo <https://github.com/LucianBuzzo>. | ||
These definitions were written by Bart van der Schoor <https://github.com/Bartvds>, BendingBender <https://github.com/BendingBender>, Lucian Buzzo <https://github.com/LucianBuzzo>. |
Sorry, the diff of this file is not supported yet
9972
172