Skip to content

Commit c06f886

Browse files
authoredJul 19, 2020
refactor(ts)!: ship yargs.d.ts (#1671)
BREAKING CHANGE: yargs now ships with its own types
1 parent 56a589f commit c06f886

File tree

3 files changed

+774
-2
lines changed

3 files changed

+774
-2
lines changed
 

‎lib/yargs.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1394,10 +1394,12 @@ export function Yargs (processArgs: string | string[] = [], cwd = process.cwd(),
13941394

13951395
// rebase an absolute path to a relative one with respect to a base directory
13961396
// exported for tests
1397-
export function rebase (base: string, dir: string) {
1398-
return path.relative(base, dir)
1397+
export interface RebaseFunction {
1398+
(base: string, dir: string): string
13991399
}
14001400

1401+
export const rebase: RebaseFunction = (base, dir) => path.relative(base, dir)
1402+
14011403
/** Instance of the yargs module. */
14021404
export interface YargsInstance {
14031405
$0: string

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"files": [
1313
"index.js",
1414
"yargs.js",
15+
"yargs.d.ts",
1516
"build",
1617
"locales",
1718
"LICENSE"

‎yargs.d.ts

+769
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.