mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Merge pull request #22104 from coldrye-collaboration/bump-regex
add typings for stevelacy/bump-regex
This commit is contained in:
@@ -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) => {});
|
||||
Vendored
+29
@@ -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;
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user