Merge pull request #22104 from coldrye-collaboration/bump-regex

add typings for stevelacy/bump-regex
This commit is contained in:
Mine Starks
2017-12-15 13:52:28 -08:00
committed by GitHub
4 changed files with 77 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import * as bump from 'bump-regex';
bump({}, (err, res) => {
if (err) {}
if (res) {
res.new;
res.prev;
}
});
bump('1.0.0', (err, res) => {});
bump({type: 'major', str: '1.0.0'}, (err, res) => {});
bump({type: 'minor', str: '1.0.0'}, (err, res) => {});
bump({type: 'patch', str: '1.0.0'}, (err, res) => {});
bump({type: 'prerelease', str: '1.0.0'}, (err, res) => {});
bump({regex: /^.+$/, str: '1.0.0'}, (err, res) => {});
bump({regex: /^.+$/, global: true, str: '1.0.0'}, (err, res) => {});
bump({regex: /^.+$/, case: true, str: '1.0.0'}, (err, res) => {});
+29
View File
@@ -0,0 +1,29 @@
// Type definitions for bump-regex 2.9
// Project: https://github.com/stevelacy/bump-regex
// Definitions by: silkentrance <https://github.com/silkentrance>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function BumpRegex(opts: string|BumpRegex.Options, cb: BumpRegex.Callback): any;
declare namespace BumpRegex {
type Callback = (err: string|Error|null, opts?: Result) => void;
interface Options {
key?: string;
type?: 'major' | 'minor' | 'patch' | 'prerelease';
case?: boolean;
keys?: string[];
global?: boolean;
version?: string;
preid?: string;
regex?: RegExp;
str?: string;
}
interface Result extends Options {
prev: string;
new: string;
}
}
export = BumpRegex;
+23
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",
"bump-regex-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}