Skip to content

Commit

Permalink
fix(yargs-interactive): Extend Interactive interface with yargs.Argv …
Browse files Browse the repository at this point in the history
…interface (#45831)
  • Loading branch information
nanovazquez committed Jul 12, 2020
1 parent a7e3800 commit d3facd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion types/yargs-interactive/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Nano Vazquez <https://github.com/nanovazquez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Argv } from 'yargs';

declare function yargsInteractive(): yargsInteractive.Interactive;

declare namespace yargsInteractive {
Expand All @@ -17,7 +19,7 @@ declare namespace yargsInteractive {
interface Option {
[key: string]: OptionData | { default: boolean };
}
interface Interactive {
interface Interactive extends Argv {
usage(usage: string): Interactive;
interactive(options: Option): Interactive;
then(callback: (result: any) => any): Interactive;
Expand Down
5 changes: 4 additions & 1 deletion types/yargs-interactive/yargs-interactive-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ yargsInteractive()
.interactive(options)
.then((result: any) => {
console.log(result);
});
})
.demandCommand(1, 1, 'You need to specify a command before moving on')
.help()
.wrap(null).version;

0 comments on commit d3facd7

Please sign in to comment.